diff --git a/wp-content/plugins/buddypress/bp-activity/admin/css/admin-rtl.min.css b/wp-content/plugins/buddypress/bp-activity/admin/css/admin-rtl.min.css
index af51f61fb50dc2746050ac96b6bc7ac60dcabfb0..c987855e8fa02d8b8baebb05c70702972ba99664 100644
--- a/wp-content/plugins/buddypress/bp-activity/admin/css/admin-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-activity/admin/css/admin-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
 .akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css
index aabb27cf92ea4215c4f5a8d60233a7432e83df19..4918e78aac648d6b4e1063556b649fa8a75bb8f5 100644
--- a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css
+++ b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
 .akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js
index 44d33281ef73de1a5f706771222abf677cb6a20a..4fa697d30ce8bd4c41cdf74b5b09efd0038c09d1 100644
--- a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js
+++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js
@@ -165,9 +165,11 @@ $(document).ready( function () {
 	$( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' );
 
 	// redo the post box toggles to reset the one made by comment.js in favor
-	// of activity administration page id so that metaboxes are still collapsible 
+	// of activity administration page id so that metaboxes are still collapsible
 	// in single Activity Administration screen.
-	postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
+	if ( typeof postboxes !== 'undefined' ) {
+		postboxes.add_postbox_toggles( bp_activity_admin_vars.page );
+	}
 });
 
 })(jQuery);
diff --git a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js
index b36b5d37a8034e46670719eef829188bcfc0daa1..2fd75536b0960b0b32afc2104757c676a967ddca 100644
--- a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js
+++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
index 640a58505be5ace21f2420862498d9542a10a2b4..2b8b244e4a0203971d6c120e5d6affcad95784f2 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php
@@ -10,16 +10,22 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Allow core components and dependent plugins to register activity actions.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses do_action() To call 'bp_register_activity_actions' hook.
  */
 function bp_register_activity_actions() {
+
+	/**
+	 * Fires on bp_init to allow core components and dependent plugins to register activity actions.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_register_activity_actions' );
 }
 add_action( 'bp_init', 'bp_register_activity_actions', 8 );
@@ -27,9 +33,8 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 );
 /**
  * Catch and route requests for single activity item permalinks.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
  * @uses bp_action_variable()
@@ -85,7 +90,7 @@ function bp_activity_action_permalink_router() {
 		}
 
 	// Set redirect to users' activity stream
-	} else if ( ! empty( $activity->user_id ) ) {
+	} elseif ( ! empty( $activity->user_id ) ) {
 		$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';
 	}
 
@@ -96,7 +101,13 @@ function bp_activity_action_permalink_router() {
 		$redirect = add_query_arg( urlencode_deep( $query_frags ), $redirect );
 	}
 
-	// Allow redirect to be filtered
+	/**
+	 * Filter the intended redirect url before the redirect occurs for the single activity item.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param array Array with url to redirect to and activity related to the redirect.
+	 */
 	if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) {
 		bp_core_redirect( bp_get_root_domain() );
 	}
@@ -109,7 +120,7 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' );
 /**
  * Delete specific activity item and redirect to previous page.
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @param int $activity_id Activity id to be deleted. Defaults to 0.
  *
@@ -149,7 +160,14 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
 	if ( ! bp_activity_user_can_delete( $activity ) )
 		return false;
 
-	// Call the action before the delete so plugins can still fetch information about it
+	/**
+	 * Fires before the deletion so plugins can still fetch information about it.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $activity_id The activity ID.
+	 * @param int $user_id     The user associated with the activity.
+	 */
 	do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );
 
 	// Delete the activity item and provide user feedback
@@ -158,6 +176,14 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) {
 	else
 		bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );
 
+	/**
+	 * Fires after the deletion so plugins can act afterwards based on the activity.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param int $activity_id The activity ID.
+	 * @param int $user_id     The user associated with the activity.
+	 */
 	do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );
 
 	// Check for the redirect query arg, otherwise let WP handle things
@@ -171,14 +197,14 @@ add_action( 'bp_actions', 'bp_activity_action_delete_activity' );
 /**
  * Mark specific activity item as spam and redirect to previous page.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
- * @global object $bp BuddyPress global settings
  * @param int $activity_id Activity id to be deleted. Defaults to 0.
+ *
  * @return bool False on failure.
  */
 function bp_activity_action_spam_activity( $activity_id = 0 ) {
-	global $bp;
+	$bp = buddypress();
 
 	// Not viewing activity, or action is not spam, or Akismet isn't present
 	if ( !bp_is_activity_component() || !bp_is_current_action( 'spam' ) || empty( $bp->activity->akismet ) )
@@ -203,16 +229,31 @@ function bp_activity_action_spam_activity( $activity_id = 0 ) {
 	// Check nonce
 	check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
 
-	// Call an action before the spamming so plugins can modify things if they want to
+	/**
+	 * Fires before the marking activity as spam so plugins can modify things if they want to.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int    $activity_id Activity ID to be marked as spam.
+	 * @param object $activity    Activity object for the ID to be marked as spam.
+	 */
 	do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
 
 	// Mark as spam
 	bp_activity_mark_as_spam( $activity );
 	$activity->save();
 
-	// Tell the user the spamming has been succesful
+	// Tell the user the spamming has been successful
 	bp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) );
 
+	/**
+	 * Fires after the marking activity as spam so plugins can act afterwards based on the activity.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int $activity_id Activity ID that was marked as spam.
+	 * @param int $user_id     User ID associated with activity.
+	 */
 	do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );
 
 	// Check for the redirect query arg, otherwise let WP handle things
@@ -226,7 +267,7 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' );
 /**
  * Post user/group activity update.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
@@ -253,14 +294,36 @@ function bp_activity_action_post_update() {
 	// Check the nonce
 	check_admin_referer( 'post_update', '_wpnonce_post_update' );
 
-	// Get activity info
+	/**
+	 * Filters the content provided in the activity input field.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Activity message being posted.
+	 */
 	$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );
 
 	if ( ! empty( $_POST['whats-new-post-object'] ) ) {
+
+		/**
+		 * Filters the item type that the activity update should be associated with.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Item type to associate with.
+		 */
 		$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );
 	}
 
 	if ( ! empty( $_POST['whats-new-post-in'] ) ) {
+
+		/**
+		 * Filters what component the activity is being to.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Chosen component to post activity to.
+		 */
 		$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
 	}
 
@@ -275,13 +338,22 @@ function bp_activity_action_post_update() {
 		$activity_id = bp_activity_post_update( array( 'content' => $content ) );
 
 	// Post to groups object
-	} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {
+	} elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) {
 		if ( (int) $item_id ) {
 			$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );
 		}
 
-	// Special circumstance so let filters handle it
 	} else {
+
+		/**
+		 * Filters activity object for BuddyPress core and plugin authors before posting activity update.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $object  Activity item being associated to.
+		 * @param string $item_id Component ID being posted to.
+		 * @param string $content Activity content being posted.
+		 */
 		$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
 	}
 
@@ -289,7 +361,7 @@ function bp_activity_action_post_update() {
 	if ( !empty( $activity_id ) )
 		bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
 	else
-		bp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );
+		bp_core_add_message( __( 'There was an error when posting your update. Please try again.', 'buddypress' ), 'error' );
 
 	// Redirect
 	bp_core_redirect( wp_get_referer() );
@@ -299,7 +371,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' );
 /**
  * Post new activity comment.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
@@ -322,7 +394,22 @@ function bp_activity_action_post_comment() {
 	// Check the nonce
 	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
 
+	/**
+	 * Filters the activity ID a comment will be in reply to.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value ID of the activity being replied to.
+	 */
 	$activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );
+
+	/**
+	 * Filters the comment content for a comment reply.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Comment content being posted.
+	 */
 	$content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );
 
 	if ( empty( $content ) ) {
@@ -339,7 +426,7 @@ function bp_activity_action_post_comment() {
 	if ( !empty( $comment_id ) )
 		bp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );
 	else
-		bp_core_add_message( __( 'There was an error posting that reply, please try again.', 'buddypress' ), 'error' );
+		bp_core_add_message( __( 'There was an error posting that reply. Please try again.', 'buddypress' ), 'error' );
 
 	bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
 }
@@ -348,7 +435,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' );
 /**
  * Mark activity as favorite.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
@@ -373,7 +460,7 @@ function bp_activity_action_mark_favorite() {
 	if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )
 		bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) );
 	else
-		bp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' );
+		bp_core_add_message( __( 'There was an error marking that activity as a favorite. Please try again.', 'buddypress' ), 'error' );
 
 	bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
 }
@@ -382,7 +469,7 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
 /**
  * Remove activity from favorites.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses is_user_logged_in()
  * @uses bp_is_activity_component()
@@ -407,7 +494,7 @@ function bp_activity_action_remove_favorite() {
 	if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
 		bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) );
 	else
-		bp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' );
+		bp_core_add_message( __( 'There was an error removing that activity as a favorite. Please try again.', 'buddypress' ), 'error' );
 
 	bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
 }
@@ -416,9 +503,8 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
 /**
  * Load the sitewide activity feed.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
  * @uses bp_is_current_action()
  * @uses bp_is_user()
@@ -427,7 +513,7 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
  * @return bool False on failure.
  */
 function bp_activity_action_sitewide_feed() {
-	global $bp;
+	$bp = buddypress();
 
 	if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )
 		return false;
@@ -449,7 +535,7 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
 /**
  * Load a user's personal activity feed.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_is_user_activity()
  * @uses bp_is_current_action()
@@ -479,7 +565,7 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' );
 /**
  * Load a user's friends' activity feed.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_is_active()
  * @uses bp_is_user_activity()
@@ -512,7 +598,7 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' );
 /**
  * Load the activity feed for a user's groups.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_is_active()
  * @uses bp_is_user_activity()
@@ -553,7 +639,7 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
 /**
  * Load a user's @mentions feed.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_is_user_activity()
  * @uses bp_is_current_action()
@@ -590,7 +676,7 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
 /**
  * Load a user's favorites feed.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_is_user_activity()
  * @uses bp_is_current_action()
@@ -625,24 +711,37 @@ add_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
 /**
  * Loads Akismet filtering for activity.
  *
- * @since BuddyPress (1.6)
- *
- * @global object $bp BuddyPress global settings
+ * @since BuddyPress (1.6.0)
+ * @since BuddyPress (2.3.0) We only support Akismet 3+.
  */
 function bp_activity_setup_akismet() {
-	global $bp;
+	$bp = buddypress();
 
 	// Bail if Akismet is not active
-	if ( ! defined( 'AKISMET_VERSION' ) )
+	if ( ! defined( 'AKISMET_VERSION' ) ) {
+		return;
+	}
+
+	// Bail if older version of Akismet
+	if ( ! class_exists( 'Akismet' ) ) {
 		return;
+	}
 
 	// Bail if no Akismet key is set
-	if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) )
+	if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {
 		return;
+	}
 
-	// Bail if BuddyPress Activity Akismet support has been disabled by another plugin
-	if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) )
+	/**
+	 * Filters if BuddyPress Activity Akismet support has been disabled by another plugin.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Return value of bp_is_akismet_active boolean function.
+	 */
+	if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
 		return;
+	}
 
 	// Instantiate Akismet for BuddyPress
 	$bp->activity->akismet = new BP_Akismet();
@@ -659,10 +758,17 @@ function bp_ajax_get_suggestions() {
 		exit;
 	}
 
-	$results = bp_core_get_suggestions( array(
+	$args = array(
 		'term' => sanitize_text_field( $_GET['term'] ),
 		'type' => sanitize_text_field( $_GET['type'] ),
-	) );
+	);
+
+	// Support per-Group suggestions.
+	if ( ! empty( $_GET['group-id'] ) ) {
+		$args['group_id'] = absint( $_GET['group-id'] );
+	}
+
+	$results = bp_core_get_suggestions( $args );
 
 	if ( is_wp_error( $results ) ) {
 		wp_send_json_error( $results->get_error_message() );
@@ -672,3 +778,58 @@ function bp_ajax_get_suggestions() {
 	wp_send_json_success( $results );
 }
 add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
+
+/**
+ * Detect a change in post type status, and initiate an activity update if necessary.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @todo Support untrashing better.
+ *
+ * @param string $new_status New status for the post.
+ * @param string $old_status Old status for the post.
+ * @param object $post       Post data.
+ */
+function bp_activity_catch_transition_post_type_status( $new_status, $old_status, $post ) {
+	if ( ! post_type_supports( $post->post_type, 'buddypress-activity' ) ) {
+		return;
+	}
+
+	// This is an edit.
+	if ( $new_status === $old_status ) {
+		// An edit of an existing post should update the existing activity item.
+		if ( $new_status == 'publish' ) {
+			bp_activity_post_type_update( $post );
+		}
+
+		return;
+	}
+
+	// Publishing a previously unpublished post.
+	if ( 'publish' === $new_status ) {
+		// Untrashing the post type - nothing here yet.
+		if ( 'trash' == $old_status ) {
+
+			/**
+			 * Fires if untrashing post in a post type.
+			 *
+			 * This is a variable filter that is dependent on the post type
+			 * being untrashed.
+			 *
+			 * @since BuddyPress (2.2.0)
+			 *
+			 * @param WP_Post $post Post data.
+			 */
+			do_action( 'bp_activity_post_type_untrash_' . $post->post_type, $post );
+		} else {
+			// Record the post.
+			bp_activity_post_type_publish( $post->ID, $post );
+		}
+
+	// Unpublishing a previously published post.
+	} elseif ( 'publish' === $old_status ) {
+		// Some form of pending status - only remove the activity entry
+		bp_activity_post_type_unpublish( $post->ID, $post );
+	}
+}
+add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 );
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php
index 5547557ee0f7c6235f6d14bd0a52fd170252622f..259957321becf1d49a2226e6eb2bb9030a432a1d 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 // Include WP's list table class
 if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
@@ -52,7 +52,8 @@ add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' );
  * @since BuddyPress (1.7.0)
  *
  * @param array $custom_menus The list of top-level BP menu items.
- * @return array $custom_menus List of top-level BP menu items, with Activity added
+ *
+ * @return array $custom_menus List of top-level BP menu items, with Activity added.
  */
 function bp_activity_admin_menu_order( $custom_menus = array() ) {
 	array_push( $custom_menus, 'bp-activity' );
@@ -138,10 +139,10 @@ add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' );
  *
  * @since BuddyPress (1.6.0)
  *
- * @param string $value Will always be false unless another plugin filters it
- *        first.
- * @param string $option Screen option name.
+ * @param string $value     Will always be false unless another plugin filters it first.
+ * @param string $option    Screen option name.
  * @param string $new_value Screen option form value.
+ *
  * @return string Option value. False to abandon update.
  */
 function bp_activity_admin_screen_options( $value, $option, $new_value ) {
@@ -161,7 +162,9 @@ function bp_activity_admin_screen_options( $value, $option, $new_value ) {
  *
  * @since BuddyPress (1.6.0)
  *
+ * @param array     $hidden Array of items to hide.
  * @param WP_Screen $screen Screen identifier.
+ *
  * @return array Hidden Meta Boxes.
  */
 function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
@@ -171,6 +174,14 @@ function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) {
 	// Hide the primary link meta box by default
 	$hidden  = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) );
 
+	/**
+	 * Filters default hidden metaboxes so plugins can alter list.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array     $hidden Default metaboxes to hide.
+	 * @param WP_Screen $screen Screen identifier.
+	 */
 	return apply_filters( 'bp_hide_meta_boxes', array_unique( $hidden ), $screen );
 }
 add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxes', 10, 2 );
@@ -180,12 +191,12 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe
  *
  * Does the following:
  *   - Register contextual help and screen options for this admin page.
- *   - Enqueues scripts and styles
- *   - Catches POST and GET requests related to Activity
+ *   - Enqueues scripts and styles.
+ *   - Catches POST and GET requests related to Activity.
  *
  * @since BuddyPress (1.6.0)
  *
- * @global object $bp BuddyPress global settings.
+ * @global object                 $bp                     BuddyPress global settings.
  * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
  */
 function bp_activity_admin_load() {
@@ -198,7 +209,13 @@ function bp_activity_admin_load() {
 
 	$doaction = bp_admin_list_table_current_bulk_action();
 
-	// Call an action for plugins to hook in early
+	/**
+	 * Fires at top of Activity admin page.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $doaction Current $_GET action being performed in admin screen.
+	 */
 	do_action( 'bp_activity_admin_load', $doaction );
 
 	// Edit screen
@@ -228,8 +245,8 @@ function bp_activity_admin_load() {
 		// Help panel - sidebar links
 		get_current_screen()->set_help_sidebar(
 			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
-			'<p>' . __( '<a href="http://codex.buddypress.org/buddypress-site-administration/managing-activity/">Managing Activity</a>', 'buddypress' ) . '</p>' .
-			'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			'<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/activity-stream-management-panels/">Managing Activity</a>', 'buddypress' ) . '</p>' .
+			'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 		);
 
 		// Register metaboxes for the edit screen.
@@ -239,7 +256,7 @@ function bp_activity_admin_load() {
 		add_meta_box( 'bp_activity_type',    _x( 'Type', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_type', get_current_screen()->id, 'normal', 'core' );
 		add_meta_box( 'bp_activity_userid',  _x( 'Author ID', 'activity admin edit screen', 'buddypress' ), 'bp_activity_admin_edit_metabox_userid', get_current_screen()->id, 'normal', 'core' );
 
-		// Enqueue javascripts
+		// Enqueue JavaScript files
 		wp_enqueue_script( 'postbox' );
 		wp_enqueue_script( 'dashboard' );
 		wp_enqueue_script( 'comment' );
@@ -273,7 +290,7 @@ function bp_activity_admin_load() {
 		// Help panel - sidebar links
 		get_current_screen()->set_help_sidebar(
 			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
-			'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 		);
 	}
 
@@ -300,7 +317,13 @@ function bp_activity_admin_load() {
 		// Get activity IDs
 		$activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] );
 
-		// Call a filter for plugins to modify the requested activities to load
+		/**
+		 * Filters list of IDs being spammed/un-spammed/deleted.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array $activity_ids Activity IDs to spam/un-spam/delete.
+		 */
 		$activity_ids = apply_filters( 'bp_activity_admin_action_activity_ids', $activity_ids );
 
 		// Is this a bulk request?
@@ -384,7 +407,17 @@ function bp_activity_admin_load() {
 			unset( $activity );
 		}
 
-		// Call actions for plugins to do something before we redirect
+		/**
+		 * Fires before redirect for plugins to do something with activity.
+		 *
+		 * Passes an activity array counts how many were spam, not spam, deleted, and IDs that were errors.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array  $value        Array holding spam, not spam, deleted counts, error IDs.
+		 * @param string $redirect_to  URL to redirect to.
+		 * @param array  $activity_ids Original array of activity IDs.
+		 */
 		do_action( 'bp_activity_admin_action_after', array( $spammed, $unspammed, $deleted, $errors ), $redirect_to, $activity_ids );
 
 		// Add arguments to the redirect URL so that on page reload, we can easily display what we've just done.
@@ -401,7 +434,13 @@ function bp_activity_admin_load() {
 		if ( ! empty( $errors ) )
 			$redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to );
 
-		// Redirect
+		/**
+		 * Filters redirect URL after activity spamming/un-spamming/deletion occurs.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $redirect_to URL to redirect to.
+		 */
 		wp_redirect( apply_filters( 'bp_activity_admin_action_redirect', $redirect_to ) );
 		exit;
 
@@ -512,7 +551,13 @@ function bp_activity_admin_load() {
 		if ( false === $result )
 			$error = $activity->id;
 
-		// Call actions for plugins to do something before we redirect
+		/**
+		 * Fires before redirect so plugins can do something first on save action.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array Array holding activity object and ID that holds error.
+		 */
 		do_action_ref_array( 'bp_activity_admin_edit_after', array( &$activity, $error ) );
 
 		// If an error occurred, pass back the activity ID that failed
@@ -521,7 +566,13 @@ function bp_activity_admin_load() {
 		else
 			$redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to );
 
-		// Redirect
+		/**
+		 * Filters URL to redirect to after saving.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $redirect_to URL to redirect to.
+		 */
 		wp_redirect( apply_filters( 'bp_activity_admin_edit_redirect', $redirect_to ) );
 		exit;
 
@@ -586,7 +637,13 @@ function bp_activity_admin_edit() {
 	$form_url = remove_query_arg( array( 'action', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] );
 	$form_url = add_query_arg( 'action', 'save', $form_url );
 
-	// Call an action for plugins to modify the activity before we display the edit form
+	/**
+	 * Fires before activity edit form is displays so plugins can modify the activity.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $value Array holding single activity object that was passed by reference.
+	 */
 	do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
 
 	<div class="wrap">
@@ -595,7 +652,7 @@ function bp_activity_admin_edit() {
 
 		<?php if ( ! empty( $activity ) ) : ?>
 
-			<form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post">
+			<form action="<?php echo esc_url( $form_url ); ?>" id="bp-activities-edit-form" method="post">
 				<div id="poststuff">
 
 					<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
@@ -744,7 +801,7 @@ function bp_activity_admin_get_activity_actions() {
 	$actions  = array();
 
 	// Walk through the registered actions, and build an array of actions/values.
-	foreach ( buddypress()->activity->actions as $action ) {
+	foreach ( bp_activity_get_actions() as $action ) {
 		$action = array_values( (array) $action );
 
 		for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
@@ -762,22 +819,20 @@ function bp_activity_admin_get_activity_actions() {
 }
 
 /**
- * Activity type metabox for the Activity admin edit screen
+ * Activity type metabox for the Activity admin edit screen.
  *
  * @since BuddyPress (1.6.0)
  *
- * @global object $bp BuddyPress global settings.
- *
  * @param object $item Activity item.
  */
 function bp_activity_admin_edit_metabox_type( $item ) {
-	global $bp;
+	$bp = buddypress();
 
 	$actions  = array();
 	$selected = $item->type;
 
 	// Walk through the registered actions, and build an array of actions/values.
-	foreach ( $bp->activity->actions as $action ) {
+	foreach ( bp_activity_get_actions() as $action ) {
 		$action = array_values( (array) $action );
 
 		for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
@@ -836,9 +891,8 @@ function bp_activity_admin_edit_metabox_itemids( $item ) {
  *
  * @since BuddyPress (1.6.0)
  *
- * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list
- *         table.
- * @global string $plugin_page The current plugin page.
+ * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table.
+ * @global string                 $plugin_page            The current plugin page.
  */
 function bp_activity_admin_index() {
 	global $bp_activity_list_table, $plugin_page;
@@ -894,13 +948,19 @@ function bp_activity_admin_index() {
 			$messages[] = sprintf( _n( '%s activity item has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) );
 
 		if ( $updated > 0 )
-			$messages[] = __( 'The activity item has been updated succesfully.', 'buddypress' );
+			$messages[] = __( 'The activity item has been updated successfully.', 'buddypress' );
 	}
 
 	// Prepare the activity items for display
 	$bp_activity_list_table->prepare_items();
 
-	// Call an action for plugins to modify the activity before we display the edit form
+	/**
+	 * Fires before edit form is displayed so plugins can modify the activity messages.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $messages Array of messages to display at top of page.
+	 */
 	do_action( 'bp_activity_admin_index', $messages ); ?>
 
 	<div class="wrap">
@@ -944,7 +1004,7 @@ function bp_activity_admin_index() {
 							<a href="#" class="cancel button-secondary alignleft"><?php _e( 'Cancel', 'buddypress' ); ?></a>
 							<a href="#" class="save button-primary alignright"><?php _e( 'Reply', 'buddypress' ); ?></a>
 
-							<img class="waiting" style="display:none;" src="<?php echo esc_url( bp_get_admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+							<img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
 							<span class="error" style="display:none;"></span>
 							<br class="clear" />
 						</p>
@@ -963,7 +1023,7 @@ function bp_activity_admin_index() {
 /**
  * List table class for the Activity component admin page.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  */
 class BP_Activity_List_Table extends WP_List_Table {
 
@@ -993,6 +1053,17 @@ class BP_Activity_List_Table extends WP_List_Table {
 	 */
 	protected $activity_user_id = array();
 
+	/**
+	 * If users can comment on blog & forum activity items.
+	 *
+	 * @since BuddyPress (2.2.2)
+	 *
+	 * @link https://buddypress.trac.wordpress.org/ticket/6277
+	 *
+	 * @var bool
+	 */
+	public $disable_blogforum_comments = false;
+
 	/**
 	 * Constructor.
 	 *
@@ -1082,7 +1153,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 			'count_total'      => 'count_query',
 		) );
 
-		// If we're viewing a specific activity, flatten all activites into a single array.
+		// If we're viewing a specific activity, flatten all activities into a single array.
 		if ( $include_id ) {
 			$activities['activities'] = BP_Activity_List_Table::flatten_activity_array( $activities['activities'] );
 			$activities['total']      = count( $activities['activities'] );
@@ -1096,7 +1167,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 		foreach ( $activities['activities'] as $activity_item ) {
 			$new_activities[] = (array) $activity_item;
 
-			// Build an array of activity-to-user ID mappings for better efficency in the In Response To column
+			// Build an array of activity-to-user ID mappings for better efficiency in the In Response To column
 			$this->activity_user_id[$activity_item->id] = $activity_item->user_id;
 		}
 
@@ -1205,13 +1276,23 @@ class BP_Activity_List_Table extends WP_List_Table {
 	 * @since BuddyPress (1.6.0)
 	 */
 	function get_views() {
-		$url_base = bp_get_admin_url( 'admin.php?page=bp-activity' ); ?>
+		$url_base = add_query_arg( array( 'page' => 'bp-activity' ), bp_get_admin_url( 'admin.php' ) ); ?>
 
 		<ul class="subsubsub">
-			<li class="all"><a href="<?php echo esc_attr( esc_url( $url_base ) ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
-			<li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $url_base ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
+			<li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'spam' != $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
+			<li class="spam"><a href="<?php echo esc_url( add_query_arg( array( 'activity_status' => 'spam' ), $url_base ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li>
 
-			<?php do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?>
+			<?php
+
+			/**
+			 * Fires inside listing of views so plugins can add their own.
+			 *
+			 * @since BuddyPress (1.6.0)
+			 *
+			 * @param string $url_base Current URL base for view.
+			 * @param string $view     Current view being displayed.
+			 */
+			do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?>
 		</ul>
 	<?php
 	}
@@ -1229,6 +1310,13 @@ class BP_Activity_List_Table extends WP_List_Table {
 		$actions['bulk_ham']    = __( 'Not Spam', 'buddypress' );
 		$actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' );
 
+		/**
+		 * Filters the default bulk actions so plugins can add custom actions.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array $actions Default available actions for bulk operations.
+		 */
 		return apply_filters( 'bp_activity_list_table_get_bulk_actions', $actions );
 	}
 
@@ -1288,7 +1376,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 		$selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : '';
 
 		// Get the actions
-		$activity_actions = buddypress()->activity->actions; ?>
+		$activity_actions = bp_activity_get_actions(); ?>
 
 		<div class="alignleft actions">
 			<select name="activity_type">
@@ -1405,7 +1493,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 
 		// Rollover actions
 
-		// Reply - javascript only; implemented by AJAX.
+		// Reply - JavaScript only; implemented by AJAX.
 		if ( 'spam' != $item_status ) {
 			if ( $this->can_comment( $item ) ) {
 				$actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', __( 'Reply', 'buddypress' ) );
@@ -1429,7 +1517,14 @@ class BP_Activity_List_Table extends WP_List_Table {
 		// Start timestamp
 		echo '<div class="submitted-on">';
 
-		// Other plugins can filter which actions are shown
+		/**
+		 * Filters available actions for plugins to alter.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array $actions Array of available actions user could use.
+		 * @param array $item    Current item being added to page.
+		 */
 		$actions = apply_filters( 'bp_activity_admin_comment_row_actions', array_filter( $actions ), $item );
 
 		/* translators: 2: activity admin ui date/time */
@@ -1440,8 +1535,23 @@ class BP_Activity_List_Table extends WP_List_Table {
 
 		// Get activity content - if not set, use the action
 		if ( ! empty( $item['content'] ) ) {
+
+			/**
+			 * Filters current activity item content.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @param array $item Array index holding current activity item content.
+			 */
 			$content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
 		} else {
+			/**
+			 * Filters current activity item action.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @var array $item Array index holding current activity item action.
+			 */
 			$content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
 		}
 
@@ -1459,6 +1569,15 @@ class BP_Activity_List_Table extends WP_List_Table {
 	 */
 	function column_response( $item ) {
 		// Is $item is a root activity?
+
+		/**
+		 * Filters default list of default root activity types.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array $value Array of default activity types.
+		 * @param array $item  Current item being displayed.
+		 */
 		if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) {
 			$comment_count     = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0;
 			$root_activity_url = bp_get_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $item['id'] );
@@ -1488,6 +1607,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param int $activity_id Activity ID to retrieve User ID for.
+	 *
 	 * @return int User ID of the activity item in question.
 	 */
 	protected function get_activity_user_id( $activity_id ) {
@@ -1504,7 +1624,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 
 			/**
 			 * If, somehow, the referenced activity has been deleted, leaving its associated
-			 * activites as orphans, use the logged in user's ID to avoid errors.
+			 * activities as orphans, use the logged in user's ID to avoid errors.
 			 */
 			if ( empty( $activity['activities'] ) )
 				return bp_loggedin_user_id();
@@ -1521,13 +1641,14 @@ class BP_Activity_List_Table extends WP_List_Table {
 	 * Checks if an activity item can be replied to.
 	 *
 	 * This method merges functionality from {@link bp_activity_can_comment()} and
-	 * {@link bp_blogs_disable_activity_commenting()}.  This is done because the activity
+	 * {@link bp_blogs_disable_activity_commenting()}. This is done because the activity
 	 * list table doesn't use a BuddyPress activity loop, which prevents those
 	 * functions from working as intended.
 	 *
 	 * @since BuddyPress (2.0.0)
 	 *
 	 * @param array $item An array version of the BP_Activity_Activity object.
+	 *
 	 * @return bool
 	 */
 	protected function can_comment( $item  ) {
@@ -1573,6 +1694,13 @@ class BP_Activity_List_Table extends WP_List_Table {
 			}
 		}
 
+		/**
+		 * Filters if an activity item can be commented on or not.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param bool $can_comment Whether an activity item can be commented on or not.
+		 */
 		return apply_filters( 'bp_activity_list_table_can_comment', $can_comment );
 	}
 
@@ -1585,6 +1713,7 @@ class BP_Activity_List_Table extends WP_List_Table {
 	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param array $tree Source array.
+	 *
 	 * @return array Flattened array.
 	 */
 	public static function flatten_activity_array( $tree ){
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php
index 9298a2d0616d2a122dd01e353070ec3738af3614..f7385dada1cdcf1edaf57e500625705292d38ebe 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php
@@ -3,17 +3,18 @@
  * Akismet support for BuddyPress' Activity Stream.
  *
  * @package BuddyPress
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  * @subpackage Activity
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Akismet support for the Activity component.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
+ * @since BuddyPress (2.3.0) We only support Akismet 3+.
  */
 class BP_Akismet {
 	/**
@@ -21,14 +22,14 @@ class BP_Akismet {
 	 *
 	 * @access protected
 	 * @var BP_Activity_Activity
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 */
 	protected $last_activity = null;
 
 	/**
 	 * Constructor.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 */
 	public function __construct() {
 		$this->setup_actions();
@@ -37,7 +38,7 @@ class BP_Akismet {
 	/**
 	 * Hook Akismet into the activity stream.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 */
 	protected function setup_actions() {
 		// Add nonces to activity stream lists
@@ -69,10 +70,11 @@ class BP_Akismet {
 	 * This function lifted with love from the Akismet WordPress plugin's
 	 * akismet_comment_row_action() function. Thanks!
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @param array $actions The hover links.
+	 * @param array $actions  The hover links.
 	 * @param array $activity The activity for the current row being processed.
+	 *
 	 * @return array The hover links.
 	 */
 	function comment_row_action( $actions, $activity ) {
@@ -112,6 +114,13 @@ class BP_Akismet {
 		if ( $desc )
 			echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';
 
+		/**
+		 * Filters the list of actions for the current activity's row.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array $actions Array of available actions for the current activity item's row.
+		 */
 		return apply_filters( 'bp_akismet_comment_row_action', $actions );
 	}
 
@@ -122,9 +131,9 @@ class BP_Akismet {
 	 * the reply form of each activity item. The nonces are, in turn, used
 	 * by Akismet to help detect spam activity.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @see http://plugins.trac.wordpress.org/ticket/1232
+	 * @see https://plugins.trac.wordpress.org/ticket/1232
 	 */
 	public function add_activity_stream_nonce() {
 		$form_id = '_bp_as_nonce';
@@ -151,13 +160,13 @@ class BP_Akismet {
 	 * This can't be done in BP_Akismet::check_activity() due to the
 	 * default AJAX implementation; see bp_dtheme_post_update().
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @see bp_dtheme_post_update()
 	 *
-	 * @param string $content Activity update text.
-	 * @param int $user_id User ID.
-	 * @param int $activity_id Activity ID.
+	 * @param string $content     Activity update text.
+	 * @param int    $user_id     User ID.
+	 * @param int    $activity_id Activity ID.
 	 */
 	public function check_member_activity_update( $content, $user_id, $activity_id ) {
 		// By default, only handle activity updates and activity comments.
@@ -177,7 +186,7 @@ class BP_Akismet {
 	 *
 	 * This function is intended to be used inside the activity stream loop.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 */
 	public function add_activity_spam_button() {
 		if ( !bp_activity_user_can_mark_spam() )
@@ -205,7 +214,7 @@ class BP_Akismet {
 	 *
 	 * This function is intended to be used inside the activity stream loop.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 */
 	public function add_activity_comment_spam_button() {
 		if ( !bp_activity_user_can_mark_spam() )
@@ -232,56 +241,92 @@ class BP_Akismet {
 	/**
 	 * Get a filterable list of activity types that Akismet should automatically check for spam.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @static
 	 *
 	 * @return array List of activity types.
 	 */
 	public static function get_activity_types() {
+
+		/**
+		 * Filters the list of activity types that Akismet should automatically check for spam.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array Array of default activity types for Akismet to check.
+		 */
 		return apply_filters( 'bp_akismet_get_activity_types', array( 'activity_comment', 'activity_update' ) );
 	}
 
 	/**
 	 * Mark activity item as spam.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @param BP_Activity_Activity $activity
-	 * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed).
+	 * @param BP_Activity_Activity $activity Activity item being spammed.
+	 * @param string               $source   Either "by_a_person" (e.g. a person has
+	 *                                       manually marked the activity as spam) or
+	 *                                       "by_akismet" (automatically spammed).
 	 */
 	public function mark_as_spam( $activity, $source ) {
 		// Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update()
 		$this->last_activity = $activity;
 
+		/**
+		 * Fires after marking an activity item has been marked as spam.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param BP_Activity_Activity $activity Activity object being marked as spam.
+		 * @param string               $source   Source of the whom marked as spam.
+		 *                                       Either "by_a_person" (e.g. a person has
+		 *                                       manually marked the activity as spam)
+		 *                                       or "by_akismet".
+		 */
 		do_action( 'bp_activity_akismet_mark_as_spam', $activity, $source );
 	}
 
 	/**
 	 * Mark activity item as ham.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @param BP_Activity_Activity $activity
-	 * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).
+	 * @param BP_Activity_Activity $activity Activity item being hammed.
+	 * @param string               $source   Either "by_a_person" (e.g. a person has
+	 *                                       manually marked the activity as ham) or
+	 *                                       "by_akismet" (automatically hammed).
 	 */
 	public function mark_as_ham( $activity, $source ) {
 		// If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped.
 		if ( 'true' == bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) )
 			$activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
 
+		/**
+		 * Fires after marking an activity item has been marked as ham.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param BP_Activity_Activity $activity Activity object being marked as ham.
+		 * @param string               $source   Source of the whom marked as ham.
+		 *                                       Either "by_a_person" (e.g. a person has
+		 *                                       manually marked the activity as ham) or
+		 *                                       "by_akismet" (automatically hammed).
+		 */
 		do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
 	}
 
 	/**
 	 * Build a data package for the Akismet service to inspect.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @see http://akismet.com/development/api/#comment-check
 	 * @static
 	 *
 	 * @param BP_Activity_Activity $activity Activity item data.
+	 *
+	 * @return array
 	 */
 	public static function build_akismet_data_package( $activity ) {
 		$userdata = get_userdata( $activity->user_id );
@@ -295,7 +340,7 @@ class BP_Akismet {
 		$activity_data['comment_type']          = $activity->type;
 		$activity_data['permalink']             = bp_activity_get_permalink( $activity->id, $activity );
 		$activity_data['user_ID']               = $userdata->ID;
-		$activity_data['user_role']             = akismet_get_user_roles( $userdata->ID );
+		$activity_data['user_role']             = Akismet::get_user_roles( $userdata->ID );
 
 		/**
 		 * Get the nonce if the new activity was submitted through the "what's up, Paul?" form.
@@ -311,13 +356,21 @@ class BP_Akismet {
 		elseif ( !empty( $activity->secondary_item_id ) && !empty( $_POST['_bp_as_nonce_' . $activity->secondary_item_id] ) )
 			$activity_data['akismet_comment_nonce'] = wp_verify_nonce( $_POST["_bp_as_nonce_{$activity->secondary_item_id}"], "_bp_as_nonce_{$userdata->ID}_{$activity->secondary_item_id}" ) ? 'passed' : 'failed';
 
+		/**
+		 * Filters activity data before being sent to Akismet to inspect.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array                $activity_data Array of activity data for Akismet to inspect.
+		 * @param BP_Activity_Activity $activity      Activity item data.
+		 */
 		return apply_filters( 'bp_akismet_build_akismet_data_package', $activity_data, $activity );
 	}
 
 	/**
 	 * Check if the activity item is spam or ham.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @see http://akismet.com/development/api/
 	 * @todo Spam counter?
@@ -347,7 +400,15 @@ class BP_Akismet {
 
 		// Spam
 		if ( 'true' == $activity_data['bp_as_result'] ) {
-			// Action for plugin authors
+			/**
+			 * Fires after an activity item has been proven to be spam, but before officially being marked as spam.
+			 *
+			 * @since BuddyPress (1.6.0)
+			 *
+			 * @param BP_Activity_Activity $activity      The activity item proven to be spam.
+			 * @param array                $activity_data Array of activity data for item including
+			 *                                            Akismet check results data.
+			 */
 			do_action_ref_array( 'bp_activity_akismet_spam_caught', array( &$activity, $activity_data ) );
 
 			// Mark as spam
@@ -361,7 +422,7 @@ class BP_Akismet {
 	/**
 	 * Update activity meta after a manual spam change (user-initiated).
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param BP_Activity_Activity $activity The activity to check.
 	 */
@@ -378,7 +439,7 @@ class BP_Akismet {
 	/**
 	 * Update activity meta after a manual ham change (user-initiated).
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param BP_Activity_Activity $activity The activity to check.
 	 */
@@ -395,7 +456,7 @@ class BP_Akismet {
 	/**
 	 * Update activity meta after an automatic spam check (not user-initiated).
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param BP_Activity_Activity $activity The activity to check.
 	 */
@@ -431,26 +492,18 @@ class BP_Akismet {
 	/**
 	 * Contact Akismet to check if this is spam or ham.
 	 *
-	 * Props to WordPress core Akismet plugin for alot of this.
+	 * Props to WordPress core Akismet plugin for a lot of this.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @global string $akismet_api_host
-	 * @global string $akismet_api_port
+	 * @param array  $activity_data Packet of information to submit to Akismet.
+	 * @param string $check         "check" or "submit".
+	 * @param string $spam          "spam" or "ham".
 	 *
-	 * @param array $activity_data Packet of information to submit to Akismet.
-	 * @param string $check "check" or "submit".
-	 * @param string $spam "spam" or "ham".
 	 * @return array $activity_data Activity data, with Akismet data added.
 	 */
 	public function send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' ) {
-		global $akismet_api_host, $akismet_api_port;
-
-		// Check that host and port are set, if not, set them
-		if ( function_exists( 'akismet_init' ) && ( empty( $akismet_api_host ) || empty( $akismet_api_port ) ) )
-			akismet_init();
-
-		$query_string = $path = $response = '';
+		$query_string = $path = '';
 
 		$activity_data['blog']         = bp_get_option( 'home' );
 		$activity_data['blog_charset'] = bp_get_option( 'blog_charset' );
@@ -459,7 +512,7 @@ class BP_Akismet {
 		$activity_data['user_agent']   = bp_core_current_user_ua();
 		$activity_data['user_ip']      = bp_core_current_user_ip();
 
-		if ( akismet_test_mode() )
+		if ( Akismet::is_test_mode() )
 			$activity_data['is_test'] = 'true';
 
 		// Loop through _POST args and rekey strings
@@ -487,13 +540,13 @@ class BP_Akismet {
 			$query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
 
 		if ( 'check' == $check )
-			$path = '/1.1/comment-check';
+			$path = 'comment-check';
 		elseif ( 'submit' == $check )
-			$path = '/1.1/submit-' . $spam;
+			$path = 'submit-' . $spam;
 
 		// Send to Akismet
 		add_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) );
-		$response = akismet_http_post( $query_string, $akismet_api_host, $path, $akismet_api_port );
+		$response = Akismet::http_post( $query_string, $path );
 		remove_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) );
 
 		// Get the response
@@ -512,9 +565,10 @@ class BP_Akismet {
 	/**
 	 * Filters user agent when sending to Akismet to add BuddyPress info.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param string $user_agent User agent string, as generated by Akismet.
+	 *
 	 * @return string $user_agent Modified user agent string.
 	 */
 	public function buddypress_ua( $user_agent ) {
@@ -525,7 +579,7 @@ class BP_Akismet {
 	/**
 	 * Adds a "History" meta box to the activity edit screen.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param string $screen_action The type of screen that has been requested.
 	 */
@@ -541,9 +595,9 @@ class BP_Akismet {
 	/**
 	 * History meta box for the Activity admin edit screen.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @see http://buddypress.trac.wordpress.org/ticket/3907
+	 * @see https://buddypress.trac.wordpress.org/ticket/3907
 	 * @todo Update activity meta to allow >1 record with the same key (iterate through $history).
 	 *
 	 * @param object $item Activity item.
@@ -562,17 +616,17 @@ class BP_Akismet {
 	/**
 	 * Update an activity item's Akismet history.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
-	 * @param int $activity_id Activity item ID.
-	 * @param string $message Human-readable description of what's changed.
-	 * @param string $event The type of check we were carrying out.
+	 * @param int    $activity_id Activity item ID.
+	 * @param string $message     Human-readable description of what's changed.
+	 * @param string $event       The type of check we were carrying out.
 	 */
 	public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) {
 		$event = array(
 			'event'   => $event,
 			'message' => $message,
-			'time'    => akismet_microtime(),
+			'time'    => Akismet::_get_microtime(),
 			'user'    => bp_loggedin_user_id(),
 		);
 
@@ -583,9 +637,10 @@ class BP_Akismet {
 	/**
 	 * Get an activity item's Akismet history.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @param int $activity_id Activity item ID.
+	 *
 	 * @return array The activity item's Akismet history.
 	 */
 	public function get_activity_history( $activity_id = 0 ) {
@@ -601,19 +656,27 @@ class BP_Akismet {
 }
 
 /**
- * Delete old spam activity meta data
+ * Delete old spam activity meta data.
  *
  * This is done as a clean-up mechanism, as _bp_akismet_submission meta can
  * grow to be quite large.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
- * @global object $bp BuddyPress global settings.
  * @global wpdb $wpdb WordPress database object.
  */
 function bp_activity_akismet_delete_old_metadata() {
-	global $bp, $wpdb;
+	global $wpdb;
 
+	$bp = buddypress();
+
+	/**
+	 * Filters the threshold for how many days old Akismet metadata needs to be before being automatically deleted.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param integer 15 How many days old metadata needs to be.
+	 */
 	$interval = apply_filters( 'bp_activity_akismet_delete_meta_interval', 15 );
 
 	// Enforce a minimum of 1 day
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php
index 36d8805db72b4aeb4784bbb7022e53e98094d697..92ffd619c796dec142278dc30b30188de0ebe34e 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php
@@ -3,11 +3,11 @@
 /**
  * Functions related to the BuddyPress Activity component and the WP Cache.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Slurp up activitymeta for a specified set of activity items.
@@ -16,11 +16,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * in $activity_ids and adds it to the WP cache. This improves efficiency when
  * using querying activitymeta inline.
  *
- * @param int|str|array $activity_ids Accepts a single activity ID, or a comma-
- *        separated list or array of activity ids
+ * @param int|string|array|bool $activity_ids Accepts a single activity ID, or a comma-
+ *                                            separated list or array of activity ids
  */
 function bp_activity_update_meta_cache( $activity_ids = false ) {
-	global $bp;
+	$bp = buddypress();
 
 	$cache_args = array(
 		'object_ids' 	   => $activity_ids,
@@ -37,19 +37,20 @@ function bp_activity_update_meta_cache( $activity_ids = false ) {
 /**
  * Clear a cached activity item when that item is updated.
  *
- * @since 2.0
+ * @since BuddyPress (2.0.0)
  *
  * @param BP_Activity_Activity $activity
  */
 function bp_activity_clear_cache_for_activity( $activity ) {
 	wp_cache_delete( $activity->id, 'bp_activity' );
+	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
 }
 add_action( 'bp_activity_after_save', 'bp_activity_clear_cache_for_activity' );
 
 /**
  * Clear cached data for deleted activity items.
  *
- * @since 2.0
+ * @since BuddyPress (2.0.0)
  *
  * @param array $deleted_ids IDs of deleted activity items.
  */
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
index ad6f9f098e06e2b7db2e7ac2e06a0582e3ce110e..8f00824cc1221b1d1e32cd23ef3c3bf42c6f2e80 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php
@@ -7,1755 +7,8 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
-/**
- * Database interaction class for the BuddyPress activity component.
- *
- * Instance methods are available for creating/editing an activity,
- * static methods for querying activities.
- *
- * @since BuddyPress (1.0)
- */
-class BP_Activity_Activity {
-
-	/** Properties ************************************************************/
-
-	/**
-	 * ID of the activity item.
-	 *
-	 * @var int
-	 */
-	var $id;
-
-	/**
-	 * ID of the associated item.
-	 *
-	 * @var int
-	 */
-	var $item_id;
-
-	/**
-	 * ID of the associated secondary item.
-	 *
-	 * @var int
-	 */
-	var $secondary_item_id;
-
-	/**
-	 * ID of user associated with the activity item.
-	 *
-	 * @var int
-	 */
-	var $user_id;
-
-	/**
-	 * The primary URL for the activity in RSS feeds.
-	 *
-	 * @var string
-	 */
-	var $primary_link;
-
-	/**
-	 * BuddyPress component the activity item relates to.
-	 *
-	 * @var string
-	 */
-	var $component;
-
-	/**
-	 * Activity type, eg 'new_blog_post'.
-	 *
-	 * @var string
-	 */
-	var $type;
-
-	/**
-	 * Description of the activity, eg 'Alex updated his profile.'
-	 *
-	 * @var string
-	 */
-	var $action;
-
-	/**
-	 * The content of the activity item.
-	 *
-	 * @var string
-	 */
-	var $content;
-
-	/**
-	 * The date the activity item was recorded, in 'Y-m-d h:i:s' format.
-	 *
-	 * @var string
-	 */
-	var $date_recorded;
-
-	/**
-	 * Whether the item should be hidden in sitewide streams.
-	 *
-	 * @var int
-	 */
-	var $hide_sitewide = false;
-
-	/**
-	 * Node boundary start for activity or activity comment.
-	 *
-	 * @var int
-	 */
-	var $mptt_left;
-
-	/**
-	 * Node boundary end for activity or activity comment.
-	 *
-	 * @var int
-	 */
-	var $mptt_right;
-
-	/**
-	 * Whether this item is marked as spam.
-	 *
-	 * @var int
-	 */
-	var $is_spam;
-
-	/**
-	 * Constructor method.
-	 *
-	 * @param int $id Optional. The ID of a specific activity item.
-	 */
-	public function __construct( $id = false ) {
-		if ( !empty( $id ) ) {
-			$this->id = $id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Populate the object with data about the specific activity item.
-	 */
-	public function populate() {
-		global $wpdb, $bp;
-
-		$row = wp_cache_get( $this->id, 'bp_activity' );
-
-		if ( false === $row ) {
-			$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) );
-
-			wp_cache_set( $this->id, $row, 'bp_activity' );
-		}
-
-		if ( ! empty( $row ) ) {
-			$this->id                = (int) $row->id;
-			$this->item_id           = (int) $row->item_id;
-			$this->secondary_item_id = (int) $row->secondary_item_id;
-			$this->user_id           = (int) $row->user_id;
-			$this->primary_link      = $row->primary_link;
-			$this->component         = $row->component;
-			$this->type              = $row->type;
-			$this->action            = $row->action;
-			$this->content           = $row->content;
-			$this->date_recorded     = $row->date_recorded;
-			$this->hide_sitewide     = $row->hide_sitewide;
-			$this->mptt_left         = (int) $row->mptt_left;
-			$this->mptt_right        = (int) $row->mptt_right;
-			$this->is_spam           = $row->is_spam;
-		}
-
-		// Generate dynamic 'action' when possible
-		$action = bp_activity_generate_action_string( $this );
-		if ( false !== $action ) {
-			$this->action = $action;
-
-		// If no callback is available, use the literal string from
-		// the database row
-		} else if ( ! empty( $row->action ) ) {
-			$this->action = $row->action;
-
-		// Provide a fallback to avoid PHP notices
-		} else {
-			$this->action = '';
-		}
-	}
-
-	/**
-	 * Save the activity item to the database.
-	 *
-	 * @return bool True on success.
-	 */
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->id                = apply_filters_ref_array( 'bp_activity_id_before_save',                array( $this->id,                &$this ) );
-		$this->item_id           = apply_filters_ref_array( 'bp_activity_item_id_before_save',           array( $this->item_id,           &$this ) );
-		$this->secondary_item_id = apply_filters_ref_array( 'bp_activity_secondary_item_id_before_save', array( $this->secondary_item_id, &$this ) );
-		$this->user_id           = apply_filters_ref_array( 'bp_activity_user_id_before_save',           array( $this->user_id,           &$this ) );
-		$this->primary_link      = apply_filters_ref_array( 'bp_activity_primary_link_before_save',      array( $this->primary_link,      &$this ) );
-		$this->component         = apply_filters_ref_array( 'bp_activity_component_before_save',         array( $this->component,         &$this ) );
-		$this->type              = apply_filters_ref_array( 'bp_activity_type_before_save',              array( $this->type,              &$this ) );
-		$this->action            = apply_filters_ref_array( 'bp_activity_action_before_save',            array( $this->action,            &$this ) );
-		$this->content           = apply_filters_ref_array( 'bp_activity_content_before_save',           array( $this->content,           &$this ) );
-		$this->date_recorded     = apply_filters_ref_array( 'bp_activity_date_recorded_before_save',     array( $this->date_recorded,     &$this ) );
-		$this->hide_sitewide     = apply_filters_ref_array( 'bp_activity_hide_sitewide_before_save',     array( $this->hide_sitewide,     &$this ) );
-		$this->mptt_left         = apply_filters_ref_array( 'bp_activity_mptt_left_before_save',         array( $this->mptt_left,         &$this ) );
-		$this->mptt_right        = apply_filters_ref_array( 'bp_activity_mptt_right_before_save',        array( $this->mptt_right,        &$this ) );
-		$this->is_spam           = apply_filters_ref_array( 'bp_activity_is_spam_before_save',           array( $this->is_spam,           &$this ) );
-
-		// Use this, not the filters above
-		do_action_ref_array( 'bp_activity_before_save', array( &$this ) );
-
-		if ( !$this->component || !$this->type )
-			return false;
-
-		if ( !$this->primary_link )
-			$this->primary_link = bp_loggedin_user_domain();
-
-		// If we have an existing ID, update the activity item, otherwise insert it.
-		if ( $this->id )
-			$q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id );
-		else
-			$q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam );
-
-		if ( false === $wpdb->query( $q ) )
-			return false;
-
-		// If this is a new activity item, set the $id property
-		if ( empty( $this->id ) )
-			$this->id = $wpdb->insert_id;
-
-		// If an existing activity item, prevent any changes to the content generating new @mention notifications.
-		else
-			add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
-
-		do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
-
-		return true;
-	}
-
-	/** Static Methods ***************************************************/
-
-	/**
-	 * Get activity items, as specified by parameters
-	 *
-	 * @see BP_Activity_Activity::get_filter_sql() for a description of the
-	 *      'filter' parameter.
-	 * @see WP_Meta_Query::queries for a description of the 'meta_query'
-	 *      parameter format.
-	 *
-	 * @param array $args {
-	 *     An array of arguments. All items are optional.
-	 *     @type int $page Which page of results to fetch. Using page=1
-	 *                     without per_page will result in no pagination.
-	 *                     Default: 1.
-	 *     @type int|bool $per_page Number of results per page. Default: 25.
-	 *     @type int|bool $max Maximum number of results to return.
-	 *                         Default: false (unlimited).
-	 *     @type string $sort ASC or DESC. Default: 'DESC'.
-	 *     @type array $exclude Array of activity IDs to exclude.
-	 *                          Default: false.
-	 *     @type array $in Array of ids to limit query by (IN).
-	 *                     Default: false.
-	 *     @type array $meta_query An array of meta_query conditions.
-	 *                             See WP_Meta_Query::queries for description.
-	 *     @type array $date_query An array of date_query conditions.
-	 *                             See first parameter of WP_Date_Query::__construct()
-	 *                             for description.
-	 *     @type array $filter See BP_Activity_Activity::get_filter_sql().
-	 *     @type string $search_terms Limit results by a search term.
-	 *                                Default: false.
-	 *     @type bool $display_comments Whether to include activity comments.
-	 *                                  Default: false.
-	 *     @type bool $show_hidden Whether to show items marked hide_sitewide.
-	 *                             Default: false.
-	 *     @type string $spam Spam status. Default: 'ham_only'.
-	 *     @type bool $update_meta_cache Whether to pre-fetch metadata for
-	 *           queried activity items. Default: true.
-	 *     @type string|bool $count_total If true, an additional DB query
-	 *           is run to count the total activity items for the query.
-	 *           Default: false.
-	 * }
-	 * @return array The array returned has two keys:
-	 *     - 'total' is the count of located activities
-	 *     - 'activities' is an array of the located activities
-	 */
-	public static function get( $args = array() ) {
-		global $wpdb, $bp;
-
-		// Backward compatibility with old method of passing arguments
-		if ( !is_array( $args ) || func_num_args() > 1 ) {
-			_deprecated_argument( __METHOD__, '1.6', 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__ ) );
-
-			$old_args_keys = array(
-				0 => 'max',
-				1 => 'page',
-				2 => 'per_page',
-				3 => 'sort',
-				4 => 'search_terms',
-				5 => 'filter',
-				6 => 'display_comments',
-				7 => 'show_hidden',
-				8 => 'exclude',
-				9 => 'in',
-				10 => 'spam'
-			);
-
-			$func_args = func_get_args();
-			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
-		}
-
-		$defaults = array(
-			'page'              => 1,          // The current page
-			'per_page'          => 25,         // Activity items per page
-			'max'               => false,      // Max number of items to return
-			'sort'              => 'DESC',     // ASC or DESC
-			'exclude'           => false,      // Array of ids to exclude
-			'in'                => false,      // Array of ids to limit query by (IN)
-			'meta_query'        => false,      // Filter by activitymeta
-			'date_query'        => false,      // Filter by date
-			'filter'            => false,      // See self::get_filter_sql()
-			'search_terms'      => false,      // Terms to search by
-			'display_comments'  => false,      // Whether to include activity comments
-			'show_hidden'       => false,      // Show items marked hide_sitewide
-			'spam'              => 'ham_only', // Spam status
-			'update_meta_cache' => true,
-			'count_total'       => false,
-		);
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r );
-
-		// Select conditions
-		$select_sql = "SELECT DISTINCT a.id";
-
-		$from_sql   = " FROM {$bp->activity->table_name} a";
-
-		$join_sql   = '';
-
-		// Where conditions
-		$where_conditions = array();
-
-		// Excluded types
-		$excluded_types = array();
-
-		// Spam
-		if ( 'ham_only' == $spam )
-			$where_conditions['spam_sql'] = 'a.is_spam = 0';
-		elseif ( 'spam_only' == $spam )
-			$where_conditions['spam_sql'] = 'a.is_spam = 1';
-
-		// Searching
-		if ( $search_terms ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$where_conditions['search_sql'] = $wpdb->prepare( 'a.content LIKE %s', $search_terms_like );
-		}
-
-		// Filtering
-		if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) )
-			$where_conditions['filter_sql'] = $filter_sql;
-
-		// Sorting
-		if ( $sort != 'ASC' && $sort != 'DESC' )
-			$sort = 'DESC';
-
-		// Hide Hidden Items?
-		if ( !$show_hidden )
-			$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
-
-		// Exclude specified items
-		if ( !empty( $exclude ) ) {
-			$exclude = implode( ',', wp_parse_id_list( $exclude ) );
-			$where_conditions['exclude'] = "a.id NOT IN ({$exclude})";
-		}
-
-		// The specific ids to which you want to limit the query
-		if ( !empty( $in ) ) {
-			$in = implode( ',', wp_parse_id_list( $in ) );
-			$where_conditions['in'] = "a.id IN ({$in})";
-		}
-
-		// Process meta_query into SQL
-		$meta_query_sql = self::get_meta_query_sql( $meta_query );
-
-		if ( ! empty( $meta_query_sql['join'] ) ) {
-			$join_sql .= $meta_query_sql['join'];
-		}
-
-		if ( ! empty( $meta_query_sql['where'] ) ) {
-			$where_conditions[] = $meta_query_sql['where'];
-		}
-
-		// Process date_query into SQL
-		$date_query_sql = self::get_date_query_sql( $date_query );
-
-		if ( ! empty( $date_query_sql ) ) {
-			$where_conditions['date'] = $date_query_sql;
-		}
-
-		// Alter the query based on whether we want to show activity item
-		// comments in the stream like normal comments or threaded below
-		// the activity.
-		if ( false === $display_comments || 'threaded' === $display_comments ) {
-			$excluded_types[] = 'activity_comment';
-		}
-
-		// Exclude 'last_activity' items unless the 'action' filter has
-		// been explicitly set
-		if ( empty( $filter['object'] ) ) {
-			$excluded_types[] = 'last_activity';
-		}
-
-		// Exclude 'new_member' items if xprofile component is not active
-		if ( ! bp_is_active( 'xprofile' ) ) {
-			$excluded_types[] = 'new_member';
-		}
-
-		// Build the excluded type sql part
-		if ( ! empty( $excluded_types ) ) {
-			$not_in = "'" . implode( "', '", esc_sql( $excluded_types ) ) . "'";
-			$where_conditions['excluded_types'] = "a.type NOT IN ({$not_in})";
-		}
-
-		// Filter the where conditions
-		$where_conditions = apply_filters( 'bp_activity_get_where_conditions', $where_conditions, $r, $select_sql, $from_sql, $join_sql );
-
-		// Join the where conditions together
-		$where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
-
-		// Define the preferred order for indexes
-		$indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
-
-		foreach( $indexes as $key => $index ) {
-			if ( false !== strpos( $where_sql, $index ) ) {
-				$the_index = $index;
-				break; // Take the first one we find
-			}
-		}
-
-		if ( !empty( $the_index ) ) {
-			$index_hint_sql = "USE INDEX ({$the_index})";
-		} else {
-			$index_hint_sql = '';
-		}
-
-		// Sanitize page and per_page parameters
-		$page     = absint( $page     );
-		$per_page = absint( $per_page );
-
-		$retval = array(
-			'activities'     => null,
-			'total'          => null,
-			'has_more_items' => null,
-		);
-
-		// Filter and return true to use the legacy query structure (not recommended)
-		if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $r ) ) {
-
-			// Legacy queries joined against the user table
-			$select_sql = "SELECT DISTINCT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name";
-			$from_sql   = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
-
-			if ( ! empty( $page ) && ! empty( $per_page ) ) {
-				$pag_sql    = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
-				$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
-			} else {
-				$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort ) );
-			}
-
-		} else {
-
-			// Query first for activity IDs
-			$activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}";
-
-			if ( ! empty( $per_page ) && ! empty( $page ) ) {
-				// We query for $per_page + 1 items in order to
-				// populate the has_more_items flag
-				$activity_ids_sql .= $wpdb->prepare( " LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page + 1 );
-			}
-
-			$activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r );
-
-			$activity_ids = $wpdb->get_col( $activity_ids_sql );
-
-			$retval['has_more_items'] = ! empty( $per_page ) && count( $activity_ids ) > $per_page;
-
-			// If we've fetched more than the $per_page value, we
-			// can discard the extra now
-			if ( ! empty( $per_page ) && count( $activity_ids ) === $per_page + 1 ) {
-				array_pop( $activity_ids );
-			}
-
-			$activities = self::get_activity_data( $activity_ids );
-		}
-
-		// Get the fullnames of users so we don't have to query in the loop
-		$activities = self::append_user_fullnames( $activities );
-
-		// Get activity meta
-		$activity_ids = array();
-		foreach ( (array) $activities as $activity ) {
-			$activity_ids[] = $activity->id;
-		}
-
-		if ( ! empty( $activity_ids ) && $update_meta_cache ) {
-			bp_activity_update_meta_cache( $activity_ids );
-		}
-
-		if ( $activities && $display_comments )
-			$activities = BP_Activity_Activity::append_comments( $activities, $spam );
-
-		// Pre-fetch data associated with activity users and other objects
-		BP_Activity_Activity::prefetch_object_data( $activities );
-
-		// Generate action strings
-		$activities = BP_Activity_Activity::generate_action_strings( $activities );
-
-		$retval['activities'] = $activities;
-
-		// If $max is set, only return up to the max results
-		if ( ! empty( $r['count_total'] ) ) {
-
-			$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort );
-			$total_activities     = $wpdb->get_var( $total_activities_sql );
-
-			if ( !empty( $max ) ) {
-				if ( (int) $total_activities > (int) $max )
-					$total_activities = $max;
-			}
-
-			$retval['total'] = $total_activities;
-		}
-
-		return $retval;
-	}
-
-	/**
-	 * Convert activity IDs to activity objects, as expected in template loop.
-	 *
-	 * @since 2.0
-	 *
-	 * @param array $activity_ids Array of activity IDs.
-	 * @return array
-	 */
-	protected static function get_activity_data( $activity_ids = array() ) {
-		global $wpdb;
-
-		// Bail if no activity ID's passed
-		if ( empty( $activity_ids ) ) {
-			return array();
-		}
-
-		// Get BuddyPress
-		$bp = buddypress();
-
-		$activities   = array();
-		$uncached_ids = bp_get_non_cached_ids( $activity_ids, 'bp_activity' );
-
-		// Prime caches as necessary
-		if ( ! empty( $uncached_ids ) ) {
-			// Format the activity ID's for use in the query below
-			$uncached_ids_sql = implode( ',', wp_parse_id_list( $uncached_ids ) );
-
-			// Fetch data from activity table, preserving order
-			$queried_adata = $wpdb->get_results( "SELECT * FROM {$bp->activity->table_name} WHERE id IN ({$uncached_ids_sql})");
-
-			// Put that data into the placeholders created earlier,
-			// and add it to the cache
-			foreach ( (array) $queried_adata as $adata ) {
-				wp_cache_set( $adata->id, $adata, 'bp_activity' );
-			}
-		}
-
-		// Now fetch data from the cache
-		foreach ( $activity_ids as $activity_id ) {
-			$activities[] = wp_cache_get( $activity_id, 'bp_activity' );
-		}
-
-		// Then fetch user data
-		$user_query = new BP_User_Query( array(
-			'user_ids'        => wp_list_pluck( $activities, 'user_id' ),
-			'populate_extras' => false,
-		) );
-
-		// Associated located user data with activity items
-		foreach ( $activities as $a_index => $a_item ) {
-			$a_user_id = intval( $a_item->user_id );
-			$a_user    = isset( $user_query->results[ $a_user_id ] ) ? $user_query->results[ $a_user_id ] : '';
-
-			if ( !empty( $a_user ) ) {
-				$activities[ $a_index ]->user_email    = $a_user->user_email;
-				$activities[ $a_index ]->user_nicename = $a_user->user_nicename;
-				$activities[ $a_index ]->user_login    = $a_user->user_login;
-				$activities[ $a_index ]->display_name  = $a_user->display_name;
-			}
-		}
-
-		return $activities;
-	}
-
-	/**
-	 * Append xProfile fullnames to an activity array.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $activities Activities array.
-	 * @return array
-	 */
-	protected static function append_user_fullnames( $activities ) {
-
-		if ( bp_is_active( 'xprofile' ) && ! empty( $activities ) ) {
-			$activity_user_ids = wp_list_pluck( $activities, 'user_id' );
-
-			if ( ! empty( $activity_user_ids ) ) {
-				$fullnames = bp_core_get_user_displaynames( $activity_user_ids );
-				if ( ! empty( $fullnames ) ) {
-					foreach ( (array) $activities as $i => $activity ) {
-						if ( ! empty( $fullnames[ $activity->user_id ] ) ) {
-							$activities[ $i ]->user_fullname = $fullnames[ $activity->user_id ];
-						}
-					}
-				}
-			}
-		}
-
-		return $activities;
-	}
-
-	/**
-	 * Pre-fetch data for objects associated with activity items.
-	 *
-	 * Activity items are associated with users, and often with other
-	 * BuddyPress data objects. Here, we pre-fetch data about these
-	 * associated objects, so that inline lookups - done primarily when
-	 * building action strings - do not result in excess database queries.
-	 *
-	 * The only object data required for activity component activity types
-	 * (activity_update and activity_comment) is related to users, and that
-	 * info is fetched separately in BP_Activity_Activity::get_activity_data().
-	 * So this method contains nothing but a filter that allows other
-	 * components, such as bp-friends and bp-groups, to hook in and prime
-	 * their own caches at the beginning of an activity loop.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $activities Array of activities.
-	 */
-	protected static function prefetch_object_data( $activities ) {
-		return apply_filters( 'bp_activity_prefetch_object_data', $activities );
-	}
-
-	/**
-	 * Generate action strings for the activities located in BP_Activity_Activity::get().
-	 *
-	 * If no string can be dynamically generated for a given item
-	 * (typically because the activity type has not been properly
-	 * registered), the static 'action' value pulled from the database will
-	 * be left in place.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $activities Array of activities.
-	 * @return array
-	 */
-	protected static function generate_action_strings( $activities ) {
-		foreach ( $activities as $key => $activity ) {
-			$generated_action = bp_activity_generate_action_string( $activity );
-			if ( false !== $generated_action ) {
-				$activity->action = $generated_action;
-			}
-
-			$activities[ $key ] = $activity;
-		}
-
-		return $activities;
-	}
-
-	/**
-	 * Get the SQL for the 'meta_query' param in BP_Activity_Activity::get().
-	 *
-	 * We use WP_Meta_Query to do the heavy lifting of parsing the
-	 * meta_query array and creating the necessary SQL clauses. However,
-	 * since BP_Activity_Activity::get() builds its SQL differently than
-	 * WP_Query, we have to alter the return value (stripping the leading
-	 * AND keyword from the 'where' clause).
-	 *
-	 * @since BuddyPress (1.8)
-	 *
-	 * @param array $meta_query An array of meta_query filters. See the
-	 *   documentation for WP_Meta_Query for details.
-	 * @return array $sql_array 'join' and 'where' clauses.
-	 */
-	public static function get_meta_query_sql( $meta_query = array() ) {
-		global $wpdb;
-
-		$sql_array = array(
-			'join'  => '',
-			'where' => '',
-		);
-
-		if ( ! empty( $meta_query ) ) {
-			$activity_meta_query = new WP_Meta_Query( $meta_query );
-
-			// WP_Meta_Query expects the table name at
-			// $wpdb->activitymeta
-			$wpdb->activitymeta = buddypress()->activity->table_name_meta;
-
-			$meta_sql = $activity_meta_query->get_sql( 'activity', 'a', 'id' );
-
-			// Strip the leading AND - BP handles it in get()
-			$sql_array['where'] = preg_replace( '/^\sAND/', '', $meta_sql['where'] );
-			$sql_array['join']  = $meta_sql['join'];
-		}
-
-		return $sql_array;
-	}
-
-	/**
-	 * Get the SQL for the 'date_query' param in BP_Activity_Activity::get().
-	 *
-	 * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting
-	 * of parsing the date_query array and creating the necessary SQL clauses.
-	 * However, since BP_Activity_Activity::get() builds its SQL differently than
-	 * WP_Query, we have to alter the return value (stripping the leading AND
-	 * keyword from the query).
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param array $date_query An array of date_query parameters. See the
-	 *        documentation for the first parameter of WP_Date_Query.
-	 * @return string
-	 */
-	public static function get_date_query_sql( $date_query = array() ) {
-		$sql = '';
-
-		// Date query
-		if ( ! empty( $date_query ) && is_array( $date_query ) && class_exists( 'BP_Date_Query' ) ) {
-			$date_query = new BP_Date_Query( $date_query, 'date_recorded' );
-			$sql = preg_replace( '/^\sAND/', '', $date_query->get_sql() );
-		}
-
-		return $sql;
-	}
-
-	/**
-	 * In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
-	 *
-	 * As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @deprecated 1.5
-	 * @deprecated Use BP_Activity_Activity::get() with an 'in' parameter instead.
-	 *
-	 * @param mixed $activity_ids Array or comma-separated string of activity IDs to retrieve
-	 * @param int $max Maximum number of results to return. (Optional; default is no maximum)
-	 * @param int $page The set of results that the user is viewing. Used in pagination. (Optional; default is 1)
-	 * @param int $per_page Specifies how many results per page. Used in pagination. (Optional; default is 25)
-	 * @param string MySQL column sort; ASC or DESC. (Optional; default is DESC)
-	 * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false)
-	 * @return array
-	 */
-	public static function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
-		_deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' );
-		return BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids );
-	}
-
-	/**
-	 * Get the first activity ID that matches a set of criteria.
-	 *
-	 * @param int $user_id The user ID to filter by.
-	 * @param string $component The component to filter by.
-	 * @param string $type The activity type to filter by.
-	 * @param int $item_id The associated item to filter by.
-	 * @param int $secondary_item_id The secondary associated item to filter by.
-	 * @param string $action The action to filter by.
-	 * @param string $content The content to filter by.
-	 * @param string $date_recorded The date to filter by.
-	 * @return int|bool Activity ID on success, false if none is found.
-	 */
-	public static function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
-		global $bp, $wpdb;
-
-		$where_args = false;
-
-		if ( !empty( $user_id ) )
-			$where_args[] = $wpdb->prepare( "user_id = %d", $user_id );
-
-		if ( !empty( $component ) )
-			$where_args[] = $wpdb->prepare( "component = %s", $component );
-
-		if ( !empty( $type ) )
-			$where_args[] = $wpdb->prepare( "type = %s", $type );
-
-		if ( !empty( $item_id ) )
-			$where_args[] = $wpdb->prepare( "item_id = %d", $item_id );
-
-		if ( !empty( $secondary_item_id ) )
-			$where_args[] = $wpdb->prepare( "secondary_item_id = %d", $secondary_item_id );
-
-		if ( !empty( $action ) )
-			$where_args[] = $wpdb->prepare( "action = %s", $action );
-
-		if ( !empty( $content ) )
-			$where_args[] = $wpdb->prepare( "content = %s", $content );
-
-		if ( !empty( $date_recorded ) )
-			$where_args[] = $wpdb->prepare( "date_recorded = %s", $date_recorded );
-
-		if ( !empty( $where_args ) )
-			$where_sql = 'WHERE ' . join( ' AND ', $where_args );
-		else
-			return false;
-
-		return $wpdb->get_var( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" );
-	}
-
-	/**
-	 * Delete activity items from the database.
-	 *
-	 * To delete a specific activity item, pass an 'id' parameter.
-	 * Otherwise use the filters.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @param array $args {
-	 *     @int $id Optional. The ID of a specific item to delete.
-	 *     @string $action Optional. The action to filter by.
-	 *     @string $content Optional. The content to filter by.
-	 *     @string $component Optional. The component name to filter by.
-	 *     @string $type Optional. The activity type to filter by.
-	 *     @string $primary_link Optional. The primary URL to filter by.
-	 *     @int $user_id Optional. The user ID to filter by.
-	 *     @int $item_id Optional. The associated item ID to filter by.
-	 *     @int $secondary_item_id Optional. The secondary associated item ID to filter by.
-	 *     @string $date_recorded Optional. The date to filter by.
-	 *     @int $hide_sitewide Optional. Default: false.
-	 * }
-	 * @return array|bool An array of deleted activity IDs on success, false on failure.
-	 */
-	public static function delete( $args = array() ) {
-		global $wpdb, $bp;
-
-		$defaults = array(
-			'id'                => false,
-			'action'            => false,
-			'content'           => false,
-			'component'         => false,
-			'type'              => false,
-			'primary_link'      => false,
-			'user_id'           => false,
-			'item_id'           => false,
-			'secondary_item_id' => false,
-			'date_recorded'     => false,
-			'hide_sitewide'     => false
-		);
-		$params = wp_parse_args( $args, $defaults );
-		extract( $params );
-
-		$where_args = false;
-
-		if ( !empty( $id ) )
-			$where_args[] = $wpdb->prepare( "id = %d", $id );
-
-		if ( !empty( $user_id ) )
-			$where_args[] = $wpdb->prepare( "user_id = %d", $user_id );
-
-		if ( !empty( $action ) )
-			$where_args[] = $wpdb->prepare( "action = %s", $action );
-
-		if ( !empty( $content ) )
-			$where_args[] = $wpdb->prepare( "content = %s", $content );
-
-		if ( !empty( $component ) )
-			$where_args[] = $wpdb->prepare( "component = %s", $component );
-
-		if ( !empty( $type ) )
-			$where_args[] = $wpdb->prepare( "type = %s", $type );
-
-		if ( !empty( $primary_link ) )
-			$where_args[] = $wpdb->prepare( "primary_link = %s", $primary_link );
-
-		if ( !empty( $item_id ) )
-			$where_args[] = $wpdb->prepare( "item_id = %d", $item_id );
-
-		if ( !empty( $secondary_item_id ) )
-			$where_args[] = $wpdb->prepare( "secondary_item_id = %d", $secondary_item_id );
-
-		if ( !empty( $date_recorded ) )
-			$where_args[] = $wpdb->prepare( "date_recorded = %s", $date_recorded );
-
-		if ( !empty( $hide_sitewide ) )
-			$where_args[] = $wpdb->prepare( "hide_sitewide = %d", $hide_sitewide );
-
-		if ( !empty( $where_args ) )
-			$where_sql = 'WHERE ' . join( ' AND ', $where_args );
-		else
-			return false;
-
-		// Fetch the activity IDs so we can delete any comments for this activity item
-		$activity_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" );
-
-		if ( ! $wpdb->query( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) ) {
-			return false;
-		}
-
-		// Handle accompanying activity comments and meta deletion
-		if ( $activity_ids ) {
-			$activity_ids_comma          = implode( ',', wp_parse_id_list( $activity_ids ) );
-			$activity_comments_where_sql = "WHERE type = 'activity_comment' AND item_id IN ({$activity_ids_comma})";
-
-			// Fetch the activity comment IDs for our deleted activity items
-			$activity_comment_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} {$activity_comments_where_sql}" );
-
-			// We have activity comments!
-			if ( ! empty( $activity_comment_ids ) ) {
-				// Delete activity comments
-				$wpdb->query( "DELETE FROM {$bp->activity->table_name} {$activity_comments_where_sql}" );
-
-				// Merge activity IDs with activity comment IDs
-				$activity_ids = array_merge( $activity_ids, $activity_comment_ids );
-			}
-
-			// Delete all activity meta entries for activity items and activity comments
-			BP_Activity_Activity::delete_activity_meta_entries( $activity_ids );
-		}
-
-		return $activity_ids;
-	}
-
-	/**
-	 * Delete the comments associated with a set of activity items.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @todo Mark as deprecated?  Method is no longer used internally.
-	 *
-	 * @param array $activity_ids Activity IDs whose comments should be deleted.
-	 * @param bool $delete_meta Should we delete the activity meta items for these comments?
-	 * @return bool True on success.
-	 */
-	public static function delete_activity_item_comments( $activity_ids = array(), $delete_meta = true ) {
-		global $bp, $wpdb;
-
-		$delete_meta = (bool) $delete_meta;
-
-		$activity_ids = implode( ',', wp_parse_id_list( $activity_ids ) );
-
-		if ( $delete_meta ) {
-			// Fetch the activity comment IDs for our deleted activity items
-			$activity_comment_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" );
-
-			if ( ! empty( $activity_comment_ids ) ) {
-				self::delete_activity_meta_entries( $activity_comment_ids );
-			}
-		}
-
-		return $wpdb->query( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" );
-	}
-
-	/**
-	 * Delete the meta entries associated with a set of activity items.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @param array $activity_ids Activity IDs whose meta should be deleted.
-	 * @return bool True on success.
-	 */
-	public static function delete_activity_meta_entries( $activity_ids = array() ) {
-		$activity_ids = wp_parse_id_list( $activity_ids );
-
-		foreach ( $activity_ids as $activity_id ) {
-			bp_activity_delete_meta( $activity_id );
-		}
-
-		return true;
-	}
-
-	/**
-	 * Append activity comments to their associated activity items.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @global wpdb $wpdb WordPress database object
-	 *
-	 * @param array $activities Activities to fetch comments for.
-	 * @param bool $spam Optional. 'ham_only' (default), 'spam_only' or 'all'.
-	 * @return array The updated activities with nested comments.
-	 */
-	public static function append_comments( $activities, $spam = 'ham_only' ) {
-		$activity_comments = array();
-
-		// Now fetch the activity comments and parse them into the correct position in the activities array.
-		foreach ( (array) $activities as $activity ) {
-			$top_level_parent_id = 'activity_comment' == $activity->type ? $activity->item_id : 0;
-			$activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam, $top_level_parent_id );
-		}
-
-		// Merge the comments with the activity items
-		foreach ( (array) $activities as $key => $activity ) {
-			if ( isset( $activity_comments[$activity->id] ) ) {
-				$activities[$key]->children = $activity_comments[$activity->id];
-			}
-		}
-
-		return $activities;
-	}
-
-	/**
-	 * Get activity comments that are associated with a specific activity ID.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param int $activity_id Activity ID to fetch comments for.
-	 * @param int $left Left-most node boundary.
-	 * @param into $right Right-most node boundary.
-	 * @param bool $spam Optional. 'ham_only' (default), 'spam_only' or 'all'.
-	 * @param int $top_level_parent_id Optional. The id of the root-level parent activity item.
-	 * @return array The updated activities with nested comments.
-	 */
-	public static function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0 ) {
-		global $wpdb, $bp;
-
-		if ( empty( $top_level_parent_id ) ) {
-			$top_level_parent_id = $activity_id;
-		}
-
-		$comments = wp_cache_get( $activity_id, 'bp_activity_comments' );
-
-		// We store the string 'none' to cache the fact that the
-		// activity item has no comments
-		if ( 'none' === $comments ) {
-			$comments = false;
-
-		// A true cache miss
-		} else if ( empty( $comments ) ) {
-
-			// Select the user's fullname with the query
-			if ( bp_is_active( 'xprofile' ) ) {
-				$fullname_select = ", pd.value as user_fullname";
-				$fullname_from = ", {$bp->profile->table_name_data} pd ";
-				$fullname_where = "AND pd.user_id = a.user_id AND pd.field_id = 1";
-
-			// Prevent debug errors
-			} else {
-				$fullname_select = $fullname_from = $fullname_where = '';
-			}
-
-			// Don't retrieve activity comments marked as spam
-			if ( 'ham_only' == $spam ) {
-				$spam_sql = 'AND a.is_spam = 0';
-			} elseif ( 'spam_only' == $spam ) {
-				$spam_sql = 'AND a.is_spam = 1';
-			} else {
-				$spam_sql = '';
-			}
-
-			// Legacy query - not recommended
-			$func_args = func_get_args();
-			if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $func_args ) ) {
-				$sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d AND a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right ), $activity_id, $left, $right, $spam_sql );
-
-				$descendants = $wpdb->get_results( $sql );
-
-			// We use the mptt BETWEEN clause to limit returned
-			// descendants to the correct part of the tree.
-			} else {
-				$sql = $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} a WHERE a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d and a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right );
-
-				$descendant_ids = $wpdb->get_col( $sql );
-				$descendants    = self::get_activity_data( $descendant_ids );
-				$descendants    = self::append_user_fullnames( $descendants );
-			}
-
-			$ref = array();
-
-			// Loop descendants and build an assoc array
-			foreach ( (array) $descendants as $d ) {
-				$d->children = array();
-
-				// If we have a reference on the parent
-				if ( isset( $ref[ $d->secondary_item_id ] ) ) {
-					$ref[ $d->secondary_item_id ]->children[ $d->id ] = $d;
-					$ref[ $d->id ] =& $ref[ $d->secondary_item_id ]->children[ $d->id ];
-
-				// If we don't have a reference on the parent, put in the root level
-				} else {
-					$comments[ $d->id ] = $d;
-					$ref[ $d->id ] =& $comments[ $d->id ];
-				}
-			}
-
-			// Calculate depth for each item
-			foreach ( $ref as &$r ) {
-				$depth = 1;
-				$parent_id = $r->secondary_item_id;
-				while ( $parent_id !== $r->item_id ) {
-					$depth++;
-
-					// When display_comments=stream, the
-					// parent comment may not be part of
-					// the returned results, so we manually
-					// fetch it
-					if ( empty( $ref[ $parent_id ] ) ) {
-						$direct_parent = new BP_Activity_Activity( $parent_id );
-						if ( isset( $direct_parent->secondary_item_id ) ) {
-							$parent_id = $direct_parent->secondary_item_id;
-						} else {
-							// Something went wrong
-							// Short-circuit the
-							// depth calculation
-							$parent_id = $r->item_id;
-						}
-					} else {
-						$parent_id = $ref[ $parent_id ]->secondary_item_id;
-					}
-				}
-				$r->depth = $depth;
-			}
-
-			// If we cache a value of false, it'll count as a cache
-			// miss the next time the activity comments are fetched.
-			// Storing the string 'none' is a hack workaround to
-			// avoid unnecessary queries.
-			if ( false === $comments ) {
-				$cache_value = 'none';
-			} else {
-				$cache_value = $comments;
-			}
-
-			wp_cache_set( $activity_id, $cache_value, 'bp_activity_comments' );
-		}
-
-		return $comments;
-	}
-
-	/**
-	 * Rebuild nested comment tree under an activity or activity comment.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param int $parent_id ID of an activty or activity comment.
-	 * @param int $left Node boundary start for activity or activity comment.
-	 * @return int Right node boundary of activity or activity comment.
-	 */
-	public static function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
-		global $wpdb, $bp;
-
-		// The right value of this node is the left value + 1
-		$right = $left + 1;
-
-		// Get all descendants of this node
-		$descendants = BP_Activity_Activity::get_child_comments( $parent_id );
-
-		// Loop the descendants and recalculate the left and right values
-		foreach ( (array) $descendants as $descendant )
-			$right = BP_Activity_Activity::rebuild_activity_comment_tree( $descendant->id, $right );
-
-		// We've got the left value, and now that we've processed the children
-		// of this node we also know the right value
-		if ( 1 == $left )
-			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE id = %d", $left, $right, $parent_id ) );
-		else
-			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE type = 'activity_comment' AND id = %d", $left, $right, $parent_id ) );
-
-		// Return the right value of this node + 1
-		return $right + 1;
-	}
-
-	/**
-	 * Get child comments of an activity or activity comment.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param int $parent_id ID of an activty or activity comment.
-	 * @return object Numerically indexed array of child comments.
-	 */
-	public static function get_child_comments( $parent_id ) {
-		global $bp, $wpdb;
-
-		return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
-	}
-
-	/**
-	 * Get a list of components that have recorded activity associated with them.
-	 *
-	 * @param bool $skip_last_activity If true, components will not be
-	 *        included if the only activity type associated with them is
-	 *        'last_activity'. (Since 2.0.0, 'last_activity' is stored in
-	 *        the activity table, but these items are not full-fledged
-	 *        activity items.) Default: true.
-	 * @return array List of component names.
-	 */
-	public static function get_recorded_components( $skip_last_activity = true ) {
-		global $wpdb, $bp;
-
-		if ( $skip_last_activity ) {
-			$components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} WHERE action != '' AND action != 'last_activity' ORDER BY component ASC" );
-		} else {
-			$components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
-		}
-
-		return $components;
-	}
-
-	/**
-	 * Get sitewide activity items for use in an RSS feed.
-	 *
-	 * @param int $limit Optional. Number of items to fetch. Default: 35.
-	 * @return array $activity_feed List of activity items, with RSS data added.
-	 */
-	public static function get_sitewide_items_for_feed( $limit = 35 ) {
-		$activities    = bp_activity_get_sitewide( array( 'max' => $limit ) );
-		$activity_feed = array();
-
-		for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) {
-			$title                            = explode( '<span', $activities[$i]['content'] );
-			$activity_feed[$i]['title']       = trim( strip_tags( $title[0] ) );
-			$activity_feed[$i]['link']        = $activities[$i]['primary_link'];
-			$activity_feed[$i]['description'] = @sprintf( $activities[$i]['content'], '' );
-			$activity_feed[$i]['pubdate']     = $activities[$i]['date_recorded'];
-		}
-
-		return $activity_feed;
-	}
-
-	/**
-	 * Create SQL IN clause for filter queries.
-	 *
-	 * @since BuddyPress (1.5)
-	 *
-	 * @see BP_Activity_Activity::get_filter_sql()
-	 *
-	 * @param string $field The database field.
-	 * @param array|bool $items The values for the IN clause, or false when none are found.
-	 */
-	public static function get_in_operator_sql( $field, $items ) {
-		global $wpdb;
-
-		// split items at the comma
-		if ( ! is_array( $items ) ) {
-			$items = explode( ',', $items );
-		}
-
-		// array of prepared integers or quoted strings
-		$items_prepared = array();
-
-		// clean up and format each item
-		foreach ( $items as $item ) {
-			// clean up the string
-			$item = trim( $item );
-			// pass everything through prepare for security and to safely quote strings
-			$items_prepared[] = ( is_numeric( $item ) ) ? $wpdb->prepare( '%d', $item ) : $wpdb->prepare( '%s', $item );
-		}
-
-		// build IN operator sql syntax
-		if ( count( $items_prepared ) )
-			return sprintf( '%s IN ( %s )', trim( $field ), implode( ',', $items_prepared ) );
-		else
-			return false;
-	}
-
-	/**
-	 * Create filter SQL clauses.
-	 *
-	 * @since BuddyPress (1.5.0)
-	 *
-	 * @param array $filter_array {
-	 *     Fields and values to filter by.
-	 *     @type array|string|id $user_id User ID(s).
-	 *     @type array|string $object Corresponds to the 'component'
-	 *           column in the database.
-	 *     @type array|string $action Corresponds to the 'type' column
-	 *           in the database.
-	 *     @type array|string|int $primary_id Corresponds to the 'item_id'
-	 *           column in the database.
-	 *     @type array|string|int $secondary_id Corresponds to the
-	 *           'secondary_item_id' column in the database.
-	 *     @type int $offset Return only those items with an ID greater
-	 *           than the offset value.
-	 *     @type string $since Return only those items that have a
-	 *           date_recorded value greater than a given MySQL-formatted
-	 *           date.
-	 * }
-	 * @return string The filter clause, for use in a SQL query.
-	 */
-	public static function get_filter_sql( $filter_array ) {
-
-		$filter_sql = array();
-
-		if ( !empty( $filter_array['user_id'] ) ) {
-			$user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] );
-			if ( !empty( $user_sql ) )
-				$filter_sql[] = $user_sql;
-		}
-
-		if ( !empty( $filter_array['object'] ) ) {
-			$object_sql = BP_Activity_Activity::get_in_operator_sql( 'a.component', $filter_array['object'] );
-			if ( !empty( $object_sql ) )
-				$filter_sql[] = $object_sql;
-		}
-
-		if ( !empty( $filter_array['action'] ) ) {
-			$action_sql = BP_Activity_Activity::get_in_operator_sql( 'a.type', $filter_array['action'] );
-			if ( ! empty( $action_sql ) )
-				$filter_sql[] = $action_sql;
-		}
-
-		if ( !empty( $filter_array['primary_id'] ) ) {
-			$pid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.item_id', $filter_array['primary_id'] );
-			if ( !empty( $pid_sql ) )
-				$filter_sql[] = $pid_sql;
-		}
-
-		if ( !empty( $filter_array['secondary_id'] ) ) {
-			$sid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.secondary_item_id', $filter_array['secondary_id'] );
-			if ( !empty( $sid_sql ) )
-				$filter_sql[] = $sid_sql;
-		}
-
-		if ( ! empty( $filter_array['offset'] ) ) {
-			$sid_sql = absint( $filter_array['offset'] );
-			$filter_sql[] = "a.id >= {$sid_sql}";
-		}
-
-		if ( ! empty( $filter_array['since'] ) ) {
-			// Validate that this is a proper Y-m-d H:i:s date
-			// Trick: parse to UNIX date then translate back
-			$translated_date = date( 'Y-m-d H:i:s', strtotime( $filter_array['since'] ) );
-			if ( $translated_date === $filter_array['since'] ) {
-				$filter_sql[] = "a.date_recorded > '{$translated_date}'";
-			}
-		}
-
-		if ( empty( $filter_sql ) )
-			return false;
-
-		return join( ' AND ', $filter_sql );
-	}
-
-	/**
-	 * Get the date/time of last recorded activity.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @return string ISO timestamp.
-	 */
-	public static function get_last_updated() {
-		global $bp, $wpdb;
-
-		return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" );
-	}
-
-	/**
-	 * Get favorite count for a given user.
-	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @param int The ID of the user whose favorites you're counting.
-	 * @return int A count of the user's favorites.
-	 */
-	public static function total_favorite_count( $user_id ) {
-		if ( !$favorite_activity_entries = bp_get_user_meta( $user_id, 'bp_favorite_activities', true ) )
-			return 0;
-
-		return count( maybe_unserialize( $favorite_activity_entries ) );
-	}
-
-	/**
-	 * Check whether an activity item exists with a given string content.
-	 *
-	 * @param string $content The content to filter by.
-	 * @return int|bool The ID of the first matching item if found, otherwise false.
-	 */
-	public static function check_exists_by_content( $content ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE content = %s", $content ) );
-	}
-
-	/**
-	 * Hide all activity for a given user.
-	 *
-	 * @param int $user_id The ID of the user whose activity you want to mark hidden.
-	 * @param int
-	 */
-	public static function hide_all_for_user( $user_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
-	}
-}
-
-/**
- * Create a RSS feed using the activity component.
- *
- * You should only construct a new feed when you've validated that you're on
- * the appropriate screen.
- *
- * See {@link bp_activity_action_sitewide_feed()} as an example.
- *
- * Accepted parameters:
- *   id	              - internal id for the feed; should be alphanumeric only
- *                      (required)
- *   title            - RSS feed title
- *   link             - Relevant link for the RSS feed
- *   description      - RSS feed description
- *   ttl              - Time-to-live (see inline doc in constructor)
- *   update_period    - Part of the syndication module (see inline doc in
- *                      constructor for more info)
- *   update_frequency - Part of the syndication module (see inline doc in
- *                      constructor for more info)
- *   max              - Number of feed items to display
- *   activity_args    - Arguments passed to {@link bp_has_activities()}
- *
- * @since BuddyPress (1.8)
- */
-class BP_Activity_Feed {
-	/**
-	 * Holds our custom class properties.
-	 *
-	 * These variables are stored in a protected array that is magically
-	 * updated using PHP 5.2+ methods.
-	 *
-	 * @see BP_Feed::__construct() This is where $data is added
-	 * @var array
-	 */
-	protected $data;
-
-	/**
-	 * Magic method for checking the existence of a certain data variable.
-	 *
-	 * @param string $key
-	 */
-	public function __isset( $key ) { return isset( $this->data[$key] ); }
-
-	/**
-	 * Magic method for getting a certain data variable.
-	 *
-	 * @param string $key
-	 */
-	public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
-
-	/**
-	 * Constructor.
-	 *
-	 * @param array $args Optional
-	 */
-	public function __construct( $args = array() ) {
-		// If feeds are disabled, stop now!
-		if ( false === (bool) apply_filters( 'bp_activity_enable_feeds', true ) ) {
-			global $wp_query;
-
-			// set feed flag to false
-			$wp_query->is_feed = false;
-
-			return false;
-		}
-
-		// Setup data
-		$this->data = wp_parse_args( $args, array(
-			// Internal identifier for the RSS feed - should be alphanumeric only
-			'id'               => '',
-
-			// RSS title - should be plain-text
-			'title'            => '',
-
-			// relevant link for the RSS feed
-			'link'             => '',
-
-			// RSS description - should be plain-text
-			'description'      => '',
-
-			// Time-to-live - number of minutes to cache the data before an aggregator
-			// requests it again.  This is only acknowledged if the RSS client supports it
-			//
-			// See: http://www.rssboard.org/rss-profile#element-channel-ttl
-			//      http://www.kbcafe.com/rss/rssfeedstate.html#ttl
-			'ttl'              => '30',
-
-			// Syndication module - similar to ttl, but not really supported by RSS
-			// clients
-			//
-			// See: http://web.resource.org/rss/1.0/modules/syndication/#description
-			//      http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule
-			'update_period'    => 'hourly',
-			'update_frequency' => 2,
-
-			// Number of items to display
-			'max'              => 50,
-
-			// Activity arguments passed to bp_has_activities()
-			'activity_args'    => array()
-		) );
-
-		// Plugins can use this filter to modify the feed before it is setup
-		do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
-
-		// Setup class properties
-		$this->setup_properties();
-
-		// Check if id is valid
-		if ( empty( $this->id ) ) {
-			_doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
-			return false;
-		}
-
-		// Plugins can use this filter to modify the feed after it's setup
-		do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
-
-		// Setup feed hooks
-		$this->setup_hooks();
-
-		// Output the feed
-		$this->output();
-
-		// Kill the rest of the output
-		die();
-	}
-
-	/** SETUP ****************************************************************/
-
-	/**
-	 * Setup and validate the class properties.
-	 *
-	 * @access protected
-	 */
-	protected function setup_properties() {
-		$this->id               = sanitize_title( $this->id );
-		$this->title            = strip_tags( $this->title );
-		$this->link             = esc_url_raw( $this->link );
-		$this->description      = strip_tags( $this->description );
-		$this->ttl              = (int) $this->ttl;
-		$this->update_period    = strip_tags( $this->update_period );
-		$this->update_frequency = (int) $this->update_frequency;
-
-		$this->activity_args    = wp_parse_args( $this->activity_args, array(
-			'max'              => $this->max,
-			'per_page'         => $this->max,
-			'display_comments' => 'stream'
-		) );
-
-	}
-
-	/**
-	 * Setup some hooks that are used in the feed.
-	 *
-	 * Currently, these hooks are used to maintain backwards compatibility with
-	 * the RSS feeds previous to BP 1.8.
-	 *
-	 * @access protected
-	 */
-	protected function setup_hooks() {
-		add_action( 'bp_activity_feed_rss_attributes',   array( $this, 'backpat_rss_attributes' ) );
-		add_action( 'bp_activity_feed_channel_elements', array( $this, 'backpat_channel_elements' ) );
-		add_action( 'bp_activity_feed_item_elements',    array( $this, 'backpat_item_elements' ) );
-	}
-
-	/** BACKPAT HOOKS ********************************************************/
-
-	/**
-	 * Fire a hook to ensure backward compatibility for RSS attributes.
-	 */
-	public function backpat_rss_attributes() {
-		do_action( 'bp_activity_' . $this->id . '_feed' );
-	}
-
-	/**
-	 * Fire a hook to ensure backward compatibility for channel elements.
-	 */
-	public function backpat_channel_elements() {
-		do_action( 'bp_activity_' . $this->id . '_feed_head' );
-	}
-
-	/**
-	 * Fire a hook to ensure backward compatibility for item elements.
-	 */
-	public function backpat_item_elements() {
-		switch ( $this->id ) {
-
-			// sitewide and friends feeds use the 'personal' hook
-			case 'sitewide' :
-			case 'friends' :
-				$id = 'personal';
-
-				break;
-
-			default :
-				$id = $this->id;
-
-				break;
-		}
-
-		do_action( 'bp_activity_' . $id . '_feed_item' );
-	}
-
-	/** HELPERS **************************************************************/
-
-	/**
-	 * Output the feed's item content.
-	 *
-	 * @access protected
-	 */
-	protected function feed_content() {
-		bp_activity_content_body();
-
-		switch ( $this->id ) {
-
-			// also output parent activity item if we're on a specific feed
-			case 'favorites' :
-			case 'friends' :
-			case 'mentions' :
-			case 'personal' :
-
-				if ( 'activity_comment' == bp_get_activity_action_name() ) :
-			?>
-				<strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
-				<?php bp_activity_parent_content() ?>
-			<?php
-				endif;
-
-				break;
-		}
-	}
-
-	/**
-	 * Sets various HTTP headers related to Content-Type and browser caching.
-	 *
-	 * Most of this class method is derived from {@link WP::send_headers()}.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @access protected
-	 */
-	protected function http_headers() {
-		// set up some additional headers if not on a directory page
-		// this is done b/c BP uses pseudo-pages
-		if ( ! bp_is_directory() ) {
-			global $wp_query;
-
-			$wp_query->is_404 = false;
-			status_header( 200 );
-		}
-
-		// Set content-type
-		@header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
-
-		// Cache-related variables
-		$last_modified      = mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false );
-		$modified_timestamp = strtotime( $last_modified );
-		$etag               = md5( $last_modified );
-
-		// Set cache-related headers
-		@header( 'Last-Modified: ' . $last_modified );
-		@header( 'Pragma: no-cache' );
-		@header( 'ETag: ' . '"' . $etag . '"' );
-
-		// First commit of BuddyPress! (Easter egg)
-		@header( 'Expires: Tue, 25 Mar 2008 17:13:55 GMT');
-
-		// Get ETag from supported user agents
-		if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) {
-			$client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );
-
-			// Remove quotes from ETag
-			$client_etag = trim( $client_etag, '"' );
-
-			// Strip suffixes from ETag if they exist (eg. "-gzip")
-			if ( $etag_suffix_pos = strpos( $client_etag, '-' ) ) {
-				$client_etag = substr( $client_etag, 0, $etag_suffix_pos );
-			}
-
-		// No ETag found
-		} else {
-			$client_etag = false;
-		}
-
-		// Get client last modified timestamp from supported user agents
-		$client_last_modified      = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
-		$client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
-
-		// Set 304 status if feed hasn't been updated since last fetch
-		if ( ( $client_last_modified && $client_etag ) ?
-				 ( ( $client_modified_timestamp >= $modified_timestamp ) && ( $client_etag == $etag ) ) :
-				 ( ( $client_modified_timestamp >= $modified_timestamp ) || ( $client_etag == $etag ) ) ) {
-			$status = 304;
-		} else {
-			$status = false;
-		}
-
-		// If feed hasn't changed as reported by the user agent, set 304 status header
-		if ( ! empty( $status ) ) {
-			status_header( $status );
-
-			// cached response, so stop now!
-			if ( $status == 304 ) {
-				exit();
-			}
-		}
-	}
-
-	/** OUTPUT ***************************************************************/
-
-	/**
-	 * Output the RSS feed.
-	 *
-	 * @access protected
-	 */
-	protected function output() {
-		$this->http_headers();
-		echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>';
-	?>
-
-<rss version="2.0"
-	xmlns:content="http://purl.org/rss/1.0/modules/content/"
-	xmlns:atom="http://www.w3.org/2005/Atom"
-	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
-	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
-	<?php do_action( 'bp_activity_feed_rss_attributes' ); ?>
->
-
-<channel>
-	<title><?php echo $this->title; ?></title>
-	<link><?php echo $this->link; ?></link>
-	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
-	<description><?php echo $this->description ?></description>
-	<lastBuildDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ); ?></lastBuildDate>
-	<generator>http://buddypress.org/?v=<?php bp_version(); ?></generator>
-	<language><?php bloginfo_rss( 'language' ); ?></language>
-	<ttl><?php echo $this->ttl; ?></ttl>
-	<sy:updatePeriod><?php echo $this->update_period; ?></sy:updatePeriod>
- 	<sy:updateFrequency><?php echo $this->update_frequency; ?></sy:updateFrequency>
-	<?php do_action( 'bp_activity_feed_channel_elements' ); ?>
-
-	<?php if ( bp_has_activities( $this->activity_args ) ) : ?>
-		<?php while ( bp_activities() ) : bp_the_activity(); ?>
-			<item>
-				<guid isPermaLink="false"><?php bp_activity_feed_item_guid(); ?></guid>
-				<title><?php echo stripslashes( bp_get_activity_feed_item_title() ); ?></title>
-				<link><?php bp_activity_thread_permalink() ?></link>
-				<pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ); ?></pubDate>
-
-				<?php if ( bp_get_activity_feed_item_description() ) : ?>
-					<content:encoded><![CDATA[<?php $this->feed_content(); ?>]]></content:encoded>
-				<?php endif; ?>
-
-				<?php if ( bp_activity_can_comment() ) : ?>
-					<slash:comments><?php bp_activity_comment_count(); ?></slash:comments>
-				<?php endif; ?>
-
-				<?php do_action( 'bp_activity_feed_item_elements' ); ?>
-			</item>
-		<?php endwhile; ?>
-
-	<?php endif; ?>
-</channel>
-</rss><?php
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-activity-activity.php';
+require dirname( __FILE__ ) . '/classes/class-bp-activity-feed.php';
+require dirname( __FILE__ ) . '/classes/class-bp-activity-query.php';
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-cssjs.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-cssjs.php
index bc747c9fdde9f4ef6641b6e64bc2432a57d7f2cc..c140fff107d60521dcadd9fce2959f8b4f436237 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-cssjs.php
@@ -8,12 +8,12 @@
  */
 
 // Exit if accessed directly
-if ( ! defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Enqueue @mentions JS.
  *
- * @since BuddyPress (2.1)
+ * @since BuddyPress (2.1.0)
  */
 function bp_activity_mentions_script() {
 	if ( ! bp_activity_maybe_load_mentions_scripts() ) {
@@ -41,8 +41,15 @@ function bp_activity_mentions_script() {
 		wp_style_add_data( 'bp-mentions-css', 'suffix', $min );
 	}
 
-	// Print a list of the current user's friends to the page for quicker @mentions lookups.
+	/**
+	 * Fires at the end of the Activity Mentions script.
+	 *
+	 * This is the hook where BP components can add their own prefetched results
+	 * friends to the page for quicker @mentions lookups.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 */
 	do_action( 'bp_activity_mentions_prime_results' );
 }
 add_action( 'bp_enqueue_scripts', 'bp_activity_mentions_script' );
-add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
\ No newline at end of file
+add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
index e2819e5274c444423282fa4cb91138dfa85d8a9c..7250c66219cfc9e670eaf85517f3d6e7f0eae451 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Filters *******************************************************************/
 
@@ -113,7 +113,7 @@ add_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys',  2, 1
 /**
  * Types of activity stream items to moderate.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
  * @return array $types List of the activity types to moderate.
  */
@@ -122,13 +122,21 @@ function bp_activity_get_moderated_activity_types() {
 		'activity_comment',
 		'activity_update'
 	);
+
+	/**
+	 * Filters the default activity types that BuddyPress should moderate.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $types Default activity types to moderate.
+	 */
 	return apply_filters( 'bp_activity_check_activity_types', $types );
 }
 
 /**
  * Moderate the posted activity item, if it contains moderate keywords.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
  * @param BP_Activity_Activity $activity The activity object to check.
  */
@@ -147,7 +155,7 @@ function bp_activity_check_moderation_keys( $activity ) {
 /**
  * Mark the posted activity as spam, if it contains blacklist keywords.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
  * @param BP_Activity_Activity $activity The activity object to check.
  */
@@ -165,23 +173,26 @@ function bp_activity_check_blacklist_keys( $activity ) {
 /**
  * Custom kses filtering for activity content.
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook.
  * @uses wp_kses()
  *
  * @param string $content The activity content.
+ *
  * @return string $content Filtered activity content.
  */
 function bp_activity_filter_kses( $content ) {
 	global $allowedtags;
 
 	$activity_allowedtags = $allowedtags;
-	$activity_allowedtags['span']          = array();
-	$activity_allowedtags['span']['class'] = array();
 	$activity_allowedtags['a']['class']    = array();
 	$activity_allowedtags['a']['id']       = array();
 	$activity_allowedtags['a']['rel']      = array();
+	$activity_allowedtags['a']['title']    = array();
+	$activity_allowedtags['b']             = array();
+	$activity_allowedtags['code']          = array();
+	$activity_allowedtags['i']             = array();
 	$activity_allowedtags['img']           = array();
 	$activity_allowedtags['img']['src']    = array();
 	$activity_allowedtags['img']['alt']    = array();
@@ -190,8 +201,17 @@ function bp_activity_filter_kses( $content ) {
 	$activity_allowedtags['img']['class']  = array();
 	$activity_allowedtags['img']['id']     = array();
 	$activity_allowedtags['img']['title']  = array();
-	$activity_allowedtags['code']          = array();
+	$activity_allowedtags['span']          = array();
+	$activity_allowedtags['span']['class'] = array();
 
+
+	/**
+	 * Filters the allowed HTML tags for BuddyPress Activity content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $value Array of allowed HTML tags and attributes.
+	 */
 	$activity_allowedtags = apply_filters( 'bp_activity_allowed_tags', $activity_allowedtags );
 	return wp_kses( $content, $activity_allowedtags );
 }
@@ -201,8 +221,9 @@ function bp_activity_filter_kses( $content ) {
  *
  * @since BuddyPress (1.2.0)
  *
- * @param string $content The contents of a given item.
- * @param int $activity_id The activity id. Deprecated.
+ * @param string $content     The contents of a given item.
+ * @param int    $activity_id The activity id. Deprecated.
+ *
  * @return string $content Content filtered for mentions.
  */
 function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
@@ -257,7 +278,7 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
  * If mentions are found, replace @mention text with user links and add our
  * hook to send mention notifications after the activity item is saved.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_activity_find_mentions()
  *
@@ -294,12 +315,12 @@ function bp_activity_at_name_filter_updates( $activity ) {
 /**
  * Sends emails and BP notifications for users @-mentioned in an activity item.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  *
  * @uses bp_activity_at_message_notification()
  * @uses bp_activity_update_mention_count_for_user()
  *
- * @param BP_Activity_Activity $activity The BP_Activity_Activity object
+ * @param BP_Activity_Activity $activity The BP_Activity_Activity object.
  */
 function bp_activity_at_name_send_emails( $activity ) {
 	// Are mentions disabled?
@@ -319,7 +340,15 @@ function bp_activity_at_name_send_emails( $activity ) {
 
 	// Send @mentions and setup BP notifications
 	foreach( (array) $usernames as $user_id => $username ) {
-		// If you want to disable notifications, you can use this filter to stop email sending
+
+		/**
+		 * Filters BuddyPress' ability to send email notifications for @mentions.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param bool  $value     Whether or not BuddyPress should send a notification to the mentioned users.
+		 * @param array $usernames Array of users potentially notified.
+		 */
 		if ( apply_filters( 'bp_activity_at_name_do_notifications', true, $usernames ) ) {
 			bp_activity_at_message_notification( $activity->id, $user_id );
 		}
@@ -332,9 +361,10 @@ function bp_activity_at_name_send_emails( $activity ) {
 /**
  * Catch links in activity text so rel=nofollow can be added.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @param string $text Activity text.
+ *
  * @return string $text Text with rel=nofollow added to any links.
  */
 function bp_activity_make_nofollow_filter( $text ) {
@@ -344,12 +374,11 @@ function bp_activity_make_nofollow_filter( $text ) {
 	/**
 	 * Add rel=nofollow to a link.
 	 *
-	 * @since BuddyPress (1.2)
-	 *
-	 * @param array $matches
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @param array $matches Items matched by preg_replace_callback() in bp_activity_make_nofollow_filter().
-	 * @return string $text Link with rel=nofollow added
+	 *
+	 * @return string $text Link with rel=nofollow added.
 	 */
 	function bp_activity_make_nofollow_filter_callback( $matches ) {
 		$text = $matches[1];
@@ -360,7 +389,9 @@ function bp_activity_make_nofollow_filter( $text ) {
 /**
  * Truncate long activity entries when viewed in activity streams.
  *
- * @since BuddyPress (1.5)
+ * This method can only be used inside the Activity loop.
+ *
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_is_single_activity()
  * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook.
@@ -371,16 +402,45 @@ function bp_activity_make_nofollow_filter( $text ) {
  * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook.
  *
  * @param string $text The original activity entry text.
+ *
  * @return string $excerpt The truncated text.
  */
 function bp_activity_truncate_entry( $text ) {
 	global $activities_template;
 
+	/**
+	 * Provides a filter that lets you choose whether to skip this filter on a per-activity basis.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param bool $value If true, text should be checked to see if it needs truncating.
+	 */
+	$maybe_truncate_text = apply_filters(
+		'bp_activity_maybe_truncate_entry',
+		isset( $activities_template->activity->type ) && ! in_array( $activities_template->activity->type, array( 'new_blog_post', ), true )
+	);
+
 	// The full text of the activity update should always show on the single activity screen
-	if ( bp_is_single_activity() )
+	if ( ! $maybe_truncate_text || bp_is_single_activity() ) {
 		return $text;
+	}
 
+	/**
+	 * Filters the appended text for the activity excerpt.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value Internationalized "Read more" text.
+	 */
 	$append_text    = apply_filters( 'bp_activity_excerpt_append_text', __( '[Read more]', 'buddypress' ) );
+
+	/**
+	 * Filters the excerpt length for the activity excerpt.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Number indicating how many words to trim the excerpt down to.
+	 */
 	$excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
 
 	// Run the text through the excerpt function. If it's too short, the original text will be
@@ -396,17 +456,27 @@ function bp_activity_truncate_entry( $text ) {
 		$excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a></span>', $excerpt, $id, bp_get_activity_thread_permalink(), $append_text );
 	}
 
+	/**
+	 * Filters the composite activity excerpt entry.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $excerpt     Excerpt text and markup to be displayed.
+	 * @param string $text        The original activity entry text.
+	 * @param string $append_text The final append text applied.
+	 */
 	return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
 }
 
 /**
- * Include extra javascript dependencies for activity component.
+ * Include extra JavaScript dependencies for activity component.
  *
  * @since BuddyPress (2.0.0)
  *
  * @uses bp_activity_do_heartbeat() to check if heartbeat is required.
  *
  * @param array $js_handles The original dependencies.
+ *
  * @return array $js_handles The new dependencies.
  */
 function bp_activity_get_js_dependencies( $js_handles = array() ) {
@@ -427,6 +497,7 @@ add_filter( 'bp_core_get_js_dependencies', 'bp_activity_get_js_dependencies', 10
  * @since BuddyPress (2.0.0)
  *
  * @param string $classes
+ *
  * @return string $classes
  */
 function bp_activity_newest_class( $classes = '' ) {
@@ -446,6 +517,7 @@ function bp_activity_newest_class( $classes = '' ) {
  * @since BuddyPress (2.0.0)
  *
  * @param string $classes
+ *
  * @return string $classes
  */
 function bp_activity_timestamp_class( $classes = '' ) {
@@ -471,15 +543,14 @@ add_filter( 'bp_get_activity_css_class', 'bp_activity_timestamp_class', 9, 1 );
  *
  * @since BuddyPress (2.0.0)
  *
- * @uses bp_activity_get_last_updated() to get the recorded date of the last activity
+ * @uses bp_activity_get_last_updated() to get the recorded date of the last activity.
  *
  * @param array $response
  * @param array $data
+ *
  * @return array $response
  */
 function bp_activity_heartbeat_last_recorded( $response = array(), $data = array() ) {
-	$bp = buddypress();
-
 	if ( empty( $data['bp_activity_last_recorded'] ) ) {
 		return $response;
 	}
@@ -499,7 +570,7 @@ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array
 	$newest_activities = array();
 	$last_activity_recorded = 0;
 
-	// Temporarly add a just-posted class for new activity items
+	// Temporarily add a just-posted class for new activity items
 	add_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1 );
 
 	ob_start();
@@ -538,6 +609,7 @@ add_filter( 'heartbeat_nopriv_received', 'bp_activity_heartbeat_last_recorded',
  * @since BuddyPress (2.0.0)
  *
  * @param array $strings Localized strings.
+ *
  * @return array $strings
  */
 function bp_activity_heartbeat_strings( $strings = array() ) {
@@ -548,14 +620,26 @@ function bp_activity_heartbeat_strings( $strings = array() ) {
 
 	$global_pulse = 0;
 
-	// Check whether the global heartbeat settings already exist.
+	/**
+	 * Filter that checks whether the global heartbeat settings already exist.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $value Heartbeat settings array.
+	 */
 	$heartbeat_settings = apply_filters( 'heartbeat_settings', array() );
 	if ( ! empty( $heartbeat_settings['interval'] ) ) {
 		// 'Fast' is 5
 		$global_pulse = is_numeric( $heartbeat_settings['interval'] ) ? absint( $heartbeat_settings['interval'] ) : 5;
 	}
 
-	// Filter here to specify a BP-specific pulse frequency
+	/**
+	 * Filters the pulse frequency to be used for the BuddyPress Activity heartbeat.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param int $value The frequency in seconds between pulses.
+	 */
 	$bp_activity_pulse = apply_filters( 'bp_activity_heartbeat_pulse', 15 );
 
 	/**
@@ -578,3 +662,175 @@ function bp_activity_heartbeat_strings( $strings = array() ) {
 	return $strings;
 }
 add_filter( 'bp_core_get_js_strings', 'bp_activity_heartbeat_strings', 10, 1 );
+
+/** Scopes ********************************************************************/
+
+/**
+ * Set up activity arguments for use with the 'just-me' scope.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array $retval Empty array by default.
+ * @param array $filter Current activity arguments.
+ *
+ * @return array
+ */
+function bp_activity_filter_just_me_scope( $retval = array(), $filter = array() ) {
+
+	// Determine the user_id
+	if ( ! empty( $filter['user_id'] ) ) {
+		$user_id = $filter['user_id'];
+	} else {
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+	}
+
+	// Should we show all items regardless of sitewide visibility?
+	$show_hidden = array();
+	if ( ! empty( $user_id ) && $user_id !== bp_loggedin_user_id() ) {
+		$show_hidden = array(
+			'column' => 'hide_sitewide',
+			'value'  => 0
+		);
+	}
+
+	$retval = array(
+		'relation' => 'AND',
+		array(
+			'column' => 'user_id',
+			'value'  => $user_id
+		),
+		$show_hidden,
+
+		// overrides
+		'override' => array(
+			'display_comments' => 'stream',
+			'filter'           => array( 'user_id' => 0 ),
+			'show_hidden'      => true
+		),
+	);
+
+	return $retval;
+}
+add_filter( 'bp_activity_set_just-me_scope_args', 'bp_activity_filter_just_me_scope', 10, 2 );
+
+/**
+ * Set up activity arguments for use with the 'favorites' scope.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array $retval Empty array by default.
+ * @param array $filter Current activity arguments.
+ *
+ * @return array
+ */
+function bp_activity_filter_favorites_scope( $retval = array(), $filter = array() ) {
+
+	// Determine the user_id
+	if ( ! empty( $filter['user_id'] ) ) {
+		$user_id = $filter['user_id'];
+	} else {
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+	}
+
+	// Determine the favorites
+	$favs = bp_activity_get_user_favorites( $user_id );
+	if ( empty( $favs ) ) {
+		$favs = array( 0 );
+	}
+
+	// Should we show all items regardless of sitewide visibility?
+	$show_hidden = array();
+	if ( ! empty( $user_id ) && ( $user_id !== bp_loggedin_user_id() ) ) {
+		$show_hidden = array(
+			'column' => 'hide_sitewide',
+			'value'  => 0
+		);
+	}
+
+	$retval = array(
+		'relation' => 'AND',
+		array(
+			'column'  => 'id',
+			'compare' => 'IN',
+			'value'   => (array) $favs
+		),
+		$show_hidden,
+
+		// overrides
+		'override' => array(
+			'display_comments' => true,
+			'filter'           => array( 'user_id' => 0 ),
+			'show_hidden'      => true
+		),
+	);
+
+	return $retval;
+}
+add_filter( 'bp_activity_set_favorites_scope_args', 'bp_activity_filter_favorites_scope', 10, 2 );
+
+
+/**
+ * Set up activity arguments for use with the 'favorites' scope.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array $retval Empty array by default.
+ * @param array $filter Current activity arguments.
+ *
+ * @return array
+ */
+function bp_activity_filter_mentions_scope( $retval = array(), $filter = array() ) {
+
+	// Are mentions disabled?
+	if ( ! bp_activity_do_mentions() ) {
+		return $retval;
+	}
+
+	// Determine the user_id
+	if ( ! empty( $filter['user_id'] ) ) {
+		$user_id = $filter['user_id'];
+	} else {
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+	}
+
+	// Should we show all items regardless of sitewide visibility?
+	$show_hidden = array();
+	if ( ! empty( $user_id ) && $user_id !== bp_loggedin_user_id() ) {
+		$show_hidden = array(
+			'column' => 'hide_sitewide',
+			'value'  => 0
+		);
+	}
+
+	$retval = array(
+		'relation' => 'AND',
+		array(
+			'column'  => 'content',
+			'compare' => 'LIKE',
+
+			// Start search at @ symbol and stop search at closing tag delimiter.
+			'value'   => '@' . bp_activity_get_user_mentionname( $user_id ) . '<'
+		),
+		$show_hidden,
+
+		// overrides
+		'override' => array(
+
+			// clear search terms so 'mentions' scope works with other scopes
+			'search_terms' => false,
+
+			'display_comments' => 'stream',
+			'filter'           => array( 'user_id' => 0 ),
+			'show_hidden'      => true
+		),
+	);
+
+	return $retval;
+}
+add_filter( 'bp_activity_set_mentions_scope_args', 'bp_activity_filter_mentions_scope', 10, 2 );
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
index 94b5de13f38810938fd599d69534db205dda990f..57e42e7bc45563d32aab828604b2c6178b874ff1 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Check whether the $bp global lists an activity directory page.
@@ -28,10 +28,10 @@ function bp_activity_has_directory() {
  *
  * The Mentions feature does a number of things, all of which will be turned
  * off if you disable mentions:
- *   - Detecting and auto-linking @username in all BP/WP content
+ *   - Detecting and auto-linking @username in all BP/WP content.
  *   - Sending BP notifications and emails to users when they are mentioned
- *     using the @username syntax
- *   - The Public Message button on user profiles
+ *     using the @username syntax.
+ *   - The Public Message button on user profiles.
  *
  * Mentions are enabled by default. To disable, put the following line in
  * bp-custom.php or your theme's functions.php file:
@@ -45,6 +45,14 @@ function bp_activity_has_directory() {
  * @return bool $retval True to enable mentions, false to disable.
  */
 function bp_activity_do_mentions() {
+
+	/**
+	 * Filters whether or not mentions are enabled.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param bool $enabled True to enable mentions, false to disable.
+	 */
 	return (bool) apply_filters( 'bp_activity_do_mentions', true );
 }
 
@@ -52,16 +60,23 @@ function bp_activity_do_mentions() {
  * Should BuddyPress load the mentions scripts and related assets, including results to prime the
  * mentions suggestions?
  *
- * @return bool True if mentions scripts should be loaded.
  * @since BuddyPress (2.1.0)
+ *
+ * @return bool True if mentions scripts should be loaded.
  */
 function bp_activity_maybe_load_mentions_scripts() {
-	$retval =
-		bp_activity_do_mentions() &&
-		bp_is_user_active() &&
-		( bp_is_activity_component() || bp_is_blog_page() && is_singular() && comments_open() || is_admin() );
+	$mentions_enabled = bp_activity_do_mentions() && bp_is_user_active();
+	$load_mentions    = $mentions_enabled && ( bp_is_activity_component() || is_admin() );
 
-	return (bool) apply_filters( 'bp_activity_maybe_load_mentions_scripts', $retval );
+	/**
+	 * Filters whether or not BuddyPress should load mentions scripts and assets.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $load_mentions    True to load mentions assets, false otherwise.
+	 * @param bool $mentions_enabled True if mentions are enabled.
+	 */
+	return (bool) apply_filters( 'bp_activity_maybe_load_mentions_scripts', $load_mentions, $mentions_enabled );
 }
 
 /**
@@ -70,9 +85,10 @@ function bp_activity_maybe_load_mentions_scripts() {
  * @since BuddyPress (1.5.0)
  *
  * @param string $content The content of the activity, usually found in
- *        $activity->content.
+ *                        $activity->content.
+ *
  * @return array|bool Associative array with user ID as key and username as
- *         value. Boolean false if no mentions found.
+ *                    value. Boolean false if no mentions found.
  */
 function bp_activity_find_mentions( $content ) {
 
@@ -133,8 +149,10 @@ function bp_activity_clear_new_mentions( $user_id ) {
  * @uses bp_activity_find_mentions()
  * @uses bp_activity_update_mention_count_for_user()
  *
- * @param int $activity_id The unique id for the activity item.
- * @param string $action Can be 'delete' or 'add'. Defaults to 'add'.
+ * @param int    $activity_id The unique id for the activity item.
+ * @param string $action      Can be 'delete' or 'add'. Defaults to 'add'.
+ *
+ * @return bool
  */
 function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
 
@@ -171,9 +189,10 @@ function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) {
  * @uses bp_get_user_meta()
  * @uses bp_update_user_meta()
  *
- * @param int $user_id The user ID.
- * @param int $activity_id The unique ID for the activity item.
- * @param string $action 'delete' or 'add'. Default: 'add'.
+ * @param int    $user_id     The user ID.
+ * @param int    $activity_id The unique ID for the activity item.
+ * @param string $action      'delete' or 'add'. Default: 'add'.
+ *
  * @return bool
  */
 function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action = 'add' ) {
@@ -225,6 +244,8 @@ function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $act
  *
  * @since BuddyPress (1.9.0)
  *
+ * @param int|string $user_id ID of the user to get @-mention name for.
+ *
  * @return string User name appropriate for @-mentions.
  */
 function bp_activity_get_user_mentionname( $user_id ) {
@@ -248,6 +269,8 @@ function bp_activity_get_user_mentionname( $user_id ) {
  *
  * @since BuddyPress (1.9.0)
  *
+ * @param string $mentionname Username of user in @-mentions.
+ *
  * @return int|bool ID of the user, if one is found. Otherwise false.
  */
 function bp_activity_get_userid_from_mentionname( $mentionname ) {
@@ -301,17 +324,18 @@ function bp_activity_get_userid_from_mentionname( $mentionname ) {
  *
  * @since BuddyPress (1.1.0)
  *
- * @param string $component_id The unique string ID of the component.
- * @param string $type The action type.
- * @param string $description The action description.
- * @param callable $format_callback Callback for formatting the action string.
- * @param string $label String to describe this action in the activity stream
- *        filter dropdown.
- * @param array $context Activity stream contexts where the filter should appear.
- *        'activity', 'member', 'member_groups', 'group'
+ * @param  string        $component_id    The unique string ID of the component.
+ * @param  string        $type            The action type.
+ * @param  string        $description     The action description.
+ * @param  callable|bool $format_callback Callback for formatting the action string.
+ * @param  string|bool   $label           String to describe this action in the activity stream filter dropdown.
+ * @param  array         $context         Optional. Activity stream contexts where the filter should appear.
+ *                                        Values: 'activity', 'member', 'member_groups', 'group'.
+ * @param  int           $position        Optional. The position of the action when listed in dropdowns.
+ *
  * @return bool False if any param is empty, otherwise true.
  */
-function bp_activity_set_action( $component_id, $type, $description, $format_callback = false, $label = false, $context = array() ) {
+function bp_activity_set_action( $component_id, $type, $description, $format_callback = false, $label = false, $context = array(), $position = 0 ) {
 	$bp = buddypress();
 
 	// Return false if any of the above values are not set
@@ -333,26 +357,245 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal
 		$bp->activity->actions->{$component_id} = new stdClass;
 	}
 
+	/**
+	 * Filters the action type being set for the current activity item.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array    $array           Array of arguments for action type being set.
+	 * @param string   $component_id    ID of the current component being set.
+	 * @param string   $type            Action type being set.
+	 * @param string   $description     Action description for action being set.
+	 * @param callable $format_callback Callback for formatting the action string.
+	 * @param string   $label           String to describe this action in the activity stream filter dropdown.
+	 * @param array    $context         Activity stream contexts where the filter should appear. 'activity', 'member',
+	 *                                  'member_groups', 'group'.
+	 */
 	$bp->activity->actions->{$component_id}->{$type} = apply_filters( 'bp_activity_set_action', array(
 		'key'             => $type,
 		'value'           => $description,
 		'format_callback' => $format_callback,
 		'label'           => $label,
 		'context'         => $context,
+		'position'        => $position,
 	), $component_id, $type, $description, $format_callback, $label, $context );
 
 	return true;
 }
 
 /**
- * Retreive the current action from a component and key.
+ * Set tracking arguments for a given post type.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @global $wp_post_types
+ *
+ * @param string $post_type The name of the post type, as registered with WordPress. Eg 'post' or 'page'.
+ * @param array  $args {
+ *     An associative array of tracking parameters. All items are optional.
+ *
+ *     @type string   $bp_activity_admin_filter String to use in the Dashboard > Activity dropdown.
+ *     @type string   $bp_activity_front_filter String to use in frontend dropdown.
+ *     @type string   $bp_activity_new_post     String format to use for generating the activity action. Should be a
+ *                                              translatable string where %1$s is replaced by a user link and %2$s is
+ *                                              the URL of the newly created post.
+ *     @type string   $bp_activity_new_post_ms  String format to use for generating the activity action on Multisite.
+ *                                              Should be a translatable string where %1$s is replaced by a user link,
+ *                                              %2$s is the URL of the newly created post, and %3$s is a link to
+ *                                              the site.
+ *     @type string   $component_id             ID of the BuddyPress component to associate the activity item.
+ *     @type string   $action_id                Value for the 'type' param of the new activity item.
+ *     @type callable $format_callback          Callback for formatting the activity action string.
+ *                                              Default: 'bp_activity_format_activity_action_custom_post_type_post'.
+ *     @type array    $contexts                 The directory contexts in which the filter will show.
+ *                                              Default: array( 'activity' ).
+ *     @type array    $position                 Position of the item in filter dropdowns.
+ *     @type string   $singular                 Singular, translatable name of the post type item. If no value is
+ *                                              provided, it's pulled from the 'singular_name' of the post type.
+ *     @type bool     $activity_comment         Whether to allow comments on the activity items. Defaults to true if
+ *                                              the post type does not natively support comments, otherwise false.
+ * }
+ *
+ * @return bool
+ */
+function bp_activity_set_post_type_tracking_args( $post_type = '', $args = array() ) {
+	global $wp_post_types;
+
+	if ( empty( $wp_post_types[ $post_type ] ) || ! post_type_supports( $post_type, 'buddypress-activity' ) || ! is_array( $args ) ) {
+		return false;
+	}
+
+	// Labels are loaded into the post type object.
+	foreach ( array( 'bp_activity_admin_filter', 'bp_activity_front_filter', 'bp_activity_new_post', 'bp_activity_new_post_ms' ) as $label_type ) {
+		if ( ! empty( $args[ $label_type ] ) ) {
+			$wp_post_types[ $post_type ]->labels->{$label_type} = $args[ $label_type ];
+			unset( $args[ $post_type ] );
+		}
+	}
+
+	// If there are any additional args, put them in the bp_activity attribute of the post type.
+	if ( ! empty( $args ) ) {
+		$wp_post_types[ $post_type ]->bp_activity = $args;
+	}
+}
+
+/**
+ * Get tracking arguments for a specific post type.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  string $post_type Name of the post type.
+ *
+ * @return object The tracking arguments of the post type.
+ */
+function bp_activity_get_post_type_tracking_args( $post_type ) {
+	if ( ! post_type_supports( $post_type, 'buddypress-activity' ) ) {
+		return false;
+	}
+
+	$post_type_object = get_post_type_object( $post_type );
+
+	$post_type_activity = array(
+		'component_id'      => buddypress()->activity->id,
+		'action_id'         => 'new_' . $post_type,
+		'format_callback'   => 'bp_activity_format_activity_action_custom_post_type_post',
+		'front_filter'      => $post_type_object->labels->name,
+		'contexts'          => array( 'activity' ),
+		'position'          => 0,
+		'singular'          => strtolower( $post_type_object->labels->singular_name ),
+		'activity_comment' => ! post_type_supports( $post_type, 'comments' ),
+	);
+
+	if ( ! empty( $post_type_object->bp_activity ) ) {
+		$post_type_activity = bp_parse_args( (array) $post_type_object->bp_activity, $post_type_activity, $post_type . '_tracking_args' );
+	}
+
+	$post_type_activity = (object) $post_type_activity;
+
+	// Try to get the admin filter from the post type labels.
+	if ( ! empty( $post_type_object->labels->bp_activity_admin_filter ) ) {
+		$post_type_activity->admin_filter = $post_type_object->labels->bp_activity_admin_filter;
+
+	// Fall back to a generic name.
+	} else {
+		$post_type_activity->admin_filter = _x( 'New item published', 'Post Type generic activity post admin filter', 'buddypress' );
+	}
+
+	// Check for the front filter in the post type labels.
+	if ( ! empty( $post_type_object->labels->bp_activity_front_filter ) ) {
+		$post_type_activity->front_filter = $post_type_object->labels->bp_activity_front_filter;
+	}
+
+	// Try to get the action for new post type action on non-multisite installations.
+	if ( ! empty( $post_type_object->labels->bp_activity_new_post ) ) {
+		$post_type_activity->new_post_type_action = $post_type_object->labels->bp_activity_new_post;
+	}
+
+	// Try to get the action for new post type action on multisite installations.
+	if ( ! empty( $post_type_object->labels->bp_activity_new_post_ms ) ) {
+		$post_type_activity->new_post_type_action_ms = $post_type_object->labels->bp_activity_new_post_ms;
+	}
+
+	/**
+	 * Filters tracking arguments for a specific post type.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param object $post_type_activity The tracking arguments of the post type.
+	 * @param string $post_type          Name of the post type.
+	 */
+	return apply_filters( 'bp_activity_get_post_type_tracking_args', $post_type_activity, $post_type );
+}
+
+/**
+ * Get tracking arguments for all post types.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return array List of post types with their tracking arguments.
+ */
+function bp_activity_get_post_types_tracking_args() {
+	// Fetch all public post types
+	$post_types = get_post_types( array( 'public' => true ), 'names' );
+
+	$post_types_tracking_args = array();
+
+	foreach ( $post_types as $post_type ) {
+		$track_post_type = bp_activity_get_post_type_tracking_args( $post_type );
+
+		if ( ! empty( $track_post_type ) ) {
+			$post_types_tracking_args[ $track_post_type->action_id ] = $track_post_type;
+		}
+
+	}
+
+	/**
+	 * Filters tracking arguments for all post types.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $post_types_tracking_args Array of post types with
+	 *                                        their tracking arguments.
+	 */
+	return apply_filters( 'bp_activity_get_post_types_tracking_args', $post_types_tracking_args );
+}
+
+/**
+ * Get all components' activity actions, sorted by their position attribute.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return object Actions ordered by their position.
+ */
+function bp_activity_get_actions() {
+	$bp = buddypress();
+
+	$post_types = bp_activity_get_post_types_tracking_args();
+
+	// Create the actions for the post types, if they haven't already been created.
+	if ( ! empty( $post_types ) ) {
+		foreach ( $post_types as $post_type ) {
+			if ( isset( $bp->activity->actions->{$post_type->component_id}->{$post_type->action_id} ) ) {
+				continue;
+			}
+
+			bp_activity_set_action(
+				$post_type->component_id,
+				$post_type->action_id,
+				$post_type->admin_filter,
+				$post_type->format_callback,
+				$post_type->front_filter,
+				$post_type->contexts,
+				$post_type->position
+			);
+		}
+	}
+
+	// Sort the actions by their position within each component.
+	foreach ( $bp->activity->actions as $component => $actions ) {
+		$actions = (array) $actions;
+		$temp = bp_sort_by_key( $actions, 'position', 'num' );
+
+		// Restore keys.
+		$bp->activity->actions->{$component} = new stdClass;
+		foreach ( $temp as $key_ordered ) {
+			$bp->activity->actions->{$component}->{$key_ordered['key']} = $key_ordered;
+		}
+	}
+
+	return $bp->activity->actions;
+}
+
+/**
+ * Retrieve the current action from a component and key.
  *
  * @since BuddyPress (1.1.0)
  *
  * @uses apply_filters() To call the 'bp_activity_get_action' hook.
  *
  * @param string $component_id The unique string ID of the component.
- * @param string $key The action key.
+ * @param string $key          The action key.
+ *
  * @return string|bool Action value if found, otherwise false.
  */
 function bp_activity_get_action( $component_id, $key ) {
@@ -362,11 +605,22 @@ function bp_activity_get_action( $component_id, $key ) {
 		return false;
 	}
 
-	$bp     = buddypress();
-	$retval = isset( $bp->activity->actions->{$component_id}->{$key} )
-		? $bp->activity->actions->{$component_id}->{$key}
-		: false;
+	$actions = bp_activity_get_actions();
+	$retval  = false;
+
+	if ( isset( $actions->{$component_id}->{$key} ) ) {
+		$retval = $actions->{$component_id}->{$key};
+	}
 
+	/**
+	 * Filters the current action by component and key.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string|bool $retval       The action key.
+	 * @param string      $component_id The unique string ID of the component.
+	 * @param string      $key          The action key.
+	 */
 	return apply_filters( 'bp_activity_get_action', $retval, $component_id, $key );
 }
 
@@ -381,7 +635,7 @@ function bp_activity_get_types() {
 	$actions  = array();
 
 	// Walk through the registered actions, and build an array of actions/values.
-	foreach ( buddypress()->activity->actions as $action ) {
+	foreach ( bp_activity_get_actions() as $action ) {
 		$action = array_values( (array) $action );
 
 		for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
@@ -392,6 +646,13 @@ function bp_activity_get_types() {
 	// This was a mis-named activity type from before BP 1.6
 	unset( $actions['friends_register_activity_action'] );
 
+	/**
+	 * Filters the available activity types.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $actions Array of registered activity types.
+	 */
 	return apply_filters( 'bp_activity_get_types', $actions );
 }
 
@@ -406,6 +667,7 @@ function bp_activity_get_types() {
  * @uses apply_filters() To call the 'bp_activity_get_user_favorites' hook.
  *
  * @param int $user_id ID of the user whose favorites are being queried.
+ *
  * @return array IDs of the user's favorite activity items.
  */
 function bp_activity_get_user_favorites( $user_id = 0 ) {
@@ -418,6 +680,13 @@ function bp_activity_get_user_favorites( $user_id = 0 ) {
 	// Get favorites for user
 	$favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
 
+	/**
+	 * Filters the favorited activity items for a specified user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $favs Array of user's favorited activity items.
+	 */
 	return apply_filters( 'bp_activity_get_user_favorites', $favs );
 }
 
@@ -435,7 +704,8 @@ function bp_activity_get_user_favorites( $user_id = 0 ) {
  * @uses do_action() To call the 'bp_activity_add_user_favorite_fail' hook.
  *
  * @param int $activity_id ID of the activity item being favorited.
- * @param int $user_id ID of the user favoriting the activity item.
+ * @param int $user_id     ID of the user favoriting the activity item.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
@@ -473,7 +743,14 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
 	// Update activity meta counts
 	if ( bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count ) ) {
 
-		// Execute additional code
+		/**
+		 * Fires if bp_activity_update_meta() for favorite_count is successful and before returning a true value for success.
+		 *
+		 * @since BuddyPress (1.2.1)
+		 *
+		 * @param int $activity_id ID of the activity item being favorited.
+		 * @param int $user_id     ID of the user doing the favoriting.
+		 */
 		do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id );
 
 		// Success
@@ -481,7 +758,15 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
 
 	// Saving meta was unsuccessful for an unknown reason
 	} else {
-		// Execute additional code
+
+		/**
+		 * Fires if bp_activity_update_meta() for favorite_count is unsuccessful and before returning a false value for failure.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $activity_id ID of the activity item being favorited.
+		 * @param int $user_id     ID of the user doing the favoriting.
+		 */
 		do_action( 'bp_activity_add_user_favorite_fail', $activity_id, $user_id );
 
 		return false;
@@ -501,7 +786,8 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) {
  * @uses do_action() To call the 'bp_activity_remove_user_favorite' hook.
  *
  * @param int $activity_id ID of the activity item being unfavorited.
- * @param int $user_id ID of the user unfavoriting the activity item.
+ * @param int $user_id     ID of the user unfavoriting the activity item.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
@@ -538,7 +824,14 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
 			// Update users favorites
 			if ( bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ) ) {
 
-				// Execute additional code
+				/**
+				 * Fires if bp_update_user_meta() is successful and before returning a true value for success.
+				 *
+				 * @since BuddyPress (1.2.1)
+				 *
+				 * @param int $activity_id ID of the activity item being unfavorited.
+				 * @param int $user_id     ID of the user doing the unfavoriting.
+				 */
 				do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
 
 				// Success
@@ -569,9 +862,18 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) {
  * @uses apply_filters() To call the 'bp_activity_check_exists_by_content' hook.
  *
  * @param string $content The content to filter by.
+ *
  * @return int|null The ID of the located activity item. Null if none is found.
  */
 function bp_activity_check_exists_by_content( $content ) {
+
+	/**
+	 * Filters the results of the check for whether an activity item exists by specified content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param BP_Activity_Activity $content_exists ID of the activity if found, else null.
+	 */
 	return apply_filters( 'bp_activity_check_exists_by_content', BP_Activity_Activity::check_exists_by_content( $content ) );
 }
 
@@ -586,6 +888,14 @@ function bp_activity_check_exists_by_content( $content ) {
  * @return string Date last updated.
  */
 function bp_activity_get_last_updated() {
+
+	/**
+	 * Filters the value for the last updated time for an activity item.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param BP_Activity_Activity $last_updated Date last updated.
+	 */
 	return apply_filters( 'bp_activity_get_last_updated', BP_Activity_Activity::get_last_updated() );
 }
 
@@ -597,6 +907,7 @@ function bp_activity_get_last_updated() {
  * @uses BP_Activity_Activity::total_favorite_count() {@link BP_Activity_Activity}
  *
  * @param int $user_id ID of the user whose favorite count is being requested.
+ *
  * @return int Total favorite count for the user.
  */
 function bp_activity_total_favorites_for_user( $user_id = 0 ) {
@@ -617,18 +928,18 @@ function bp_activity_total_favorites_for_user( $user_id = 0 ) {
  * @since BuddyPress (1.2.0)
  *
  * @global object $wpdb WordPress database access object.
- * @global object $bp BuddyPress global settings.
- *
- * @param int $activity_id ID of the activity item whose metadata is being deleted.
- * @param string $meta_key Optional. The key of the metadata being deleted. If
- *        omitted, all metadata associated with the activity
- *        item will be deleted.
- * @param string $meta_value Optional. If present, the metadata will only be
- *        deleted if the meta_value matches this parameter.
- * @param bool $delete_all Optional. If true, delete matching metadata entries
- * 	  for all objects, ignoring the specified object_id. Otherwise,
- * 	  only delete matching metadata entries for the specified
- * 	  activity item. Default: false.
+ *
+ * @param int    $activity_id ID of the activity item whose metadata is being deleted.
+ * @param string $meta_key    Optional. The key of the metadata being deleted. If
+ *                            omitted, all metadata associated with the activity
+ *                            item will be deleted.
+ * @param string $meta_value  Optional. If present, the metadata will only be
+ *                            deleted if the meta_value matches this parameter.
+ * @param bool   $delete_all  Optional. If true, delete matching metadata entries
+ *                            for all objects, ignoring the specified object_id. Otherwise,
+ * 	                          only delete matching metadata entries for the specified
+ * 	                          activity item. Default: false.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '', $delete_all = false ) {
@@ -662,13 +973,14 @@ function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = ''
  *
  * @uses apply_filters() To call the 'bp_activity_get_meta' hook.
  *
- * @param int $activity_id ID of the activity item whose metadata is being requested.
- * @param string $meta_key Optional. If present, only the metadata matching
- *        that meta key will be returned. Otherwise, all metadata for the
- *        activity item will be fetched.
- * @param bool $single Optional. If true, return only the first value of the
- *	  specified meta_key. This parameter has no effect if meta_key is not
- *	  specified. Default: true.
+ * @param int    $activity_id ID of the activity item whose metadata is being requested.
+ * @param string $meta_key    Optional. If present, only the metadata matching
+ *                            that meta key will be returned. Otherwise, all metadata for the
+ *                            activity item will be fetched.
+ * @param bool   $single      Optional. If true, return only the first value of the
+ *	                          specified meta_key. This parameter has no effect if meta_key is not
+ *	                          specified. Default: true.
+ *
  * @return mixed The meta value(s) being requested.
  */
 function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true ) {
@@ -676,7 +988,16 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true
 	$retval = get_metadata( 'activity', $activity_id, $meta_key, $single );
 	remove_filter( 'query', 'bp_filter_metaid_column_name' );
 
-	// Filter result before returning
+	/**
+	 * Filters the metadata for a specified activity item.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param mixed  $retval      The meta values for the activity item.
+	 * @param int    $activity_id ID of the activity item.
+	 * @param string $meta_key    Meta key for the value being requested.
+	 * @param bool   $single      Whether to return one matched meta key row or all.
+	 */
 	return apply_filters( 'bp_activity_get_meta', $retval, $activity_id, $meta_key, $single );
 }
 
@@ -685,16 +1006,15 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true
  *
  * @since BuddyPress (1.2.0)
  *
- * @param int $activity_id ID of the activity item whose metadata is being
- *        updated.
- * @param string $meta_key Key of the metadata being updated.
- * @param mixed $meta_value Value to be set.
- * @param mixed $prev_value Optional. If specified, only update existing
- *        metadata entries with the specified value. Otherwise, update all
- *        entries.
+ * @param int    $activity_id ID of the activity item whose metadata is being updated.
+ * @param string $meta_key    Key of the metadata being updated.
+ * @param mixed  $meta_value  Value to be set.
+ * @param mixed  $prev_value  Optional. If specified, only update existing metadata entries
+ *                            with the specified value. Otherwise, update all entries.
+ *
  * @return bool|int Returns false on failure. On successful update of existing
- *         metadata, returns true. On successful creation of new metadata,
- *         returns the integer ID of the new metadata row.
+ *                  metadata, returns true. On successful creation of new metadata,
+ *                  returns the integer ID of the new metadata row.
  */
 function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_value = '' ) {
 	add_filter( 'query', 'bp_filter_metaid_column_name' );
@@ -709,12 +1029,13 @@ function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_va
  *
  * @since BuddyPress (2.0.0)
  *
- * @param int $activity_id ID of the activity item.
- * @param string $meta_key Metadata key.
- * @param mixed $meta_value Metadata value.
- * @param bool $unique Optional. Whether to enforce a single metadata value
- *        for the given key. If true, and the object already has a value for
- *        the key, no change will be made. Default: false.
+ * @param int    $activity_id ID of the activity item.
+ * @param string $meta_key    Metadata key.
+ * @param mixed  $meta_value  Metadata value.
+ * @param bool   $unique      Optional. Whether to enforce a single metadata value for the
+ *                            given key. If true, and the object already 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.
  */
 function bp_activity_add_meta( $activity_id, $meta_key, $meta_value, $unique = false ) {
@@ -739,6 +1060,8 @@ function bp_activity_add_meta( $activity_id, $meta_key, $meta_value, $unique = f
  * @uses do_action() To call the 'bp_activity_remove_all_user_data' hook.
  *
  * @param int $user_id ID of the user whose activity is being deleted.
+ *
+ * @return bool
  */
 function bp_activity_remove_all_user_data( $user_id = 0 ) {
 
@@ -757,7 +1080,13 @@ function bp_activity_remove_all_user_data( $user_id = 0 ) {
 	// Execute additional code
 	do_action( 'bp_activity_remove_data', $user_id ); // Deprecated! Do not use!
 
-	// Use this going forward
+	/**
+	 * Fires after the removal of all of a user's activity data.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $user_id ID of the user being deleted.
+	 */
 	do_action( 'bp_activity_remove_all_user_data', $user_id );
 }
 add_action( 'wpmu_delete_user',  'bp_activity_remove_all_user_data' );
@@ -769,9 +1098,10 @@ add_action( 'delete_user',       'bp_activity_remove_all_user_data' );
  * @since BuddyPress (1.6.0)
  *
  * @global object $wpdb WordPress database access object.
- * @global object $bp BuddyPress global settings.
  *
  * @param int $user_id ID of the user whose activity is being spammed.
+ *
+ * @return bool
  */
 function bp_activity_spam_all_user_data( $user_id = 0 ) {
 	global $wpdb;
@@ -806,7 +1136,7 @@ function bp_activity_spam_all_user_data( $user_id = 0 ) {
 		 * If Akismet is present, update the activity history meta.
 		 *
 		 * This is usually taken care of when BP_Activity_Activity::save() happens, but
-		 * as we're going to be updating all the activity statuses directly, for efficency,
+		 * as we're going to be updating all the activity statuses directly, for efficiency,
 		 * we need to update manually.
 		 */
 		if ( ! empty( $bp->activity->akismet ) ) {
@@ -820,7 +1150,14 @@ function bp_activity_spam_all_user_data( $user_id = 0 ) {
 	// Mark all of this user's activities as spam
 	$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET is_spam = 1 WHERE user_id = %d", $user_id ) );
 
-	// Call an action for plugins to use
+	/**
+	 * Fires after all activity data from a user has been marked as spam.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int   $user_id    ID of the user whose activity is being marked as spam.
+	 * @param array $activities Array of activity items being marked as spam.
+	 */
 	do_action( 'bp_activity_spam_all_user_data', $user_id, $activities['activities'] );
 }
 add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' );
@@ -831,9 +1168,10 @@ add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' );
  * @since BuddyPress (1.6.0)
  *
  * @global object $wpdb WordPress database access object.
- * @global object $bp BuddyPress global settings.
  *
  * @param int $user_id ID of the user whose activity is being hammed.
+ *
+ * @return bool
  */
 function bp_activity_ham_all_user_data( $user_id = 0 ) {
 	global $wpdb;
@@ -869,7 +1207,7 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) {
 		 * If Akismet is present, update the activity history meta.
 		 *
 		 * This is usually taken care of when BP_Activity_Activity::save() happens, but
-		 * as we're going to be updating all the activity statuses directly, for efficency,
+		 * as we're going to be updating all the activity statuses directly, for efficiency,
 		 * we need to update manually.
 		 */
 		if ( ! empty( $bp->activity->akismet ) ) {
@@ -880,16 +1218,23 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) {
 		unset( $activity_obj );
 	}
 
-	// Mark all of this user's activities as spam
+	// Mark all of this user's activities as not spam
 	$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET is_spam = 0 WHERE user_id = %d", $user_id ) );
 
-	// Call an action for plugins to use
+	/**
+	 * Fires after all activity data from a user has been marked as ham.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int   $user_id    ID of the user whose activity is being marked as ham.
+	 * @param array $activities Array of activity items being marked as ham.
+	 */
 	do_action( 'bp_activity_ham_all_user_data', $user_id, $activities['activities'] );
 }
 add_action( 'bp_make_ham_user', 'bp_activity_ham_all_user_data' );
 
 /**
- * Register the activity stream actions for updates
+ * Register the activity stream actions for updates.
  *
  * @since BuddyPress (1.6.0)
  */
@@ -913,6 +1258,13 @@ function bp_activity_register_activity_actions() {
 		__( 'Activity Comments', 'buddypress' )
 	);
 
+	/**
+	 * Fires at the end of the activity actions registration.
+	 *
+	 * Allows plugin authors to add their own activity actions alongside the core actions.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_activity_register_activity_actions' );
 
 	// Backpat. Don't use this.
@@ -924,8 +1276,9 @@ add_action( 'bp_register_activity_actions', 'bp_activity_register_activity_actio
  * Generate an activity action string for an activity item.
  *
  * @param object $activity Activity data object.
+ *
  * @return string|bool Returns false if no callback is found, otherwise returns
- *         the formatted action string.
+ *                     the formatted action string.
  */
 function bp_activity_generate_action_string( $activity ) {
 
@@ -935,18 +1288,26 @@ function bp_activity_generate_action_string( $activity ) {
 	}
 
 	// Check for registered format callback
-	if ( empty( buddypress()->activity->actions->{$activity->component}->{$activity->type}['format_callback'] ) ) {
+	$actions = bp_activity_get_actions();
+	if ( empty( $actions->{$activity->component}->{$activity->type}['format_callback'] ) ) {
 		return false;
 	}
 
 	// We apply the format_callback as a filter
-	add_filter( 'bp_activity_generate_action_string', buddypress()->activity->actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 );
+	add_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 );
 
-	// Generate the action string (run through the filter defined above)
+	/**
+	 * Filters the string for the activity action being returned.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param BP_Activity_Activity $action   Action string being requested.
+	 * @param BP_Activity_Activity $activity Activity item object.
+	 */
 	$action = apply_filters( 'bp_activity_generate_action_string', $activity->action, $activity );
 
 	// Remove the filter for future activity items
-	remove_filter( 'bp_activity_generate_action_string', buddypress()->activity->actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 );
+	remove_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 );
 
 	return $action;
 }
@@ -956,12 +1317,22 @@ function bp_activity_generate_action_string( $activity ) {
  *
  * @since BuddyPress (2.0.0)
  *
- * @param string $action Static activity action.
+ * @param string $action   Static activity action.
  * @param object $activity Activity data object.
+ *
  * @return string
  */
 function bp_activity_format_activity_action_activity_update( $action, $activity ) {
 	$action = sprintf( __( '%s posted an update', 'buddypress' ), bp_core_get_userlink( $activity->user_id ) );
+
+	/**
+	 * Filters the formatted activity action update string.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string               $action   Activity action string value.
+	 * @param BP_Activity_Activity $activity Activity item object.
+	 */
 	return apply_filters( 'bp_activity_new_update_action', $action, $activity );
 }
 
@@ -970,15 +1341,83 @@ function bp_activity_format_activity_action_activity_update( $action, $activity
  *
  * @since BuddyPress (2.0.0)
  *
- * @param string $action Static activity action.
+ * @param string $action   Static activity action.
  * @param object $activity Activity data object.
+ *
  * @return string
  */
 function bp_activity_format_activity_action_activity_comment( $action, $activity ) {
 	$action = sprintf( __( '%s posted a new activity comment', 'buddypress' ), bp_core_get_userlink( $activity->user_id ) );
+
+	/**
+	 * Filters the formatted activity action comment string.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string               $action   Activity action string value.
+	 * @param BP_Activity_Activity $activity Activity item object.
+	 */
 	return apply_filters( 'bp_activity_comment_action', $action, $activity );
 }
 
+/**
+ * Format activity action strings for custom post types.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $action   Static activity action.
+ * @param object $activity Activity data object.
+ *
+ * @return string
+ */
+function bp_activity_format_activity_action_custom_post_type_post( $action, $activity ) {
+	$bp = buddypress();
+
+	// Fetch all the tracked post types once.
+	if ( empty( $bp->activity->track ) ) {
+		$bp->activity->track = bp_activity_get_post_types_tracking_args();
+	}
+
+	if ( empty( $activity->type ) || empty( $bp->activity->track[ $activity->type ] ) ) {
+		return $action;
+	}
+
+	$user_link = bp_core_get_userlink( $activity->user_id );
+	$blog_url  = get_home_url( $activity->item_id );
+
+	if ( empty( $activity->post_url ) ) {
+		$post_url = add_query_arg( 'p', $activity->secondary_item_id, trailingslashit( $blog_url ) );
+	} else {
+		$post_url = $activity->post_url;
+	}
+
+	if ( is_multisite() ) {
+		$blog_link = '<a href="' . esc_url( $blog_url ) . '">' . get_blog_option( $activity->item_id, 'blogname' ) . '</a>';
+
+		if ( ! empty( $bp->activity->track[ $activity->type ]->new_post_type_action_ms ) ) {
+			$action = sprintf( $bp->activity->track[ $activity->type ]->new_post_type_action_ms, $user_link, $post_url, $blog_link );
+		} else {
+			$action = sprintf( _x( '%1$s wrote a new <a href="%2$s">item</a>, on the site %3$s', 'Activity Custom Post Type post action', 'buddypress' ), $user_link, esc_url( $post_url ), $blog_link );
+		}
+	} else {
+		if ( ! empty( $bp->activity->track[ $activity->type ]->new_post_type_action ) ) {
+			$action = sprintf( $bp->activity->track[ $activity->type ]->new_post_type_action, $user_link, $post_url );
+		} else {
+			$action = sprintf( _x( '%1$s wrote a new <a href="%2$s">item</a>', 'Activity Custom Post Type post action', 'buddypress' ), $user_link, esc_url( $post_url ) );
+		}
+	}
+
+	/**
+	 * Filters the formatted custom post type activity post action string.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string               $action   Activity action string value.
+	 * @param BP_Activity_Activity $activity Activity item object.
+	 */
+	return apply_filters( 'bp_activity_custom_post_type_post_action', $action, $activity );
+}
+
 /******************************************************************************
  * Business functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
@@ -1005,7 +1444,8 @@ function bp_activity_format_activity_action_activity_comment( $action, $activity
  * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
  * @uses apply_filters_ref_array() To call the 'bp_activity_get' hook.
  *
- * @param array $args See BP_Activity_Activity::get() for description.
+ * @param array|string $args See BP_Activity_Activity::get() for description.
+ *
  * @return array $activity See BP_Activity_Activity::get() for description.
  */
 function bp_activity_get( $args = '' ) {
@@ -1020,12 +1460,14 @@ function bp_activity_get( $args = '' ) {
 		'search_terms'      => false,        // Pass search terms as a string
 		'meta_query'        => false,        // Filter by activity meta. See WP_Meta_Query for format
 		'date_query'        => false,        // Filter by date. See first parameter of WP_Date_Query for format
+		'filter_query'      => false,
 		'show_hidden'       => false,        // Show activity items that are hidden site-wide?
 		'exclude'           => false,        // Comma-separated list of activity IDs to exclude
 		'in'                => false,        // Comma-separated list or array of activity IDs to which you want to limit the query
 		'spam'              => 'ham_only',   // 'ham_only' (default), 'spam_only' or 'all'.
 		'update_meta_cache' => true,
 		'count_total'       => false,
+		'scope'             => false,
 
 		/**
 		 * Pass filters as an array -- all filter items can be multiple values comma separated:
@@ -1041,7 +1483,7 @@ function bp_activity_get( $args = '' ) {
 	) );
 
 	// Attempt to return a cached copy of the first page of sitewide activity.
-	if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter'] ) && empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
+	if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && empty( $r['search_terms'] ) && empty( $r['meta_query'] ) && empty( $r['date_query'] ) && empty( $r['filter_query'] ) && empty( $r['filter'] ) && empty( $r['scope'] )&& empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) {
 
 		$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' );
 		if ( false === $activity ) {
@@ -1054,7 +1496,9 @@ function bp_activity_get( $args = '' ) {
 				'search_terms'      => $r['search_terms'],
 				'meta_query'        => $r['meta_query'],
 				'date_query'        => $r['date_query'],
+				'filter_query'      => $r['filter_query'],
 				'filter'            => $r['filter'],
+				'scope'             => $r['scope'],
 				'display_comments'  => $r['display_comments'],
 				'show_hidden'       => $r['show_hidden'],
 				'spam'              => $r['spam'],
@@ -1074,7 +1518,9 @@ function bp_activity_get( $args = '' ) {
 			'search_terms'     => $r['search_terms'],
 			'meta_query'       => $r['meta_query'],
 			'date_query'       => $r['date_query'],
+			'filter_query'     => $r['filter_query'],
 			'filter'           => $r['filter'],
+			'scope'            => $r['scope'],
 			'display_comments' => $r['display_comments'],
 			'show_hidden'      => $r['show_hidden'],
 			'exclude'          => $r['exclude'],
@@ -1084,6 +1530,14 @@ function bp_activity_get( $args = '' ) {
 		) );
 	}
 
+	/**
+	 * Filters the requested activity item(s).
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param BP_Activity_Activity $activity Requested activity object.
+	 * @param array                $r        Arguments used for the activity query.
+	 */
 	return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) );
 }
 
@@ -1092,12 +1546,12 @@ function bp_activity_get( $args = '' ) {
  *
  * @since BuddyPress (1.2.0)
  *
- * @see BP_Activity_Activity::get() For more information on accepted arguments
+ * @see BP_Activity_Activity::get() For more information on accepted arguments.
  * @uses wp_parse_args()
- * @uses apply_filters() To call the 'bp_activity_get_specific' hook
+ * @uses apply_filters() To call the 'bp_activity_get_specific' hook.
  * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity}
  *
- * @param array $args {
+ * @param array|string $args {
  *     All arguments and defaults are shared with BP_Activity_Activity::get(),
  *     except for the following:
  *     @type string|int|array Single activity ID, comma-separated list of IDs,
@@ -1131,6 +1585,15 @@ function bp_activity_get_specific( $args = '' ) {
 		'update_meta_cache' => $r['update_meta_cache'],
 	);
 
+	/**
+	 * Filters the requested specific activity item.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param BP_Activity_Activity $activity Requested activity object.
+	 * @param array                $args     Original passed in arguments.
+	 * @param array                $get_args Constructed arguments used with request.
+	 */
 	return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $get_args ), $args, $get_args );
 }
 
@@ -1143,38 +1606,38 @@ function bp_activity_get_specific( $args = '' ) {
  * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
  * @uses BP_Activity_Activity::rebuild_activity_comment_tree() {@link BP_Activity_Activity}
  * @uses wp_cache_delete()
- * @uses do_action() To call the 'bp_activity_add' hook
+ * @uses do_action() To call the 'bp_activity_add' hook.
  *
- * @param array $args {
+ * @param array|string $args {
  *     An array of arguments.
- *     @type int|bool $id Pass an activity ID to update an existing item, or
- *           false to create a new item. Default: false.
- *     @type string $action Optional. The activity action/description, typically
- *           something like "Joe posted an update". Values passed to this param
- *           will be stored in the database and used as a fallback for when the
- *           activity item's format_callback cannot be found (eg, when the
- *           component is disabled). As long as you have registered a
- *           format_callback for your $type, it is unnecessary to include this
- *           argument - BP will generate it automatically.
- *           See {@link bp_activity_set_action()}.
- *     @type string $content Optional. The content of the activity item.
- *     @type string $component The unique name of the component associated with
- *           the activity item - 'groups', 'profile', etc.
- *     @type string $type The specific activity type, used for directory
- *           filtering. 'new_blog_post', 'activity_update', etc.
- *     @type string $primary_link Optional. The URL for this item, as used in
- *           RSS feeds. Defaults to the URL for this activity item's permalink page.
- *     @type int|bool $user_id Optional. The ID of the user associated with the
- *           activity item. May be set to false or 0 if the item is not related
- *           to any user. Default: the ID of the currently logged-in user.
- *     @type int $item_id Optional. The ID of the associated item.
- *     @type int $secondary_item_id Optional. The ID of a secondary associated
- *           item.
- *     @type string $date_recorded Optional. The GMT time, in Y-m-d h:i:s format,
- *           when the item was recorded. Defaults to the current time.
- *     @type bool $hide_sitewide Should the item be hidden on sitewide streams?
- *           Default: false.
- *     @type bool $is_spam Should the item be marked as spam? Default: false.
+ *     @type int|bool $id                Pass an activity ID to update an existing item, or
+ *                                       false to create a new item. Default: false.
+ *     @type string   $action            Optional. The activity action/description, typically
+ *                                       something like "Joe posted an update". Values passed to this param
+ *                                       will be stored in the database and used as a fallback for when the
+ *                                       activity item's format_callback cannot be found (eg, when the
+ *                                       component is disabled). As long as you have registered a
+ *                                       format_callback for your $type, it is unnecessary to include this
+ *                                       argument - BP will generate it automatically.
+ *                                       See {@link bp_activity_set_action()}.
+ *     @type string   $content           Optional. The content of the activity item.
+ *     @type string   $component         The unique name of the component associated with
+ *                                       the activity item - 'groups', 'profile', etc.
+ *     @type string   $type              The specific activity type, used for directory
+ *                                       filtering. 'new_blog_post', 'activity_update', etc.
+ *     @type string   $primary_link      Optional. The URL for this item, as used in
+ *                                       RSS feeds. Defaults to the URL for this activity
+ *                                       item's permalink page.
+ *     @type int|bool $user_id           Optional. The ID of the user associated with the activity
+ *                                       item. May be set to false or 0 if the item is not related
+ *                                       to any user. Default: the ID of the currently logged-in user.
+ *     @type int      $item_id           Optional. The ID of the associated item.
+ *     @type int      $secondary_item_id Optional. The ID of a secondary associated item.
+ *     @type string   $date_recorded     Optional. The GMT time, in Y-m-d h:i:s format, when
+ *                                       the item was recorded. Defaults to the current time.
+ *     @type bool     $hide_sitewide     Should the item be hidden on sitewide streams?
+ *                                       Default: false.
+ *     @type bool     $is_spam           Should the item be marked as spam? Default: false.
  * }
  * @return int|bool The ID of the activity on success. False on error.
  */
@@ -1193,7 +1656,7 @@ function bp_activity_add( $args = '' ) {
 		'recorded_time'     => bp_core_current_time(), // The GMT time that this activity was recorded
 		'hide_sitewide'     => false,                  // Should this be hidden on the sitewide activity stream?
 		'is_spam'           => false,                  // Is this activity item to be marked as spam?
-	) );
+	), 'activity_add' );
 
 	// Make sure we are backwards compatible
 	if ( empty( $r['component'] ) && !empty( $r['component_name'] ) ) {
@@ -1233,6 +1696,14 @@ function bp_activity_add( $args = '' ) {
 	}
 
 	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
+
+	/**
+	 * Fires at the end of the execution of adding a new activity item, before returning the new activity item ID.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array $r Array of parsed arguments for the activity item being added.
+	 */
 	do_action( 'bp_activity_add', $r );
 
 	return $activity->id;
@@ -1254,11 +1725,11 @@ function bp_activity_add( $args = '' ) {
  * @uses wp_filter_kses()
  * @uses do_action() To call the 'bp_activity_posted_update' hook.
  *
- * @param array $args {
+ * @param array|string $args {
  *     @type string $content The content of the activity update.
- *     @type int $user_id Optional. Defaults to the logged-in user.
+ *     @type int    $user_id Optional. Defaults to the logged-in user.
  * }
- * @return int $activity_id The activity id
+ * @return int $activity_id The activity id.
  */
 function bp_activity_post_update( $args = '' ) {
 
@@ -1279,15 +1750,41 @@ function bp_activity_post_update( $args = '' ) {
 	$activity_content = $r['content'];
 	$primary_link     = bp_core_get_userlink( $r['user_id'], false, true );
 
-	// Now write the values
-	$activity_id = bp_activity_add( array(
-		'user_id'      => $r['user_id'],
-		'content'      => apply_filters( 'bp_activity_new_update_content', $activity_content ),
-		'primary_link' => apply_filters( 'bp_activity_new_update_primary_link', $primary_link ),
-		'component'    => buddypress()->activity->id,
-		'type'         => 'activity_update',
-	) );
+	/**
+	 * Filters the new activity content for current activity item.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_content Activity content posted by user.
+	 */
+	$add_content = apply_filters( 'bp_activity_new_update_content', $activity_content );
 
+	/**
+	 * Filters the activity primary link for current activity item.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $primary_link Link to the profile for the user who posted the activity.
+	 */
+	$add_primary_link = apply_filters( 'bp_activity_new_update_primary_link', $primary_link );
+
+	// Now write the values
+	$activity_id = bp_activity_add( array(
+		'user_id'      => $r['user_id'],
+		'content'      => $add_content,
+		'primary_link' => $add_primary_link,
+		'component'    => buddypress()->activity->id,
+		'type'         => 'activity_update',
+	) );
+
+	/**
+	 * Filters the latest update content for the activity item.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $r                Content of the activity update.
+	 * @param string $activity_content Content of the activity update.
+	 */
 	$activity_content = apply_filters( 'bp_activity_latest_update_content', $r['content'], $activity_content );
 
 	// Add this update to the "latest update" usermeta so it can be fetched anywhere.
@@ -1296,39 +1793,311 @@ function bp_activity_post_update( $args = '' ) {
 		'content' => $activity_content
 	) );
 
+	/**
+	 * Fires at the end of an activity post update, before returning the updated activity item ID.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $content     Content of the activity post update.
+	 * @param int    $user_id     ID of the user posting the activity update.
+	 * @param int    $activity_id ID of the activity item being updated.
+	 */
 	do_action( 'bp_activity_posted_update', $r['content'], $r['user_id'], $activity_id );
 
 	return $activity_id;
 }
 
+/**
+ * Create an activity item for a newly published post type post.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  int      $post_id ID of the new post.
+ * @param  WP_Post  $post    Post object.
+ * @param  int      $user_id ID of the post author.
+ *
+ * @return int|bool The ID of the activity on success. False on error.
+ */
+function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 ) {
+
+	if ( ! is_a( $post, 'WP_Post' ) ) {
+		return;
+	}
+
+	// Get the post type tracking args.
+	$activity_post_object = bp_activity_get_post_type_tracking_args( $post->post_type );
+
+	if ( 'publish' != $post->post_status || ! empty( $post->post_password ) || empty( $activity_post_object->action_id ) ) {
+		return;
+	}
+
+	if ( empty( $post_id ) ) {
+		$post_id = $post->ID;
+	}
+
+	$blog_id = get_current_blog_id();
+
+	if ( empty( $user_id ) ) {
+		$user_id = (int) $post->post_author;
+	}
+
+	// Bail if an activity item already exists for this post.
+	$existing = bp_activity_get( array(
+		'filter' => array(
+			'action'       => $activity_post_object->action_id,
+			'primary_id'   => $blog_id,
+			'secondary_id' => $post_id,
+		)
+	) );
+
+	if ( ! empty( $existing['activities'] ) ) {
+		return;
+	}
+
+	/**
+	 * Filters whether or not to post the activity.
+	 *
+	 * This is a variable filter, dependent on the post type,
+	 * that lets components or plugins bail early if needed.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param bool $value   Whether or not to continue.
+	 * @param int  $blog_id ID of the current site.
+	 * @param int  $post_id ID of the current post being published.
+	 * @param int  $user_id ID of the current user or post author.
+	 */
+	if ( false === apply_filters( "bp_activity_{$post->post_type}_pre_publish", true, $blog_id, $post_id, $user_id ) ) {
+		return;
+	}
+
+	// Record this in activity streams.
+	$blog_url = get_home_url( $blog_id );
+	$post_url = add_query_arg(
+		'p',
+		$post_id,
+		trailingslashit( $blog_url )
+	);
+
+	// Backward compatibility filters for the 'blogs' component.
+	if ( 'blogs' == $activity_post_object->component_id )  {
+		$activity_content      = apply_filters( 'bp_blogs_activity_new_post_content', $post->post_content, $post, $post_url, $post->post_type );
+		$activity_primary_link = apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_url, $post_id, $post->post_type );
+	} else {
+		$activity_content      = $post->post_content;
+		$activity_primary_link = $post_url;
+	}
+
+	$activity_args = array(
+		'user_id'           => $user_id,
+		'content'           => $activity_content,
+		'primary_link'      => $activity_primary_link,
+		'component'         => $activity_post_object->component_id,
+		'type'              => $activity_post_object->action_id,
+		'item_id'           => $blog_id,
+		'secondary_item_id' => $post_id,
+		'recorded_time'     => $post->post_date_gmt,
+	);
+
+	if ( ! empty( $activity_args['content'] ) ) {
+		// Create the excerpt.
+		$activity_summary = bp_activity_create_summary( $activity_args['content'], $activity_args );
+
+		// Backward compatibility filter for blog posts.
+		if ( 'blogs' == $activity_post_object->component_id )  {
+			$activity_args['content'] = apply_filters( 'bp_blogs_record_activity_content', $activity_summary, $activity_args['content'], $activity_args, $post->post_type );
+		} else {
+			$activity_args['content'] = $activity_summary;
+		}
+	}
+
+	// Set up the action by using the format functions.
+	$action_args = array_merge( $activity_args, array(
+		'post_title' => $post->post_title,
+		'post_url'   => $post_url,
+	) );
+
+	$activity_args['action'] = call_user_func_array( $activity_post_object->format_callback, array( '', (object) $action_args ) );
+
+	// Make sure the action is set.
+	if ( empty( $activity_args['action'] ) ) {
+		return;
+	} else {
+		// Backward compatibility filter for the blogs component.
+		if ( 'blogs' == $activity_post_object->component_id )  {
+			$activity_args['action'] = apply_filters( 'bp_blogs_record_activity_action', $activity_args['action'] );
+		}
+	}
+
+	$activity_id = bp_activity_add( $activity_args );
+
+	/**
+	 * Fires after the publishing of an activity item for a newly published post type post.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param int     $activity_id   ID of the newly published activity item.
+	 * @param WP_Post $post          Post object.
+	 * @param array   $activity_args Array of activity arguments.
+	 */
+	do_action( 'bp_activity_post_type_published', $activity_id, $post, $activity_args );
+
+	return $activity_id;
+}
+
+/**
+ * Update the activity item for a custom post type entry.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  WP_Post $post Post item.
+ *
+ * @return bool    True on success, false on failure.
+ */
+function bp_activity_post_type_update( $post = null ) {
+
+	if ( ! is_a( $post, 'WP_Post' ) ) {
+		return;
+	}
+
+	// Get the post type tracking args.
+	$activity_post_object = bp_activity_get_post_type_tracking_args( $post->post_type );
+
+	if ( empty( $activity_post_object->action_id ) ) {
+		return;
+	}
+
+	$activity_id = bp_activity_get_activity_id( array(
+		'component'         => $activity_post_object->component_id,
+		'item_id'           => get_current_blog_id(),
+		'secondary_item_id' => $post->ID,
+		'type'              => $activity_post_object->action_id,
+	) );
+
+	// Activity ID doesn't exist, so stop!
+	if ( empty( $activity_id ) ) {
+		return;
+	}
+
+	// Delete the activity if the post was updated with a password.
+	if ( ! empty( $post->post_password ) ) {
+		bp_activity_delete( array( 'id' => $activity_id ) );
+	}
+
+	// Update the activity entry.
+	$activity = new BP_Activity_Activity( $activity_id );
+
+	if ( ! empty( $post->post_content ) ) {
+		$activity_summary = bp_activity_create_summary( $post->post_content, (array) $activity );
+
+		// Backward compatibility filter for the blogs component.
+		if ( 'blogs' == $activity_post_object->component_id ) {
+			$activity->content = apply_filters( 'bp_blogs_record_activity_content', $activity_summary, $post->post_content, (array) $activity, $post->post_type );
+		} else {
+			$activity->content = $activity_summary;
+		}
+	}
+
+	// Save the updated activity.
+	$updated = $activity->save();
+
+	/**
+	 * Fires after the updating of an activity item for a custom post type entry.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param WP_Post              $post     Post object.
+	 * @param BP_Activity_Activity $activity Activity object.
+	 */
+	do_action( 'bp_activity_post_type_updated', $post, $activity );
+
+	return $updated;
+}
+
+/**
+ * Unpublish an activity for the custom post type.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  int     $post_id ID of the post being unpublished.
+ * @param  WP_Post $post    Post object.
+ *
+ * @return bool    True on success, false on failure.
+ */
+function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) {
+
+	if ( ! is_a( $post, 'WP_Post' ) ) {
+		return;
+	}
+
+	// Get the post type tracking args
+	$activity_post_object = bp_activity_get_post_type_tracking_args( $post->post_type );
+
+	if ( empty( $activity_post_object->action_id ) ) {
+		return;
+	}
+
+	if ( empty( $post_id ) ) {
+		$post_id = $post->ID;
+	}
+
+	$delete_activity_args = array(
+		'item_id'           => get_current_blog_id(),
+		'secondary_item_id' => $post_id,
+		'component'         => $activity_post_object->component_id,
+		'type'              => $activity_post_object->action_id,
+		'user_id'           => false,
+	);
+
+	$deleted = bp_activity_delete_by_item_id( $delete_activity_args );
+
+	/**
+	 * Fires after the unpublishing for the custom post type.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array   $delete_activity_args Array of arguments for activity deletion.
+	 * @param WP_Post $post                 Post object.
+	 * @param bool    $activity             Whether or not the activity was successfully deleted.
+	 */
+	do_action( 'bp_activity_post_type_unpublished', $delete_activity_args, $post, $deleted );
+
+	return $deleted;
+}
+
 /**
  * Add an activity comment.
  *
  * @since BuddyPress (1.2.0)
  *
- * @global object $bp BuddyPress global settings.
  * @uses wp_parse_args()
  * @uses bp_activity_add()
  * @uses apply_filters() To call the 'bp_activity_comment_action' hook.
  * @uses apply_filters() To call the 'bp_activity_comment_content' hook.
- * @uses bp_activity_new_comment_notification()
  * @uses wp_cache_delete()
  * @uses do_action() To call the 'bp_activity_comment_posted' hook.
  *
- * @param array $args {
- *     @type int $id Optional. Pass an ID to update an existing comment.
- *     @type string $content The content of the comment.
- *     @type int $user_id Optional. The ID of the user making the comment.
- *           Defaults to the ID of the logged-in user.
- *     @type int $activity_id The ID of the "root" activity item, ie the oldest
- *           ancestor of the comment.
- *     @type int $parent_id Optional. The ID of the parent activity item, ie the
- *           item to which the comment is an immediate reply. If not provided,
- *           this value defaults to the $activity_id.
+ * @param array|string $args {
+ *     @type int    $id          Optional. Pass an ID to update an existing comment.
+ *     @type string $content     The content of the comment.
+ *     @type int    $user_id     Optional. The ID of the user making the comment.
+ *                               Defaults to the ID of the logged-in user.
+ *     @type int    $activity_id The ID of the "root" activity item, ie the oldest
+ *                               ancestor of the comment.
+ *     @type int    $parent_id   Optional. The ID of the parent activity item, ie the item to
+ *                               which the comment is an immediate reply. If not provided,
+ *                               this value defaults to the $activity_id.
  * }
  * @return int|bool The ID of the comment on success, otherwise false.
  */
 function bp_activity_new_comment( $args = '' ) {
+	$bp       = buddypress();
+	$errors   = new WP_Error();
+	$feedback = __( 'There was an error posting your reply. Please try again.', 'buddypress' );
+
+	if ( empty( $bp->activity->errors ) ) {
+		$bp->activity->errors = array();
+	}
 
 	$r = wp_parse_args( $args, array(
 		'id'          => false,
@@ -1340,6 +2109,9 @@ function bp_activity_new_comment( $args = '' ) {
 
 	// Bail if missing necessary data
 	if ( empty( $r['content'] ) || empty( $r['user_id'] ) || empty( $r['activity_id'] ) ) {
+		$errors->add( 'missing_data', $feedback );
+		$bp->activity->errors['new_comment'] = $errors;
+
 		return false;
 	}
 
@@ -1350,14 +2122,33 @@ function bp_activity_new_comment( $args = '' ) {
 
 	$activity_id = $r['activity_id'];
 
-	// Check to see if the parent activity is hidden, and if so, hide this comment publically.
+	// Get the parent activity
 	$activity  = new BP_Activity_Activity( $activity_id );
+
+	// Bail if the parent activity does not exist
+	if ( empty( $activity->date_recorded ) ) {
+		$errors->add( 'missing_activity', __( 'Sorry, the item you are replying to no longer exists.', 'buddypress' ) );
+		$bp->activity->errors['new_comment'] = $errors;
+
+		return false;
+	}
+
+	// Check to see if the parent activity is hidden, and if so, hide this comment publicly.
 	$is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0;
 
+	/**
+	 * Filters the content of a new comment.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $r Content for the newly posted comment.
+	 */
+	$comment_content = apply_filters( 'bp_activity_comment_content', $r['content'] );
+
 	// Insert the activity comment
 	$comment_id = bp_activity_add( array(
 		'id'                => $r['id'],
-		'content'           => apply_filters( 'bp_activity_comment_content', $r['content'] ),
+		'content'           => $comment_content,
 		'component'         => buddypress()->activity->id,
 		'type'              => 'activity_comment',
 		'user_id'           => $r['user_id'],
@@ -1378,8 +2169,22 @@ function bp_activity_new_comment( $args = '' ) {
 	}
 	wp_cache_delete( $activity_id, 'bp_activity' );
 
+	/**
+	 * Fires near the end of an activity comment posting, before the returning of the comment ID.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param int   $comment_id ID of the newly posted activity comment.
+	 * @param array $r          Array of parsed comment arguments.
+	 * @param int   $activity   ID of the activity item being commented on.
+	 */
 	do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );
 
+	if ( empty( $comment_id ) ) {
+		$errors->add( 'comment_failed', $feedback );
+		$bp->activity->errors['new_comment'] = $errors;
+	}
+
 	return $comment_id;
 }
 
@@ -1393,7 +2198,8 @@ function bp_activity_new_comment( $args = '' ) {
  * @uses apply_filters() To call the 'bp_activity_get_activity_id' hook.
  * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
  *
- * @param array $args See BP_Activity_Activity::get() for description.
+ * @param array|string $args See BP_Activity_Activity::get() for description.
+ *
  * @return int $activity_id The ID of the activity item found.
  */
 function bp_activity_get_activity_id( $args = '' ) {
@@ -1409,6 +2215,13 @@ function bp_activity_get_activity_id( $args = '' ) {
 		'date_recorded'     => false,
 	) );
 
+	/**
+	 * Filters the activity ID being requested.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments.
+	 */
 	return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id(
 		$r['user_id'],
 		$r['component'],
@@ -1447,10 +2260,12 @@ function bp_activity_get_activity_id( $args = '' ) {
  * @uses do_action() To call the 'bp_activity_deleted_activities' hook.
  * @uses wp_cache_delete()
  *
- * @param array $args To delete specific activity items, use
- *            $args = array( 'id' => $ids );
- *        Otherwise, to use filters for item deletion, the argument format is
- *        the same as BP_Activity_Activity::get(). See that method for a description.
+ * @param array|string $args To delete specific activity items, use
+ *                           $args = array( 'id' => $ids ); Otherwise, to use
+ *                           filters for item deletion, the argument format is
+ *                           the same as BP_Activity_Activity::get().
+ *                           See that method for a description.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_activity_delete( $args = '' ) {
@@ -1470,6 +2285,13 @@ function bp_activity_delete( $args = '' ) {
 		'hide_sitewide'     => false
 	) );
 
+	/**
+	 * Fires before an activity item proceeds to be deleted.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $args Array of arguments to be used with the activity deletion.
+	 */
 	do_action( 'bp_before_activity_delete', $args );
 
 	// Adjust the new mention count of any mentioned member
@@ -1492,7 +2314,22 @@ function bp_activity_delete( $args = '' ) {
 		}
 	}
 
+	/**
+	 * Fires after the activity item has been deleted.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $args Array of arguments used with the activity deletion.
+	 */
 	do_action( 'bp_activity_delete', $args );
+
+	/**
+	 * Fires after the activity item has been deleted.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $activity_ids_deleted Array of affected activity item IDs.
+	 */
 	do_action( 'bp_activity_deleted_activities', $activity_ids_deleted );
 
 	wp_cache_delete( 'bp_activity_sitewide_front', 'bp' );
@@ -1506,13 +2343,13 @@ function bp_activity_delete( $args = '' ) {
 	 * You should use bp_activity_delete() instead.
 	 *
 	 * @since BuddyPress (1.1.0)
-	 * @deprecated BuddyPress (1.2)
+	 * @deprecated BuddyPress (1.2.0)
 	 *
 	 * @uses wp_parse_args()
 	 * @uses bp_activity_delete()
 	 *
-	 * @param array $args See BP_Activity_Activity::get for a description
-	 *                    of accepted arguments.
+	 * @param array|string $args See BP_Activity_Activity::get for a
+	 *                           description of accepted arguments.
 	 *
 	 * @return bool True on success, false on failure.
 	 */
@@ -1536,7 +2373,8 @@ function bp_activity_delete( $args = '' ) {
 	 *
 	 * @uses bp_activity_delete()
 	 *
-	 * @param int ID of the activity item to be deleted.
+	 * @param int $activity_id ID of the activity item to be deleted.
+	 *
 	 * @return bool True on success, false on failure.
 	 */
 	function bp_activity_delete_by_activity_id( $activity_id ) {
@@ -1549,14 +2387,15 @@ function bp_activity_delete( $args = '' ) {
 	 * You should use bp_activity_delete() instead.
 	 *
 	 * @since BuddyPress (1.1.0)
-	 * @deprecated BuddyPress (1.2)
+	 * @deprecated BuddyPress (1.2.0)
 	 *
 	 * @uses bp_activity_delete()
 	 *
-	 * @param int $user_id The user id.
-	 * @param string $content The activity id.
+	 * @param int    $user_id   The user id.
+	 * @param string $content   The activity id.
 	 * @param string $component The activity component.
-	 * @param string $type The activity type.
+	 * @param string $type      The activity type.
+	 *
 	 * @return bool True on success, false on failure.
 	 */
 	function bp_activity_delete_by_content( $user_id, $content, $component, $type ) {
@@ -1574,12 +2413,13 @@ function bp_activity_delete( $args = '' ) {
 	 * You should use bp_activity_delete() instead.
 	 *
 	 * @since BuddyPress (1.1.0)
-	 * @deprecated BuddyPress (1.2)
+	 * @deprecated BuddyPress (1.2.0)
 	 *
 	 * @uses bp_activity_delete()
 	 *
-	 * @param int $user_id The user id.
+	 * @param int    $user_id   The user id.
 	 * @param string $component The activity component.
+	 *
 	 * @return bool True on success, false on failure.
 	 */
 	function bp_activity_delete_for_user_by_component( $user_id, $component ) {
@@ -1606,13 +2446,23 @@ function bp_activity_delete( $args = '' ) {
  *
  * @param int $activity_id The ID of the "root" activity, ie the comment's
  *                         oldest ancestor.
- * @param int $comment_id The ID of the comment to be deleted.
- * @return bool True on success, false on failure
+ * @param int $comment_id  The ID of the comment to be deleted.
+ *
+ * @return bool True on success, false on failure.
  */
 function bp_activity_delete_comment( $activity_id, $comment_id ) {
-	/***
+
+	/**
+	 * Filters whether BuddyPress should delete an activity comment or not.
+	 *
 	 * You may want to hook into this filter if you want to override this function and
 	 * handle the deletion of child comments differently. Make sure you return false.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param bool $value       Whether BuddyPress should continue or not.
+	 * @param int  $activity_id ID of the root activity item being deleted.
+	 * @param int  $comment_id  ID of the comment being deleted.
 	 */
 	if ( ! apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) ) {
 		return false;
@@ -1632,6 +2482,14 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
 	// Recalculate the comment tree
 	BP_Activity_Activity::rebuild_activity_comment_tree( $activity_id );
 
+	/**
+	 * Fires at the end of the deletion of an activity comment, before returning success.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param int $activity_id ID of the activity that has had a comment deleted from.
+	 * @param int $comment_id  ID of the comment that was deleted.
+	 */
 	do_action( 'bp_activity_delete_comment', $activity_id, $comment_id );
 
 	return true;
@@ -1647,8 +2505,8 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
 	 * @uses bp_activity_delete()
 	 *
 	 * @param int $activity_id The ID of the "root" activity, ie the
-	 *        comment's oldest ancestor.
-	 * @param int $comment_id The ID of the comment to be deleted.
+	 *                         comment's oldest ancestor.
+	 * @param int $comment_id  The ID of the comment to be deleted.
 	 */
 	function bp_activity_delete_children( $activity_id, $comment_id ) {
 
@@ -1661,7 +2519,7 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
 				bp_activity_delete_children( $activity_id, $child->id );
 			}
 		}
-		
+
 		// Delete the comment itself
 		bp_activity_delete( array(
 			'secondary_item_id' => $comment_id,
@@ -1684,11 +2542,13 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) {
  * @uses bp_get_activity_root_slug()
  * @uses apply_filters_ref_array() To call the 'bp_activity_get_permalink' hook.
  *
- * @param int $activity_id The unique id of the activity object.
- * @param object $activity_obj Optional. The activity object.
+ * @param int         $activity_id  The unique id of the activity object.
+ * @param object|bool $activity_obj Optional. The activity object.
+ *
  * @return string $link Permalink for the activity item.
  */
 function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
+	$bp = buddypress();
 
 	if ( empty( $activity_obj ) ) {
 		$activity_obj = new BP_Activity_Activity( $activity_id );
@@ -1698,7 +2558,18 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
 		$activity_obj = $activity_obj->current_comment;
 	}
 
-	if ( 'new_blog_post' == $activity_obj->type || 'new_blog_comment' == $activity_obj->type || 'new_forum_topic' == $activity_obj->type || 'new_forum_post' == $activity_obj->type ) {
+	$use_primary_links = array(
+		'new_blog_post',
+		'new_blog_comment',
+		'new_forum_topic',
+		'new_forum_post',
+	);
+
+	if ( ! empty( $bp->activity->track ) ) {
+		$use_primary_links = array_merge( $use_primary_links, array_keys( $bp->activity->track ) );
+	}
+
+	if ( false !== array_search( $activity_obj->type, $use_primary_links ) ) {
 		$link = $activity_obj->primary_link;
 	} else {
 		if ( 'activity_comment' == $activity_obj->type ) {
@@ -1708,6 +2579,13 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
 		}
 	}
 
+	/**
+	 * Filters the activity permalink for the specified activity item.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $array Array holding activity permalink and activity item object.
+	 */
 	return apply_filters_ref_array( 'bp_activity_get_permalink', array( $link, &$activity_obj ) );
 }
 
@@ -1719,6 +2597,7 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
  * @uses BP_Activity_Activity::hide_all_for_user() {@link BP_Activity_Activity}
  *
  * @param int $user_id The ID of the user whose activity is being hidden.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_activity_hide_user_activity( $user_id ) {
@@ -1735,18 +2614,21 @@ function bp_activity_hide_user_activity( $user_id ) {
  * through the content, grabs the first image and converts it to a thumbnail,
  * and removes the rest of the images from the string.
  *
+ * As of BuddyPress 2.3, this function is no longer in use.
+ *
  * @since BuddyPress (1.2.0)
  *
  * @uses esc_attr()
- * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook
+ * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook.
+ *
+ * @param string      $content The content of the activity item.
+ * @param string|bool $link    Optional. The unescaped URL that the image should link
+ *                             to. If absent, the image will not be a link.
+ * @param array|bool  $args    Optional. The args passed to the activity
+ *                             creation function (eg bp_blogs_record_activity()).
  *
- * @param string $content The content of the activity item.
- * @param string $link Optional. The unescaped URL that the image should link
- *        to. If absent, the image will not be a link.
- * @param array $args Optional. The args passed to the activity
- *        creation function (eg bp_blogs_record_activity()).
  * @return string $content The content with images stripped and replaced with a
- *         single thumb.
+ *                         single thumb.
  */
 function bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) {
 
@@ -1764,10 +2646,16 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
 		preg_match( '/<img.*?(height\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $height );
 		preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i',  $matches[0][0], $width  );
 
-		if ( !empty( $src ) ) {
-			$src    = substr( substr( str_replace( 'src=',    '', $src[1]    ), 0, -1 ), 1 );
-			$height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
-			$width  = substr( substr( str_replace( 'width=',  '', $width[1]  ), 0, -1 ), 1 );
+		if ( ! empty( $src ) ) {
+			$src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 );
+
+			if ( isset( $width[1] ) ) {
+				$width = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 );
+			}
+
+			if ( isset( $height[1] ) ) {
+				$height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 );
+			}
 
 			if ( empty( $width ) || empty( $height ) ) {
 				$width  = 100;
@@ -1787,9 +2675,180 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
 		}
 	}
 
+	/**
+	 * Filters the activity content that had a thumbnail replace images.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $content Activity content that had images replaced in.
+	 * @param array  $matches Array of all image tags found in the posted content.
+	 * @param array  $args    Arguments passed into function creating the activity update.
+	 */
 	return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args );
 }
 
+/**
+ * Create a rich summary of an activity item for the activity stream.
+ *
+ * More than just a simple excerpt, the summary could contain oEmbeds and other types of media.
+ * Currently, it's only used for blog post items, but it will probably be used for all types of
+ * activity in the future.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param string $content  The content of the activity item.
+ * @param array  $activity The data passed to bp_activity_add() or the values
+ *                         from an Activity obj.
+ *
+ * @return string
+ */
+function bp_activity_create_summary( $content, $activity ) {
+	$args = array(
+		'width' => isset( $GLOBALS['content_width'] ) ? (int) $GLOBALS['content_width'] : 'medium',
+	);
+
+	// Get the WP_Post object if this activity type is a blog post.
+	if ( $activity['type'] === 'new_blog_post' ) {
+		$content = get_post( $activity['secondary_item_id'] );
+	}
+
+	/**
+	 * Filter the class name of the media extractor when creating an Activity summary.
+	 *
+	 * Use this filter to change the media extractor used to extract media info for the activity item.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param string $extractor Class name.
+	 * @param string $content   The content of the activity item.
+	 * @param array  $activity  The data passed to bp_activity_add() or the values from an Activity obj.
+	 */
+	$extractor = apply_filters( 'bp_activity_create_summary_extractor_class', 'BP_Media_Extractor', $content, $activity );
+	$extractor = new $extractor;
+
+	/**
+	 * Filter the arguments passed to the media extractor when creating an Activity summary.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array              $args      Array of bespoke data for the media extractor.
+	 * @param string             $content   The content of the activity item.
+	 * @param array              $activity  The data passed to bp_activity_add() or the values from an Activity obj.
+	 * @param BP_Media_Extractor $extractor The media extractor object.
+	 */
+	$args = apply_filters( 'bp_activity_create_summary_extractor_args', $args, $content, $activity, $extractor );
+
+
+	// Extract media information from the $content.
+	$media = $extractor->extract( $content, BP_Media_Extractor::ALL, $args );
+
+	// If we converted $content to an object earlier, flip it back to a string.
+	if ( is_a( $content, 'WP_Post' ) ) {
+		$content = $content->post_content;
+	}
+
+	$para_count     = substr_count( strtolower( wpautop( $content ) ), '<p>' );
+	$has_audio      = ! empty( $media['has']['audio'] )           && $media['has']['audio'];
+	$has_videos     = ! empty( $media['has']['videos'] )          && $media['has']['videos'];
+	$has_feat_image = ! empty( $media['has']['featured_images'] ) && $media['has']['featured_images'];
+	$has_galleries  = ! empty( $media['has']['galleries'] )       && $media['has']['galleries'];
+	$has_images     = ! empty( $media['has']['images'] )          && $media['has']['images'];
+	$has_embeds     = false;
+
+	// Embeds must be subtracted from the paragraph count.
+	if ( ! empty( $media['has']['embeds'] ) ) {
+		$has_embeds = $media['has']['embeds'] > 0;
+		$para_count -= count( $media['has']['embeds'] );
+	}
+
+	$extracted_media = array();
+	$use_media_type  = '';
+	$image_source    = '';
+
+	// If it's a short article and there's an embed/audio/video, use it.
+	if ( $para_count <= 3 ) {
+		if ( $has_embeds ) {
+			$use_media_type = 'embeds';
+		} elseif ( $has_audio ) {
+			$use_media_type = 'audio';
+		} elseif ( $has_videos ) {
+			$use_media_type = 'videos';
+		}
+	}
+
+	// If not, or in any other situation, try to use an image.
+	if ( ! $use_media_type && $has_images ) {
+		$use_media_type = 'images';
+		$image_source   = 'html';
+
+		// Featured Image > Galleries > inline <img>.
+		if ( $has_feat_image ) {
+			$image_source = 'featured_images';
+
+		} elseif ( $has_galleries ) {
+			$image_source = 'galleries';
+		}
+	}
+
+	// Extract an item from the $media results.
+	if ( $use_media_type ) {
+		if ( $use_media_type === 'images' ) {
+			$extracted_media = wp_list_filter( $media[ $use_media_type ], array( 'source' => $image_source ) );
+			$extracted_media = array_shift( $extracted_media );
+		} else {
+			$extracted_media = array_shift( $media[ $use_media_type ] );
+		}
+
+		/**
+		 * Filter the results of the media extractor when creating an Activity summary.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array  $extracted_media Extracted media item. See {@link BP_Media_Extractor::extract()} for format.
+		 * @param string $content         Content of the activity item.
+		 * @param array  $activity        The data passed to bp_activity_add() or the values from an Activity obj.
+		 * @param array  $media           All results from the media extraction.
+		 *                                See {@link BP_Media_Extractor::extract()} for format.
+		 * @param string $use_media_type  The kind of media item that was preferentially extracted.
+		 * @param string $image_source    If $use_media_type was "images", the preferential source of the image.
+		 *                                Otherwise empty.
+		 */
+		$extracted_media = apply_filters(
+			'bp_activity_create_summary_extractor_result',
+			$extracted_media,
+			$content,
+			$activity,
+			$media,
+			$use_media_type,
+			$image_source
+		);
+	}
+
+	// Generate a text excerpt for this activity item (and remove any oEmbeds URLs).
+	$summary = strip_shortcodes( html_entity_decode( strip_tags( $content ) ) );
+	$summary = bp_create_excerpt( preg_replace( '#^\s*(https?://[^\s"]+)\s*$#im', '', $summary ) );
+
+	if ( $use_media_type === 'embeds' ) {
+		$summary .= PHP_EOL . PHP_EOL . $extracted_media['url'];
+	} elseif ( $use_media_type === 'images' ) {
+		$summary .= sprintf( ' <img src="%s">', esc_url( $extracted_media['url'] ) );
+	} elseif ( in_array( $use_media_type, array( 'audio', 'videos' ), true ) ) {
+		$summary .= PHP_EOL . PHP_EOL . $extracted_media['original'];  // Full shortcode.
+	}
+
+	/**
+	 * Filters the newly-generated summary for the activity item.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param string $summary         Activity summary HTML.
+	 * @param string $content         Content of the activity item.
+	 * @param array  $activity        The data passed to bp_activity_add() or the values from an Activity obj.
+	 * @param array  $extracted_media Media item extracted. See {@link BP_Media_Extractor::extract()} for format.
+	 */
+	return apply_filters( 'bp_activity_create_summary', $summary, $content, $activity, $extracted_media );
+}
+
 /**
  * Fetch whether the current user is allowed to mark items as spam.
  *
@@ -1798,6 +2857,14 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args =
  * @return bool True if user is allowed to mark activity items as spam.
  */
 function bp_activity_user_can_mark_spam() {
+
+	/**
+	 * Filters whether the current user should be able to mark items as spam.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $moderate Whether or not the current user has bp_moderate capability.
+	 */
 	return apply_filters( 'bp_activity_user_can_mark_spam', bp_current_user_can( 'bp_moderate' ) );
 }
 
@@ -1807,9 +2874,9 @@ function bp_activity_user_can_mark_spam() {
  * @since BuddyPress (1.6.0)
  *
  * @param BP_Activity_Activity $activity The activity item to be spammed.
- * @param string $source Optional. Default is "by_a_person" (ie, a person has
- *        manually marked the activity as spam). BP core also accepts
- *        'by_akismet'.
+ * @param string               $source   Optional. Default is "by_a_person" (ie, a person has
+ *                                       manually marked the activity as spam). BP core also
+ *                                       accepts 'by_akismet'.
  */
 function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
 	$bp = buddypress();
@@ -1836,6 +2903,15 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
 		add_action( 'bp_activity_after_save', array( $bp->activity->akismet, 'update_activity_spam_meta' ), 1, 1 );
 	}
 
+	/**
+	 * Fires at the end of the process to mark an activity item as spam.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param BP_Activity_Activity $activity Activity item being marked as spam.
+	 * @param string               $source   Source of determination of spam status. For example
+	 *                                       "by_a_person" or "by_akismet".
+	 */
 	do_action( 'bp_activity_mark_as_spam', $activity, $source );
 }
 
@@ -1844,10 +2920,10 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) {
  *
  * @since BuddyPress (1.6.0)
  *
- * @param BP_Activity_Activity $activity The activity item to be hammed.
- * @param string $source Optional. Default is "by_a_person" (ie, a person has
- *        manually marked the activity as spam). BP core also accepts
- *        'by_akismet'.
+ * @param BP_Activity_Activity $activity The activity item to be hammed. Passed by reference.
+ * @param string               $source   Optional. Default is "by_a_person" (ie, a person has
+ *                                       manually marked the activity as spam). BP core also accepts
+ *                                       'by_akismet'.
  */
 function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
 	$bp = buddypress();
@@ -1874,6 +2950,15 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
 		add_action( 'bp_activity_after_save', array( $bp->activity->akismet, 'update_activity_ham_meta' ), 1, 1 );
 	}
 
+	/**
+	 * Fires at the end of the process to mark an activity item as ham.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param BP_Activity_Activity $activity Activity item being marked as ham.
+	 * @param string               $source   Source of determination of ham status. For example
+	 *                                       "by_a_person" or "by_akismet".
+	 */
 	do_action( 'bp_activity_mark_as_ham', $activity, $source );
 }
 
@@ -1895,6 +2980,7 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) {
  * @see BP_Embed
  * @see bp_embed_activity_cache()
  * @see bp_embed_activity_save_cache()
+ *
  * @uses add_filter() To attach 'bp_get_activity_id' to 'embed_post_id'.
  * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'.
  * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'.
@@ -1919,6 +3005,7 @@ add_action( 'activity_loop_start', 'bp_activity_embed' );
  * @see BP_Embed
  * @see bp_embed_activity_cache()
  * @see bp_embed_activity_save_cache()
+ *
  * @uses add_filter() To attach 'bp_get_activity_comment_id' to 'embed_post_id'.
  * @uses add_filter() To attach 'bp_embed_activity_cache' to 'bp_embed_get_cache'.
  * @uses add_action() To attach 'bp_embed_activity_save_cache' to 'bp_embed_update_cache'.
@@ -1978,10 +3065,11 @@ add_action( 'bp_after_activity_comment', 'bp_activity_comment_embed_after_recurs
  * @see BP_Embed::parse_oembed()
  * @uses bp_activity_get_meta()
  *
- * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
- *        functions like this one to filter.
- * @param int $id The ID of the activity item.
+ * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
+ *                         functions like this one to filter.
+ * @param int    $id       The ID of the activity item.
  * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
+ *
  * @return mixed The cached embeds for this activity item.
  */
 function bp_embed_activity_cache( $cache, $id, $cachekey ) {
@@ -1998,10 +3086,11 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) {
  * @see BP_Embed::parse_oembed()
  * @uses bp_activity_update_meta()
  *
- * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
- *        functions like this one to filter.
+ * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
+ *                         functions like this one to filter.
  * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
- * @param int $id The ID of the activity item.
+ * @param int    $id       The ID of the activity item.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
@@ -2013,7 +3102,7 @@ function bp_embed_activity_save_cache( $cache, $cachekey, $id ) {
  *
  * @since BuddyPress (2.0.0)
  *
- * @uses bp_is_activity_heartbeat_active() to check if heatbeat setting is on.
+ * @uses bp_is_activity_heartbeat_active() to check if heartbeat setting is on.
  * @uses bp_is_activity_directory() to check if the current page is the activity
  *       directory.
  * @uses bp_is_active() to check if the group component is active.
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
index e3a8dadc159eb7d0c8229a7097da92421aec05da..2a34acaa7e646d5e71ef99575d9bdf86f25370b1 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php
@@ -10,19 +10,19 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Main Activity Class.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  */
 class BP_Activity_Component extends BP_Component {
 
 	/**
 	 * Start the activity component setup process.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	public function __construct() {
 		parent::start(
@@ -38,7 +38,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Include component files.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @see BP_Component::includes() for a description of arguments.
 	 *
@@ -60,7 +60,9 @@ class BP_Activity_Component extends BP_Component {
 
 		// Load Akismet support if Akismet is configured
 		$akismet_key = bp_get_option( 'wordpress_api_key' );
-		if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
+
+		/** This filter is documented in bp-activity/bp-activity-actions.php */
+		if ( defined( 'AKISMET_VERSION' ) && class_exists( 'Akismet' ) && ( ! empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {
 			$includes[] = 'akismet';
 		}
 
@@ -77,7 +79,7 @@ class BP_Activity_Component extends BP_Component {
 	 * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @see BP_Component::setup_globals() for a description of arguments.
 	 *
@@ -120,7 +122,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Set up component navigation.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @see BP_Component::setup_nav() for a description of arguments.
 	 * @uses bp_is_active()
@@ -128,10 +130,8 @@ class BP_Activity_Component extends BP_Component {
 	 * @uses bp_get_friends_slug()
 	 * @uses bp_get_groups_slug()
 	 *
-	 * @param array $main_nav Optional. See BP_Component::setup_nav() for
-	 *                        description.
-	 * @param array $sub_nav Optional. See BP_Component::setup_nav() for
-	 *                       description.
+	 * @param array $main_nav Optional. See BP_Component::setup_nav() for description.
+	 * @param array $sub_nav  Optional. See BP_Component::setup_nav() for description.
 	 */
 	public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
 
@@ -185,15 +185,17 @@ class BP_Activity_Component extends BP_Component {
 		}
 
 		// Favorite activity items
-		$sub_nav[] = array(
-			'name'            => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ),
-			'slug'            => 'favorites',
-			'parent_url'      => $activity_link,
-			'parent_slug'     => $this->slug,
-			'screen_function' => 'bp_activity_screen_favorites',
-			'position'        => 30,
-			'item_css_id'     => 'activity-favs'
-		);
+		if ( bp_activity_can_favorite() ) {
+			$sub_nav[] = array(
+				'name'            => _x( 'Favorites', 'Profile activity screen sub nav', 'buddypress' ),
+				'slug'            => 'favorites',
+				'parent_url'      => $activity_link,
+				'parent_slug'     => $this->slug,
+				'screen_function' => 'bp_activity_screen_favorites',
+				'position'        => 30,
+				'item_css_id'     => 'activity-favs'
+			);
+		}
 
 		// Additional menu if friends is active
 		if ( bp_is_active( 'friends' ) ) {
@@ -227,7 +229,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Set up the component entries in the WordPress Admin Bar.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @see BP_Component::setup_nav() for a description of the $wp_admin_nav
 	 *      parameter array.
@@ -289,12 +291,15 @@ class BP_Activity_Component extends BP_Component {
 			}
 
 			// Favorites
-			$wp_admin_nav[] = array(
-				'parent' => 'my-account-' . $this->id,
-				'id'     => 'my-account-' . $this->id . '-favorites',
-				'title'  => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ),
-				'href'   => trailingslashit( $activity_link . 'favorites' )
-			);
+			// Favorite activity items
+			if ( bp_activity_can_favorite() ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-favorites',
+					'title'  => _x( 'Favorites', 'My Account Activity sub nav', 'buddypress' ),
+					'href'   => trailingslashit( $activity_link . 'favorites' )
+				);
+			}
 
 			// Friends?
 			if ( bp_is_active( 'friends' ) ) {
@@ -323,7 +328,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Set up the title for pages and <title>.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @uses bp_is_activity_component()
 	 * @uses bp_is_my_profile()
@@ -352,7 +357,7 @@ class BP_Activity_Component extends BP_Component {
 	/**
 	 * Set up actions necessary for the component.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 */
 	public function setup_actions() {
 		// Spam prevention
@@ -360,6 +365,23 @@ class BP_Activity_Component extends BP_Component {
 
 		parent::setup_actions();
 	}
+
+	/**
+	 * Setup cache groups.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_activity',
+			'bp_activity_comments',
+			'activity_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
index 005b4c759dc9b1a476691e9e8717aff4a50a9dc5..3d14cc217bb49b600b3cd56c3d39819ab8eae502 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php
@@ -8,14 +8,14 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /* Emails *********************************************************************/
 
 /**
  * Send email and BP notifications when a user is mentioned in an update.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_notifications_add_notification()
  * @uses bp_get_user_meta()
@@ -34,9 +34,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook.
  * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook.
  * @uses wp_mail()
- * @uses do_action() To call the 'bp_activity_sent_mention_email' hook
+ * @uses do_action() To call the 'bp_activity_sent_mention_email' hook.
  *
- * @param int $activity_id The ID of the activity update.
+ * @param int $activity_id      The ID of the activity update.
  * @param int $receiver_user_id The ID of the user who is receiving the update.
  */
 function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) {
@@ -99,21 +99,59 @@ To view and respond to the message, log in and visit: %3$s
 			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 		}
 
-		// Send the message
+		/**
+		 * Filters the user email that the @mention notification will be sent to.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $to User email the notification is being sent to.
+		 */
 		$to 	 = apply_filters( 'bp_activity_at_message_notification_to', $to );
+
+		/**
+		 * Filters the @mention notification subject that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $subject     Email notification subject text.
+		 * @param string $poster_name Name of the person who made the @mention.
+		 */
 		$subject = apply_filters( 'bp_activity_at_message_notification_subject', $subject, $poster_name );
+
+		/**
+		 * Filters the @mention notification message that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $message       Email notification message text.
+		 * @param string $poster_name   Name of the person who made the @mention.
+		 * @param string $content       Content of the @mention.
+		 * @param string $message_link  URL permalink for the activity message.
+		 * @param string $settings_link URL permalink for the user's notification settings area.
+		 */
 		$message = apply_filters( 'bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link );
 
 		wp_mail( $to, $subject, $message );
 	}
 
+	/**
+	 * Fires after the sending of an @mention email notification.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param BP_Activity_Activity $activity         Activity Item object.
+	 * @param string               $subject          Email notification subject text.
+	 * @param string               $message          Email notification message text.
+	 * @param string               $content          Content of the @mention.
+	 * @param int                  $receiver_user_id The ID of the user who is receiving the update.
+	 */
 	do_action( 'bp_activity_sent_mention_email', $activity, $subject, $message, $content, $receiver_user_id );
 }
 
 /**
  * Send email and BP notifications when an activity item receives a comment.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_user_meta()
  * @uses bp_core_get_user_displayname()
@@ -125,19 +163,21 @@ To view and respond to the message, log in and visit: %3$s
  * @uses wp_specialchars_decode()
  * @uses get_blog_option()
  * @uses bp_get_root_blog_id()
- * @uses apply_filters() To call the 'bp_activity_new_comment_notification_to' hook
- * @uses apply_filters() To call the 'bp_activity_new_comment_notification_subject' hook
- * @uses apply_filters() To call the 'bp_activity_new_comment_notification_message' hook
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_to' hook.
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_subject' hook.
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_message' hook.
  * @uses wp_mail()
- * @uses do_action() To call the 'bp_activity_sent_reply_to_update_email' hook
- * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_to' hook
- * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_subject' hook
- * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_message' hook
- * @uses do_action() To call the 'bp_activity_sent_reply_to_reply_email' hook
+ * @uses do_action() To call the 'bp_activity_sent_reply_to_update_email' hook.
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_to' hook.
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_subject' hook.
+ * @uses apply_filters() To call the 'bp_activity_new_comment_notification_comment_author_message' hook.
+ * @uses do_action() To call the 'bp_activity_sent_reply_to_reply_email' hook.
+ *
+ * @param int   $comment_id   The comment id.
+ * @param int   $commenter_id The ID of the user who posted the comment.
+ * @param array $params       {@link bp_activity_new_comment()}
  *
- * @param int $comment_id The comment id.
- * @param int $commenter_id The ID of the user who posted the comment.
- * @param array $params {@link bp_activity_new_comment()}
+ * @return bool
  */
 function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) {
 
@@ -177,13 +217,52 @@ To view your original update and all comments, log in and visit: %3$s
 			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 		}
 
-		/* Send the message */
+		/**
+		 * Filters the user email that the new comment notification will be sent to.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $to User email the notification is being sent to.
+		 */
 		$to = apply_filters( 'bp_activity_new_comment_notification_to', $to );
+
+		/**
+		 * Filters the new comment notification subject that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $subject     Email notification subject text.
+		 * @param string $poster_name Name of the person who made the comment.
+		 */
 		$subject = apply_filters( 'bp_activity_new_comment_notification_subject', $subject, $poster_name );
+
+		/**
+		 * Filters the new comment notification message that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $message       Email notification message text.
+		 * @param string $poster_name   Name of the person who made the comment.
+		 * @param string $content       Content of the comment.
+		 * @param string $thread_link   URL permalink for the activity thread.
+		 * @param string $settings_link URL permalink for the user's notification settings area.
+		 */
 		$message = apply_filters( 'bp_activity_new_comment_notification_message', $message, $poster_name, $content, $thread_link, $settings_link );
 
 		wp_mail( $to, $subject, $message );
 
+		/**
+		 * Fires after the sending of a reply to an update email notification.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int    $user_id      ID of the original activity item author.
+		 * @param string $subject      Email notification subject text.
+		 * @param string $message      Email notification message text.
+		 * @param int    $comment_id   ID for the newly received comment.
+		 * @param int    $commenter_id ID of the user who made the comment.
+		 * @param array  $params       Arguments used with the original activity comment.
+		 */
 		do_action( 'bp_activity_sent_reply_to_update_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
 	}
 
@@ -226,22 +305,62 @@ To view the original activity, your comment and all replies, log in and visit: %
 			$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 		}
 
-		/* Send the message */
+		/**
+		 * Filters the user email that the new comment reply notification will be sent to.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $to User email the notification is being sent to.
+		 */
 		$to = apply_filters( 'bp_activity_new_comment_notification_comment_author_to', $to );
+
+		/**
+		 * Filters the new comment reply notification subject that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $subject     Email notification subject text.
+		 * @param string $poster_name Name of the person who made the comment reply.
+		 */
 		$subject = apply_filters( 'bp_activity_new_comment_notification_comment_author_subject', $subject, $poster_name );
+
+		/**
+		 * Filters the new comment reply notification message that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $message       Email notification message text.
+		 * @param string $poster_name   Name of the person who made the comment reply.
+		 * @param string $content       Content of the comment reply.
+		 * @param string $settings_link URL permalink for the user's notification settings area.
+		 * @param string $thread_link   URL permalink for the activity thread.
+		 */
 		$message = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $message, $poster_name, $content, $settings_link, $thread_link );
 
 		wp_mail( $to, $subject, $message );
 
-		do_action( 'bp_activity_sent_reply_to_reply_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params );
+		/**
+		 * Fires after the sending of a reply to a reply email notification.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int    $user_id      ID of the parent activity item author.
+		 * @param string $subject      Email notification subject text.
+		 * @param string $message      Email notification message text.
+		 * @param int    $comment_id   ID for the newly received comment.
+		 * @param int    $commenter_id ID of the user who made the comment.
+		 * @param array  $params       Arguments used with the original activity comment.
+		 */
+		do_action( 'bp_activity_sent_reply_to_reply_email', $parent_comment->user_id, $subject, $message, $comment_id, $commenter_id, $params );
 	}
 }
 
 /**
- * Helper method to map action arguments to function parameters
+ * Helper method to map action arguments to function parameters.
  *
  * @since BuddyPress (1.9.0)
- * @param int $comment_id
+ *
+ * @param int   $comment_id
  * @param array $params
  */
 function bp_activity_new_comment_notification_helper( $comment_id, $params ) {
@@ -254,7 +373,7 @@ add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_
 /**
  * Format notifications related to activity.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_loggedin_user_domain()
  * @uses bp_get_activity_slug()
@@ -263,11 +382,12 @@ add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_
  * @uses apply_filters() To call the 'bp_activity_single_at_mentions_notification' hook.
  * @uses do_action() To call 'activity_format_notifications' hook.
  *
- * @param string $action The type of activity item. Just 'new_at_mention' for now.
- * @param int $item_id The activity ID.
- * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
- * @param int $total_items The total number of notifications to format.
- * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise.
+ * @param string $action            The type of activity item. Just 'new_at_mention' for now.
+ * @param int    $item_id           The activity ID.
+ * @param int    $secondary_item_id In the case of at-mentions, this is the mentioner's ID.
+ * @param int    $total_items       The total number of notifications to format.
+ * @param string $format            'string' to get a BuddyBar-compatible notification, 'array' otherwise.
+ *
  * @return string $return Formatted @mention notification.
  */
 function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
@@ -278,27 +398,69 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id
 			$poster_user_id   = $secondary_item_id;
 			$at_mention_link  = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/';
 			$at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() );
+			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( 'You have %1$d new mentions', 'buddypress' ), (int) $total_items );
-				$filter = 'bp_activity_multiple_at_mentions_notification';
+				$amount = 'multiple';
 			} else {
 				$user_fullname = bp_core_get_user_displayname( $poster_user_id );
 				$text =  sprintf( __( '%1$s mentioned you', 'buddypress' ), $user_fullname );
-				$filter = 'bp_activity_single_at_mentions_notification';
 			}
 		break;
 	}
 
 	if ( 'string' == $format ) {
-		$return = apply_filters( $filter, '<a href="' . esc_url( $at_mention_link ) . '" title="' . esc_attr( $at_mention_title ) . '">' . esc_html( $text ) . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
+
+		/**
+		 * Filters the @mention notification for the string format.
+		 *
+		 * This is a variable filter that is dependent on how many items
+		 * need notified about. The two possible hooks are bp_activity_single_at_mentions_notification
+		 * or bp_activity_multiple_at_mentions_notification.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $string          HTML anchor tag for the mention.
+		 * @param string $at_mention_link The permalink for the mention.
+		 * @param int    $total_items     How many items being notified about.
+		 * @param int    $activity_id     ID of the activity item being formatted.
+		 * @param int    $poster_user_id  ID of the user posting the mention.
+		 */
+		$return = apply_filters( 'bp_activity_' . $amount . '_at_mentions_notification', '<a href="' . esc_url( $at_mention_link ) . '" title="' . esc_attr( $at_mention_title ) . '">' . esc_html( $text ) . '</a>', $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
 	} else {
-		$return = apply_filters( $filter, array(
+
+		/**
+		 * Filters the @mention notification for any non-string format.
+		 *
+		 * This is a variable filter that is dependent on how many items need notified about.
+		 * The two possible hooks are bp_activity_single_at_mentions_notification
+		 * or bp_activity_multiple_at_mentions_notification.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param array  $array           Array holding the content and permalink for the mention notification.
+		 * @param string $at_mention_link The permalink for the mention.
+		 * @param int    $total_items     How many items being notified about.
+		 * @param int    $activity_id     ID of the activity item being formatted.
+		 * @param int    $poster_user_id  ID of the user posting the mention.
+		 */
+		$return = apply_filters( 'bp_activity_' . $amount . '_at_mentions_notification', array(
 			'text' => $text,
 			'link' => $at_mention_link
 		), $at_mention_link, (int) $total_items, $activity_id, $poster_user_id );
 	}
 
+	/**
+	 * Fires right before returning the formatted activity notifications.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $action            The type of activity item.
+	 * @param int    $item_id           The activity ID.
+	 * @param int    $secondary_item_id @mention mentioner ID.
+	 * @param int    $total_items       Total amount of items to format.
+	 */
 	do_action( 'activity_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
 
 	return $return;
@@ -314,11 +476,11 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id
  *
  * @since BuddyPress (1.9.0)
  *
- * @param obj $activity
+ * @param object $activity
  * @param string $subject (not used)
  * @param string $message (not used)
  * @param string $content (not used)
- * @param int $receiver_user_id
+ * @param int    $receiver_user_id
  */
 function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) {
 	if ( bp_is_active( 'notifications' ) ) {
@@ -338,7 +500,7 @@ add_action( 'bp_activity_sent_mention_email', 'bp_activity_at_mention_add_notifi
 /**
  * Mark at-mention notifications as read when users visit their Mentions page.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_notifications_mark_all_notifications_by_type()
  */
@@ -360,6 +522,8 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notificati
  * Mark at-mention notification as read when user visits the activity with the mention.
  *
  * @since BuddyPress (2.0.0)
+ *
+ * @param object BP_Activity_Activity
  */
 function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) {
 	if ( ! bp_is_active( 'notifications' ) ) {
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
index c70363095c2775423b78a5003419c7f6f162fb5d..8ac5f3abf6983274b23ee9a2d13a276f937669bf 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php
@@ -12,12 +12,12 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Load the Activity directory.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_displayed_user_id()
  * @uses bp_is_activity_component()
@@ -31,8 +31,20 @@ function bp_activity_screen_index() {
 	if ( bp_is_activity_directory() ) {
 		bp_update_is_directory( true, 'activity' );
 
+		/**
+		 * Fires right before the loading of the Activity directory screen template file.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_activity_screen_index' );
 
+		/**
+		 * Filters the template to load for the Activity directory screen.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $template Path to the activity template to load.
+		 */
 		bp_core_load_template( apply_filters( 'bp_activity_screen_index', 'activity/index' ) );
 	}
 }
@@ -41,21 +53,35 @@ add_action( 'bp_screens', 'bp_activity_screen_index' );
 /**
  * Load the 'My Activity' page.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses do_action() To call the 'bp_activity_screen_my_activity' hook.
  * @uses bp_core_load_template()
  * @uses apply_filters() To call the 'bp_activity_template_my_activity' hook.
  */
 function bp_activity_screen_my_activity() {
+
+	/**
+	 * Fires right before the loading of the "My Activity" screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'bp_activity_screen_my_activity' );
+
+	/**
+	 * Filters the template to load for the "My Activity" screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the activity template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'members/single/home' ) );
 }
 
 /**
  * Load the 'My Friends' activity page.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_is_active()
  * @uses bp_update_is_item_admin()
@@ -69,69 +95,125 @@ function bp_activity_screen_friends() {
 		return false;
 
 	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
+
+	/**
+	 * Fires right before the loading of the "My Friends" screen template file.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_activity_screen_friends' );
+
+	/**
+	 * Filters the template to load for the "My Friends" screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the activity template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'members/single/home' ) );
 }
 
 /**
  * Load the 'My Groups' activity page.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_is_active()
  * @uses bp_update_is_item_admin()
  * @uses bp_current_user_can()
- * @uses do_action() To call the 'bp_activity_screen_groups' hook
+ * @uses do_action() To call the 'bp_activity_screen_groups' hook.
  * @uses bp_core_load_template()
- * @uses apply_filters() To call the 'bp_activity_template_groups_activity' hook
+ * @uses apply_filters() To call the 'bp_activity_template_groups_activity' hook.
  */
 function bp_activity_screen_groups() {
 	if ( !bp_is_active( 'groups' ) )
 		return false;
 
 	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
+
+	/**
+	 * Fires right before the loading of the "My Groups" screen template file.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_activity_screen_groups' );
+
+	/**
+	 * Filters the template to load for the "My Groups" screen.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $template Path to the activity template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_activity_template_groups_activity', 'members/single/home' ) );
 }
 
 /**
  * Load the 'Favorites' activity page.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_update_is_item_admin()
  * @uses bp_current_user_can()
- * @uses do_action() To call the 'bp_activity_screen_favorites' hook
+ * @uses do_action() To call the 'bp_activity_screen_favorites' hook.
  * @uses bp_core_load_template()
- * @uses apply_filters() To call the 'bp_activity_template_favorite_activity' hook
+ * @uses apply_filters() To call the 'bp_activity_template_favorite_activity' hook.
  */
 function bp_activity_screen_favorites() {
 	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
+
+	/**
+	 * Fires right before the loading of the "Favorites" screen template file.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_activity_screen_favorites' );
+
+	/**
+	 * Filters the template to load for the "Favorites" screen.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $template Path to the activity template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_activity_template_favorite_activity', 'members/single/home' ) );
 }
 
 /**
  * Load the 'Mentions' activity page.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_update_is_item_admin()
  * @uses bp_current_user_can()
- * @uses do_action() To call the 'bp_activity_screen_mentions' hook
+ * @uses do_action() To call the 'bp_activity_screen_mentions' hook.
  * @uses bp_core_load_template()
- * @uses apply_filters() To call the 'bp_activity_template_mention_activity' hook
+ * @uses apply_filters() To call the 'bp_activity_template_mention_activity' hook.
  */
 function bp_activity_screen_mentions() {
 	bp_update_is_item_admin( bp_current_user_can( 'bp_moderate' ), 'activity' );
+
+	/**
+	 * Fires right before the loading of the "Mentions" screen template file.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_activity_screen_mentions' );
+
+	/**
+	 * Filters the template to load for the "Mentions" screen.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $template Path to the activity template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_activity_template_mention_activity', 'members/single/home' ) );
 }
 
 /**
  * Reset the logged-in user's new mentions data when he visits his mentions screen.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_is_my_profile()
  * @uses bp_activity_clear_new_mentions()
@@ -146,9 +228,8 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' )
 /**
  * Load the page for a single activity item.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
- * @global object $bp BuddyPress global settings
  * @uses bp_is_activity_component()
  * @uses bp_activity_get_specific()
  * @uses bp_current_action()
@@ -157,8 +238,8 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' )
  * @uses bp_is_active()
  * @uses groups_get_group()
  * @uses groups_is_user_member()
- * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_access' hook
- * @uses do_action() To call the 'bp_activity_screen_single_activity_permalink' hook
+ * @uses apply_filters_ref_array() To call the 'bp_activity_permalink_access' hook.
+ * @uses do_action() To call the 'bp_activity_screen_single_activity_permalink' hook.
  * @uses bp_core_add_message()
  * @uses is_user_logged_in()
  * @uses bp_core_redirect()
@@ -167,10 +248,10 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' )
  * @uses bp_get_root_domain()
  * @uses bp_get_activity_root_slug()
  * @uses bp_core_load_template()
- * @uses apply_filters() To call the 'bp_activity_template_profile_activity_permalink' hook
+ * @uses apply_filters() To call the 'bp_activity_template_profile_activity_permalink' hook.
  */
 function bp_activity_screen_single_activity_permalink() {
-	global $bp;
+	$bp = buddypress();
 
 	// No displayed user or not viewing activity component
 	if ( !bp_is_activity_component() )
@@ -218,10 +299,23 @@ function bp_activity_screen_single_activity_permalink() {
 		}
 	}
 
-	// Allow access to be filtered
+	/**
+	 * Filters the access permission for a single activity view.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $access Array holding the current $has_access value and current activity item instance.
+	 */
 	$has_access = apply_filters_ref_array( 'bp_activity_permalink_access', array( $has_access, &$activity ) );
 
-	// Allow additional code execution
+	/**
+	 * Fires before the loading of a single activity template file.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param BP_Activity_Activity $activity   Object representing the current activity item being displayed.
+	 * @param bool                 $has_access Whether or not the current user has access to view activity.
+	 */
 	do_action( 'bp_activity_screen_single_activity_permalink', $activity, $has_access );
 
 	// Access is specifically disallowed
@@ -231,11 +325,26 @@ function bp_activity_screen_single_activity_permalink() {
 		bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' );
 
 		// Redirect based on logged in status
-		is_user_logged_in() ?
-			bp_core_redirect( bp_loggedin_user_domain() ) :
-			bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . esc_url( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . bp_current_action() . '/' ) ) );
+		if ( is_user_logged_in() ) {
+			$url = bp_loggedin_user_domain();
+
+		} else {
+			$url = sprintf(
+				site_url( 'wp-login.php?redirect_to=%s' ),
+				urlencode( esc_url_raw( bp_activity_get_permalink( (int) bp_current_action() ) ) )
+			);
+		}
+
+		bp_core_redirect( $url );
 	}
 
+	/**
+	 * Filters the template to load for a single activity screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the activity template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) );
 }
 add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' );
@@ -243,7 +352,7 @@ add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' );
 /**
  * Add activity notifications settings to the notifications settings page.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_user_meta()
  * @uses bp_core_get_username()
@@ -290,7 +399,14 @@ function bp_activity_screen_notification_settings() {
 				<td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php checked( $reply, 'no', true ) ?>/></td>
 			</tr>
 
-			<?php do_action( 'bp_activity_screen_notification_settings' ) ?>
+			<?php
+
+			/**
+			 * Fires inside the closing </tbody> tag for activity screen notification settings.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 */
+			do_action( 'bp_activity_screen_notification_settings' ) ?>
 		</tbody>
 	</table>
 
@@ -298,22 +414,22 @@ function bp_activity_screen_notification_settings() {
 }
 add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 );
 
-/** Theme Compatability *******************************************************/
+/** Theme Compatibility *******************************************************/
 
 /**
  * The main theme compat class for BuddyPress Activity.
  *
- * This class sets up the necessary theme compatability actions to safely output
+ * This class sets up the necessary theme compatibility actions to safely output
  * activity template parts to the_title and the_content areas of a theme.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  */
 class BP_Activity_Theme_Compat {
 
 	/**
 	 * Set up the activity component theme compatibility.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 */
 	public function __construct() {
 		add_action( 'bp_setup_theme_compat', array( $this, 'is_activity' ) );
@@ -322,7 +438,7 @@ class BP_Activity_Theme_Compat {
 	/**
 	 * Set up the theme compatibility hooks, if we're looking at an activity page.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 */
 	public function is_activity() {
 
@@ -334,6 +450,7 @@ class BP_Activity_Theme_Compat {
 		if ( ! bp_displayed_user_id() && ! bp_current_action() ) {
 			bp_update_is_directory( true, 'activity' );
 
+			/** This action is documented in bp-activity/bp-activity-screens.php */
 			do_action( 'bp_activity_screen_index' );
 
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'directory_template_hierarchy' ) );
@@ -355,13 +472,21 @@ class BP_Activity_Theme_Compat {
 	 *
 	 * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
 	 *
-	 * @since BuddyPress (1.8)
+	 * @since BuddyPress (1.8.0)
 	 *
 	 * @param string $templates The templates from bp_get_theme_compat_templates().
+	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function directory_template_hierarchy( $templates ) {
-		// Setup our templates based on priority
+
+		/**
+		 * Filters the template hierarchy for the activity directory page.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $index-directory Array holding template names to be merged into template list.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_activity_directory', array(
 			'activity/index-directory.php'
 		) );
@@ -376,7 +501,7 @@ class BP_Activity_Theme_Compat {
 	/**
 	 * Update the global $post with directory data.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 */
 	public function directory_dummy_post() {
 		bp_theme_compat_reset_post( array(
@@ -395,7 +520,7 @@ class BP_Activity_Theme_Compat {
 	/**
 	 * Filter the_content with the groups index template part.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 */
 	public function directory_content() {
 		return bp_buffer_template_part( 'activity/index', null, false );
@@ -408,13 +533,21 @@ class BP_Activity_Theme_Compat {
 	 *
 	 * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
 	 *
-	 * @since BuddyPress (1.8)
+	 * @since BuddyPress (1.8.0)
 	 *
 	 * @param string $templates The templates from bp_get_theme_compat_templates().
+	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function single_template_hierarchy( $templates ) {
-		// Setup our templates based on priority
+
+		/**
+		 * Filters the template hierarchy for the activity permalink pages.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $index Array holding template names to be merged into template list.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_activity_single_item', array(
 			'activity/single/index.php'
 		) );
@@ -429,7 +562,7 @@ class BP_Activity_Theme_Compat {
 	/**
 	 * Update the global $post with the displayed user's data.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 */
 	public function single_dummy_post() {
 		bp_theme_compat_reset_post( array(
@@ -448,7 +581,7 @@ class BP_Activity_Theme_Compat {
 	/**
 	 * Filter the_content with the members' activity permalink template part.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 */
 	public function single_dummy_content() {
 		return bp_buffer_template_part( 'activity/single/home', null, false );
diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
index d65eac3c3736d91419d40a6a2ebd229324af0304..e73a2598fcabe4580849364c31753ffc16c1f264 100644
--- a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
+++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php
@@ -8,12 +8,12 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the activity component slug.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_slug()
  */
@@ -23,20 +23,28 @@ function bp_activity_slug() {
 	/**
 	 * Return the activity component slug.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @uses apply_filters() To call the 'bp_get_activity_slug' hook.
 	 *
 	 * @return string The activity component slug.
 	 */
 	function bp_get_activity_slug() {
+
+		/**
+		 * Filters the activity component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Activity component slug.
+		 */
 		return apply_filters( 'bp_get_activity_slug', buddypress()->activity->slug );
 	}
 
 /**
  * Output the activity component root slug.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_root_slug()
  */
@@ -46,32 +54,40 @@ function bp_activity_root_slug() {
 	/**
 	 * Return the activity component root slug.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook.
 	 *
 	 * @return string The activity component root slug.
 	 */
 	function bp_get_activity_root_slug() {
+
+		/**
+		 * Filters the activity component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $root_slug Activity component root slug.
+		 */
 		return apply_filters( 'bp_get_activity_root_slug', buddypress()->activity->root_slug );
 	}
 
 /**
  * Output activity directory permalink.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_directory_permalink()
  */
 function bp_activity_directory_permalink() {
-	echo bp_get_activity_directory_permalink();
+	echo esc_url( bp_get_activity_directory_permalink() );
 }
 	/**
-	 * Return activity directory permalink
+	 * Return activity directory permalink.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
-	 * @uses traisingslashit()
+	 * @uses trailingslashit()
 	 * @uses bp_get_root_domain()
 	 * @uses bp_get_activity_root_slug()
 	 * @uses apply_filters() To call the 'bp_get_activity_directory_permalink' hook.
@@ -79,6 +95,14 @@ function bp_activity_directory_permalink() {
 	 * @return string Activity directory permalink.
 	 */
 	function bp_get_activity_directory_permalink() {
+
+		/**
+		 * Filters the activity directory permalink.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $url Permalink url for the activity directory.
+		 */
 		return apply_filters( 'bp_get_activity_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ) );
 	}
 
@@ -87,16 +111,62 @@ function bp_activity_directory_permalink() {
  *
  * This is responsible for loading a group of activity items and displaying them.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  */
 class BP_Activity_Template {
-	var $current_activity = -1;
-	var $activity_count;
-	var $total_activity_count;
-	var $activities;
-	var $activity;
+	/**
+	 * The loop iterator.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var int
+	 */
+	public $current_activity = -1;
 
-	var $in_the_loop;
+	/**
+	 * The activity count.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var int
+	 */
+	public $activity_count;
+
+	/**
+	 * The total activity count.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var int
+	 */
+	public $total_activity_count;
+
+	/**
+	 * Array of activities located by the query.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var array
+	 */
+	public $activities;
+
+	/**
+	 * The activity object currently being iterated on.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var object
+	 */
+	public $activity;
+
+	/**
+	 * A flag for whether the loop is currently being iterated.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var bool
+	 */
+	public $in_the_loop;
 
 	/**
 	 * URL parameter key for activity pagination. Default: 'acpage'.
@@ -104,13 +174,43 @@ class BP_Activity_Template {
 	 * @since BuddyPress (2.1.0)
 	 * @var string
 	 */
-	var $pag_arg;
+	public $pag_arg;
 
-	var $pag_page;
-	var $pag_num;
-	var $pag_links;
+	/**
+	 * The page number being requested.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var int
+	 */
+	public $pag_page;
 
-	var $full_name;
+	/**
+	 * The number of items being requested per page.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var int
+	 */
+	public $pag_num;
+
+	/**
+	 * An HTML string containing pagination links.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var string
+	 */
+	public $pag_links;
+
+	/**
+	 * The displayed user's full name.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @access public
+	 * @var string
+	 */
+	public $full_name;
 
 	/**
 	 * Constructor method.
@@ -126,21 +226,21 @@ class BP_Activity_Template {
 	 *     BP_Activity_Activity::get(), as well as 'page_arg' and
 	 *     'include'. Default values for 'per_page' and 'display_comments'
 	 *     differ from the originating function, and are described below.
-	 *     @type string $page_arg The string used as a query parameter in
-	 *           pagination links. Default: 'acpage'.
-	 *     @type array|bool $include Pass an array of activity IDs to
-	 *           retrieve only those items, or false to noop the 'include'
-	 *           parameter. 'include' differs from 'in' in that 'in' forms
-	 *           an IN clause that works in conjunction with other filters
-	 *           passed to the function, while 'include' is interpreted as
-	 *           an exact list of items to retrieve, which skips all other
-	 *           filter-related parameters. Default: false.
-	 *     @type int|bool $per_page Default: 20.
+	 *     @type string      $page_arg         The string used as a query parameter in
+	 *                                         pagination links. Default: 'acpage'.
+	 *     @type array|bool  $include          Pass an array of activity IDs to
+	 *                                         retrieve only those items, or false to noop the 'include'
+	 *                                         parameter. 'include' differs from 'in' in that 'in' forms
+	 *                                         an IN clause that works in conjunction with other filters
+	 *                                         passed to the function, while 'include' is interpreted as
+	 *                                         an exact list of items to retrieve, which skips all other
+	 *                                         filter-related parameters. Default: false.
+	 *     @type int|bool    $per_page         Default: 20.
 	 *     @type string|bool $display_comments Default: 'threaded'.
 	 * }
 	 */
-	function __construct( $args ) {
-		global $bp;
+	public function __construct( $args ) {
+		$bp = buddypress();
 
 		// Backward compatibility with old method of passing arguments
 		if ( !is_array( $args ) || func_num_args() > 1 ) {
@@ -171,14 +271,17 @@ class BP_Activity_Template {
 			'per_page'          => 20,
 			'page_arg'          => 'acpage',
 			'max'               => false,
+			'count_total'       => false,
 			'sort'              => false,
 			'include'           => false,
 			'exclude'           => false,
 			'in'                => false,
 			'filter'            => false,
+			'scope'             => false,
 			'search_terms'      => false,
 			'meta_query'        => false,
 			'date_query'        => false,
+			'filter_query'      => false,
 			'display_comments'  => 'threaded',
 			'show_hidden'       => false,
 			'spam'              => 'ham_only',
@@ -187,12 +290,12 @@ class BP_Activity_Template {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r );
 
-		$this->pag_arg  = $r['page_arg'];
-		$this->pag_page = isset( $_REQUEST[ $this->pag_arg ] ) ? intval( $_REQUEST[ $this->pag_arg ] ) : $page;
-		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
+		$this->pag_arg  = sanitize_key( $r['page_arg'] );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
 
 		// Check if blog/forum replies are disabled
-		$this->disable_blogforum_replies = isset( $bp->site_options['bp-disable-blogforum-comments'] ) ? $bp->site_options['bp-disable-blogforum-comments'] : false;
+		$this->disable_blogforum_replies = (bool) bp_core_get_root_option( 'bp-disable-blogforum-comments' );
 
 		// Get an array of the logged in user's favorite activities
 		$this->my_favs = maybe_unserialize( bp_get_user_meta( bp_loggedin_user_id(), 'bp_favorite_activities', true ) );
@@ -202,6 +305,7 @@ class BP_Activity_Template {
 			$this->activities = bp_activity_get_specific( array(
 				'activity_ids'      => explode( ',', $include ),
 				'max'               => $max,
+				'count_total'       => $count_total,
 				'page'              => $this->pag_page,
 				'per_page'          => $this->pag_num,
 				'sort'              => $sort,
@@ -216,13 +320,16 @@ class BP_Activity_Template {
 			$this->activities = bp_activity_get( array(
 				'display_comments'  => $display_comments,
 				'max'               => $max,
+				'count_total'       => $count_total,
 				'per_page'          => $this->pag_num,
 				'page'              => $this->pag_page,
 				'sort'              => $sort,
 				'search_terms'      => $search_terms,
 				'meta_query'        => $meta_query,
 				'date_query'        => $date_query,
+				'filter_query'      => $filter_query,
 				'filter'            => $filter,
+				'scope'             => $scope,
 				'show_hidden'       => $show_hidden,
 				'exclude'           => $exclude,
 				'in'                => $in,
@@ -259,31 +366,35 @@ class BP_Activity_Template {
 
 		// Fetch parent content for activity comments so we do not have to query in the loop
 		foreach ( (array) $this->activities as $activity ) {
-			if ( 'activity_comment' != $activity->type )
+			if ( 'activity_comment' != $activity->type ) {
 				continue;
+			}
 
 			$parent_ids[] = $activity->item_id;
 		}
 
-		if ( !empty( $parent_ids ) )
+		if ( !empty( $parent_ids ) ) {
 			$activity_parents = bp_activity_get_specific( array( 'activity_ids' => $parent_ids ) );
+		}
 
 		if ( !empty( $activity_parents['activities'] ) ) {
-			foreach( $activity_parents['activities'] as $parent )
+			foreach( $activity_parents['activities'] as $parent ) {
 				$this->activity_parents[$parent->id] = $parent;
+			}
 
 			unset( $activity_parents );
 		}
 
 		if ( (int) $this->total_activity_count && (int) $this->pag_num ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( $page_arg, '%#%' ),
+				'base'      => add_query_arg( $this->pag_arg, '%#%' ),
 				'format'    => '',
 				'total'     => ceil( (int) $this->total_activity_count / (int) $this->pag_num ),
 				'current'   => (int) $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Activity pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Activity pagination next text', 'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => array(),
 			) );
 		}
 	}
@@ -296,8 +407,9 @@ class BP_Activity_Template {
 	 * @return bool True if there are items in the loop, otherwise false.
 	 */
 	function has_activities() {
-		if ( $this->activity_count )
+		if ( $this->activity_count ) {
 			return true;
+		}
 
 		return false;
 	}
@@ -307,9 +419,9 @@ class BP_Activity_Template {
 	 *
 	 * @return object The next activity item to iterate over.
 	 */
-	function next_activity() {
+	public function next_activity() {
 		$this->current_activity++;
-		$this->activity = $this->activities[$this->current_activity];
+		$this->activity = $this->activities[ $this->current_activity ];
 
 		return $this->activity;
 	}
@@ -317,7 +429,7 @@ class BP_Activity_Template {
 	/**
 	 * Rewind the posts and reset post index.
 	 */
-	function rewind_activities() {
+	public function rewind_activities() {
 		$this->current_activity = -1;
 		if ( $this->activity_count > 0 ) {
 			$this->activity = $this->activities[0];
@@ -336,16 +448,24 @@ class BP_Activity_Template {
 	 * @return bool True if there are more activity items to show,
 	 *              otherwise false.
 	 */
-	function user_activities() {
-		if ( $this->current_activity + 1 < $this->activity_count ) {
+	public function user_activities() {
+		if ( ( $this->current_activity + 1 ) < $this->activity_count ) {
 			return true;
-		} elseif ( $this->current_activity + 1 == $this->activity_count ) {
-			do_action('activity_loop_end');
+		} elseif ( ( $this->current_activity + 1 ) == $this->activity_count ) {
+
+			/**
+			 * Fires right before the rewinding of activity posts.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'activity_loop_end' );
+
 			// Do some cleaning up after the loop
 			$this->rewind_activities();
 		}
 
 		$this->in_the_loop = false;
+
 		return false;
 	}
 
@@ -358,16 +478,25 @@ class BP_Activity_Template {
 	 *
 	 * @see bp_the_activity()
 	 */
-	function the_activity() {
+	public function the_activity() {
 
 		$this->in_the_loop = true;
 		$this->activity    = $this->next_activity();
 
-		if ( is_array( $this->activity ) )
+		if ( is_array( $this->activity ) ) {
 			$this->activity = (object) $this->activity;
+		}
 
-		if ( $this->current_activity == 0 ) // loop has just started
+		// loop has just started
+		if ( $this->current_activity == 0 ) {
+
+			/**
+			 * Fires if the current activity item is the first in the activity loop.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action('activity_loop_start');
+		}
 	}
 }
 
@@ -378,10 +507,9 @@ class BP_Activity_Template {
  * $activities_template global, enabling the use of BuddyPress templates and
  * template functions to display a list of activity items.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
- * @global object $bp BuddyPress global settings.
  * @uses groups_is_user_member()
  * @uses bp_current_action()
  * @uses bp_is_current_action()
@@ -394,168 +522,144 @@ class BP_Activity_Template {
  * @uses bp_activity_get_user_favorites()
  * @uses apply_filters() To call the 'bp_has_activities' hook.
  *
- * @param array $args {
- *     Arguments for limiting the contents of the activity loop. Most
- *     arguments are in the same format as {@link BP_Activity_Activity::get()}.
- *     However, because the format of the arguments accepted here differs in
- *     a number of ways, and because bp_has_activities() determines some
- *     default arguments in a dynamic fashion, we list all accepted arguments
- *     here as well.
- *
- *     Arguments can be passed as an associative array, or as a URL query
- *     string (eg, 'user_id=4&display_comments=threaded').
- *
- *     @type int $page Which page of results to fetch. Using page=1 without
- *           per_page will result in no pagination. Default: 1.
- *     @type int|bool $per_page Number of results per page. Default: 20.
- *     @type string $page_arg The string used as a query parameter in
- *           pagination links. Default: 'acpage'.
- *     @type int|bool $max Maximum number of results to return.
- *           Default: false (unlimited).
- *     @type string $sort 'ASC' or 'DESC'. Default: 'DESC'.
- *     @type array|bool $exclude Array of activity IDs to exclude. Default: false.
- *     @type array|bool $in Array of IDs to limit query by (IN). 'in' is
- *           intended to be used in conjunction with other filter parameters.
- *           Default: false.
- *     @type array|bool $include Array of exact activity IDs to query.
- *           Providing an 'include' array will override all other filters
- *           passed in the argument array. When viewing a the permalink page
- *           for a single activity item, this value defaults to the ID of that
- *           item. Otherwise the default is false.
- *     @type array $meta_query Limit by activitymeta by passing an array of
- *           meta_query conditions. See {@link WP_Meta_Query::queries} for a
- *           description of the syntax.
- *     @type string $search_terms Limit results by a search term. Default: false.
- *     @type string|bool $scope Use one of BuddyPress's pre-built filters. In
- *           each case, the term 'current user' refers to the displayed user
- *           when looking at a user profile, and otherwise to the logged-in user.
- *             - 'just-me' retrieves items belonging only to the logged-in user;
- *               this is equivalent to passing a 'user_id' argument
- *             - 'friends' retrieves items belonging to the friends of the
- *               current user
- *             - 'groups' retrieves items associated with the groups to which
- *               the current user belongs
- *             - 'favorites' retrieves the current user's favorited activity
- *               items
- *             - 'mentions' retrieves activity items where the current user has
- *               received an @-mention
- *           The default value of 'scope' is set to one of the above if that
- *           value appears in the appropriate place in the URL; eg, 'scope' will
- *           be 'groups' when visiting http://example.com/members/joe/activity/groups/.
- *           Otherwise defaults to false.
- *     @type int|array|bool $user_id The ID(s) of user(s) whose activity should
- *           be fetched. Pass a single ID or an array of IDs. When viewing a
- *           user profile page (but not that user's activity subpages, ie My
- *           Friends, My Groups, etc), 'user_id' defaults to the ID of the
- *           displayed user. Otherwise the default is false.
- *     @type string|array|bool $object Filters by the `component` column in the
- *           database, which is generally the component ID in the case of
- *           BuddyPress components, or the plugin slug in the case of plugins.
- *           For example, 'groups' will limit results to those that are
- *           associated with the BP Groups component. Accepts a single
- *           component string, or an array of multiple components. Defaults to
- *           'groups' when viewing the page of a single group, the My Groups
- *           activity filter, or the Activity > Groups filter of a user profile.
- *           Otherwise defaults to false.
- *     @type string|array|bool $action Filters by the `type` column in the
- *           database, which is a string categorizing the activity item (eg,
- *           'new_blog_post', 'created_group'). Accepts a single type string,
- *           or an array of multiple types. Defaults to false.
- *     @type int|array|bool $primary_id Filters by the `item_id` column in the
- *           database. The meaning of 'primary_id' differs between components/
- *           types; for example, in the case of 'created_group', 'primary_id'
- *           is the ID of the group. Accepts a single ID, or an array of
- *           multiple IDs. When viewing a single group, defaults to the current
- *           group ID. When viewing a user's Groups stream page, defaults to
- *           the IDs of the user's groups. Otherwise defaults to false.
- *     @type int|array|bool $secondary_id Filters by the `secondary_item_id`
- *           column in the database. The meaning of 'secondary_id' differs
- *           between components/types. Accepts a single ID, or an array of
- *           multiple IDs. Defaults to false.
- *     @type int $offset Return only activity items with an ID greater than or
- *           equal to this one. Note that providing an offset will disable
- *           pagination. Default: false.
- *     @type string|bool $display_comments How to handle activity comments.
- *           Possible values:
- *             - 'threaded' - comments appear in a threaded tree, under their
- *               parent items
- *             - 'stream' - the activity stream is presented in a flat manner,
- *               with comments sorted in chronological order alongside other
- *               activity items
- *             - false - don't fetch activity comments at all
- *           Default: 'threaded'.
- *     @type bool $show_hidden Whether to show items marked hide_sitewide.
- *           Defaults to false, except in the following cases:
- *             - User is viewing his own activity stream
- *             - User is viewing the activity stream of a non-public group of
- *               which he is a member
- *     @type bool $show_hidden Normally defaults to false, except when:
- *             - a user is viewing his own activity stream
- *             - a user is viewing the activity stream of a non-public group of
- *               which he is a member
- *     @type string|bool $spam Spam status. 'ham_only', 'spam_only', or false
- *           to show all activity regardless of spam status. Default: 'ham_only'.
- *     @type bool $populate_extras Whether to pre-fetch the activity metadata
- *           for the queried items. Default: true.
+ * @param array|string $args {
+ *     Arguments for limiting the contents of the activity loop. Most arguments
+ *     are in the same format as {@link BP_Activity_Activity::get()}. However,
+ *     because the format of the arguments accepted here differs in a number of
+ *     ways, and because bp_has_activities() determines some default arguments in
+ *     a dynamic fashion, we list all accepted arguments here as well.
+ *
+ *     Arguments can be passed as an associative array, or as a URL querystring
+ *     (eg, 'user_id=4&display_comments=threaded').
+ *
+ *     @type int               $page             Which page of results to fetch. Using page=1 without per_page will result
+ *                                               in no pagination. Default: 1.
+ *     @type int|bool          $per_page         Number of results per page. Default: 20.
+ *     @type string            $page_arg         String used as a query parameter in pagination links. Default: 'acpage'.
+ *     @type int|bool          $max              Maximum number of results to return. Default: false (unlimited).
+ *     @type string|bool       $count_total      If true, an additional DB query is run to count the total activity items
+ *                                               for the query. Default: false.
+ *     @type string            $sort             'ASC' or 'DESC'. Default: 'DESC'.
+ *     @type array|bool        $exclude          Array of activity IDs to exclude. Default: false.
+ *     @type array|bool        $in               Array of IDs to limit query by (IN). 'in' is intended to be used in
+ *                                               conjunction with other filter parameters. Default: false.
+ *     @type array|bool        $include          Array of exact activity IDs to query. Providing an 'include' array will
+ *                                               override all other filters passed in the argument array. When viewing the
+ *                                               permalink page for a single activity item, this value defaults to the ID of
+ *                                               that item. Otherwise the default is false.
+ *     @type array             $meta_query       Limit by activitymeta by passing an array of meta_query conditions. See
+ *                                               {@link WP_Meta_Query::queries} for a description of the syntax.
+ *     @type array             $date_query       Limit by date by passing an array of date_query conditions. See first
+ *                                               parameter of {@link WP_Date_Query::__construct()} for syntax.
+ *     @type array             $filter_query     Advanced activity filtering.  See {@link BP_Activity_Query::__construct()}.
+ *     @type string            $search_terms     Limit results by a search term. Default: false.
+ *     @type string            $scope            Use a BuddyPress pre-built filter.
+ *                                                 - 'just-me' retrieves items belonging only to a user; this is equivalent
+ *                                                   to passing a 'user_id' argument.
+ *                                                 - 'friends' retrieves items belonging to the friends of a user.
+ *                                                 - 'groups' retrieves items belonging to groups to which a user belongs to.
+ *                                                 - 'favorites' retrieves a user's favorited activity items.
+ *                                                 - 'mentions' retrieves items where a user has received an @-mention.
+ *                                               The default value of 'scope' is set to one of the above if that value
+ *                                               appears in the appropriate place in the URL; eg, 'scope' will be 'groups'
+ *                                               when visiting http://example.com/members/joe/activity/groups/. Otherwise
+ *                                               defaults to false.
+ *     @type int|array|bool    $user_id          The ID(s) of user(s) whose activity should be fetched. Pass a single ID or
+ *                                               an array of IDs. When viewing a user profile page (but not that user's
+ *                                               activity subpages, ie My Friends, My Groups, etc), 'user_id' defaults to
+ *                                               the ID of the displayed user. Otherwise the default is false.
+ *     @type string|array|bool $object           Filters by the `component` column in the database, which is generally the
+ *                                               component ID in the case of BuddyPress components, or the plugin slug in
+ *                                               the case of plugins. For example, 'groups' will limit results to those that
+ *                                               are associated with the BP Groups component. Accepts a single component
+ *                                               string, or an array of multiple components. Defaults to 'groups' when
+ *                                               viewing the page of a single group, the My Groups activity filter, or the
+ *                                               Activity > Groups filter of a user profile. Otherwise defaults to false.
+ *     @type string|array|bool $action           Filters by the `type` column in the database, which is a string
+ *                                               categorizing the activity item (eg, 'new_blog_post', 'created_group').
+ *                                               Accepts a comma-delimited string or an array of types. Default: false.
+ *     @type int|array|bool    $primary_id       Filters by the `item_id` column in the database. The meaning of
+ *                                               'primary_id' differs between components/types; for example, in the case of
+ *                                               'created_group', 'primary_id' is the ID of the group. Accepts a single ID,
+ *                                               or an array of multiple IDs. When viewing a single group, defaults to the
+ *                                               current group ID. When viewing a user's Groups stream page, defaults to the
+ *                                               IDs of the user's groups. Otherwise defaults to false.
+ *     @type int|array|bool    $secondary_id     Filters by the `secondary_item_id` column in the database. The meaning of
+ *                                               'secondary_id' differs between components/types. Accepts a single ID, or an
+ *                                               array of multiple IDs. Defaults to false.
+ *     @type int               $offset           Return only activity items with an ID greater than or equal to this one.
+ *                                               Note that providing an offset will disable pagination. Default: false.
+ *     @type string|bool       $display_comments How to handle activity comments. Possible values:
+ *                                                 - 'threaded' - comments appear in a threaded tree, under their parent
+ *                                                   items.
+ *                                                 - 'stream' - the activity stream is presented in a flat manner, with
+ *                                                   comments sorted in chronological order alongside other activity items.
+ *                                                 - false - don't fetch activity comments at all.
+ *                                               Default: 'threaded'.
+ *     @type bool              $show_hidden      Whether to show items marked hide_sitewide. Defaults to false, except in
+ *                                               the following cases:
+ *                                                 - User is viewing his own activity stream.
+ *                                                 - User is viewing the activity stream of a non-public group of which he
+ *                                                   is a member.
+ *     @type string|bool       $spam             Spam status. 'ham_only', 'spam_only', or false to show all activity
+ *                                               regardless of spam status. Default: 'ham_only'.
+ *     @type bool              $populate_extras  Whether to pre-fetch the activity metadata for the queried items.
+ *                                               Default: true.
  * }
  * @return bool Returns true when activities are found, otherwise false.
  */
 function bp_has_activities( $args = '' ) {
-	global $activities_template, $bp;
+	global $activities_template;
 
-	/***
-	 * Set the defaults based on the current page. Any of these will be overridden
-	 * if arguments are directly passed into the loop. Custom plugins should always
-	 * pass their parameters directly to the loop.
-	 */
-	$user_id     = false;
-	$include     = false;
-	$exclude     = false;
-	$in          = false;
-	$show_hidden = false;
-	$object      = false;
-	$primary_id  = false;
+	// Get BuddyPress
+	$bp = buddypress();
+
+	/** Smart Defaults ********************************************************/
 
 	// User filtering
-	if ( bp_displayed_user_id() )
-		$user_id = bp_displayed_user_id();
+	$user_id = bp_displayed_user_id()
+		? bp_displayed_user_id()
+		: false;
 
 	// Group filtering
-	if ( !empty( $bp->groups->current_group ) ) {
-		$object = $bp->groups->id;
-		$primary_id = $bp->groups->current_group->id;
-
-		if ( groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) || bp_current_user_can( 'bp_moderate' ) ) {
-			$show_hidden = true;
-		}
+	if ( bp_is_group() ) {
+		$object      = $bp->groups->id;
+		$primary_id  = bp_get_current_group_id();
+		$show_hidden = (bool) ( groups_is_user_member( bp_loggedin_user_id(), $primary_id ) || bp_current_user_can( 'bp_moderate' ) );
+	} else {
+		$object      = false;
+		$primary_id  = false;
+		$show_hidden = false;
 	}
 
 	// The default scope should recognize custom slugs
-	if ( array_key_exists( bp_current_action(), (array) $bp->loaded_components ) ) {
-		$scope = $bp->loaded_components[bp_current_action()];
-	}
-	else
-		$scope = bp_current_action();
+	$scope = array_key_exists( bp_current_action(), (array) $bp->loaded_components )
+		? $bp->loaded_components[ bp_current_action() ]
+		: bp_current_action();
 
 	// Support for permalinks on single item pages: /groups/my-group/activity/124/
-	if ( bp_is_current_action( bp_get_activity_slug() ) )
-		$include = bp_action_variable( 0 );
+	$include = bp_is_current_action( bp_get_activity_slug() )
+		? bp_action_variable( 0 )
+		: false;
+
+	/** Parse Args ************************************************************/
 
-	// Note: any params used for filtering can be a single value, or multiple values comma separated.
-	$defaults = array(
+	// Note: any params used for filtering can be a single value, or multiple
+	// values comma separated.
+	$r = bp_parse_args( $args, array(
 		'display_comments'  => 'threaded',   // false for none, stream/threaded - show comments in the stream or threaded under items
 		'include'           => $include,     // pass an activity_id or string of IDs comma-separated
-		'exclude'           => $exclude,     // pass an activity_id or string of IDs comma-separated
-		'in'                => $in,          // comma-separated list or array of activity IDs among which to search
+		'exclude'           => false,        // pass an activity_id or string of IDs comma-separated
+		'in'                => false,        // comma-separated list or array of activity IDs among which to search
 		'sort'              => 'DESC',       // sort DESC or ASC
 		'page'              => 1,            // which page to load
 		'per_page'          => 20,           // number of items per page
+		'page_arg'          => 'acpage',     // See https://buddypress.trac.wordpress.org/ticket/3679
 		'max'               => false,        // max number to return
+		'count_total'       => false,
 		'show_hidden'       => $show_hidden, // Show activity items that are hidden site-wide?
 		'spam'              => 'ham_only',   // Hide spammed items
 
-		'page_arg'          => 'acpage',     // See https://buddypress.trac.wordpress.org/ticket/3679
-
 		// Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
 		'scope'             => $scope,
 
@@ -570,135 +674,92 @@ function bp_has_activities( $args = '' ) {
 
 		'meta_query'        => false,        // filter on activity meta. See WP_Meta_Query for format
 		'date_query'        => false,        // filter by date. See first parameter of WP_Date_Query for format
+		'filter_query'      => false,        // advanced filtering.  See BP_Activity_Query for format
 
 		// Searching
 		'search_terms'      => false,        // specify terms to search on
 		'update_meta_cache' => true,
-	);
+	), 'has_activities' );
 
-	$r = bp_parse_args( $args, $defaults, 'has_activities' );
-	extract( $r );
+	/** Smart Overrides *******************************************************/
 
 	// Translate various values for 'display_comments'
 	// This allows disabling comments via ?display_comments=0
 	// or =none or =false. Final true is a strict type check. See #5029
-	if ( in_array( $display_comments, array( 0, '0', 'none', 'false' ), true ) ) {
-		$display_comments = false;
+	if ( in_array( $r['display_comments'], array( 0, '0', 'none', 'false' ), true ) ) {
+		$r['display_comments'] = false;
 	}
 
 	// Ignore pagination if an offset is passed
-	if ( ! empty( $offset ) ) {
-		$page = 0;
+	if ( ! empty( $r['offset'] ) ) {
+		$r['page'] = 0;
 	}
 
-	if ( empty( $search_terms ) && ! empty( $_REQUEST['s'] ) )
-		$search_terms = $_REQUEST['s'];
-
-	// If you have passed a "scope" then this will override any filters you have passed.
-	if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) {
-		if ( 'just-me' == $scope )
-			$display_comments = 'stream';
-
-		// determine which user_id applies
-		if ( empty( $user_id ) )
-			$user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id();
-
-		// are we displaying user specific activity?
-		if ( is_numeric( $user_id ) ) {
-			$show_hidden = ( $user_id == bp_loggedin_user_id() && $scope != 'friends' ) ? 1 : 0;
+	// Search terms
+	if ( ! empty( $_REQUEST['s'] ) && empty( $r['search_terms'] ) ) {
+		$r['search_terms'] = $_REQUEST['s'];
+	}
 
-			switch ( $scope ) {
-				case 'friends':
-					if ( bp_is_active( 'friends' ) )
-						$friends = friends_get_friend_user_ids( $user_id );
-						if ( empty( $friends ) )
-							return false;
+	// Do not exceed the maximum per page
+	if ( ! empty( $r['max'] ) && ( (int) $r['per_page'] > (int) $r['max'] ) ) {
+		$r['per_page'] = $r['max'];
+	}
 
-						$user_id = implode( ',', (array) $friends );
-					break;
-				case 'groups':
-					if ( bp_is_active( 'groups' ) ) {
-						$groups = groups_get_user_groups( $user_id );
-						if ( empty( $groups['groups'] ) )
-							return false;
+	/**
+	 * Filters whether BuddyPress should enable afilter support.
+	 *
+	 * Support for basic filters in earlier BP versions is disabled by default.
+	 * To enable, put add_filter( 'bp_activity_enable_afilter_support', '__return_true' );
+	 * into bp-custom.php or your theme's functions.php.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value True if BuddyPress should enable afilter support.
+	 */
+	if ( isset( $_GET['afilter'] ) && apply_filters( 'bp_activity_enable_afilter_support', false ) ) {
+		$r['filter'] = array(
+			'object' => $_GET['afilter']
+		);
+	} elseif ( ! empty( $r['user_id'] ) || ! empty( $r['object'] ) || ! empty( $r['action'] ) || ! empty( $r['primary_id'] ) || ! empty( $r['secondary_id'] ) || ! empty( $r['offset'] ) || ! empty( $r['since'] ) ) {
+		$r['filter'] = array(
+			'user_id'      => $r['user_id'],
+			'object'       => $r['object'],
+			'action'       => $r['action'],
+			'primary_id'   => $r['primary_id'],
+			'secondary_id' => $r['secondary_id'],
+			'offset'       => $r['offset'],
+			'since'        => $r['since']
+		);
+	} else {
+		$r['filter'] = false;
+	}
 
-						$object = $bp->groups->id;
-						$primary_id = implode( ',', (array) $groups['groups'] );
+	// If specific activity items have been requested, override the $hide_spam
+	// argument. This prevents backpat errors with AJAX.
+	if ( ! empty( $r['include'] ) && ( 'ham_only' === $r['spam'] ) ) {
+		$r['spam'] = 'all';
+	}
 
-						$user_id = 0;
-					}
-					break;
-				case 'favorites':
-					$favs = bp_activity_get_user_favorites( $user_id );
-					if ( empty( $favs ) )
-						return false;
-
-					$in = implode( ',', (array) $favs );
-					$display_comments = true;
-					$user_id = 0;
-					break;
-				case 'mentions':
-
-					// Are mentions disabled?
-					if ( ! bp_activity_do_mentions() ) {
-						return false;
-					}
+	/** Query *****************************************************************/
 
-					// Start search at @ symbol and stop search at closing tag delimiter.
-					$search_terms     = '@' . bp_activity_get_user_mentionname( $user_id ) . '<';
-					$display_comments = 'stream';
-					$user_id = 0;
-					break;
-			}
-		}
-	}
+	$activities_template = new BP_Activity_Template( $r );
 
-	// Do not exceed the maximum per page
-	if ( !empty( $max ) && ( (int) $per_page > (int) $max ) )
-		$per_page = $max;
-
-	// Support for basic filters in earlier BP versions is disabled by default. To enable, put
-	//   add_filter( 'bp_activity_enable_afilter_support', '__return_true' );
-	// into bp-custom.php or your theme's functions.php
-	if ( isset( $_GET['afilter'] ) && apply_filters( 'bp_activity_enable_afilter_support', false ) )
-		$filter = array( 'object' => $_GET['afilter'] );
-	else if ( ! empty( $user_id ) || ! empty( $object ) || ! empty( $action ) || ! empty( $primary_id ) || ! empty( $secondary_id ) || ! empty( $offset ) || ! empty( $since ) )
-		$filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id, 'offset' => $offset, 'since' => $since );
-	else
-		$filter = false;
-
-	// If specific activity items have been requested, override the $hide_spam argument. This prevents backpat errors with AJAX.
-	if ( !empty( $include ) && ( 'ham_only' == $spam ) )
-		$spam = 'all';
-
-	$template_args = array(
-		'page'              => $page,
-		'per_page'          => $per_page,
-		'page_arg'          => $page_arg,
-		'max'               => $max,
-		'sort'              => $sort,
-		'include'           => $include,
-		'exclude'           => $exclude,
-		'in'                => $in,
-		'filter'            => $filter,
-		'search_terms'      => $search_terms,
-		'meta_query'        => $meta_query,
-		'date_query'        => $date_query,
-		'display_comments'  => $display_comments,
-		'show_hidden'       => $show_hidden,
-		'spam'              => $spam,
-		'update_meta_cache' => $update_meta_cache,
-	);
-
-	$activities_template = new BP_Activity_Template( $template_args );
-
-	return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template, $template_args );
+	/**
+	 * Filters whether or not there are activity items to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool   $value               Whether or not there are activity items to display.
+	 * @param string $activities_template Current activities template being used.
+	 * @param array  $r                   Array of arguments passed into the BP_Activity_Template class.
+	 */
+	return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template, $r );
 }
 
 /**
  * Determine if there are still activities left in the loop.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses BP_Activity_Template::user_activities() {@link BP_Activity_Template::user_activities()}
@@ -713,7 +774,7 @@ function bp_activities() {
 /**
  * Get the current activity object in the loop.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
@@ -731,21 +792,35 @@ function bp_the_activity() {
  * @since BuddyPress (2.1.0)
  */
 function bp_activity_load_more_link() {
-	echo bp_get_activity_load_more_link();
+	echo esc_url( bp_get_activity_load_more_link() );
 }
+	/**
+	 * Get the URL for the Load More link.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 */
 	function bp_get_activity_load_more_link() {
 		global $activities_template;
 
-		$link = bp_get_requested_url();
-		$link = add_query_arg( $activities_template->pag_arg, $activities_template->pag_page + 1, $link );
+		$url  = bp_get_requested_url();
+		$link = add_query_arg( $activities_template->pag_arg, $activities_template->pag_page + 1, $url );
 
-		return apply_filters( 'bp_get_activity_load_more_link', $link );
+		/**
+		 * Filters the Load More link URL.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $link                The "Load More" link URL with appropriate query args.
+		 * @param string $url                 The original URL.
+		 * @param object $activities_template The activity template loop global.
+		 */
+		return apply_filters( 'bp_get_activity_load_more_link', $link, $url, $activities_template );
 	}
 
 /**
  * Output the activity pagination count.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
@@ -757,7 +832,7 @@ function bp_activity_pagination_count() {
 	/**
 	 * Return the activity pagination count.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_core_number_format()
@@ -772,13 +847,19 @@ function bp_activity_pagination_count() {
 		$to_num    = bp_core_number_format( ( $start_num + ( $activities_template->pag_num - 1 ) > $activities_template->total_activity_count ) ? $activities_template->total_activity_count : $start_num + ( $activities_template->pag_num - 1 ) );
 		$total     = bp_core_number_format( $activities_template->total_activity_count );
 
-		return sprintf( _n( 'Viewing 1 item', 'Viewing %1$s - %2$s of %3$s items', $total, 'buddypress' ), $from_num, $to_num, $total );
+		if ( 1 == $activities_template->total_activity_count ) {
+			$message = __( 'Viewing 1 item', 'buddypress' );
+		} else {
+			$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s item', 'Viewing %1$s - %2$s of %3$s items', $activities_template->total_activity_count, 'buddypress' ), $from_num, $to_num, $total );
+		}
+
+		return $message;
 	}
 
 /**
  * Output the activity pagination links.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activity_pagination_links()
  */
@@ -789,7 +870,7 @@ function bp_activity_pagination_links() {
 	/**
 	 * Return the activity pagination links.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_pagination_links' hook.
@@ -799,13 +880,20 @@ function bp_activity_pagination_links() {
 	function bp_get_activity_pagination_links() {
 		global $activities_template;
 
+		/**
+		 * Filters the activity pagination link output.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $pag_links Output for the activity pagination links.
+		 */
 		return apply_filters( 'bp_get_activity_pagination_links', $activities_template->pag_links );
 	}
 
 /**
  * Return true when there are more activity items to be shown than currently appear.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses apply_filters() To call the 'bp_activity_has_more_items' hook.
@@ -827,13 +915,20 @@ function bp_activity_has_more_items() {
 		$has_more_items = (int) $remaining_pages > 0;
 	}
 
+	/**
+	 * Filters whether there are more activity items to display.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $has_more_items Whether or not there are more activity items to display.
+	 */
 	return apply_filters( 'bp_activity_has_more_items', $has_more_items );
 }
 
 /**
  * Output the activity count.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_count()
  */
@@ -844,7 +939,7 @@ function bp_activity_count() {
 	/**
 	 * Return the activity count.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_count' hook.
@@ -854,13 +949,20 @@ function bp_activity_count() {
 	function bp_get_activity_count() {
 		global $activities_template;
 
+		/**
+		 * Filters the activity count for the activity template.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $activity_count The count for total activity.
+		 */
 		return apply_filters( 'bp_get_activity_count', (int) $activities_template->activity_count );
 	}
 
 /**
  * Output the number of activities per page.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_per_page()
  */
@@ -871,7 +973,7 @@ function bp_activity_per_page() {
 	/**
 	 * Return the number of activities per page.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_per_page' hook.
@@ -881,13 +983,20 @@ function bp_activity_per_page() {
 	function bp_get_activity_per_page() {
 		global $activities_template;
 
+		/**
+		 * Filters the activity posts per page value.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $pag_num How many post should be displayed for pagination.
+		 */
 		return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num );
 	}
 
 /**
  * Output the activities title.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activities_title()
  * @todo Deprecate.
@@ -899,24 +1008,31 @@ function bp_activities_title() {
 	/**
 	 * Return the activities title.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global string $bp_activity_title
 	 * @uses apply_filters() To call the 'bp_get_activities_title' hook.
 	 * @todo Deprecate.
 	 *
-	 * @return int The activities title.
+	 * @return string The activities title.
 	 */
 	function bp_get_activities_title() {
 		global $bp_activity_title;
 
+		/**
+		 * Filters the activities title for the activity template.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $bp_activity_title The title to be displayed.
+		 */
 		return apply_filters( 'bp_get_activities_title', $bp_activity_title );
 	}
 
 /**
  * {@internal Missing Description}
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activities_no_activity()
  * @todo Deprecate.
@@ -928,10 +1044,10 @@ function bp_activities_no_activity() {
 	/**
 	 * {@internal Missing Description}
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global string $bp_activity_no_activity
-	 * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook
+	 * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook.
 	 * @todo Deprecate.
 	 *
 	 * @return string
@@ -939,13 +1055,20 @@ function bp_activities_no_activity() {
 	function bp_get_activities_no_activity() {
 		global $bp_activity_no_activity;
 
+		/**
+		 * Filters the text used when there is no activity to display.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $bp_activity_no_activity Text to display for no activity.
+		 */
 		return apply_filters( 'bp_get_activities_no_activity', $bp_activity_no_activity );
 	}
 
 /**
  * Output the activity ID.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_id()
  */
@@ -956,7 +1079,7 @@ function bp_activity_id() {
 	/**
 	 * Return the activity ID.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_id' hook.
@@ -965,13 +1088,21 @@ function bp_activity_id() {
 	 */
 	function bp_get_activity_id() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity ID being displayed.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $id The activity ID.
+		 */
 		return apply_filters( 'bp_get_activity_id', $activities_template->activity->id );
 	}
 
 /**
  * Output the activity item ID.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_item_id()
  */
@@ -982,7 +1113,7 @@ function bp_activity_item_id() {
 	/**
 	 * Return the activity item ID.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_item_id' hook.
@@ -991,13 +1122,21 @@ function bp_activity_item_id() {
 	 */
 	function bp_get_activity_item_id() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity item ID being displayed.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $item_id The activity item ID.
+		 */
 		return apply_filters( 'bp_get_activity_item_id', $activities_template->activity->item_id );
 	}
 
 /**
  * Output the activity secondary item ID.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_secondary_item_id()
  */
@@ -1008,7 +1147,7 @@ function bp_activity_secondary_item_id() {
 	/**
 	 * Return the activity secondary item ID.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_secondary_item_id' hook.
@@ -1017,13 +1156,21 @@ function bp_activity_secondary_item_id() {
 	 */
 	function bp_get_activity_secondary_item_id() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity secondary item ID being displayed.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $secondary_item_id The activity secondary item ID.
+		 */
 		return apply_filters( 'bp_get_activity_secondary_item_id', $activities_template->activity->secondary_item_id );
 	}
 
 /**
  * Output the date the activity was recorded.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_date_recorded()
  */
@@ -1034,7 +1181,7 @@ function bp_activity_date_recorded() {
 	/**
 	 * Return the date the activity was recorded.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_date_recorded' hook.
@@ -1043,11 +1190,19 @@ function bp_activity_date_recorded() {
 	 */
 	function bp_get_activity_date_recorded() {
 		global $activities_template;
+
+		/**
+		 * Filters the date the activity was recorded.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $date_recorded The activity's date.
+		 */
 		return apply_filters( 'bp_get_activity_date_recorded', $activities_template->activity->date_recorded );
 	}
 
 /**
- * Output the display name of the member who posted the activity
+ * Output the display name of the member who posted the activity.
  *
  * @since BuddyPress (2.1.0)
  *
@@ -1058,7 +1213,7 @@ function bp_activity_member_display_name() {
 }
 
 	/**
-	 * Return the display name of the member who posted the activity
+	 * Return the display name of the member who posted the activity.
 	 *
 	 * @since BuddyPress (2.1.0)
 	 *
@@ -1074,13 +1229,20 @@ function bp_activity_member_display_name() {
 			? $activities_template->activity->display_name
 			: '';
 
+		/**
+		 * Filters the display name of the member who posted the activity.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param int $retval Display name for the member who posted.
+		 */
 		return apply_filters( 'bp_get_activity_member_display_name', $retval );
 	}
 
 /**
  * Output the activity object name.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_object_name()
  */
@@ -1091,7 +1253,7 @@ function bp_activity_object_name() {
 	/**
 	 * Return the activity object name.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_object_name' hook.
@@ -1100,13 +1262,21 @@ function bp_activity_object_name() {
 	 */
 	function bp_get_activity_object_name() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity object name.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $activity_component The activity object name.
+		 */
 		return apply_filters( 'bp_get_activity_object_name', $activities_template->activity->component );
 	}
 
 /**
  * Output the activity type.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_type()
  */
@@ -1117,7 +1287,7 @@ function bp_activity_type() {
 	/**
 	 * Return the activity type.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_type' hook.
@@ -1126,6 +1296,14 @@ function bp_activity_type() {
 	 */
 	function bp_get_activity_type() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity type.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $activity_type The activity type.
+		 */
 		return apply_filters( 'bp_get_activity_type', $activities_template->activity->type );
 	}
 
@@ -1134,8 +1312,8 @@ function bp_activity_type() {
 	 *
 	 * Just a wrapper for bp_activity_type().
 	 *
-	 * @since BuddyPress (1.2)
-	 * @deprecated BuddyPress (1.5)
+	 * @since BuddyPress (1.2.0)
+	 * @deprecated BuddyPress (1.5.0)
 	 *
 	 * @todo Properly deprecate in favor of bp_activity_type() and
 	 *		 remove redundant echo
@@ -1149,8 +1327,8 @@ function bp_activity_type() {
 	 *
 	 * Just a wrapper for bp_get_activity_type().
 	 *
-	 * @since BuddyPress (1.2)
-	 * @deprecated BuddyPress (1.5)
+	 * @since BuddyPress (1.2.0)
+	 * @deprecated BuddyPress (1.5.0)
 	 *
 	 * @todo Properly deprecate in favor of bp_get_activity_type().
 	 *
@@ -1163,7 +1341,7 @@ function bp_activity_type() {
 /**
  * Output the activity user ID.
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @uses bp_get_activity_user_id()
  */
@@ -1174,7 +1352,7 @@ function bp_activity_user_id() {
 	/**
 	 * Return the activity user ID.
 	 *
-	 * @since BuddyPress (1.1)
+	 * @since BuddyPress (1.1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_user_id' hook.
@@ -1183,13 +1361,21 @@ function bp_activity_user_id() {
 	 */
 	function bp_get_activity_user_id() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity user ID.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $user_id The activity user ID.
+		 */
 		return apply_filters( 'bp_get_activity_user_id', $activities_template->activity->user_id );
 	}
 
 /**
  * Output the activity user link.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_user_link()
  */
@@ -1200,7 +1386,7 @@ function bp_activity_user_link() {
 	/**
 	 * Return the activity user link.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_core_get_user_domain()
@@ -1217,18 +1403,25 @@ function bp_activity_user_link() {
 			$link = bp_core_get_user_domain( $activities_template->activity->user_id, $activities_template->activity->user_nicename, $activities_template->activity->user_login );
 		}
 
+		/**
+		 * Filters the activity user link.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $link The activity user link.
+		 */
 		return apply_filters( 'bp_get_activity_user_link', $link );
 	}
 
 /**
  * Output the avatar of the user that performed the action.
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @see bp_get_activity_avatar() for description of arguments.
  * @uses bp_get_activity_avatar()
  *
- * @param array $args See {@link bp_get_activity_avatar()} for description.
+ * @param array|string $args See {@link bp_get_activity_avatar()} for description.
  */
 function bp_activity_avatar( $args = '' ) {
 	echo bp_get_activity_avatar( $args );
@@ -1236,30 +1429,29 @@ function bp_activity_avatar( $args = '' ) {
 	/**
 	 * Return the avatar of the user that performed the action.
 	 *
-	 * @since BuddyPress (1.1)
+	 * @since BuddyPress (1.1.0)
 	 *
 	 * @see bp_core_fetch_avatar() For a description of the arguments.
 	 * @global object $activities_template {@link BP_Activity_Template}
-	 * @global object $bp BuddyPress global settings
 	 * @uses bp_is_single_activity()
 	 * @uses wp_parse_args()
-	 * @uses apply_filters() To call the 'bp_get_activity_avatar_object_' . $current_activity_item->component hook
-	 * @uses apply_filters() To call the 'bp_get_activity_avatar_item_id' hook
+	 * @uses apply_filters() To call the 'bp_get_activity_avatar_object_' . $current_activity_item->component hook.
+	 * @uses apply_filters() To call the 'bp_get_activity_avatar_item_id' hook.
 	 * @uses bp_core_fetch_avatar()
-	 * @uses apply_filters() To call the 'bp_get_activity_avatar' hook
+	 * @uses apply_filters() To call the 'bp_get_activity_avatar' hook.
 	 *
-	 * @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()}.
-	 *     @type string $alt Default: 'Profile picture of [user name]' if
-	 *           activity user name is available, otherwise 'Profile picture'.
-	 *     @type string $class Default: 'avatar'.
-	 *     @type string|bool $email Default: Email of the activity's
-	 *           associated user, if available. Otherwise false.
-	 *     @type string $type Default: 'full' when viewing a single activity
-	 *           permalink page, otherwise 'thumb'.
-	 *     @type int|bool $user_id Default: ID of the activity's user.
+	 *     @type string      $alt     Default: 'Profile picture of [user name]' if
+	 *                                activity user name is available, otherwise 'Profile picture'.
+	 *     @type string      $class   Default: 'avatar'.
+	 *     @type string|bool $email   Default: Email of the activity's
+	 *                                associated user, if available. Otherwise false.
+	 *     @type string      $type    Default: 'full' when viewing a single activity
+	 *                                permalink page, otherwise 'thumb'.
+	 *     @type int|bool    $user_id Default: ID of the activity's user.
 	 * }
 	 * @return string User avatar string.
 	 */
@@ -1309,15 +1501,41 @@ function bp_activity_avatar( $args = '' ) {
 			}
 		}
 
-		// Primary activity avatar is always a user, but can be modified via a filter
+		/**
+		 * Filters the activity avatar object based on current activity item component.
+		 *
+		 * This is a variable filter dependent on the component used.
+		 * Possible hooks are bp_get_activity_avatar_object_blog,
+		 * bp_get_activity_avatar_object_group, and bp_get_activity_avatar_object_user.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $component Component being displayed.
+		 */
 		$object  = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' );
 		$item_id = !empty( $user_id ) ? $user_id : $current_activity_item->user_id;
+
+		/**
+		 * Filters the activity avatar item ID.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param int $item_id Item ID for the activity avatar.
+		 */
 		$item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id );
 
-		// If this is a user object pass the users' email address for Gravatar so we don't have to refetch it.
-		if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $current_activity_item->user_email ) )
+		// If this is a user object pass the users' email address for Gravatar so we don't have to prefetch it.
+		if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $current_activity_item->user_email ) ) {
 			$email = $current_activity_item->user_email;
+		}
 
+		/**
+		 * Filters the value returned by bp_core_fetch_avatar.
+		 *
+		 * @since BuddyPress (1.1.3)
+		 *
+		 * @param array $value Array of arguments calculated for use with bp_core_fetch_avatar.
+		 */
 		return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array(
 			'item_id' => $item_id,
 			'object'  => $object,
@@ -1333,21 +1551,21 @@ function bp_activity_avatar( $args = '' ) {
 /**
  * Output the avatar of the object that action was performed on.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_activity_secondary_avatar() for description of arguments.
  * @uses bp_get_activity_secondary_avatar()
  *
- * @param array $args See {@link bp_get_activity_secondary_avatar} for description.
+ * @param array|string $args See {@link bp_get_activity_secondary_avatar} for description.
  */
 function bp_activity_secondary_avatar( $args = '' ) {
 	echo bp_get_activity_secondary_avatar( $args );
 }
 
 	/**
-	 * Return the avatar of the object that action was performed on
+	 * Return the avatar of the object that action was performed on.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @see bp_core_fetch_avatar() for description of arguments.
 	 * @global object $activities_template {@link BP_Activity_Template}
@@ -1358,15 +1576,15 @@ function bp_activity_secondary_avatar( $args = '' ) {
 	 * @uses bp_core_fetch_avatar()
 	 * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar' hook.
 	 *
-	 * @param array $args  {
+	 * @param array|string $args  {
 	 *     For a complete description of arguments, see {@link bp_core_fetch_avatar()}.
-	 *     @type string $alt Default value varies based on current activity
-	 *           item component.
-	 *     @type string $type Default: 'full' when viewing a single activity
-	 *           permalink page, otherwise 'thumb'.
-	 *     @type string $class Default: 'avatar'.
-	 *     @type string|bool $email Default: email of the activity's user.
-	 *     @type int|bool $user_id Default: ID of the activity's user.
+	 *     @type string      $alt     Default value varies based on current activity
+	 *                                item component.
+	 *     @type string      $type    Default: 'full' when viewing a single activity
+	 *                                permalink page, otherwise 'thumb'.
+	 *     @type string      $class   Default: 'avatar'.
+	 *     @type string|bool $email   Default: email of the activity's user.
+	 *     @type int|bool    $user_id Default: ID of the activity's user.
 	 * }
 	 * @return string The secondary avatar
 	 */
@@ -1388,6 +1606,10 @@ function bp_activity_secondary_avatar( $args = '' ) {
 		// Set item_id and object (default to user)
 		switch ( $activities_template->activity->component ) {
 			case 'groups' :
+				if ( bp_disable_group_avatar_uploads() ) {
+					return false;
+				}
+
 				$object  = 'group';
 				$item_id = $activities_template->activity->item_id;
 				$link    = '';
@@ -1446,8 +1668,26 @@ function bp_activity_secondary_avatar( $args = '' ) {
 				break;
 		}
 
-		// Allow object, item_id, and link to be filtered
+		/**
+		 * Filters the activity secondary avatar object based on current activity item component.
+		 *
+		 * This is a variable filter dependent on the component used. Possible hooks are
+		 * bp_get_activity_secondary_avatar_object_blog, bp_get_activity_secondary_avatar_object_group,
+		 * and bp_get_activity_secondary_avatar_object_user.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param string $object Component being displayed.
+		 */
 		$object  = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object );
+
+		/**
+		 * Filters the activity secondary avatar item ID.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param int $item_id ID for the secondary avatar item.
+		 */
 		$item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id );
 
 		// If we have no item_id or object, there is no avatar to display
@@ -1468,23 +1708,41 @@ function bp_activity_secondary_avatar( $args = '' ) {
 		) );
 
 		if ( !empty( $linked ) ) {
+
+			/**
+			 * Filters the secondary avatar link for current activity.
+			 *
+			 * @since BuddyPress (1.7.0)
+			 *
+			 * @param string $link      Link to wrap the avatar image in.
+			 * @param string $component Activity component being acted on.
+			 */
 			$link = apply_filters( 'bp_get_activity_secondary_avatar_link', $link, $activities_template->activity->component );
 
+			/**
+			 * Filters the determined avatar for the secondary activity item.
+			 *
+			 * @since BuddyPress (1.2.10)
+			 *
+			 * @param string $avatar Formatted HTML <img> element, or raw avatar URL.
+			 */
+			$avatar = apply_filters( 'bp_get_activity_secondary_avatar', $avatar );
+
 			return sprintf( '<a href="%s" class="%s">%s</a>',
 				$link,
 				$link_class,
-				apply_filters( 'bp_get_activity_secondary_avatar', $avatar )
+				$avatar
 			);
 		}
 
-		// else
+		/** This filter is documented in bp-activity/bp-activity-template.php */
 		return apply_filters( 'bp_get_activity_secondary_avatar', $avatar );
 	}
 
 /**
- * Output the activity action
+ * Output the activity action.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @param array $args See bp_get_activity_action()
  * @uses bp_get_activity_action()
@@ -1494,44 +1752,65 @@ function bp_activity_action( $args = array() ) {
 }
 
 	/**
-	 * Return the activity action
+	 * Return the activity action.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @param array $args Only parameter is "no_timestamp". If true, timestamp is shown in output.
-	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook
+	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook.
 	 * @uses bp_insert_activity_meta()
 	 * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook.
 	 *
 	 * @param array $args {
 	 *     @type bool $no_timestamp Whether to exclude the timestamp.
 	 * }
+	 *
 	 * @return string The activity action.
 	 */
 	function bp_get_activity_action( $args = array() ) {
 		global $activities_template;
 
-		$defaults = array(
+		$r = wp_parse_args( $args, array(
 			'no_timestamp' => false,
-		);
-
-		$args = wp_parse_args( $args, $defaults );
-		extract( $args, EXTR_SKIP );
+		) );
 
-		$action = $activities_template->activity->action;
-		$action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity, $args ) );
+		/**
+		 * Filters the activity action before the action is inserted as meta.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function.
+		 */
+		$action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array(
+			$activities_template->activity->action,
+			&$activities_template->activity,
+			$r
+		) );
 
-		if ( ! empty( $action ) && ! $no_timestamp )
+		// Prepend the activity action meta (link, time since, etc...)
+		if ( ! empty( $action ) && empty( $r['no_timestamp'] ) ) {
 			$action = bp_insert_activity_meta( $action );
+		}
 
-		return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity, $args ) );
+		/**
+		 * Filters the activity action after the action has been inserted as meta.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function.
+		 */
+		return apply_filters_ref_array( 'bp_get_activity_action', array(
+			$action,
+			&$activities_template->activity,
+			$r
+		) );
 	}
 
 /**
- * Output the activity content body
+ * Output the activity content body.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_content_body()
  */
@@ -1540,9 +1819,9 @@ function bp_activity_content_body() {
 }
 
 	/**
-	 * Return the activity content body
+	 * Return the activity content body.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_insert_activity_meta()
@@ -1554,16 +1833,24 @@ function bp_activity_content_body() {
 		global $activities_template;
 
 		// Backwards compatibility if action is not being used
-		if ( empty( $activities_template->activity->action ) && !empty( $activities_template->activity->content ) )
+		if ( empty( $activities_template->activity->action ) && ! empty( $activities_template->activity->content ) ) {
 			$activities_template->activity->content = bp_insert_activity_meta( $activities_template->activity->content );
+		}
 
+		/**
+		 * Filters the activity content body.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param array $value Array containing the current activity content body and the current activity.
+		 */
 		return apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );
 	}
 
 /**
  * Does the activity have content?
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  *
@@ -1572,8 +1859,9 @@ function bp_activity_content_body() {
 function bp_activity_has_content() {
 	global $activities_template;
 
-	if ( !empty( $activities_template->activity->content ) )
+	if ( ! empty( $activities_template->activity->content ) ) {
 		return true;
+	}
 
 	return false;
 }
@@ -1581,8 +1869,8 @@ function bp_activity_has_content() {
 /**
  * Output the activity content.
  *
- * @since BuddyPress (1.0)
- * @deprecated BuddyPress (1.5)
+ * @since BuddyPress (1.0.0)
+ * @deprecated BuddyPress (1.5.0)
  *
  * @todo properly deprecate this function.
  *
@@ -1595,8 +1883,8 @@ function bp_activity_content() {
 	/**
 	 * Return the activity content.
 	 *
-	 * @since BuddyPress (1.0)
-	 * @deprecated BuddyPress (1.5)
+	 * @since BuddyPress (1.0.0)
+	 * @deprecated BuddyPress (1.5.0)
 	 *
 	 * @todo properly deprecate this function.
 	 *
@@ -1607,13 +1895,13 @@ function bp_activity_content() {
 	 * @return string The activity content.
 	 */
 	function bp_get_activity_content() {
+
 		/**
 		 * If you want to filter activity update content, please use
-		 * the filter 'bp_get_activity_content_body'
+		 * the filter 'bp_get_activity_content_body'.
 		 *
-		 * This function is mainly for backwards comptibility.
+		 * This function is mainly for backwards compatibility.
 		 */
-
 		$content = bp_get_activity_action() . ' ' . bp_get_activity_content_body();
 		return apply_filters( 'bp_get_activity_content', $content );
 	}
@@ -1624,7 +1912,7 @@ function bp_activity_content() {
  * This metadata includes the time since the item was posted (which will appear
  * as a link to the item's permalink).
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses bp_core_time_since()
@@ -1636,35 +1924,77 @@ function bp_activity_content() {
  * @uses apply_filters() To call the 'bp_insert_activity_meta' hook.
  *
  * @param string $content The activity content.
+ *
  * @return string The activity content with the metadata string attached.
  */
-function bp_insert_activity_meta( $content ) {
+function bp_insert_activity_meta( $content = '' ) {
 	global $activities_template;
 
 	// Strip any legacy time since placeholders from BP 1.0-1.1
-	$content = str_replace( '<span class="time-since">%s</span>', '', $content );
+	$new_content = str_replace( '<span class="time-since">%s</span>', '', $content );
+
+	// Get the time since this activity was recorded
+	$date_recorded  = bp_core_time_since( $activities_template->activity->date_recorded );
 
-	// Insert the time since.
-	$time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) );
+	/**
+	 * Filters the activity item time since markup.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $value Array containing the time since markup and the current activity component.
+	 */
+	$time_since = apply_filters_ref_array( 'bp_activity_time_since', array(
+		'<span class="time-since">' . $date_recorded . '</span>',
+		&$activities_template->activity
+	) );
 
 	// Insert the permalink
-	if ( !bp_is_single_activity() )
-		$content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) );
-	else
-		$content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH );
+	if ( ! bp_is_single_activity() ) {
+
+		// Setup variables for activity meta
+		$activity_permalink = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity );
+		$activity_meta      = sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>',
+			$new_content,
+			$activity_permalink,
+			esc_attr__( 'View Discussion', 'buddypress' ),
+			$time_since
+		);
+
+		/**
+		 * Filters the activity permalink to be added to the activity content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param array $value Array containing the html markup for the activity permalink, after being parsed by sprintf and current activity component.
+		 */
+		$new_content = apply_filters_ref_array( 'bp_activity_permalink', array(
+			$activity_meta,
+			&$activities_template->activity
+		) );
+	} else {
+		$new_content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH );
+	}
 
-	return apply_filters( 'bp_insert_activity_meta', $content );
+	/**
+	 * Filters the activity content after activity metadata has been attached.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $content Activity content with the activity metadata added.
+	 */
+	return apply_filters( 'bp_insert_activity_meta', $new_content, $content );
 }
 
 /**
  * Determine if the current user can delete an activity item.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
- * @uses apply_filters() To call the 'bp_activity_user_can_delete' hook
+ * @uses apply_filters() To call the 'bp_activity_user_can_delete' hook.
+ *
+ * @param object|bool $activity Optional. Falls back on the current item in the loop.
  *
- * @param object $activity Optional. Falls back on the current item in the loop.
  * @return bool True if can delete, false otherwise.
  */
 function bp_activity_user_can_delete( $activity = false ) {
@@ -1704,18 +2034,26 @@ function bp_activity_user_can_delete( $activity = false ) {
 		}
 	}
 
+	/**
+	 * Filters whether the current user can delete an activity item.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $can_delete Whether the user can delete the item.
+	 * @param object $activity   Current activity item object.
+	 */
 	return (bool) apply_filters( 'bp_activity_user_can_delete', $can_delete, $activity );
 }
 
 /**
  * Output the activity parent content.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_activity_parent_content() for a description of arguments.
  * @uses bp_get_activity_parent_content()
  *
- * @param array $args See {@link bp_get_activity_parent_content} for description.
+ * @param array|string $args See {@link bp_get_activity_parent_content} for description.
  */
 function bp_activity_parent_content( $args = '' ) {
 	echo bp_get_activity_parent_content($args);
@@ -1724,46 +2062,43 @@ function bp_activity_parent_content( $args = '' ) {
 	/**
 	 * Return the activity content.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
-	 * @uses wp_parse_args()
 	 * @uses apply_filters() To call the 'bp_get_activity_parent_content' hook.
 	 *
-	 * @param array $args {
-	 *     Array of optional arguments.
-	 *     @deprecated bool $hide_user No longer used.
-	 * }
-	 * @return mixed False on failure, otherwise the activity parent content
+	 * @param string $args Unused. Left over from an earlier implementation.
+	 *
+	 * @return mixed False on failure, otherwise the activity parent content.
 	 */
 	function bp_get_activity_parent_content( $args = '' ) {
 		global $activities_template;
 
-		$defaults = array(
-			'hide_user' => false
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
+		// Bail if no activity on no item ID
+		if ( empty( $activities_template->activity ) || empty( $activities_template->activity->item_id ) ) {
+			return false;
+		}
 
 		// Get the ID of the parent activity content
-		if ( !$parent_id = $activities_template->activity->item_id )
-			return false;
+		$parent_id = (int) $activities_template->activity->item_id;
 
 		// Bail if no parent content
-		if ( empty( $activities_template->activity_parents[$parent_id] ) )
+		if ( empty( $activities_template->activity_parents[ $parent_id ] ) ) {
 			return false;
+		}
 
 		// Bail if no action
-		if ( empty( $activities_template->activity_parents[$parent_id]->action ) )
+		if ( empty( $activities_template->activity_parents[ $parent_id ]->action ) ) {
 			return false;
+		}
 
 		// Content always includes action
-		$content = $activities_template->activity_parents[$parent_id]->action;
+		$content = $activities_template->activity_parents[ $parent_id ]->action;
 
 		// Maybe append activity content, if it exists
-		if ( ! empty( $activities_template->activity_parents[$parent_id]->content ) )
-			$content .= ' ' . $activities_template->activity_parents[$parent_id]->content;
+		if ( ! empty( $activities_template->activity_parents[ $parent_id ]->content ) ) {
+			$content .= ' ' . $activities_template->activity_parents[ $parent_id ]->content;
+		}
 
 		// Remove the time since content for backwards compatibility
 		$content = str_replace( '<span class="time-since">%s</span>', '', $content );
@@ -1771,13 +2106,20 @@ function bp_activity_parent_content( $args = '' ) {
 		// Remove images
 		$content = preg_replace( '/<img[^>]*>/Ui', '', $content );
 
+		/**
+		 * Filters the activity parent content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $content Content set to be displayed as parent content.
+		 */
 		return apply_filters( 'bp_get_activity_parent_content', $content );
 	}
 
 /**
  * Output the parent activity's user ID.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  */
 function bp_activity_parent_user_id() {
 	echo bp_get_activity_parent_user_id();
@@ -1786,41 +2128,50 @@ function bp_activity_parent_user_id() {
 	/**
 	 * Return the parent activity's user ID.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 *
 	 * @global BP_Activity_Template $activities_template
 	 *
 	 * @return bool|int False if parent activity can't be found, otherwise
-	 *         the parent activity's user ID.
+	 *                  the parent activity's user ID.
 	 */
 	function bp_get_activity_parent_user_id() {
 		global $activities_template;
 
 		// Bail if no activity on no item ID
-		if ( empty( $activities_template->activity ) || empty( $activities_template->activity->item_id ) )
+		if ( empty( $activities_template->activity ) || empty( $activities_template->activity->item_id ) ) {
 			return false;
+		}
 
 		// Get the ID of the parent activity content
-		if ( !$parent_id = $activities_template->activity->item_id )
-			return false;
+		$parent_id = (int) $activities_template->activity->item_id;
 
 		// Bail if no parent item
-		if ( empty( $activities_template->activity_parents[$parent_id] ) )
+		if ( empty( $activities_template->activity_parents[ $parent_id ] ) ) {
 			return false;
+		}
 
 		// Bail if no parent user ID
-		if ( empty( $activities_template->activity_parents[$parent_id]->user_id ) )
+		if ( empty( $activities_template->activity_parents[ $parent_id ]->user_id ) ) {
 			return false;
+		}
 
-		$retval = $activities_template->activity_parents[$parent_id]->user_id;
+		$retval = $activities_template->activity_parents[ $parent_id ]->user_id;
 
+		/**
+		 * Filters the activity parent item's user ID.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param int $retval ID for the activity parent's user.
+		 */
 		return (int) apply_filters( 'bp_get_activity_parent_user_id', $retval );
 	}
 
 /**
  * Output whether or not the current activity is in a current user's favorites.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_is_favorite()
  */
@@ -1831,7 +2182,7 @@ function bp_activity_is_favorite() {
 	/**
 	 * Return whether the current activity is in a current user's favorites.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_is_favorite' hook.
@@ -1841,17 +2192,24 @@ function bp_activity_is_favorite() {
 	function bp_get_activity_is_favorite() {
 		global $activities_template;
 
+		/**
+		 * Filters whether the current activity item is in the current user's favorites.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param bool $value Whether or not the current activity item is in the current user's favorites.
+		 */
  		return (bool) apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) );
 	}
 
 /**
  * Output the comment markup for an activity item.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @todo deprecate $args param
  *
- * @param string $args Unused. Appears to be left over from an earlier implementation.
+ * @param array|string $args See {@link bp_activity_get_comments} for description.
  */
 function bp_activity_comments( $args = '' ) {
 	echo bp_activity_get_comments( $args );
@@ -1860,51 +2218,66 @@ function bp_activity_comments( $args = '' ) {
 	/**
 	 * Get the comment markup for an activity item.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @todo deprecate $args param
 	 *
 	 * @todo Given that checks for children already happen in bp_activity_recurse_comments(),
 	 *    this function can probably be streamlined or removed.
 	 *
-	 * @param string $args Unused. Appears to be left over from an earlier implementation.
+	 * @param string $args Unused. Left over from an earlier implementation.
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_activity_recurse_comments()
+	 *
+	 * @return bool
 	 */
 	function bp_activity_get_comments( $args = '' ) {
 		global $activities_template;
 
-		if ( !isset( $activities_template->activity->children ) || !$activities_template->activity->children )
+		if ( empty( $activities_template->activity->children ) ) {
 			return false;
+		}
 
 		bp_activity_recurse_comments( $activities_template->activity );
 	}
 
 		/**
-		 * Loops through a level of activity comments and loads the template for each
+		 * Loops through a level of activity comments and loads the template for each.
 		 *
 		 * Note: The recursion itself used to happen entirely in this function. Now it is
 		 * split between here and the comment.php template.
 		 *
-		 * @since BuddyPress (1.2)
+		 * @since BuddyPress (1.2.0)
 		 *
-		 * @param object $comment The activity object currently being recursed
+		 * @param object $comment The activity object currently being recursed.
 		 *
 		 * @global object $activities_template {@link BP_Activity_Template}
 		 * @uses locate_template()
+		 *
+		 * @return bool|string
 		 */
 		function bp_activity_recurse_comments( $comment ) {
 			global $activities_template;
 
-			if ( empty( $comment ) )
+			if ( empty( $comment ) ) {
 				return false;
+			}
 
-			if ( empty( $comment->children ) )
+			if ( empty( $comment->children ) ) {
 				return false;
+			}
 
-			echo apply_filters( 'bp_activity_recurse_comments_start_ul', '<ul>');
+			/**
+			 * Filters the opening tag for the template that lists activity comments.
+			 *
+			 * @since BuddyPress (1.6.0)
+			 *
+			 * @param string $value Opening tag for the HTML markup to use.
+			 */
+			echo apply_filters( 'bp_activity_recurse_comments_start_ul', '<ul>' );
 			foreach ( (array) $comment->children as $comment_child ) {
+
 				// Put the comment into the global so it's available to filters
 				$activities_template->activity->current_comment = $comment_child;
 
@@ -1922,25 +2295,42 @@ function bp_activity_comments( $args = '' ) {
 
 				unset( $activities_template->activity->current_comment );
 			}
-			echo apply_filters( 'bp_activity_recurse_comments_end_ul', '</ul>');
+
+			/**
+			 * Filters the closing tag for the template that list activity comments.
+			 *
+			 * @since BuddyPress (1.6.0)
+			 *
+			 * @param string $value Closing tag for the HTML markup to use.
+			 */
+			echo apply_filters( 'bp_activity_recurse_comments_end_ul', '</ul>' );
 		}
 
 /**
  * Utility function that returns the comment currently being recursed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses apply_filters() To call the 'bp_activity_current_comment' hook.
  *
  * @return object|bool $current_comment The activity comment currently being
- *         displayed. False on failure.
+ *                                      displayed. False on failure.
  */
 function bp_activity_current_comment() {
 	global $activities_template;
 
-	$current_comment = !empty( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : false;
+	$current_comment = !empty( $activities_template->activity->current_comment )
+		? $activities_template->activity->current_comment
+		: false;
 
+	/**
+	 * Filters the current comment being recursed.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param object|bool $current_comment The activity comment currently being displayed. False on failure.
+	 */
 	return apply_filters( 'bp_activity_current_comment', $current_comment );
 }
 
@@ -1948,7 +2338,7 @@ function bp_activity_current_comment() {
 /**
  * Output the ID of the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_comment_id()
  */
@@ -1959,26 +2349,33 @@ function bp_activity_comment_id() {
 	/**
 	 * Return the ID of the activity comment currently being displayed.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_activity_comment_id' hook.
 	 *
-	 * @return int|bool $comment_id The ID of the activity comment
-	 *         currently being displayed, false if none is found.
+	 * @return int|bool $comment_id The ID of the activity comment currently
+	 *                              being displayed, false if none is found.
 	 */
 	function bp_get_activity_comment_id() {
 		global $activities_template;
 
 		$comment_id = isset( $activities_template->activity->current_comment->id ) ? $activities_template->activity->current_comment->id : false;
 
+		/**
+		 * Filters the ID of the activity comment currently being displayed.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int|bool $comment_id ID for the comment currently being displayed.
+		 */
 		return apply_filters( 'bp_activity_comment_id', $comment_id );
 	}
 
 /**
  * Output the ID of the author of the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_comment_user_id()
  */
@@ -1989,26 +2386,33 @@ function bp_activity_comment_user_id() {
 	/**
 	 * Return the ID of the author of the activity comment currently being displayed.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_activity_comment_user_id' hook.
 	 *
 	 * @return int|bool $user_id The user_id of the author of the displayed
-	 *         activity comment. False on failure.
+	 *                           activity comment. False on failure.
 	 */
 	function bp_get_activity_comment_user_id() {
 		global $activities_template;
 
 		$user_id = isset( $activities_template->activity->current_comment->user_id ) ? $activities_template->activity->current_comment->user_id : false;
 
+		/**
+		 * Filters the ID of the author of the activity comment currently being displayed.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int|bool $user_id ID for the author of the comment currently being displayed.
+		 */
 		return apply_filters( 'bp_activity_comment_user_id', $user_id );
 	}
 
 /**
  * Output the author link for the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_comment_user_link()
  */
@@ -2019,24 +2423,31 @@ function bp_activity_comment_user_link() {
 	/**
 	 * Return the author link for the activity comment currently being displayed.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @uses bp_core_get_user_domain()
 	 * @uses bp_get_activity_comment_user_id()
-	 * @uses apply_filters() To call the 'bp_activity_comment_user_link' hook
+	 * @uses apply_filters() To call the 'bp_activity_comment_user_link' hook.
 	 *
 	 * @return string $user_link The URL of the activity comment author's profile.
 	 */
 	function bp_get_activity_comment_user_link() {
 		$user_link = bp_core_get_user_domain( bp_get_activity_comment_user_id() );
 
+		/**
+		 * Filters the author link for the activity comment currently being displayed.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $user_link Link for the author of the activity comment currently being displayed.
+		 */
 		return apply_filters( 'bp_activity_comment_user_link', $user_link );
 	}
 
 /**
  * Output the author name for the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_comment_name()
  */
@@ -2050,63 +2461,108 @@ function bp_activity_comment_name() {
 	 * The use of the 'bp_acomment_name' filter is deprecated. Please use
 	 * 'bp_activity_comment_name'.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_acomment_name' hook.
 	 * @uses apply_filters() To call the 'bp_activity_comment_name' hook.
 	 *
-	 * @return string $name The full name of the activity comment author.
+	 * @return string $name The full name of the activity comment author.
+	 */
+	function bp_get_activity_comment_name() {
+		global $activities_template;
+
+		if ( isset( $activities_template->activity->current_comment->user_fullname ) ) {
+
+			$name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment );  // backward compatibility
+		} else {
+			$name = $activities_template->activity->current_comment->display_name;
+		}
+
+		/**
+		 * Filters the name of the author for the activity comment.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $name Name to be displayed with the activity comment.
+		 */
+		return apply_filters( 'bp_activity_comment_name', $name );
+	}
+
+/**
+ * Output the formatted date_recorded of the activity comment currently being displayed.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @uses bp_get_activity_comment_date_recorded()
+ */
+function bp_activity_comment_date_recorded() {
+	echo bp_get_activity_comment_date_recorded();
+}
+
+	/**
+	 * Return the formatted date_recorded for the activity comment currently being displayed.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @uses bp_core_time_since()
+	 * @uses apply_filters() To call the 'bp_activity_comment_date_recorded' hook.
+	 *
+	 * @return string|bool $date_recorded Time since the activity was recorded,
+	 *                                    in the form "%s ago". False on failure.
 	 */
-	function bp_get_activity_comment_name() {
-		global $activities_template;
-
-		if ( isset( $activities_template->activity->current_comment->user_fullname ) )
-			$name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment );  // backward compatibility
-		else
-			$name = $activities_template->activity->current_comment->display_name;
+	function bp_get_activity_comment_date_recorded() {
 
-		return apply_filters( 'bp_activity_comment_name', $name );
+		/**
+		 * Filters the recorded date of the activity comment currently being displayed.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string|bool Date for the activity comment currently being displayed.
+		 */
+		return apply_filters( 'bp_activity_comment_date_recorded', bp_core_time_since( bp_get_activity_comment_date_recorded_raw() ) );
 	}
 
 /**
  * Output the date_recorded of the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (2.3.0)
  *
  * @uses bp_get_activity_comment_date_recorded()
  */
-function bp_activity_comment_date_recorded() {
-	echo bp_get_activity_comment_date_recorded();
+function bp_activity_comment_date_recorded_raw() {
+	echo bp_get_activity_comment_date_recorded_raw();
 }
 
 	/**
 	 * Return the date_recorded for the activity comment currently being displayed.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (2.3.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_core_time_since()
-	 * @uses apply_filters() To call the 'bp_activity_comment_date_recorded' hook
+	 * @uses apply_filters() To call the 'bp_activity_comment_date_recorded' hook.
 	 *
 	 * @return string|bool $date_recorded Time since the activity was recorded,
-	 *         in the form "%s ago". False on failure.
+	 *                                    in the form "%s ago". False on failure.
 	 */
-	function bp_get_activity_comment_date_recorded() {
+	function bp_get_activity_comment_date_recorded_raw() {
 		global $activities_template;
 
-		if ( empty( $activities_template->activity->current_comment->date_recorded ) )
-			return false;
-
-		$date_recorded = bp_core_time_since( $activities_template->activity->current_comment->date_recorded );
-
-		return apply_filters( 'bp_activity_comment_date_recorded', $date_recorded );
+		/**
+		 * Filters the raw recorded date of the activity comment currently being displayed.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param string|bool Raw date for the activity comment currently being displayed.
+		 */
+		return apply_filters( 'bp_activity_comment_date_recorded', $activities_template->activity->current_comment->date_recorded );
 	}
 
 /**
  * Output the 'delete' URL for the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_comment_delete_link()
  */
@@ -2115,9 +2571,9 @@ function bp_activity_comment_delete_link() {
 }
 
 	/**
-	 * Gets the 'delete' URL for the activity comment currently being displayed
+	 * Gets the 'delete' URL for the activity comment currently being displayed.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @uses wp_nonce_url()
 	 * @uses bp_get_root_domain()
@@ -2126,18 +2582,25 @@ function bp_activity_comment_delete_link() {
 	 * @uses apply_filters() To call the 'bp_activity_comment_delete_link' hook.
 	 *
 	 * @return string $link The nonced URL for deleting the current
-	 *         activity comment.
+	 *                      activity comment.
 	 */
 	function bp_get_activity_comment_delete_link() {
 		$link = wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/delete/' . bp_get_activity_comment_id() . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
 
+		/**
+		 * Filters the link used for deleting the activity comment currently being displayed.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $link Link to use for deleting the currently displayed activity comment.
+		 */
 		return apply_filters( 'bp_activity_comment_delete_link', $link );
 	}
 
 /**
  * Output the content of the activity comment currently being displayed.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_activity_comment_content()
  */
@@ -2153,7 +2616,7 @@ function bp_activity_comment_content() {
 	 * 'bp_activity_comment_content' to modify the content of activity
 	 * comments only.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_content' hook.
@@ -2164,15 +2627,23 @@ function bp_activity_comment_content() {
 	function bp_get_activity_comment_content() {
 		global $activities_template;
 
+		/** This filter is documented in bp-activity/bp-activity-template.php */
 		$content = apply_filters( 'bp_get_activity_content', $activities_template->activity->current_comment->content );
 
+		/**
+		 * Filters the content of the current activity comment.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $content The content of the current activity comment.
+		 */
 		return apply_filters( 'bp_activity_comment_content', $content );
 	}
 
 /**
  * Output the activity comment count.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_activity_get_comment_count()
  */
@@ -2183,7 +2654,7 @@ function bp_activity_comment_count() {
 	/**
 	 * Return the comment count of an activity item.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_activity_recurse_comment_count()
@@ -2206,6 +2677,13 @@ function bp_activity_comment_count() {
 			? bp_activity_recurse_comment_count( $activities_template->activity )
 			: 0;
 
+		/**
+		 * Filters the activity comment count.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $count The activity comment count.
+		 */
 		return apply_filters( 'bp_activity_get_comment_count', (int) $count );
 	}
 
@@ -2215,13 +2693,13 @@ function bp_activity_comment_count() {
 		 * This function recursively adds the total number of comments each
 		 * activity child has, and returns them.
 		 *
-		 * @since BuddyPress (1.2)
+		 * @since BuddyPress (1.2.0)
 		 *
 		 * @uses bp_activity_recurse_comment_count()
-		 * @uses apply_filters() To call the 'bp_activity_recurse_comment_count' hook
+		 * @uses apply_filters() To call the 'bp_activity_recurse_comment_count' hook.
 		 *
 		 * @param object $comment Activity comment object.
-		 * @param int $count The current iteration count.
+		 * @param int    $count The current iteration count.
 		 *
 		 * @return int $count The activity comment count.
 		 */
@@ -2238,7 +2716,15 @@ function bp_activity_comment_count() {
 				}
 			}
 
-			// Filter and return
+			/**
+			 * Filters the total number of comments for the current comment.
+			 *
+			 * @since BuddyPress (2.1.0)
+			 *
+			 * @param int    $new_count New total count for the current comment.
+			 * @param object $comment   Activity comment object.
+			 * @param int    $count     Current iteration count for the current comment.
+			 */
 			return apply_filters( 'bp_activity_recurse_comment_count', $new_count, $comment, $count );
 		}
 
@@ -2255,17 +2741,25 @@ function bp_activity_comment_depth() {
 	 *
 	 * @since BuddyPress (2.0.0)
 	 *
-	 * @return int
+	 * @return int $depth Depth for the current activity comment.
 	 */
 	function bp_activity_get_comment_depth() {
 		global $activities_template;
+
+		/**
+		 * Filters the comment depth of the current activity comment.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int $depth Depth for the current activity comment.
+		 */
 		return apply_filters( 'bp_activity_get_comment_depth', $activities_template->activity->current_comment->depth );
 	}
 
 /**
  * Output the activity comment link.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_comment_link()
  */
@@ -2276,7 +2770,7 @@ function bp_activity_comment_link() {
 	/**
 	 * Return the activity comment link.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_comment_link' hook.
@@ -2285,13 +2779,21 @@ function bp_activity_comment_link() {
 	 */
 	function bp_get_activity_comment_link() {
 		global $activities_template;
+
+		/**
+		 * Filters the comment link for the current activity comment.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Constructed URL parameters with activity IDs.
+		 */
 		return apply_filters( 'bp_get_activity_comment_link', '?ac=' . $activities_template->activity->id . '/#ac-form-' . $activities_template->activity->id );
 	}
 
 /**
- * Output the activity comment form no javascript display CSS.
+ * Output the activity comment form no JavaScript display CSS.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_comment_form_nojs_display()
  */
@@ -2300,19 +2802,21 @@ function bp_activity_comment_form_nojs_display() {
 }
 
 	/**
-	 * Return the activity comment form no javascript display CSS.
+	 * Return the activity comment form no JavaScript display CSS.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 *
-	 * @return string|bool The activity comment form no javascript
-	 *         display CSS. False on failure
+	 * @return string|bool The activity comment form no JavaScript
+	 *                     display CSS. False on failure.
 	 */
 	function bp_get_activity_comment_form_nojs_display() {
 		global $activities_template;
-		if ( isset( $_GET['ac'] ) && $_GET['ac'] == $activities_template->activity->id . '/' )
+
+		if ( isset( $_GET['ac'] ) && ( $_GET['ac'] === ( $activities_template->activity->id . '/' ) ) ) {
 			return 'style="display: block"';
+		}
 
 		return false;
 	}
@@ -2320,7 +2824,7 @@ function bp_activity_comment_form_nojs_display() {
 /**
  * Output the activity comment form action.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_comment_form_action()
  */
@@ -2331,7 +2835,7 @@ function bp_activity_comment_form_action() {
 	/**
 	 * Return the activity comment form action.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
@@ -2340,13 +2844,21 @@ function bp_activity_comment_form_action() {
 	 * @return string The activity comment form action.
 	 */
 	function bp_get_activity_comment_form_action() {
+
+		/**
+		 * Filters the activity comment form action URL.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value URL to use in the comment form's action attribute.
+		 */
 		return apply_filters( 'bp_get_activity_comment_form_action', home_url( bp_get_activity_root_slug() . '/reply/' ) );
 	}
 
 /**
  * Output the activity permalink ID.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_permalink_id()
  */
@@ -2357,20 +2869,28 @@ function bp_activity_permalink_id() {
 	/**
 	 * Return the activity permalink ID.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses apply_filters() To call the 'bp_get_activity_permalink_id' hook.
 	 *
 	 * @return string The activity permalink ID.
 	 */
 	function bp_get_activity_permalink_id() {
+
+		/**
+		 * Filters the activity action permalink ID.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Current action for the activity item.
+		 */
 		return apply_filters( 'bp_get_activity_permalink_id', bp_current_action() );
 	}
 
 /**
  * Output the activity thread permalink.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_permalink_id()
  */
@@ -2381,7 +2901,7 @@ function bp_activity_thread_permalink() {
 	/**
 	 * Return the activity thread permalink.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_activity_get_permalink()
 	 * @uses apply_filters() To call the 'bp_get_activity_thread_permalink' hook.
@@ -2393,13 +2913,20 @@ function bp_activity_thread_permalink() {
 
 		$link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity );
 
+		/**
+		 * Filters the activity thread permalink.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $link The activity thread permalink.
+		 */
 	 	return apply_filters( 'bp_get_activity_thread_permalink', $link );
 	}
 
 /**
  * Output the activity comment permalink.
  *
- * @since BuddyPress (1.8)
+ * @since BuddyPress (1.8.0)
  *
  * @uses bp_get_activity_permalink_id()
  */
@@ -2409,7 +2936,7 @@ function bp_activity_comment_permalink() {
 	/**
 	 * Return the activity comment permalink.
 	 *
-	 * @since BuddyPress (1.8)
+	 * @since BuddyPress (1.8.0)
 	 *
 	 * @uses bp_activity_get_permalink()
 	 * @uses apply_filters() To call the 'bp_get_activity_comment_permalink' hook.
@@ -2432,13 +2959,21 @@ function bp_activity_comment_permalink() {
 		// Append comment ID to end of activity permalink
 		$link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . $comment_link;
 
+		/**
+		 * Filters the activity comment permalink.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param string $link       Activity comment permalink.
+		 * @param int    $comment_id ID for the current activity comment.
+		 */
 		return apply_filters( 'bp_get_activity_comment_permalink', $link, $comment_id );
 	}
 
 /**
  * Output the activity favorite link.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_favorite_link()
  */
@@ -2449,25 +2984,33 @@ function bp_activity_favorite_link() {
 	/**
 	 * Return the activity favorite link.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses wp_nonce_url()
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
-	 * @uses apply_filters() To call the 'bp_get_activity_favorite_link' hook
+	 * @uses apply_filters() To call the 'bp_get_activity_favorite_link' hook.
 	 *
 	 * @return string The activity favorite link.
 	 */
 	function bp_get_activity_favorite_link() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity favorite link.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Constructed link for favoriting the activity comment.
+		 */
 		return apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . $activities_template->activity->id . '/' ), 'mark_favorite' ) );
 	}
 
 /**
  * Output the activity unfavorite link.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_unfavorite_link()
  */
@@ -2478,7 +3021,7 @@ function bp_activity_unfavorite_link() {
 	/**
 	 * Return the activity unfavorite link.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses wp_nonce_url()
@@ -2490,13 +3033,21 @@ function bp_activity_unfavorite_link() {
 	 */
 	function bp_get_activity_unfavorite_link() {
 		global $activities_template;
+
+		/**
+		 * Filters the activity unfavorite link.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Constructed link for unfavoriting the activity comment.
+		 */
 		return apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/unfavorite/' . $activities_template->activity->id . '/' ), 'unmark_favorite' ) );
 	}
 
 /**
  * Output the activity CSS class.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activity_css_class()
  */
@@ -2507,7 +3058,7 @@ function bp_activity_css_class() {
 	/**
 	 * Return the current activity item's CSS class.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_activity_mini_activity_types' hook.
@@ -2520,6 +3071,13 @@ function bp_activity_css_class() {
 	function bp_get_activity_css_class() {
 		global $activities_template;
 
+		/**
+		 * Filters the available mini activity actions available as CSS classes.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param array $value Array of classes used to determine classes applied to HTML element.
+		 */
 		$mini_activity_actions = apply_filters( 'bp_activity_mini_activity_types', array(
 			'friendship_accepted',
 			'friendship_created',
@@ -2531,19 +3089,28 @@ function bp_activity_css_class() {
 
 		$class = ' activity-item';
 
-		if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) )
+		if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) ) {
 			$class .= ' mini';
+		}
 
-		if ( bp_activity_get_comment_count() && bp_activity_can_comment() )
+		if ( bp_activity_get_comment_count() && bp_activity_can_comment() ) {
 			$class .= ' has-comments';
+		}
 
+		/**
+		 * Filters the determined classes to add to the HTML element.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Classes to be added to the HTML element.
+		 */
 		return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component . ' ' . $activities_template->activity->type . $class );
 	}
 
 /**
  * Output the activity delete link.
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @uses bp_get_activity_delete_link()
  */
@@ -2554,20 +3121,19 @@ function bp_activity_delete_link() {
 	/**
 	 * Return the activity delete link.
 	 *
-	 * @since BuddyPress (1.1)
+	 * @since BuddyPress (1.1.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses bp_get_root_domain()
 	 * @uses bp_get_activity_root_slug()
 	 * @uses bp_is_activity_component()
 	 * @uses bp_current_action()
-	 * @uses add_query_arg()
 	 * @uses wp_get_referer()
 	 * @uses wp_nonce_url()
 	 * @uses apply_filters() To call the 'bp_get_activity_delete_link' hook.
 	 *
 	 * @return string $link Activity delete link. Contains $redirect_to arg
-	 *         if on single activity page.
+	 *                      if on single activity page.
 	 */
 	function bp_get_activity_delete_link() {
 
@@ -2581,11 +3147,18 @@ function bp_activity_delete_link() {
 
 		$link = '<a href="' . esc_url( $url ) . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>';
 
+		/**
+		 * Filters the activity delete link.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $link Activity delete HTML link.
+		 */
 		return apply_filters( 'bp_get_activity_delete_link', $link );
 	}
 
 /**
- * Output the URL to delete a single activity stream item
+ * Output the URL to delete a single activity stream item.
  *
  * @since BuddyPress (2.1.0)
  *
@@ -2595,7 +3168,7 @@ function bp_activity_delete_url() {
 	echo esc_url( bp_get_activity_delete_url() );
 }
 	/**
-	 * Return the URL to delete a single activity item
+	 * Return the URL to delete a single activity item.
 	 *
 	 * @since BuddyPress (2.1.0)
 	 *
@@ -2610,7 +3183,7 @@ function bp_activity_delete_url() {
 	 * @uses apply_filters() To call the 'bp_get_activity_delete_link' hook.
 	 *
 	 * @return string $link Activity delete link. Contains $redirect_to arg
-	 *         if on single activity page.
+	 *                      if on single activity page.
 	 */
 	function bp_get_activity_delete_url() {
 		global $activities_template;
@@ -2624,13 +3197,20 @@ function bp_activity_delete_url() {
 
 		$url = wp_nonce_url( $url, 'bp_activity_delete_link' );
 
+		/**
+		 * Filters the activity delete URL.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $url Activity delete URL.
+		 */
 		return apply_filters( 'bp_get_activity_delete_url', $url );
 	}
 
 /**
  * Output the activity latest update link.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_activity_latest_update() for description of parameters.
  * @uses bp_get_activity_latest_update()
@@ -2644,47 +3224,71 @@ function bp_activity_latest_update( $user_id = 0 ) {
 	/**
 	 * Return the activity latest update link.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_is_user_inactive()
 	 * @uses bp_core_is_user_deleted()
 	 * @uses bp_get_user_meta()
-	 * @uses apply_filters() To call the 'bp_get_activity_latest_update_excerpt' hook
+	 * @uses apply_filters() To call the 'bp_get_activity_latest_update_excerpt' hook.
 	 * @uses bp_create_excerpt()
 	 * @uses bp_get_root_domain()
 	 * @uses bp_get_activity_root_slug()
-	 * @uses apply_filters() To call the 'bp_get_activity_latest_update' hook
+	 * @uses apply_filters() To call the 'bp_get_activity_latest_update' hook.
 	 *
 	 * @param int $user_id If empty, will fall back on displayed user.
+	 *
 	 * @return string|bool $latest_update The activity latest update link.
-	 *         False on failure
+	 *                                    False on failure.
 	 */
 	function bp_get_activity_latest_update( $user_id = 0 ) {
 
-		if ( empty( $user_id ) )
+		if ( empty( $user_id ) ) {
 			$user_id = bp_displayed_user_id();
+		}
 
-		if ( bp_is_user_inactive( $user_id ) )
+		if ( bp_is_user_inactive( $user_id ) ) {
 			return false;
+		}
 
-		if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) )
+		if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) ) {
 			return false;
+		}
 
+		/**
+		 * Filters the latest update excerpt.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param string $value The excerpt for the latest update.
+		 */
 		$latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) );
-		$latest_update .= ' <a href="' . bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $update['id'] . '/"> ' . __( 'View', 'buddypress' ) . '</a>';
 
-		return apply_filters( 'bp_get_activity_latest_update', $latest_update  );
+		$latest_update = sprintf(
+			'%s <a href="%s">%s</a>',
+			$latest_update,
+			esc_url_raw( bp_activity_get_permalink( $update['id'] ) ),
+			esc_attr__( 'View', 'buddypress' )
+		);
+
+		/**
+		 * Filters the latest update excerpt with view link appended to the end.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $latest_update The latest update with "view" link appended to it.
+		 */
+		return apply_filters( 'bp_get_activity_latest_update', $latest_update );
 	}
 
 /**
  * Output the activity filter links.
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @see bp_get_activity_filter_links() for description of parameters.
  * @uses bp_get_activity_filter_links()
  *
- * @param array $args See {@link bp_get_activity_filter_links()} for description.
+ * @param array|bool $args See {@link bp_get_activity_filter_links()} for description.
  */
 function bp_activity_filter_links( $args = false ) {
 	echo bp_get_activity_filter_links( $args );
@@ -2693,7 +3297,7 @@ function bp_activity_filter_links( $args = false ) {
 	/**
 	 * Return the activity filter links.
 	 *
-	 * @since BuddyPress (1.1)
+	 * @since BuddyPress (1.1.0)
 	 *
 	 * @uses wp_parse_args()
 	 * @uses BP_Activity_Activity::get_recorded_components() {@link BP_Activity_Activity}
@@ -2703,21 +3307,18 @@ function bp_activity_filter_links( $args = false ) {
 	 * @uses apply_filters() To call the 'bp_get_activity_filter_link_href' hook.
 	 * @uses apply_filters() To call the 'bp_get_activity_filter_links' hook.
 	 *
-	 * @param array $args {
+	 * @param array|bool $args {
 	 *     @type string $style The type of markup to use for the links.
-	 *           'list', 'paragraph', or 'span'. Default: 'list'.
+	 *                         'list', 'paragraph', or 'span'. Default: 'list'.
 	 * }
 	 * @return string|bool $component_links The activity filter links.
 	 *         False on failure.
 	 */
 	function bp_get_activity_filter_links( $args = false ) {
 
-		$defaults = array(
+		$r = wp_parse_args( $args, array(
 			'style' => 'list'
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
+		) );
 
 		// Define local variable
 		$component_links = array();
@@ -2725,23 +3326,26 @@ function bp_activity_filter_links( $args = false ) {
 		// Fetch the names of components that have activity recorded in the DB
 		$components = BP_Activity_Activity::get_recorded_components();
 
-		if ( empty( $components ) )
+		if ( empty( $components ) ) {
 			return false;
+		}
 
 		foreach ( (array) $components as $component ) {
 
 			// Skip the activity comment filter
-			if ( 'activity' == $component )
+			if ( 'activity' == $component ) {
 				continue;
+			}
 
-			if ( isset( $_GET['afilter'] ) && $component == $_GET['afilter'] )
+			if ( isset( $_GET['afilter'] ) && $component == $_GET['afilter'] ) {
 				$selected = ' class="selected"';
-			else
-				unset($selected);
+			} else {
+				$selected = '';
+			}
 
 			$component = esc_attr( $component );
 
-			switch ( $style ) {
+			switch ( $r['style'] ) {
 				case 'list':
 					$tag = 'li';
 					$before = '<li id="afilter-' . $component . '"' . $selected . '>';
@@ -2761,23 +3365,40 @@ function bp_activity_filter_links( $args = false ) {
 
 			$link = add_query_arg( 'afilter', $component );
 			$link = remove_query_arg( 'acpage' , $link );
+
+			/**
+			 * Filters the activity filter link URL for the current activity component.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param string $link      The URL for the current component.
+			 * @param string $component The current component getting links constructed for.
+			 */
 			$link = apply_filters( 'bp_get_activity_filter_link_href', $link, $component );
 
-			$component_links[] = $before . '<a href="' . esc_attr( $link ) . '">' . ucwords( $component ) . '</a>' . $after;
+			$component_links[] = $before . '<a href="' . esc_url( $link ) . '">' . ucwords( $component ) . '</a>' . $after;
 		}
 
 		$link = remove_query_arg( 'afilter' , $link );
 
-		if ( isset( $_GET['afilter'] ) )
-			$component_links[] = '<' . $tag . ' id="afilter-clear"><a href="' . esc_attr( $link ) . '">' . __( 'Clear Filter', 'buddypress' ) . '</a></' . $tag . '>';
+		if ( isset( $_GET['afilter'] ) ) {
+			$component_links[] = '<' . $tag . ' id="afilter-clear"><a href="' . esc_url( $link ) . '">' . __( 'Clear Filter', 'buddypress' ) . '</a></' . $tag . '>';
+		}
 
+		/**
+		 * Filters all of the constructed filter links.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value All of the links to be displayed to the user.
+		 */
  		return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ) );
 	}
 
 /**
  * Determine if a comment can be made on an activity item.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @global object $activities_template {@link BP_Activity_Template}
  * @uses bp_get_activity_action_name()
@@ -2787,30 +3408,49 @@ function bp_activity_filter_links( $args = false ) {
  */
 function bp_activity_can_comment() {
 	global $activities_template;
+	$bp = buddypress();
 
 	// Assume activity can be commented on
 	$can_comment = true;
 
 	// Determine ability to comment based on activity action name
 	$activity_action = bp_get_activity_action_name();
-	switch ( $activity_action ) {
-
-		// Maybe turn off for blog and forum updates
-		case 'new_blog_post'    :
-		case 'new_blog_comment' :
-		case 'new_forum_topic'  :
-		case 'new_forum_post'   :
-			if ( ! empty( $activities_template->disable_blogforum_replies ) ) {
-				$can_comment = false;
-			}
-			break;
 
-		// Turn off for activity comments
-		case 'activity_comment' :
-			$can_comment = false;
-			break;
+	$turn_off = 0;
+	if ( ! empty( $activities_template->disable_blogforum_replies ) ) {
+		$turn_off = 1;
+	}
+
+	$maybe_turn_off = array_fill_keys( array(
+		'new_blog_post',
+		'new_blog_comment',
+		'new_forum_topic',
+		'new_forum_post',
+	), $turn_off );
+
+	$maybe_turn_off['activity_comment'] = 1;
+
+	// Fetch all the tracked post types once.
+	if ( empty( $bp->activity->track ) ) {
+		$bp->activity->track = bp_activity_get_post_types_tracking_args();
+	}
+
+	foreach ( $bp->activity->track as $action => $tracking_args ) {
+		if ( empty( $tracking_args->activity_comment ) ) {
+			$maybe_turn_off[ $action ] = $turn_off;
+		}
 	}
 
+	$can_comment = empty( $maybe_turn_off[ $activity_action ] );
+
+	/**
+	 * Filters whether a comment can be made on an activity item.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $can_comment     Status on if activity can be commented on.
+	 * @param string $activity_action Current activity action being checked on.
+	 */
 	return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_action );
 }
 
@@ -2819,11 +3459,11 @@ function bp_activity_can_comment() {
  *
  * @since BuddyPress (1.5.0)
  *
- * @param object $comment Activity comment.
- * @return bool $can_comment True if comment can receive comments, otherwise
- *         false.
+ * @param  bool|object $comment     Activity comment.
+ * @return bool        $can_comment True if comment can receive comments,
+ *                                  otherwise false.
  */
-function bp_activity_can_comment_reply( $comment = '' ) {
+function bp_activity_can_comment_reply( $comment = false ) {
 
 	// Assume activity can be commented on
 	$can_comment = true;
@@ -2850,28 +3490,44 @@ function bp_activity_can_comment_reply( $comment = '' ) {
 		}
 	}
 
+	/**
+	 * Filters whether a comment can be made on an activity reply item.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $can_comment Status on if activity reply can be commented on.
+	 * @param string $comment     Current comment being checked on.
+	 */
 	return (bool) apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment );
 }
 
 /**
- * Determine if an favorites are allowed.
+ * Determine whether favorites are allowed.
  *
  * Defaults to true, but can be modified by plugins.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses apply_filters() To call the 'bp_activity_can_favorite' hook.
  *
  * @return bool True if comment can receive comments.
  */
 function bp_activity_can_favorite() {
+
+	/**
+	 * Filters whether or not users can favorite activity items.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not favoriting is enabled.
+	 */
 	return apply_filters( 'bp_activity_can_favorite', true );
 }
 
 /**
  * Output the total favorite count for a specified user.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_total_favorite_count_for_user() for description of parameters.
  * @uses bp_get_total_favorite_count_for_user()
@@ -2885,26 +3541,37 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
 	/**
 	 * Return the total favorite count for a specified user.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_activity_total_favorites_for_user()
-	 * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook
+	 * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook.
 	 *
 	 * @param int $user_id ID of user being queried. Default: displayed user ID.
+	 *
 	 * @return int The total favorite count for the specified user.
 	 */
 	function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
+		$retval = false;
 
-		// Default to displayed user if none is passed
-		$user_id = empty( $user_id )
-			? bp_displayed_user_id()
-			: $user_id;
+		if ( bp_activity_can_favorite() ) {
+			// Default to displayed user if none is passed
+			$user_id = empty( $user_id )
+				? bp_displayed_user_id()
+				: $user_id;
 
-		// Get user meta if user ID exists
-		$retval = ! empty( $user_id )
-			? bp_activity_total_favorites_for_user( $user_id )
-			: false;
+			// Get user meta if user ID exists
+			if ( ! empty( $user_id ) ) {
+				$retval = bp_activity_total_favorites_for_user( $user_id );
+			}
+		}
 
+		/**
+		 * Filters the total favorite count for a user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int|bool $retval Total favorite count for a user. False on no favorites.
+		 */
 		return apply_filters( 'bp_get_total_favorite_count_for_user', $retval );
 	}
 
@@ -2912,7 +3579,7 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) {
 /**
  * Output the total mention count for a specified user.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_total_mention_count_for_user() for description of parameters.
  * @uses bp_get_total_favorite_count_for_user()
@@ -2926,12 +3593,13 @@ function bp_total_mention_count_for_user( $user_id = 0 ) {
 	/**
 	 * Return the total mention count for a specified user.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_get_user_meta()
 	 * @uses apply_filters() To call the 'bp_get_total_mention_count_for_user' hook.
 	 *
 	 * @param int $user_id ID of user being queried. Default: displayed user ID.
+	 *
 	 * @return int The total mention count for the specified user.
 	 */
 	function bp_get_total_mention_count_for_user( $user_id = 0 ) {
@@ -2946,31 +3614,38 @@ function bp_total_mention_count_for_user( $user_id = 0 ) {
 			? bp_get_user_meta( $user_id, 'bp_new_mention_count', true )
 			: false;
 
+		/**
+		 * Filters the total mention count for a user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int|bool $retval Total mention count for a user. False on no mentions.
+		 */
 		return apply_filters( 'bp_get_total_mention_count_for_user', $retval );
 	}
 
 /**
  * Output the public message link for displayed user.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_send_public_message_link()
  */
 function bp_send_public_message_link() {
-	echo bp_get_send_public_message_link();
+	echo esc_url( bp_get_send_public_message_link() );
 }
 
 	/**
 	 * Return the public message link for the displayed user.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses is_user_logged_in()
 	 * @uses bp_is_my_profile()
 	 * @uses bp_is_user()
 	 * @uses wp_nonce_url()
 	 * @uses bp_get_activity_directory_permalink()
-	 * @uses apply_filters() To call the 'bp_get_send_public_message_link' hook
+	 * @uses apply_filters() To call the 'bp_get_send_public_message_link' hook.
 	 *
 	 * @return string The public message link for the displayed user.
 	 */
@@ -2985,6 +3660,13 @@ function bp_send_public_message_link() {
 			$retval = wp_nonce_url( $url );
 		}
 
+		/**
+		 * Filters the public message link for the displayed user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $retval The URL for the public message link.
+		 */
 		return apply_filters( 'bp_get_send_public_message_link', $retval );
 	}
 
@@ -2995,6 +3677,7 @@ function bp_send_public_message_link() {
  *
  * @param array $activity Array of activities generated from {@link bp_activity_get()}.
  * @param array $activity_ids Used for recursion purposes in this function.
+ *
  * @return array
  */
 function bp_activity_recurse_comments_activity_ids( $activity = array(), $activity_ids = array() ) {
@@ -3018,26 +3701,27 @@ function bp_activity_recurse_comments_activity_ids( $activity = array(), $activi
 /**
  * Output the mentioned user display name.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_mentioned_user_display_name() for description of parameters.
  * @uses bp_get_mentioned_user_display_name()
  *
- * @param int|string $user_id_or_username See {@link bp_get_mentioned_user_display_name()}.
+ * @param int|string|bool $user_id_or_username See {@link bp_get_mentioned_user_display_name()}.
  */
 function bp_mentioned_user_display_name( $user_id_or_username = false ) {
 	echo bp_get_mentioned_user_display_name( $user_id_or_username );
 }
 
 	/**
-	 * Returns the mentioned user display name
+	 * Returns the mentioned user display name.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_core_get_user_displayname()
 	 * @uses apply_filters() To call the 'bp_get_mentioned_user_display_name' hook.
 	 *
-	 * @param int|string User ID or username.
+	 * @param int|string|bool User ID or username.
+	 *
 	 * @return string The mentioned user's display name.
 	 */
 	function bp_get_mentioned_user_display_name( $user_id_or_username = false ) {
@@ -3050,18 +3734,26 @@ function bp_mentioned_user_display_name( $user_id_or_username = false ) {
 			$name = __( 'a user', 'buddypress' );
 		}
 
+		/**
+		 * Filters the mentioned user display name.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string     $name                Display name for the mentioned user.
+		 * @param int|string $user_id_or_username User ID or username use for query.
+		 */
 		return apply_filters( 'bp_get_mentioned_user_display_name', $name, $user_id_or_username );
 	}
 
 /**
  * Output button for sending a public message (an @-mention).
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @see bp_get_send_public_message_button() for description of parameters.
  * @uses bp_get_send_public_message_button()
  *
- * @param array $args See {@link bp_get_send_public_message_button()}.
+ * @param array|string $args See {@link bp_get_send_public_message_button()}.
  */
 function bp_send_public_message_button( $args = '' ) {
 	echo bp_get_send_public_message_button( $args );
@@ -3070,27 +3762,27 @@ function bp_send_public_message_button( $args = '' ) {
 	/**
 	 * Return button for sending a public message (an @-mention).
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_get_send_public_message_link()
 	 * @uses wp_parse_args()
 	 * @uses bp_get_button()
 	 * @uses apply_filters() To call the 'bp_get_send_public_message_button' hook.
 	 *
-	 * @param array $args {
+	 * @param array|string $args {
 	 *     All arguments are optional. See {@link BP_Button} for complete
 	 *     descriptions.
-	 *     @type string $id Default: 'public_message'.
-	 *     @type string $component Default: 'activity'.
-	 *     @type bool $must_be_logged_in Default: true.
-	 *     @type bool $block_self Default: true.
-	 *     @type string $wrapper_id Default: 'post-mention'.
-	 *     @type string $link_href Default: the public message link for
-	 *           the current member in the loop.
-	 *     @type string $link_title Default: 'Send a public message on your
-	 *           activity stream.'.
-	 *     @type string $link_text Default: 'Public Message'.
-	 *     @type string $link_class Default: 'activity-button mention'.
+	 *     @type string $id                Default: 'public_message'.
+	 *     @type string $component         Default: 'activity'.
+	 *     @type bool   $must_be_logged_in Default: true.
+	 *     @type bool   $block_self        Default: true.
+	 *     @type string $wrapper_id        Default: 'post-mention'.
+	 *     @type string $link_href         Default: the public message link for
+	 *                                     the current member in the loop.
+	 *     @type string $link_title        Default: 'Send a public message on your
+	 *                                     activity stream.'.
+	 *     @type string $link_text         Default: 'Public Message'.
+	 *     @type string $link_class        Default: 'activity-button mention'.
 	 * }
 	 * @return string The button for sending a public message.
 	 */
@@ -3108,14 +3800,20 @@ function bp_send_public_message_button( $args = '' ) {
 			'link_class'        => 'activity-button mention'
 		) );
 
-		// Filter and return the HTML button
+		/**
+		 * Filters the public message button HTML.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param array $r Array of arguments for the public message button HTML.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_send_public_message_button', $r ) );
 	}
 
 /**
  * Output the activity post form action.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_activity_post_form_action()
  */
@@ -3126,7 +3824,7 @@ function bp_activity_post_form_action() {
 	/**
 	 * Return the activity post form action.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
@@ -3135,6 +3833,14 @@ function bp_activity_post_form_action() {
 	 * @return string The activity post form action.
 	 */
 	function bp_get_activity_post_form_action() {
+
+		/**
+		 * Filters the action url used for the activity post form.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value URL to be used for the activity post form.
+		 */
 		return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) );
 	}
 
@@ -3146,7 +3852,7 @@ function bp_activity_post_form_action() {
  * Avatars are wrapped in <li> elements, but you've got to provide your own
  * <ul> or <ol> wrapper markup.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  *
  * @see bp_core_fetch_avatar() for a description of arguments.
  *
@@ -3198,13 +3904,22 @@ function bp_activity_comments_user_avatars( $args = array() ) {
 		}
 	}
 
+	/**
+	 * Filters the list of linked avatars for users who have commented on the current activity item.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $retval HTML markup for the list of avatars.
+	 * @param array  $r      Array of arguments used for each avatar.
+	 * @param array  $output Array of each avatar found, before imploded into single string.
+	 */
 	echo apply_filters( 'bp_activity_comments_user_avatars', $retval, $r, $output );
 }
 
 /**
  * Return the IDs of every user who's left a comment on the current activity item.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  *
  * @return bool|array An array of IDs, or false if none are found.
  */
@@ -3215,15 +3930,23 @@ function bp_activity_get_comments_user_ids() {
 		? (array) bp_activity_recurse_comments_user_ids( $activities_template->activity->children )
 		: array();
 
+	/**
+	 * Filters the list of user IDs for the current activity item.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $value Array of unique user IDs for the current activity item.
+	 */
 	return apply_filters( 'bp_activity_get_comments_user_ids', array_unique( $user_ids ) );
 }
 
 	/**
 	 * Recurse through all activity comments and collect the IDs of the users who wrote them.
 	 *
-	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (1.7.0)
 	 *
 	 * @param array $comments Array of {@link BP_Activity_Activity} items.
+	 *
 	 * @return array Array of user IDs.
 	 */
 	function bp_activity_recurse_comments_user_ids( array $comments = array() ) {
@@ -3251,7 +3974,14 @@ function bp_activity_get_comments_user_ids() {
 			}
 		}
 
-		// Filter and return
+		/**
+		 * Filters the list of user IDs for the current activity comment item.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array $user_ids Array of user IDs for the current activity comment item.
+		 * @param array $comments Array of comments being checked for user IDs.
+		 */
 		return apply_filters( 'bp_activity_recurse_comments_user_ids', $user_ids, $comments );
 	}
 
@@ -3271,21 +4001,29 @@ function bp_displayed_user_mentionname() {
 	 * @return string Mentionname for the displayed user, if available.
 	 */
 	function bp_get_displayed_user_mentionname() {
+
+		/**
+		 * Filters the mentionname for the displayed user.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $value The mentionanme for the displayed user.
+		 */
 		return apply_filters( 'bp_get_displayed_user_mentionname', bp_activity_get_user_mentionname( bp_displayed_user_id() ) );
 	}
 
 /**
  * Echo a list of all registered activity types for use in dropdowns or checkbox lists.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  *
- * @param string $output Optional. Either 'select' or 'checkbox'. Default: 'select'.
- * @param array $args {
+ * @param string       $output Optional. Either 'select' or 'checkbox'. Default: 'select'.
+ * @param array|string $args {
  *     Optional extra arguments.
- *     @type string $checkbox_name When returning checkboxes, sets the 'name'
- *           attribute.
- *     @type array|string $selected A list of types that should be checked/
- *           selected.
+ *     @type string       $checkbox_name When returning checkboxes, sets the 'name'
+ *                                       attribute.
+ *     @type array|string $selected      A list of types that should be checked/
+ *                                       selected.
  * }
  */
 function bp_activity_types_list( $output = 'select', $args = '' ) {
@@ -3315,7 +4053,18 @@ function bp_activity_types_list( $output = 'select', $args = '' ) {
 				break;
 		}
 
-		// Allow custom markup
+		/**
+		 * Fires at the end of the listing of activity types.
+		 *
+		 * This is a variable action hook. The actual hook to use will depend on the output type specified.
+		 * Two default hooks are bp_activity_types_list_select and bp_activity_types_list_checkbox.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array  $args        Array of arguments passed into function.
+		 * @param string $type        Activity type being rendered in the output.
+		 * @param string $description Description of the activity type being rendered.
+		 */
 		do_action( 'bp_activity_types_list_' . $output, $args, $type, $description );
 	}
 
@@ -3331,7 +4080,7 @@ function bp_activity_types_list( $output = 'select', $args = '' ) {
 /**
  * Output the sitewide activity feed link.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_sitewide_activity_feed_link()
  */
@@ -3342,7 +4091,7 @@ function bp_sitewide_activity_feed_link() {
 	/**
 	 * Returns the sitewide activity feed link.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @uses home_url()
 	 * @uses bp_get_activity_root_slug()
@@ -3351,13 +4100,21 @@ function bp_sitewide_activity_feed_link() {
 	 * @return string The sitewide activity feed link.
 	 */
 	function bp_get_sitewide_activity_feed_link() {
+
+		/**
+		 * Filters the sidewide activity feed link.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value The feed link for sitewide activity.
+		 */
 		return apply_filters( 'bp_get_sitewide_activity_feed_link', bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed/' );
 	}
 
 /**
  * Output the member activity feed link.
  *
- * @since BuddyPress (1.2)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_member_activity_feed_link()
  */
@@ -3368,8 +4125,8 @@ function bp_member_activity_feed_link() {
 /**
  * Output the member activity feed link.
  *
- * @since BuddyPress (1.0)
- * @deprecated BuddyPress (1.2)
+ * @since BuddyPress (1.0.0)
+ * @deprecated BuddyPress (1.2.0)
  *
  * @todo properly deprecate in favor of bp_member_activity_feed_link().
  *
@@ -3380,7 +4137,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 	/**
 	 * Return the member activity feed link.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @uses bp_is_profile_component()
 	 * @uses bp_is_current_action()
@@ -3420,14 +4177,21 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 			$link = '';
 		}
 
+		/**
+		 * Filters the member activity feed link.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $link URL for the member activity feed.
+		 */
 		return apply_filters( 'bp_get_activities_member_rss_link', $link );
 	}
 
 	/**
 	 * Return the member activity feed link.
 	 *
-	 * @since BuddyPress (1.0)
-	 * @deprecated BuddyPress (1.2)
+	 * @since BuddyPress (1.0.0)
+	 * @deprecated BuddyPress (1.2.0)
 	 *
 	 * @todo properly deprecate in favor of bp_get_member_activity_feed_link().
 	 *
@@ -3443,7 +4207,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link
 /**
  * Outputs the activity feed item guid.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_activity_feed_item_guid()
  */
@@ -3454,7 +4218,7 @@ function bp_activity_feed_item_guid() {
 	/**
 	 * Returns the activity feed item guid.
 	 *
-	 * @since BuddyPress (1.2)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_guid' hook.
@@ -3464,13 +4228,20 @@ function bp_activity_feed_item_guid() {
 	function bp_get_activity_feed_item_guid() {
 		global $activities_template;
 
+		/**
+		 * Filters the activity feed item guid.
+		 *
+		 * @since BuddyPress (1.1.3)
+		 *
+		 * @param string $value Calculated md5 value for the activity feed item.
+		 */
 		return apply_filters( 'bp_get_activity_feed_item_guid', md5( $activities_template->activity->date_recorded . '-' . $activities_template->activity->content ) );
 	}
 
 /**
  * Output the activity feed item title.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activity_feed_item_title()
  */
@@ -3481,7 +4252,7 @@ function bp_activity_feed_item_title() {
 	/**
 	 * Return the activity feed item title.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses ent2ncr()
@@ -3511,13 +4282,20 @@ function bp_activity_feed_item_title() {
 			$title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " [&#133;]" ) ) ) ) ) );
 		}
 
+		/**
+		 * Filters the activity feed item title.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $title The title for the activity feed item.
+		 */
 		return apply_filters( 'bp_get_activity_feed_item_title', $title );
 	}
 
 /**
- * Output the activity feed item link
+ * Output the activity feed item link.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activity_feed_item_link()
  */
@@ -3526,9 +4304,9 @@ function bp_activity_feed_item_link() {
 }
 
 	/**
-	 * Return the activity feed item link
+	 * Return the activity feed item link.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_link' hook.
@@ -3542,13 +4320,20 @@ function bp_activity_feed_item_link() {
 			? $activities_template->activity->primary_link
 			: '';
 
+		/**
+		 * Filters the activity feed item link.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $retval The URL for the activity feed item.
+		 */
 		return apply_filters( 'bp_get_activity_feed_item_link', $retval );
 	}
 
 /**
  * Output the activity feed item date.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activity_feed_item_date()
  */
@@ -3559,7 +4344,7 @@ function bp_activity_feed_item_date() {
 	/**
 	 * Return the activity feed item date.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses apply_filters() To call the 'bp_get_activity_feed_item_date' hook.
@@ -3573,13 +4358,20 @@ function bp_activity_feed_item_date() {
 			? $activities_template->activity->date_recorded
 			: '';
 
+		/**
+		 * Filters the activity feed item date.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $retval The date for the activity feed item.
+		 */
 		return apply_filters( 'bp_get_activity_feed_item_date', $retval );
 	}
 
 /**
  * Output the activity feed item description.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  *
  * @uses bp_get_activity_feed_item_description()
  */
@@ -3590,7 +4382,7 @@ function bp_activity_feed_item_description() {
 	/**
 	 * Return the activity feed item description.
 	 *
-	 * @since BuddyPress (1.0)
+	 * @since BuddyPress (1.0.0)
 	 *
 	 * @global object $activities_template {@link BP_Activity_Template}
 	 * @uses ent2ncr()
@@ -3612,13 +4404,20 @@ function bp_activity_feed_item_description() {
 			$content = ent2ncr( convert_chars( str_replace( '%s', '', $content ) ) );
 		}
 
+		/**
+		 * Filters the activity feed item description.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $content The description for the activity feed item.
+		 */
 		return apply_filters( 'bp_get_activity_feed_item_description', $content );
 	}
 
 /**
  * Template tag so we can hook activity feed to <head>.
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bloginfo()
  * @uses bp_sitewide_activity_feed_link()
@@ -3638,7 +4437,7 @@ add_action( 'bp_head', 'bp_activity_sitewide_feed' );
  * @since BuddyPress (2.1.0)
  *
  * @param string $context The current context. 'activity', 'member',
- *	  'member_groups', 'group'.
+ *	                      'member_groups', 'group'.
  * @uses bp_get_activity_show_filters()
  */
 function bp_activity_show_filters( $context = '' ) {
@@ -3650,7 +4449,8 @@ function bp_activity_show_filters( $context = '' ) {
 	 * @since BuddyPress (2.1.0)
 	 *
 	 * @param string $context The current context. 'activity', 'member',
-	 *	  'member_groups', 'group'
+	 *	                      'member_groups', 'group'.
+	 *
 	 * @return string HTML for <option> values.
 	 */
 	function bp_get_activity_show_filters( $context = '' ) {
@@ -3667,7 +4467,7 @@ function bp_activity_show_filters( $context = '' ) {
 				}
 
 			// On individual group pages, default to 'group'
-			} else if ( bp_is_active( 'groups' ) && bp_is_group() ) {
+			} elseif ( bp_is_active( 'groups' ) && bp_is_group() ) {
 				$context = 'group';
 
 			// 'activity' everywhere else
@@ -3680,7 +4480,7 @@ function bp_activity_show_filters( $context = '' ) {
 
 		// Walk through the registered actions, and prepare an the
 		// select box options.
-		foreach ( buddypress()->activity->actions as $actions ) {
+		foreach ( bp_activity_get_actions() as $actions ) {
 			foreach ( $actions as $action ) {
 				if ( ! in_array( $context, (array) $action['context'] ) ) {
 					continue;
@@ -3696,17 +4496,14 @@ function bp_activity_show_filters( $context = '' ) {
 		}
 
 		/**
-		 * Modify the filter options available in the activity filter dropdown.
+		 * Filters the options available in the activity filter dropdown.
 		 *
-		 * @since BuddyPress (2.1.0)
+		 * @since BuddyPress (2.2.0)
 		 *
-		 * @param array $filters Array of filter options for the given
-		 *        context, in the following format:
-		 *            $option_value => $option_name
-		 * @param string $context Context for the filter. 'activity'
-		 *        'member', 'member_groups', 'group'.
+		 * @param array  $filters Array of filter options for the given context, in the following format: $option_value => $option_name.
+		 * @param string $context Context for the filter. 'activity', 'member', 'member_groups', 'group'.
 		 */
-		$filters = apply_filters( 'bp_get_activity_show_filters', $filters, $context );
+		$filters = apply_filters( 'bp_get_activity_show_filters_options', $filters, $context );
 
 		// Build the options output
 		$output = '';
@@ -3717,5 +4514,14 @@ function bp_activity_show_filters( $context = '' ) {
 			}
 		}
 
+		/**
+		 * Filters the HTML markup result for the activity filter dropdown.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $output  HTML output for the activity filter dropdown.
+		 * @param array  $filters Array of filter options for the given context, in the following format: $option_value => $option_name.
+		 * @param string $context Context for the filter. 'activity', 'member', 'member_groups', 'group'.
+		 */
 		return apply_filters( 'bp_get_activity_show_filters', $output, $filters, $context );
 	}
diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-activity.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-activity.php
new file mode 100644
index 0000000000000000000000000000000000000000..e6040fbfede7e29332128be1791c44e954447a7d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-activity.php
@@ -0,0 +1,1800 @@
+<?php
+/**
+ * BuddyPress Activity Classes
+ *
+ * @package BuddyPress
+ * @subpackage Activity
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Database interaction class for the BuddyPress activity component.
+ *
+ * Instance methods are available for creating/editing an activity,
+ * static methods for querying activities.
+ *
+ * @since BuddyPress (1.0.0)
+ */
+class BP_Activity_Activity {
+
+	/** Properties ************************************************************/
+
+	/**
+	 * ID of the activity item.
+	 *
+	 * @var int
+	 */
+	var $id;
+
+	/**
+	 * ID of the associated item.
+	 *
+	 * @var int
+	 */
+	var $item_id;
+
+	/**
+	 * ID of the associated secondary item.
+	 *
+	 * @var int
+	 */
+	var $secondary_item_id;
+
+	/**
+	 * ID of user associated with the activity item.
+	 *
+	 * @var int
+	 */
+	var $user_id;
+
+	/**
+	 * The primary URL for the activity in RSS feeds.
+	 *
+	 * @var string
+	 */
+	var $primary_link;
+
+	/**
+	 * BuddyPress component the activity item relates to.
+	 *
+	 * @var string
+	 */
+	var $component;
+
+	/**
+	 * Activity type, eg 'new_blog_post'.
+	 *
+	 * @var string
+	 */
+	var $type;
+
+	/**
+	 * Description of the activity, eg 'Alex updated his profile.'.
+	 *
+	 * @var string
+	 */
+	var $action;
+
+	/**
+	 * The content of the activity item.
+	 *
+	 * @var string
+	 */
+	var $content;
+
+	/**
+	 * The date the activity item was recorded, in 'Y-m-d h:i:s' format.
+	 *
+	 * @var string
+	 */
+	var $date_recorded;
+
+	/**
+	 * Whether the item should be hidden in sitewide streams.
+	 *
+	 * @var int
+	 */
+	var $hide_sitewide = false;
+
+	/**
+	 * Node boundary start for activity or activity comment.
+	 *
+	 * @var int
+	 */
+	var $mptt_left;
+
+	/**
+	 * Node boundary end for activity or activity comment.
+	 *
+	 * @var int
+	 */
+	var $mptt_right;
+
+	/**
+	 * Whether this item is marked as spam.
+	 *
+	 * @var int
+	 */
+	var $is_spam;
+
+	/**
+	 * Constructor method.
+	 *
+	 * @param int|bool $id Optional. The ID of a specific activity item.
+	 */
+	public function __construct( $id = false ) {
+		if ( !empty( $id ) ) {
+			$this->id = $id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Populate the object with data about the specific activity item.
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$row = wp_cache_get( $this->id, 'bp_activity' );
+
+		if ( false === $row ) {
+			$bp  = buddypress();
+			$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE id = %d", $this->id ) );
+
+			wp_cache_set( $this->id, $row, 'bp_activity' );
+		}
+
+		if ( ! empty( $row ) ) {
+			$this->id                = (int) $row->id;
+			$this->item_id           = (int) $row->item_id;
+			$this->secondary_item_id = (int) $row->secondary_item_id;
+			$this->user_id           = (int) $row->user_id;
+			$this->primary_link      = $row->primary_link;
+			$this->component         = $row->component;
+			$this->type              = $row->type;
+			$this->action            = $row->action;
+			$this->content           = $row->content;
+			$this->date_recorded     = $row->date_recorded;
+			$this->hide_sitewide     = $row->hide_sitewide;
+			$this->mptt_left         = (int) $row->mptt_left;
+			$this->mptt_right        = (int) $row->mptt_right;
+			$this->is_spam           = $row->is_spam;
+		}
+
+		// Generate dynamic 'action' when possible
+		$action = bp_activity_generate_action_string( $this );
+		if ( false !== $action ) {
+			$this->action = $action;
+
+		// If no callback is available, use the literal string from
+		// the database row
+		} elseif ( ! empty( $row->action ) ) {
+			$this->action = $row->action;
+
+		// Provide a fallback to avoid PHP notices
+		} else {
+			$this->action = '';
+		}
+	}
+
+	/**
+	 * Save the activity item to the database.
+	 *
+	 * @return bool True on success.
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->id                = apply_filters_ref_array( 'bp_activity_id_before_save',                array( $this->id,                &$this ) );
+		$this->item_id           = apply_filters_ref_array( 'bp_activity_item_id_before_save',           array( $this->item_id,           &$this ) );
+		$this->secondary_item_id = apply_filters_ref_array( 'bp_activity_secondary_item_id_before_save', array( $this->secondary_item_id, &$this ) );
+		$this->user_id           = apply_filters_ref_array( 'bp_activity_user_id_before_save',           array( $this->user_id,           &$this ) );
+		$this->primary_link      = apply_filters_ref_array( 'bp_activity_primary_link_before_save',      array( $this->primary_link,      &$this ) );
+		$this->component         = apply_filters_ref_array( 'bp_activity_component_before_save',         array( $this->component,         &$this ) );
+		$this->type              = apply_filters_ref_array( 'bp_activity_type_before_save',              array( $this->type,              &$this ) );
+		$this->action            = apply_filters_ref_array( 'bp_activity_action_before_save',            array( $this->action,            &$this ) );
+		$this->content           = apply_filters_ref_array( 'bp_activity_content_before_save',           array( $this->content,           &$this ) );
+		$this->date_recorded     = apply_filters_ref_array( 'bp_activity_date_recorded_before_save',     array( $this->date_recorded,     &$this ) );
+		$this->hide_sitewide     = apply_filters_ref_array( 'bp_activity_hide_sitewide_before_save',     array( $this->hide_sitewide,     &$this ) );
+		$this->mptt_left         = apply_filters_ref_array( 'bp_activity_mptt_left_before_save',         array( $this->mptt_left,         &$this ) );
+		$this->mptt_right        = apply_filters_ref_array( 'bp_activity_mptt_right_before_save',        array( $this->mptt_right,        &$this ) );
+		$this->is_spam           = apply_filters_ref_array( 'bp_activity_is_spam_before_save',           array( $this->is_spam,           &$this ) );
+
+		/**
+		 * Fires before the current activity item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Activity_Activity $this Current instance of the activity item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_activity_before_save', array( &$this ) );
+
+		if ( empty( $this->component ) || empty( $this->type ) ) {
+			return false;
+		}
+
+		if ( empty( $this->primary_link ) ) {
+			$this->primary_link = bp_loggedin_user_domain();
+		}
+
+		// If we have an existing ID, update the activity item, otherwise insert it.
+		if ( ! empty( $this->id ) ) {
+			$q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id );
+		} else {
+			$q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam );
+		}
+
+		if ( false === $wpdb->query( $q ) ) {
+			return false;
+		}
+
+		// If this is a new activity item, set the $id property
+		if ( empty( $this->id ) ) {
+			$this->id = $wpdb->insert_id;
+
+		// If an existing activity item, prevent any changes to the content generating new @mention notifications.
+		} else {
+			add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
+		}
+
+		/**
+		 * Fires after an activity item has been saved to the database.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Activity_Activity $this Current instance of activity item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
+
+		return true;
+	}
+
+	/** Static Methods ***************************************************/
+
+	/**
+	 * Get activity items, as specified by parameters.
+	 *
+	 * @see BP_Activity_Activity::get_filter_sql() for a description of the
+	 *      'filter' parameter.
+	 * @see WP_Meta_Query::queries for a description of the 'meta_query'
+	 *      parameter format.
+	 *
+	 * @param array $args {
+	 *     An array of arguments. All items are optional.
+	 *
+	 *     @type int          $page              Which page of results to fetch. Using page=1 without per_page will result
+	 *                                           in no pagination. Default: 1.
+	 *     @type int|bool     $per_page          Number of results per page. Default: 25.
+	 *     @type int|bool     $max               Maximum number of results to return. Default: false (unlimited).
+	 *     @type string       $sort              ASC or DESC. Default: 'DESC'.
+	 *     @type array        $exclude           Array of activity IDs to exclude. Default: false.
+	 *     @type array        $in                Array of ids to limit query by (IN). Default: false.
+	 *     @type array        $meta_query        Array of meta_query conditions. See WP_Meta_Query::queries.
+	 *     @type array        $date_query        Array of date_query conditions. See first parameter of
+	 *                                           WP_Date_Query::__construct().
+	 *     @type array        $filter_query      Array of advanced query conditions. See BP_Activity_Query::__construct().
+	 *     @type string|array $scope             Pre-determined set of activity arguments.
+	 *     @type array        $filter            See BP_Activity_Activity::get_filter_sql().
+	 *     @type string       $search_terms      Limit results by a search term. Default: false.
+	 *     @type bool         $display_comments  Whether to include activity comments. Default: false.
+	 *     @type bool         $show_hidden       Whether to show items marked hide_sitewide. Default: false.
+	 *     @type string       $spam              Spam status. Default: 'ham_only'.
+	 *     @type bool         $update_meta_cache Whether to pre-fetch metadata for queried activity items. Default: true.
+	 *     @type string|bool  $count_total       If true, an additional DB query is run to count the total activity items
+	 *                                           for the query. Default: false.
+	 * }
+	 * @return array The array returned has two keys:
+	 *     - 'total' is the count of located activities
+	 *     - 'activities' is an array of the located activities
+	 */
+	public static function get( $args = array() ) {
+		global $wpdb;
+
+		// Backward compatibility with old method of passing arguments
+		if ( !is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '1.6', 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__ ) );
+
+			$old_args_keys = array(
+				0 => 'max',
+				1 => 'page',
+				2 => 'per_page',
+				3 => 'sort',
+				4 => 'search_terms',
+				5 => 'filter',
+				6 => 'display_comments',
+				7 => 'show_hidden',
+				8 => 'exclude',
+				9 => 'in',
+				10 => 'spam'
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$bp = buddypress();
+		$r  = wp_parse_args( $args, array(
+			'page'              => 1,          // The current page
+			'per_page'          => 25,         // Activity items per page
+			'max'               => false,      // Max number of items to return
+			'sort'              => 'DESC',     // ASC or DESC
+			'exclude'           => false,      // Array of ids to exclude
+			'in'                => false,      // Array of ids to limit query by (IN)
+			'meta_query'        => false,      // Filter by activitymeta
+			'date_query'        => false,      // Filter by date
+			'filter_query'      => false,      // Advanced filtering - see BP_Activity_Query
+			'filter'            => false,      // See self::get_filter_sql()
+			'scope'             => false,      // Preset activity arguments
+			'search_terms'      => false,      // Terms to search by
+			'display_comments'  => false,      // Whether to include activity comments
+			'show_hidden'       => false,      // Show items marked hide_sitewide
+			'spam'              => 'ham_only', // Spam status
+			'update_meta_cache' => true,
+			'count_total'       => false,
+		) );
+
+		// Select conditions
+		$select_sql = "SELECT DISTINCT a.id";
+
+		$from_sql   = " FROM {$bp->activity->table_name} a";
+
+		$join_sql   = '';
+
+		// Where conditions
+		$where_conditions = array();
+
+		// Excluded types
+		$excluded_types = array();
+
+		// Scope takes precedence
+		if ( ! empty( $r['scope'] ) ) {
+			$scope_query = self::get_scope_query_sql( $r['scope'], $r );
+
+			// Add our SQL conditions if matches were found
+			if ( ! empty( $scope_query['sql'] ) ) {
+				$where_conditions['scope_query_sql'] = $scope_query['sql'];
+			}
+
+			// override some arguments if needed
+			if ( ! empty( $scope_query['override'] ) ) {
+				$r = self::array_replace_recursive( $r, $scope_query['override'] );
+			}
+
+		// Advanced filtering
+		} elseif ( ! empty( $r['filter_query'] ) ) {
+			$filter_query = new BP_Activity_Query( $r['filter_query'] );
+			$sql          = $filter_query->get_sql();
+			if ( ! empty( $sql ) ) {
+				$where_conditions['filter_query_sql'] = $sql;
+			}
+		}
+
+		// Regular filtering
+		if ( $r['filter'] && $filter_sql = BP_Activity_Activity::get_filter_sql( $r['filter'] ) ) {
+			$where_conditions['filter_sql'] = $filter_sql;
+		}
+
+		// Spam
+		if ( 'ham_only' == $r['spam'] ) {
+			$where_conditions['spam_sql'] = 'a.is_spam = 0';
+		} elseif ( 'spam_only' == $r['spam'] ) {
+			$where_conditions['spam_sql'] = 'a.is_spam = 1';
+		}
+
+		// Searching
+		if ( $r['search_terms'] ) {
+			$search_terms_like = '%' . bp_esc_like( $r['search_terms'] ) . '%';
+			$where_conditions['search_sql'] = $wpdb->prepare( 'a.content LIKE %s', $search_terms_like );
+		}
+
+		// Sorting
+		$sort = $r['sort'];
+		if ( $sort != 'ASC' && $sort != 'DESC' ) {
+			$sort = 'DESC';
+		}
+
+		// Hide Hidden Items?
+		if ( ! $r['show_hidden'] ) {
+			$where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
+		}
+
+		// Exclude specified items
+		if ( ! empty( $r['exclude'] ) ) {
+			$exclude = implode( ',', wp_parse_id_list( $r['exclude'] ) );
+			$where_conditions['exclude'] = "a.id NOT IN ({$exclude})";
+		}
+
+		// The specific ids to which you want to limit the query
+		if ( ! empty( $r['in'] ) ) {
+			$in = implode( ',', wp_parse_id_list( $r['in'] ) );
+			$where_conditions['in'] = "a.id IN ({$in})";
+		}
+
+		// Process meta_query into SQL
+		$meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
+
+		if ( ! empty( $meta_query_sql['join'] ) ) {
+			$join_sql .= $meta_query_sql['join'];
+		}
+
+		if ( ! empty( $meta_query_sql['where'] ) ) {
+			$where_conditions[] = $meta_query_sql['where'];
+		}
+
+		// Process date_query into SQL
+		$date_query_sql = self::get_date_query_sql( $r['date_query'] );
+
+		if ( ! empty( $date_query_sql ) ) {
+			$where_conditions['date'] = $date_query_sql;
+		}
+
+		// Alter the query based on whether we want to show activity item
+		// comments in the stream like normal comments or threaded below
+		// the activity.
+		if ( false === $r['display_comments'] || 'threaded' === $r['display_comments'] ) {
+			$excluded_types[] = 'activity_comment';
+		}
+
+		// Exclude 'last_activity' items unless the 'action' filter has
+		// been explicitly set
+		if ( empty( $r['filter']['object'] ) ) {
+			$excluded_types[] = 'last_activity';
+		}
+
+		// Build the excluded type sql part
+		if ( ! empty( $excluded_types ) ) {
+			$not_in = "'" . implode( "', '", esc_sql( $excluded_types ) ) . "'";
+			$where_conditions['excluded_types'] = "a.type NOT IN ({$not_in})";
+		}
+
+		/**
+		 * Filters the MySQL WHERE conditions for the Activity items get method.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param array  $where_conditions Current conditions for MySQL WHERE statement.
+		 * @param array  $r                Parsed arguments passed into method.
+		 * @param string $select_sql       Current SELECT MySQL statement at point of execution.
+		 * @param string $from_sql         Current FROM MySQL statement at point of execution.
+		 * @param string $join_sql         Current INNER JOIN MySQL statement at point of execution.
+		 */
+		$where_conditions = apply_filters( 'bp_activity_get_where_conditions', $where_conditions, $r, $select_sql, $from_sql, $join_sql );
+
+		// Join the where conditions together
+		$where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
+
+		/**
+		 * Filters the preferred order of indexes for activity item.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param array Array of indexes in preferred order.
+		 */
+		$indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
+
+		foreach( $indexes as $key => $index ) {
+			if ( false !== strpos( $where_sql, $index ) ) {
+				$the_index = $index;
+				break; // Take the first one we find
+			}
+		}
+
+		if ( !empty( $the_index ) ) {
+			$index_hint_sql = "USE INDEX ({$the_index})";
+		} else {
+			$index_hint_sql = '';
+		}
+
+		// Sanitize page and per_page parameters
+		$page     = absint( $r['page']     );
+		$per_page = absint( $r['per_page'] );
+
+		$retval = array(
+			'activities'     => null,
+			'total'          => null,
+			'has_more_items' => null,
+		);
+
+		/**
+		 * Filters if BuddyPress should use legacy query structure over current structure for version 2.0+.
+		 *
+		 * It is not recommended to use the legacy structure, but allowed to if needed.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param bool                 $value Whether to use legacy structure or not.
+		 * @param BP_Activity_Activity $value Current method being called.
+		 * @param array                $r     Parsed arguments passed into method.
+		 */
+		if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $r ) ) {
+
+			// Legacy queries joined against the user table
+			$select_sql = "SELECT DISTINCT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name";
+			$from_sql   = " FROM {$bp->activity->table_name} a LEFT JOIN {$wpdb->users} u ON a.user_id = u.ID";
+
+			if ( ! empty( $page ) && ! empty( $per_page ) ) {
+				$pag_sql    = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
+
+				/** this filter is documented in bp-activity/bp-activity-classes.php */
+				$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
+			} else {
+				$pag_sql    = '';
+
+				/**
+				 * Filters the legacy MySQL query statement so plugins can alter before results are fetched.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string $value      Concatenated MySQL statement pieces to be query results with for legacy query.
+				 * @param string $select_sql Final SELECT MySQL statement portion for legacy query.
+				 * @param string $from_sql   Final FROM MySQL statement portion for legacy query.
+				 * @param string $where_sql  Final WHERE MySQL statement portion for legacy query.
+				 * @param string $sort       Final sort direction for legacy query.
+				 */
+				$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
+			}
+
+		} else {
+			// Query first for activity IDs
+			$activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}";
+
+			if ( ! empty( $per_page ) && ! empty( $page ) ) {
+				// We query for $per_page + 1 items in order to
+				// populate the has_more_items flag
+				$activity_ids_sql .= $wpdb->prepare( " LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page + 1 );
+			}
+
+			/**
+			 * Filters the paged activities MySQL statement.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param string $activity_ids_sql MySQL statement used to query for Activity IDs.
+			 * @param array  $r                Array of arguments passed into method.
+			 */
+			$activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r );
+
+			$activity_ids = $wpdb->get_col( $activity_ids_sql );
+
+			$retval['has_more_items'] = ! empty( $per_page ) && count( $activity_ids ) > $per_page;
+
+			// If we've fetched more than the $per_page value, we
+			// can discard the extra now
+			if ( ! empty( $per_page ) && count( $activity_ids ) === $per_page + 1 ) {
+				array_pop( $activity_ids );
+			}
+
+			$activities = self::get_activity_data( $activity_ids );
+		}
+
+		// Get the fullnames of users so we don't have to query in the loop
+		$activities = self::append_user_fullnames( $activities );
+
+		// Get activity meta
+		$activity_ids = array();
+		foreach ( (array) $activities as $activity ) {
+			$activity_ids[] = $activity->id;
+		}
+
+		if ( ! empty( $activity_ids ) && $r['update_meta_cache'] ) {
+			bp_activity_update_meta_cache( $activity_ids );
+		}
+
+		if ( $activities && $r['display_comments'] ) {
+			$activities = BP_Activity_Activity::append_comments( $activities, $r['spam'] );
+		}
+
+		// Pre-fetch data associated with activity users and other objects
+		BP_Activity_Activity::prefetch_object_data( $activities );
+
+		// Generate action strings
+		$activities = BP_Activity_Activity::generate_action_strings( $activities );
+
+		$retval['activities'] = $activities;
+
+		// If $max is set, only return up to the max results
+		if ( ! empty( $r['count_total'] ) ) {
+
+			/**
+			 * Filters the total activities MySQL statement.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $value     MySQL statement used to query for total activities.
+			 * @param string $where_sql MySQL WHERE statement portion.
+			 * @param string $sort      Sort direction for query.
+			 */
+			$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort );
+			$total_activities     = $wpdb->get_var( $total_activities_sql );
+
+			if ( !empty( $r['max'] ) ) {
+				if ( (int) $total_activities > (int) $r['max'] ) {
+					$total_activities = $r['max'];
+				}
+			}
+
+			$retval['total'] = $total_activities;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Convert activity IDs to activity objects, as expected in template loop.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $activity_ids Array of activity IDs.
+	 *
+	 * @return array
+	 */
+	protected static function get_activity_data( $activity_ids = array() ) {
+		global $wpdb;
+
+		// Bail if no activity ID's passed
+		if ( empty( $activity_ids ) ) {
+			return array();
+		}
+
+		// Get BuddyPress
+		$bp = buddypress();
+
+		$activities   = array();
+		$uncached_ids = bp_get_non_cached_ids( $activity_ids, 'bp_activity' );
+
+		// Prime caches as necessary
+		if ( ! empty( $uncached_ids ) ) {
+			// Format the activity ID's for use in the query below
+			$uncached_ids_sql = implode( ',', wp_parse_id_list( $uncached_ids ) );
+
+			// Fetch data from activity table, preserving order
+			$queried_adata = $wpdb->get_results( "SELECT * FROM {$bp->activity->table_name} WHERE id IN ({$uncached_ids_sql})");
+
+			// Put that data into the placeholders created earlier,
+			// and add it to the cache
+			foreach ( (array) $queried_adata as $adata ) {
+				wp_cache_set( $adata->id, $adata, 'bp_activity' );
+			}
+		}
+
+		// Now fetch data from the cache
+		foreach ( $activity_ids as $activity_id ) {
+			$activities[] = wp_cache_get( $activity_id, 'bp_activity' );
+		}
+
+		// Then fetch user data
+		$user_query = new BP_User_Query( array(
+			'user_ids'        => wp_list_pluck( $activities, 'user_id' ),
+			'populate_extras' => false,
+		) );
+
+		// Associated located user data with activity items
+		foreach ( $activities as $a_index => $a_item ) {
+			$a_user_id = intval( $a_item->user_id );
+			$a_user    = isset( $user_query->results[ $a_user_id ] ) ? $user_query->results[ $a_user_id ] : '';
+
+			if ( !empty( $a_user ) ) {
+				$activities[ $a_index ]->user_email    = $a_user->user_email;
+				$activities[ $a_index ]->user_nicename = $a_user->user_nicename;
+				$activities[ $a_index ]->user_login    = $a_user->user_login;
+				$activities[ $a_index ]->display_name  = $a_user->display_name;
+			}
+		}
+
+		return $activities;
+	}
+
+	/**
+	 * Append xProfile fullnames to an activity array.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $activities Activities array.
+	 *
+	 * @return array
+	 */
+	protected static function append_user_fullnames( $activities ) {
+
+		if ( bp_is_active( 'xprofile' ) && ! empty( $activities ) ) {
+			$activity_user_ids = wp_list_pluck( $activities, 'user_id' );
+
+			if ( ! empty( $activity_user_ids ) ) {
+				$fullnames = bp_core_get_user_displaynames( $activity_user_ids );
+				if ( ! empty( $fullnames ) ) {
+					foreach ( (array) $activities as $i => $activity ) {
+						if ( ! empty( $fullnames[ $activity->user_id ] ) ) {
+							$activities[ $i ]->user_fullname = $fullnames[ $activity->user_id ];
+						}
+					}
+				}
+			}
+		}
+
+		return $activities;
+	}
+
+	/**
+	 * Pre-fetch data for objects associated with activity items.
+	 *
+	 * Activity items are associated with users, and often with other
+	 * BuddyPress data objects. Here, we pre-fetch data about these
+	 * associated objects, so that inline lookups - done primarily when
+	 * building action strings - do not result in excess database queries.
+	 *
+	 * The only object data required for activity component activity types
+	 * (activity_update and activity_comment) is related to users, and that
+	 * info is fetched separately in BP_Activity_Activity::get_activity_data().
+	 * So this method contains nothing but a filter that allows other
+	 * components, such as bp-friends and bp-groups, to hook in and prime
+	 * their own caches at the beginning of an activity loop.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $activities Array of activities.
+	 *
+	 * @return array $activities Array of activities.
+	 */
+	protected static function prefetch_object_data( $activities ) {
+
+		/**
+		 * Filters inside prefetch_object_data method to aid in pre-fetching object data associated with activity item.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $activities Array of activities.
+		 */
+		return apply_filters( 'bp_activity_prefetch_object_data', $activities );
+	}
+
+	/**
+	 * Generate action strings for the activities located in BP_Activity_Activity::get().
+	 *
+	 * If no string can be dynamically generated for a given item
+	 * (typically because the activity type has not been properly
+	 * registered), the static 'action' value pulled from the database will
+	 * be left in place.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $activities Array of activities.
+	 *
+	 * @return array
+	 */
+	protected static function generate_action_strings( $activities ) {
+		foreach ( $activities as $key => $activity ) {
+			$generated_action = bp_activity_generate_action_string( $activity );
+			if ( false !== $generated_action ) {
+				$activity->action = $generated_action;
+			}
+
+			$activities[ $key ] = $activity;
+		}
+
+		return $activities;
+	}
+
+	/**
+	 * Get the SQL for the 'meta_query' param in BP_Activity_Activity::get().
+	 *
+	 * We use WP_Meta_Query to do the heavy lifting of parsing the
+	 * meta_query array and creating the necessary SQL clauses. However,
+	 * since BP_Activity_Activity::get() builds its SQL differently than
+	 * WP_Query, we have to alter the return value (stripping the leading
+	 * AND keyword from the 'where' clause).
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param array $meta_query An array of meta_query filters. See the
+	 *                          documentation for WP_Meta_Query for details.
+	 *
+	 * @return array $sql_array 'join' and 'where' clauses.
+	 */
+	public static function get_meta_query_sql( $meta_query = array() ) {
+		global $wpdb;
+
+		$sql_array = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		if ( ! empty( $meta_query ) ) {
+			$activity_meta_query = new WP_Meta_Query( $meta_query );
+
+			// WP_Meta_Query expects the table name at
+			// $wpdb->activitymeta
+			$wpdb->activitymeta = buddypress()->activity->table_name_meta;
+
+			$meta_sql = $activity_meta_query->get_sql( 'activity', 'a', 'id' );
+
+			// Strip the leading AND - BP handles it in get()
+			$sql_array['where'] = preg_replace( '/^\sAND/', '', $meta_sql['where'] );
+			$sql_array['join']  = $meta_sql['join'];
+		}
+
+		return $sql_array;
+	}
+
+	/**
+	 * Get the SQL for the 'date_query' param in BP_Activity_Activity::get().
+	 *
+	 * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting
+	 * of parsing the date_query array and creating the necessary SQL clauses.
+	 * However, since BP_Activity_Activity::get() builds its SQL differently than
+	 * WP_Query, we have to alter the return value (stripping the leading AND
+	 * keyword from the query).
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $date_query An array of date_query parameters. See the
+	 *                          documentation for the first parameter of WP_Date_Query.
+	 *
+	 * @return string
+	 */
+	public static function get_date_query_sql( $date_query = array() ) {
+		$sql = '';
+
+		// Date query
+		if ( ! empty( $date_query ) && is_array( $date_query ) && class_exists( 'BP_Date_Query' ) ) {
+			$date_query = new BP_Date_Query( $date_query, 'date_recorded' );
+			$sql = preg_replace( '/^\sAND/', '', $date_query->get_sql() );
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Get the SQL for the 'scope' param in BP_Activity_Activity::get().
+	 *
+	 * A scope is a predetermined set of activity arguments.  This method is used
+	 * to grab these activity arguments and override any existing args if needed.
+	 *
+	 * Can handle multiple scopes.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param  mixed $scope  The activity scope. Accepts string or array of scopes.
+	 * @param  array $r      Current activity arguments. Same as those of BP_Activity_Activity::get(),
+	 *                       but merged with defaults.
+	 *
+	 * @return array 'sql' WHERE SQL string and 'override' activity args.
+	 */
+	public static function get_scope_query_sql( $scope = false, $r = array() ) {
+
+		// Define arrays for future use
+		$query_args = array();
+		$override   = array();
+		$retval     = array();
+
+		// Check for array of scopes
+		if ( is_array( $scope ) ) {
+			$scopes = $scope;
+
+		// Explode a comma separated string of scopes
+		} elseif ( is_string( $scope ) ) {
+			$scopes = explode( ',', $scope );
+		}
+
+		// Bail if no scope passed
+		if ( empty( $scopes ) ) {
+			return false;
+		}
+
+		// Helper to easily grab the 'user_id'
+		if ( ! empty( $r['filter']['user_id'] ) ) {
+			$r['user_id'] = $r['filter']['user_id'];
+		}
+
+		// parse each scope; yes! we handle multiples!
+		foreach ( $scopes as $scope ) {
+			$scope_args = array();
+
+			/**
+			 * Plugins can hook here to set their activity arguments for custom scopes.
+			 *
+			 * This is a dynamic filter based on the activity scope. eg:
+			 *   - 'bp_activity_set_groups_scope_args'
+			 *   - 'bp_activity_set_friends_scope_args'
+			 *
+			 * To see how this filter is used, plugin devs should check out:
+			 *   - bp_groups_filter_activity_scope() - used for 'groups' scope
+			 *   - bp_friends_filter_activity_scope() - used for 'friends' scope
+			 *
+			 * @since BuddyPress (2.2.0)
+			 *
+			 *  @param array {
+			 *     Activity query clauses.
+			 *
+			 *     @type array {
+			 *         Activity arguments for your custom scope.
+			 *         See {@link BP_Activity_Query::_construct()} for more details.
+			 *     }
+			 *     @type array $override Optional. Override existing activity arguments passed by $r.
+			 * }
+			 * @param array $r Current activity arguments passed in BP_Activity_Activity::get().
+			 */
+			$scope_args = apply_filters( "bp_activity_set_{$scope}_scope_args", array(), $r );
+
+			if ( ! empty( $scope_args ) ) {
+				// merge override properties from other scopes
+				// this might be a problem...
+				if ( ! empty( $scope_args['override'] ) ) {
+					$override = array_merge( $override, $scope_args['override'] );
+					unset( $scope_args['override'] );
+				}
+
+				// save scope args
+				if ( ! empty( $scope_args ) ) {
+					$query_args[] = $scope_args;
+				}
+			}
+		}
+
+		if ( ! empty( $query_args ) ) {
+			// set relation to OR
+			$query_args['relation'] = 'OR';
+
+			$query = new BP_Activity_Query( $query_args );
+			$sql   = $query->get_sql();
+			if ( ! empty( $sql ) ) {
+				$retval['sql'] = $sql;
+			}
+		}
+
+		if ( ! empty( $override ) ) {
+			$retval['override'] = $override;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page).
+	 *
+	 * As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @deprecated 1.5
+	 * @deprecated Use BP_Activity_Activity::get() with an 'in' parameter instead.
+	 *
+	 * @param mixed    $activity_ids     Array or comma-separated string of activity IDs to retrieve.
+	 * @param int|bool $max              Maximum number of results to return. (Optional; default is no maximum).
+	 * @param int      $page             The set of results that the user is viewing. Used in pagination. (Optional; default is 1).
+	 * @param int      $per_page         Specifies how many results per page. Used in pagination. (Optional; default is 25).
+	 * @param string   $sort             MySQL column sort; ASC or DESC. (Optional; default is DESC).
+	 * @param bool     $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false).
+	 *
+	 * @return array
+	 */
+	public static function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) {
+		_deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' );
+		return BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids );
+	}
+
+	/**
+	 * Get the first activity ID that matches a set of criteria.
+	 *
+	 * @param int    $user_id           User ID to filter by.
+	 * @param string $component         Component to filter by.
+	 * @param string $type              Activity type to filter by.
+	 * @param int    $item_id           Associated item to filter by.
+	 * @param int    $secondary_item_id Secondary associated item to filter by.
+	 * @param string $action            Action to filter by.
+	 * @param string $content           Content to filter by.
+	 * @param string $date_recorded     Date to filter by.
+	 *
+	 * @todo Should parameters be optional?
+	 *
+	 * @return int|bool Activity ID on success, false if none is found.
+	 */
+	public static function get_id( $user_id, $component, $type, $item_id, $secondary_item_id, $action, $content, $date_recorded ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$where_args = false;
+
+		if ( ! empty( $user_id ) ) {
+			$where_args[] = $wpdb->prepare( "user_id = %d", $user_id );
+		}
+
+		if ( ! empty( $component ) ) {
+			$where_args[] = $wpdb->prepare( "component = %s", $component );
+		}
+
+		if ( ! empty( $type ) ) {
+			$where_args[] = $wpdb->prepare( "type = %s", $type );
+		}
+
+		if ( ! empty( $item_id ) ) {
+			$where_args[] = $wpdb->prepare( "item_id = %d", $item_id );
+		}
+
+		if ( ! empty( $secondary_item_id ) ) {
+			$where_args[] = $wpdb->prepare( "secondary_item_id = %d", $secondary_item_id );
+		}
+
+		if ( ! empty( $action ) ) {
+			$where_args[] = $wpdb->prepare( "action = %s", $action );
+		}
+
+		if ( ! empty( $content ) ) {
+			$where_args[] = $wpdb->prepare( "content = %s", $content );
+		}
+
+		if ( ! empty( $date_recorded ) ) {
+			$where_args[] = $wpdb->prepare( "date_recorded = %s", $date_recorded );
+		}
+
+		if ( ! empty( $where_args ) ) {
+			$where_sql = 'WHERE ' . join( ' AND ', $where_args );
+			return $wpdb->get_var( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" );
+		}
+
+		return false;
+	}
+
+	/**
+	 * Delete activity items from the database.
+	 *
+	 * To delete a specific activity item, pass an 'id' parameter.
+	 * Otherwise use the filters.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $args {
+	 *     @int    $id                Optional. The ID of a specific item to delete.
+	 *     @string $action            Optional. The action to filter by.
+	 *     @string $content           Optional. The content to filter by.
+	 *     @string $component         Optional. The component name to filter by.
+	 *     @string $type              Optional. The activity type to filter by.
+	 *     @string $primary_link      Optional. The primary URL to filter by.
+	 *     @int    $user_id           Optional. The user ID to filter by.
+	 *     @int    $item_id           Optional. The associated item ID to filter by.
+	 *     @int    $secondary_item_id Optional. The secondary associated item ID to filter by.
+	 *     @string $date_recorded     Optional. The date to filter by.
+	 *     @int    $hide_sitewide     Optional. Default: false.
+	 * }
+	 *
+	 * @return array|bool An array of deleted activity IDs on success, false on failure.
+	 */
+	public static function delete( $args = array() ) {
+		global $wpdb;
+
+		$bp = buddypress();
+		$r  = wp_parse_args( $args, array(
+			'id'                => false,
+			'action'            => false,
+			'content'           => false,
+			'component'         => false,
+			'type'              => false,
+			'primary_link'      => false,
+			'user_id'           => false,
+			'item_id'           => false,
+			'secondary_item_id' => false,
+			'date_recorded'     => false,
+			'hide_sitewide'     => false
+		) );
+
+		// Setup empty array from where query arguments
+		$where_args = array();
+
+		// ID
+		if ( ! empty( $r['id'] ) ) {
+			$where_args[] = $wpdb->prepare( "id = %d", $r['id'] );
+		}
+
+		// User ID
+		if ( ! empty( $r['user_id'] ) ) {
+			$where_args[] = $wpdb->prepare( "user_id = %d", $r['user_id'] );
+		}
+
+		// Action
+		if ( ! empty( $r['action'] ) ) {
+			$where_args[] = $wpdb->prepare( "action = %s", $r['action'] );
+		}
+
+		// Content
+		if ( ! empty( $r['content'] ) ) {
+			$where_args[] = $wpdb->prepare( "content = %s", $r['content'] );
+		}
+
+		// Component
+		if ( ! empty( $r['component'] ) ) {
+			$where_args[] = $wpdb->prepare( "component = %s", $r['component'] );
+		}
+
+		// Type
+		if ( ! empty( $r['type'] ) ) {
+			$where_args[] = $wpdb->prepare( "type = %s", $r['type'] );
+		}
+
+		// Primary Link
+		if ( ! empty( $r['primary_link'] ) ) {
+			$where_args[] = $wpdb->prepare( "primary_link = %s", $r['primary_link'] );
+		}
+
+		// Item ID
+		if ( ! empty( $r['item_id'] ) ) {
+			$where_args[] = $wpdb->prepare( "item_id = %d", $r['item_id'] );
+		}
+
+		// Secondary item ID
+		if ( ! empty( $r['secondary_item_id'] ) ) {
+			$where_args[] = $wpdb->prepare( "secondary_item_id = %d", $r['secondary_item_id'] );
+		}
+
+		// Date Recorded
+		if ( ! empty( $r['date_recorded'] ) ) {
+			$where_args[] = $wpdb->prepare( "date_recorded = %s", $r['date_recorded'] );
+		}
+
+		// Hidden sitewide
+		if ( ! empty( $r['hide_sitewide'] ) ) {
+			$where_args[] = $wpdb->prepare( "hide_sitewide = %d", $r['hide_sitewide'] );
+		}
+
+		// Bail if no where arguments
+		if ( empty( $where_args ) ) {
+			return false;
+		}
+
+		// Join the where arguments for querying
+		$where_sql = 'WHERE ' . join( ' AND ', $where_args );
+
+		// Fetch all activities being deleted so we can perform more actions
+		$activities = $wpdb->get_results( "SELECT * FROM {$bp->activity->table_name} {$where_sql}" );
+
+		/**
+		 * Action to allow intercepting activity items to be deleted.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array $activities Array of activities.
+		 * @param array $r          Array of parsed arguments.
+		 */
+		do_action_ref_array( 'bp_activity_before_delete', array( $activities, $r ) );
+
+		// Attempt to delete activities from the database
+		$deleted = $wpdb->query( "DELETE FROM {$bp->activity->table_name} {$where_sql}" );
+
+		// Bail if nothing was deleted
+		if ( empty( $deleted ) ) {
+			return false;
+		}
+
+		/**
+		 * Action to allow intercepting activity items just deleted.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array $activities Array of activities.
+		 * @param array $r          Array of parsed arguments.
+		 */
+		do_action_ref_array( 'bp_activity_after_delete', array( $activities, $r ) );
+
+		// Pluck the activity IDs out of the $activities array
+		$activity_ids = wp_parse_id_list( wp_list_pluck( $activities, 'id' ) );
+
+		// Handle accompanying activity comments and meta deletion
+		if ( ! empty( $activity_ids ) ) {
+
+			// Delete all activity meta entries for activity items
+			BP_Activity_Activity::delete_activity_meta_entries( $activity_ids );
+
+			// Setup empty array for comments
+			$comment_ids = array();
+
+			// Loop through activity ids and attempt to delete comments
+			foreach ( $activity_ids as $activity_id ) {
+
+				// Attempt to delete comments
+				$comments = BP_Activity_Activity::delete( array(
+					'type'    => 'activity_comment',
+					'item_id' => $activity_id
+				) );
+
+				// Merge IDs together
+				if ( ! empty( $comments ) ) {
+					$comment_ids = array_merge( $comment_ids, $comments );
+				}
+			}
+
+			// Merge activity IDs with any deleted comment IDs
+			if ( ! empty( $comment_ids ) ) {
+				$activity_ids = array_unique( array_merge( $activity_ids, $comment_ids ) );
+			}
+		}
+
+		return $activity_ids;
+	}
+
+	/**
+	 * Delete the comments associated with a set of activity items.
+	 *
+	 * This method is no longer used by BuddyPress, and it is recommended not to
+	 * use it going forward, and use BP_Activity_Activity::delete() instead.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @deprecated BuddyPress (2.3.0)
+	 *
+	 * @param array $activity_ids Activity IDs whose comments should be deleted.
+	 * @param bool  $delete_meta  Should we delete the activity meta items for these comments?
+	 *
+	 * @return bool True on success.
+	 */
+	public static function delete_activity_item_comments( $activity_ids = array(), $delete_meta = true ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$delete_meta  = (bool) $delete_meta;
+		$activity_ids = implode( ',', wp_parse_id_list( $activity_ids ) );
+
+		if ( $delete_meta ) {
+			// Fetch the activity comment IDs for our deleted activity items
+			$activity_comment_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" );
+
+			if ( ! empty( $activity_comment_ids ) ) {
+				self::delete_activity_meta_entries( $activity_comment_ids );
+			}
+		}
+
+		return $wpdb->query( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" );
+	}
+
+	/**
+	 * Delete the meta entries associated with a set of activity items.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $activity_ids Activity IDs whose meta should be deleted.
+	 *
+	 * @return bool True on success.
+	 */
+	public static function delete_activity_meta_entries( $activity_ids = array() ) {
+		$activity_ids = wp_parse_id_list( $activity_ids );
+
+		foreach ( $activity_ids as $activity_id ) {
+			bp_activity_delete_meta( $activity_id );
+		}
+
+		return true;
+	}
+
+	/**
+	 * Append activity comments to their associated activity items.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param array  $activities Activities to fetch comments for.
+	 * @param string $spam       Optional. 'ham_only' (default), 'spam_only' or 'all'.
+	 *
+	 * @return array The updated activities with nested comments.
+	 */
+	public static function append_comments( $activities, $spam = 'ham_only' ) {
+		$activity_comments = array();
+
+		// Now fetch the activity comments and parse them into the correct position in the activities array.
+		foreach ( (array) $activities as $activity ) {
+			$top_level_parent_id = 'activity_comment' == $activity->type ? $activity->item_id : 0;
+			$activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam, $top_level_parent_id );
+		}
+
+		// Merge the comments with the activity items
+		foreach ( (array) $activities as $key => $activity ) {
+			if ( isset( $activity_comments[$activity->id] ) ) {
+				$activities[$key]->children = $activity_comments[$activity->id];
+			}
+		}
+
+		return $activities;
+	}
+
+	/**
+	 * Get activity comments that are associated with a specific activity ID.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param int    $activity_id         Activity ID to fetch comments for.
+	 * @param int    $left                Left-most node boundary.
+	 * @param int    $right               Right-most node boundary.
+	 * @param string $spam                Optional. 'ham_only' (default), 'spam_only' or 'all'.
+	 * @param int    $top_level_parent_id Optional. The id of the root-level parent activity item.
+	 *
+	 * @return array The updated activities with nested comments.
+	 */
+	public static function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $top_level_parent_id ) ) {
+			$top_level_parent_id = $activity_id;
+		}
+
+		$comments = wp_cache_get( $activity_id, 'bp_activity_comments' );
+
+		// We store the string 'none' to cache the fact that the
+		// activity item has no comments
+		if ( 'none' === $comments ) {
+			$comments = false;
+
+		// A true cache miss
+		} elseif ( empty( $comments ) ) {
+
+			$bp = buddypress();
+
+			// Select the user's fullname with the query
+			if ( bp_is_active( 'xprofile' ) ) {
+				$fullname_select = ", pd.value as user_fullname";
+				$fullname_from = ", {$bp->profile->table_name_data} pd ";
+				$fullname_where = "AND pd.user_id = a.user_id AND pd.field_id = 1";
+
+			// Prevent debug errors
+			} else {
+				$fullname_select = $fullname_from = $fullname_where = '';
+			}
+
+			// Don't retrieve activity comments marked as spam
+			if ( 'ham_only' == $spam ) {
+				$spam_sql = 'AND a.is_spam = 0';
+			} elseif ( 'spam_only' == $spam ) {
+				$spam_sql = 'AND a.is_spam = 1';
+			} else {
+				$spam_sql = '';
+			}
+
+			// Legacy query - not recommended
+			$func_args = func_get_args();
+
+			/**
+			 * Filters if BuddyPress should use the legacy activity query.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param bool                 $value     Whether or not to use the legacy query.
+			 * @param BP_Activity_Activity $value     Magic method referring to currently called method.
+			 * @param array                $func_args Array of the method's argument list.
+			 */
+			if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $func_args ) ) {
+
+				/**
+				 * Filters the MySQL prepared statement for the legacy activity query.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string $value       Prepared statement for the activity query.
+				 * @param int    $activity_id Activity ID to fetch comments for.
+				 * @param int    $left        Left-most node boundary.
+				 * @param int    $right       Right-most node boundary.
+				 * @param string $spam_sql    SQL Statement portion to differentiate between ham or spam.
+				 */
+				$sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d AND a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right ), $activity_id, $left, $right, $spam_sql );
+
+				$descendants = $wpdb->get_results( $sql );
+
+			// We use the mptt BETWEEN clause to limit returned
+			// descendants to the correct part of the tree.
+			} else {
+				$sql = $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} a WHERE a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d and a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right );
+
+				$descendant_ids = $wpdb->get_col( $sql );
+				$descendants    = self::get_activity_data( $descendant_ids );
+				$descendants    = self::append_user_fullnames( $descendants );
+			}
+
+			$ref = array();
+
+			// Loop descendants and build an assoc array
+			foreach ( (array) $descendants as $d ) {
+				$d->children = array();
+
+				// If we have a reference on the parent
+				if ( isset( $ref[ $d->secondary_item_id ] ) ) {
+					$ref[ $d->secondary_item_id ]->children[ $d->id ] = $d;
+					$ref[ $d->id ] =& $ref[ $d->secondary_item_id ]->children[ $d->id ];
+
+				// If we don't have a reference on the parent, put in the root level
+				} else {
+					$comments[ $d->id ] = $d;
+					$ref[ $d->id ] =& $comments[ $d->id ];
+				}
+			}
+
+			// Calculate depth for each item
+			foreach ( $ref as &$r ) {
+				$depth = 1;
+				$parent_id = $r->secondary_item_id;
+				while ( $parent_id !== $r->item_id ) {
+					$depth++;
+
+					// When display_comments=stream, the
+					// parent comment may not be part of
+					// the returned results, so we manually
+					// fetch it
+					if ( empty( $ref[ $parent_id ] ) ) {
+						$direct_parent = new BP_Activity_Activity( $parent_id );
+						if ( isset( $direct_parent->secondary_item_id ) ) {
+							$parent_id = $direct_parent->secondary_item_id;
+						} else {
+							// Something went wrong
+							// Short-circuit the
+							// depth calculation
+							$parent_id = $r->item_id;
+						}
+					} else {
+						$parent_id = $ref[ $parent_id ]->secondary_item_id;
+					}
+				}
+				$r->depth = $depth;
+			}
+
+			// If we cache a value of false, it'll count as a cache
+			// miss the next time the activity comments are fetched.
+			// Storing the string 'none' is a hack workaround to
+			// avoid unnecessary queries.
+			if ( false === $comments ) {
+				$cache_value = 'none';
+			} else {
+				$cache_value = $comments;
+			}
+
+			wp_cache_set( $activity_id, $cache_value, 'bp_activity_comments' );
+		}
+
+		return $comments;
+	}
+
+	/**
+	 * Rebuild nested comment tree under an activity or activity comment.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param  int $parent_id ID of an activity or activity comment.
+	 * @param  int $left      Node boundary start for activity or activity comment.
+	 * @return int Right      Node boundary of activity or activity comment.
+	 */
+	public static function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// The right value of this node is the left value + 1
+		$right = intval( $left + 1 );
+
+		// Get all descendants of this node
+		$comments    = BP_Activity_Activity::get_child_comments( $parent_id );
+		$descendants = wp_list_pluck( $comments, 'id' );
+
+		// Loop the descendants and recalculate the left and right values
+		foreach ( (array) $descendants as $descendant_id ) {
+			$right = BP_Activity_Activity::rebuild_activity_comment_tree( $descendant_id, $right );
+		}
+
+		// We've got the left value, and now that we've processed the children
+		// of this node we also know the right value
+		if ( 1 === $left ) {
+			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE id = %d", $left, $right, $parent_id ) );
+		} else {
+			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET mptt_left = %d, mptt_right = %d WHERE type = 'activity_comment' AND id = %d", $left, $right, $parent_id ) );
+		}
+
+		// Return the right value of this node + 1
+		return intval( $right + 1 );
+	}
+
+	/**
+	 * Get child comments of an activity or activity comment.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param int $parent_id ID of an activity or activity comment.
+	 *
+	 * @return object Numerically indexed array of child comments.
+	 */
+	public static function get_child_comments( $parent_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
+	}
+
+	/**
+	 * Get a list of components that have recorded activity associated with them.
+	 *
+	 * @param bool $skip_last_activity If true, components will not be
+	 *        included if the only activity type associated with them is
+	 *        'last_activity'. (Since 2.0.0, 'last_activity' is stored in
+	 *        the activity table, but these items are not full-fledged
+	 *        activity items.) Default: true.
+	 *
+	 * @return array List of component names.
+	 */
+	public static function get_recorded_components( $skip_last_activity = true ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( true === $skip_last_activity ) {
+			$components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} WHERE action != '' AND action != 'last_activity' ORDER BY component ASC" );
+		} else {
+			$components = $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
+		}
+
+		return $components;
+	}
+
+	/**
+	 * Get sitewide activity items for use in an RSS feed.
+	 *
+	 * @param int $limit Optional. Number of items to fetch. Default: 35.
+	 *
+	 * @return array $activity_feed List of activity items, with RSS data added.
+	 */
+	public static function get_sitewide_items_for_feed( $limit = 35 ) {
+		$activities    = bp_activity_get_sitewide( array( 'max' => $limit ) );
+		$activity_feed = array();
+
+		for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) {
+			$title                            = explode( '<span', $activities[$i]['content'] );
+			$activity_feed[$i]['title']       = trim( strip_tags( $title[0] ) );
+			$activity_feed[$i]['link']        = $activities[$i]['primary_link'];
+			$activity_feed[$i]['description'] = @sprintf( $activities[$i]['content'], '' );
+			$activity_feed[$i]['pubdate']     = $activities[$i]['date_recorded'];
+		}
+
+		return $activity_feed;
+	}
+
+	/**
+	 * Create SQL IN clause for filter queries.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @see BP_Activity_Activity::get_filter_sql()
+	 *
+	 * @param string     $field The database field.
+	 * @param array|bool $items The values for the IN clause, or false when none are found.
+	 *
+	 * @return string|bool.
+	 */
+	public static function get_in_operator_sql( $field, $items ) {
+		global $wpdb;
+
+		// split items at the comma
+		if ( ! is_array( $items ) ) {
+			$items = explode( ',', $items );
+		}
+
+		// array of prepared integers or quoted strings
+		$items_prepared = array();
+
+		// clean up and format each item
+		foreach ( $items as $item ) {
+			// clean up the string
+			$item = trim( $item );
+			// pass everything through prepare for security and to safely quote strings
+			$items_prepared[] = ( is_numeric( $item ) ) ? $wpdb->prepare( '%d', $item ) : $wpdb->prepare( '%s', $item );
+		}
+
+		// build IN operator sql syntax
+		if ( count( $items_prepared ) )
+			return sprintf( '%s IN ( %s )', trim( $field ), implode( ',', $items_prepared ) );
+		else
+			return false;
+	}
+
+	/**
+	 * Create filter SQL clauses.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $filter_array {
+	 *     Fields and values to filter by.
+	 *
+	 *     @type array|string|int $user_id User ID(s).
+	 *     @type array|string     $object       Corresponds to the 'component'
+	 *                                          column in the database.
+	 *     @type array|string     $action       Corresponds to the 'type' column
+	 *                                          in the database.
+	 *     @type array|string|int $primary_id   Corresponds to the 'item_id'
+	 *                                          column in the database.
+	 *     @type array|string|int $secondary_id Corresponds to the
+	 *                                          'secondary_item_id' column in the database.
+	 *     @type int              $offset       Return only those items with an ID greater
+	 *                                          than the offset value.
+	 *     @type string           $since        Return only those items that have a
+	 *                                          date_recorded value greater than a
+	 *                                          given MySQL-formatted date.
+	 * }
+	 *
+	 * @return string The filter clause, for use in a SQL query.
+	 */
+	public static function get_filter_sql( $filter_array ) {
+
+		$filter_sql = array();
+
+		if ( !empty( $filter_array['user_id'] ) ) {
+			$user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] );
+			if ( !empty( $user_sql ) )
+				$filter_sql[] = $user_sql;
+		}
+
+		if ( !empty( $filter_array['object'] ) ) {
+			$object_sql = BP_Activity_Activity::get_in_operator_sql( 'a.component', $filter_array['object'] );
+			if ( !empty( $object_sql ) )
+				$filter_sql[] = $object_sql;
+		}
+
+		if ( !empty( $filter_array['action'] ) ) {
+			$action_sql = BP_Activity_Activity::get_in_operator_sql( 'a.type', $filter_array['action'] );
+			if ( ! empty( $action_sql ) )
+				$filter_sql[] = $action_sql;
+		}
+
+		if ( !empty( $filter_array['primary_id'] ) ) {
+			$pid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.item_id', $filter_array['primary_id'] );
+			if ( !empty( $pid_sql ) )
+				$filter_sql[] = $pid_sql;
+		}
+
+		if ( !empty( $filter_array['secondary_id'] ) ) {
+			$sid_sql = BP_Activity_Activity::get_in_operator_sql( 'a.secondary_item_id', $filter_array['secondary_id'] );
+			if ( !empty( $sid_sql ) )
+				$filter_sql[] = $sid_sql;
+		}
+
+		if ( ! empty( $filter_array['offset'] ) ) {
+			$sid_sql = absint( $filter_array['offset'] );
+			$filter_sql[] = "a.id >= {$sid_sql}";
+		}
+
+		if ( ! empty( $filter_array['since'] ) ) {
+			// Validate that this is a proper Y-m-d H:i:s date
+			// Trick: parse to UNIX date then translate back
+			$translated_date = date( 'Y-m-d H:i:s', strtotime( $filter_array['since'] ) );
+			if ( $translated_date === $filter_array['since'] ) {
+				$filter_sql[] = "a.date_recorded > '{$translated_date}'";
+			}
+		}
+
+		if ( empty( $filter_sql ) )
+			return false;
+
+		return join( ' AND ', $filter_sql );
+	}
+
+	/**
+	 * Get the date/time of last recorded activity.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @return string ISO timestamp.
+	 */
+	public static function get_last_updated() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" );
+	}
+
+	/**
+	 * Get favorite count for a given user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param int $user_id The ID of the user whose favorites you're counting.
+	 *
+	 * @return int $value A count of the user's favorites.
+	 */
+	public static function total_favorite_count( $user_id ) {
+
+		// Get activities from user meta
+		$favorite_activity_entries = bp_get_user_meta( $user_id, 'bp_favorite_activities', true );
+		if ( ! empty( $favorite_activity_entries ) ) {
+			return count( maybe_unserialize( $favorite_activity_entries ) );
+		}
+
+		// No favorites
+		return 0;
+	}
+
+	/**
+	 * Check whether an activity item exists with a given string content.
+	 *
+	 * @param string $content The content to filter by.
+	 *
+	 * @return int|bool The ID of the first matching item if found, otherwise false.
+	 */
+	public static function check_exists_by_content( $content ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE content = %s", $content ) );
+	}
+
+	/**
+	 * Hide all activity for a given user.
+	 *
+	 * @param int $user_id The ID of the user whose activity you want to mark hidden.
+	 *
+	 * @return mixed
+	 */
+	public static function hide_all_for_user( $user_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) );
+	}
+
+	/**
+	 * PHP-agnostic version of {@link array_replace_recursive()}.
+	 *
+	 * array_replace_recursive() is a PHP 5.3 function.  BuddyPress (and
+	 * WordPress) currently supports down to PHP 5.2, so this method is a workaround
+	 * for PHP 5.2.
+	 *
+	 * Note: array_replace_recursive() supports infinite arguments, but for our use-
+	 * case, we only need to support two arguments.
+	 *
+	 * Subject to removal once WordPress makes PHP 5.3.0 the minimum requirement.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @see http://php.net/manual/en/function.array-replace-recursive.php#109390
+	 *
+	 * @param  array $base         Array with keys needing to be replaced.
+	 * @param  array $replacements Array with the replaced keys.
+	 *
+	 * @return array
+	 */
+	protected static function array_replace_recursive( $base = array(), $replacements = array() ) {
+		if ( function_exists( 'array_replace_recursive' ) ) {
+			return array_replace_recursive( $base, $replacements );
+		}
+
+		// PHP 5.2-compatible version
+		// http://php.net/manual/en/function.array-replace-recursive.php#109390
+		foreach ( array_slice( func_get_args(), 1 ) as $replacements ) {
+			$bref_stack = array( &$base );
+			$head_stack = array( $replacements );
+
+			do {
+				end( $bref_stack );
+
+				$bref = &$bref_stack[ key( $bref_stack ) ];
+				$head = array_pop( $head_stack );
+
+				unset( $bref_stack[ key($bref_stack) ] );
+
+				foreach ( array_keys( $head ) as $key ) {
+					if ( isset( $key, $bref ) && is_array( $bref[$key] ) && is_array( $head[$key] ) ) {
+						$bref_stack[] = &$bref[ $key ];
+						$head_stack[] = $head[ $key ];
+					} else {
+						$bref[ $key ] = $head[ $key ];
+					}
+				}
+			} while( count( $head_stack ) );
+		}
+
+		return $base;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-feed.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-feed.php
new file mode 100644
index 0000000000000000000000000000000000000000..b1302eb00314ede6da85f6853fc968c2745ed4e9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-feed.php
@@ -0,0 +1,446 @@
+<?php
+/**
+ * BuddyPress Activity Classes
+ *
+ * @package BuddyPress
+ * @subpackage Activity
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Create a RSS feed using the activity component.
+ *
+ * You should only construct a new feed when you've validated that you're on
+ * the appropriate screen.
+ *
+ * See {@link bp_activity_action_sitewide_feed()} as an example.
+ *
+ * @param array $args {
+ *   @type string $id	            Required. Internal id for the feed; should be alphanumeric only.
+ *   @type string $title            Optional. RSS feed title.
+ *   @type string $link             Optional. Relevant link for the RSS feed.
+ *   @type string $description      Optional. RSS feed description.
+ *   @type string $ttl              Optional. Time-to-live. (see inline doc in constructor)
+ *   @type string $update_period    Optional. Part of the syndication module.
+ *                                            (see inline doc in constructor for more info)
+ *   @type string $update_frequency Optional. Part of the syndication module.
+ *                                            (see inline doc in constructor for more info)
+ *   @type string $max              Optional. Number of feed items to display.
+ *   @type array  $activity_args    Optional. Arguments passed to {@link bp_has_activities()}
+ * }
+ * @since BuddyPress (1.8.0)
+ */
+class BP_Activity_Feed {
+
+	/**
+	 * Holds our custom class properties.
+	 *
+	 * These variables are stored in a protected array that is magically
+	 * updated using PHP 5.2+ methods.
+	 *
+	 * @see BP_Feed::__construct() This is where $data is added.
+	 * @var array
+	 */
+	protected $data;
+
+	/**
+	 * Magic method for checking the existence of a certain data variable.
+	 *
+	 * @param string $key
+	 *
+	 * @return bool Whether or not data variable exists.
+	 */
+	public function __isset( $key ) { return isset( $this->data[$key] ); }
+
+	/**
+	 * Magic method for getting a certain data variable.
+	 *
+	 * @param string $key
+	 *
+	 * @return mixed Data in variable if available or null.
+	 */
+	public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
+
+	/**
+	 * Constructor.
+	 *
+	 * @param array $args Optional.
+	 */
+	public function __construct( $args = array() ) {
+
+		/**
+		 * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param bool true Default true aka feeds are enabled.
+		 */
+		if ( false === (bool) apply_filters( 'bp_activity_enable_feeds', true ) ) {
+			global $wp_query;
+
+			// set feed flag to false
+			$wp_query->is_feed = false;
+
+			return false;
+		}
+
+		// Setup data
+		$this->data = wp_parse_args( $args, array(
+			// Internal identifier for the RSS feed - should be alphanumeric only
+			'id'               => '',
+
+			// RSS title - should be plain-text
+			'title'            => '',
+
+			// relevant link for the RSS feed
+			'link'             => '',
+
+			// RSS description - should be plain-text
+			'description'      => '',
+
+			// Time-to-live - number of minutes to cache the data before an aggregator
+			// requests it again.  This is only acknowledged if the RSS client supports it
+			//
+			// See: http://www.rssboard.org/rss-profile#element-channel-ttl
+			//      http://www.kbcafe.com/rss/rssfeedstate.html#ttl
+			'ttl'              => '30',
+
+			// Syndication module - similar to ttl, but not really supported by RSS
+			// clients
+			//
+			// See: http://web.resource.org/rss/1.0/modules/syndication/#description
+			//      http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule
+			'update_period'    => 'hourly',
+			'update_frequency' => 2,
+
+			// Number of items to display
+			'max'              => 50,
+
+			// Activity arguments passed to bp_has_activities()
+			'activity_args'    => array()
+		) );
+
+		/**
+		 * Fires before the feed is setup so plugins can modify.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) );
+
+		// Setup class properties
+		$this->setup_properties();
+
+		// Check if id is valid
+		if ( empty( $this->id ) ) {
+			_doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' );
+			return false;
+		}
+
+		/**
+		 * Fires after the feed is setup so plugins can modify.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) );
+
+		// Setup feed hooks
+		$this->setup_hooks();
+
+		// Output the feed
+		$this->output();
+
+		// Kill the rest of the output
+		die();
+	}
+
+	/** SETUP ****************************************************************/
+
+	/**
+	 * Setup and validate the class properties.
+	 *
+	 * @access protected
+	 */
+	protected function setup_properties() {
+		$this->id               = sanitize_title( $this->id );
+		$this->title            = strip_tags( $this->title );
+		$this->link             = esc_url_raw( $this->link );
+		$this->description      = strip_tags( $this->description );
+		$this->ttl              = (int) $this->ttl;
+		$this->update_period    = strip_tags( $this->update_period );
+		$this->update_frequency = (int) $this->update_frequency;
+
+		$this->activity_args    = wp_parse_args( $this->activity_args, array(
+			'max'              => $this->max,
+			'per_page'         => $this->max,
+			'display_comments' => 'stream'
+		) );
+
+	}
+
+	/**
+	 * Setup some hooks that are used in the feed.
+	 *
+	 * Currently, these hooks are used to maintain backwards compatibility with
+	 * the RSS feeds previous to BP 1.8.
+	 *
+	 * @access protected
+	 */
+	protected function setup_hooks() {
+		add_action( 'bp_activity_feed_rss_attributes',   array( $this, 'backpat_rss_attributes' ) );
+		add_action( 'bp_activity_feed_channel_elements', array( $this, 'backpat_channel_elements' ) );
+		add_action( 'bp_activity_feed_item_elements',    array( $this, 'backpat_item_elements' ) );
+	}
+
+	/** BACKPAT HOOKS ********************************************************/
+
+	/**
+	 * Fire a hook to ensure backward compatibility for RSS attributes.
+	 */
+	public function backpat_rss_attributes() {
+
+		/**
+		 * Fires inside backpat_rss_attributes method for backwards compatibility related to RSS attributes.
+		 *
+		 * This hook was originally separated out for individual components but has since been abstracted into the BP_Activity_Feed class.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 */
+		do_action( 'bp_activity_' . $this->id . '_feed' );
+	}
+
+	/**
+	 * Fire a hook to ensure backward compatibility for channel elements.
+	 */
+	public function backpat_channel_elements() {
+
+		/**
+		 * Fires inside backpat_channel_elements method for backwards compatibility related to RSS channel elements.
+		 *
+		 * This hook was originally separated out for individual components but has since been abstracted into the BP_Activity_Feed class.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 */
+		do_action( 'bp_activity_' . $this->id . '_feed_head' );
+	}
+
+	/**
+	 * Fire a hook to ensure backward compatibility for item elements.
+	 */
+	public function backpat_item_elements() {
+		switch ( $this->id ) {
+
+			// sitewide and friends feeds use the 'personal' hook
+			case 'sitewide' :
+			case 'friends' :
+				$id = 'personal';
+
+				break;
+
+			default :
+				$id = $this->id;
+
+				break;
+		}
+
+		/**
+		 * Fires inside backpat_item_elements method for backwards compatibility related to RSS item elements.
+		 *
+		 * This hook was originally separated out for individual components but has since been abstracted into the BP_Activity_Feed class.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 */
+		do_action( 'bp_activity_' . $id . '_feed_item' );
+	}
+
+	/** HELPERS **************************************************************/
+
+	/**
+	 * Output the feed's item content.
+	 *
+	 * @access protected
+	 */
+	protected function feed_content() {
+		bp_activity_content_body();
+
+		switch ( $this->id ) {
+
+			// also output parent activity item if we're on a specific feed
+			case 'favorites' :
+			case 'friends' :
+			case 'mentions' :
+			case 'personal' :
+
+				if ( 'activity_comment' == bp_get_activity_action_name() ) :
+			?>
+				<strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> -
+				<?php bp_activity_parent_content() ?>
+			<?php
+				endif;
+
+				break;
+		}
+	}
+
+	/**
+	 * Sets various HTTP headers related to Content-Type and browser caching.
+	 *
+	 * Most of this class method is derived from {@link WP::send_headers()}.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @access protected
+	 */
+	protected function http_headers() {
+		// set up some additional headers if not on a directory page
+		// this is done b/c BP uses pseudo-pages
+		if ( ! bp_is_directory() ) {
+			global $wp_query;
+
+			$wp_query->is_404 = false;
+			status_header( 200 );
+		}
+
+		// Set content-type
+		@header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
+		send_nosniff_header();
+
+		// Cache-related variables
+		$last_modified      = mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false );
+		$modified_timestamp = strtotime( $last_modified );
+		$etag               = md5( $last_modified );
+
+		// Set cache-related headers
+		@header( 'Last-Modified: ' . $last_modified );
+		@header( 'Pragma: no-cache' );
+		@header( 'ETag: ' . '"' . $etag . '"' );
+
+		// First commit of BuddyPress! (Easter egg)
+		@header( 'Expires: Tue, 25 Mar 2008 17:13:55 GMT');
+
+		// Get ETag from supported user agents
+		if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) {
+			$client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );
+
+			// Remove quotes from ETag
+			$client_etag = trim( $client_etag, '"' );
+
+			// Strip suffixes from ETag if they exist (eg. "-gzip")
+			$etag_suffix_pos = strpos( $client_etag, '-' );
+			if ( ! empty( $etag_suffix_pos ) ) {
+				$client_etag = substr( $client_etag, 0, $etag_suffix_pos );
+			}
+
+		// No ETag found
+		} else {
+			$client_etag = false;
+		}
+
+		// Get client last modified timestamp from supported user agents
+		$client_last_modified      = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
+		$client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
+
+		// Set 304 status if feed hasn't been updated since last fetch
+		if ( ( $client_last_modified && $client_etag ) ?
+				 ( ( $client_modified_timestamp >= $modified_timestamp ) && ( $client_etag == $etag ) ) :
+				 ( ( $client_modified_timestamp >= $modified_timestamp ) || ( $client_etag == $etag ) ) ) {
+			$status = 304;
+		} else {
+			$status = false;
+		}
+
+		// If feed hasn't changed as reported by the user agent, set 304 status header
+		if ( ! empty( $status ) ) {
+			status_header( $status );
+
+			// cached response, so stop now!
+			if ( $status == 304 ) {
+				exit();
+			}
+		}
+	}
+
+	/** OUTPUT ***************************************************************/
+
+	/**
+	 * Output the RSS feed.
+	 *
+	 * @access protected
+	 */
+	protected function output() {
+		$this->http_headers();
+		echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>';
+	?>
+
+<rss version="2.0"
+	xmlns:content="http://purl.org/rss/1.0/modules/content/"
+	xmlns:atom="http://www.w3.org/2005/Atom"
+	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
+	<?php
+
+	/**
+	 * Fires at the end of the opening RSS tag for feed output so plugins can add extra attributes.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	do_action( 'bp_activity_feed_rss_attributes' ); ?>
+>
+
+<channel>
+	<title><?php echo $this->title; ?></title>
+	<link><?php echo $this->link; ?></link>
+	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
+	<description><?php echo $this->description ?></description>
+	<lastBuildDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ); ?></lastBuildDate>
+	<generator>https://buddypress.org/?v=<?php bp_version(); ?></generator>
+	<language><?php bloginfo_rss( 'language' ); ?></language>
+	<ttl><?php echo $this->ttl; ?></ttl>
+	<sy:updatePeriod><?php echo $this->update_period; ?></sy:updatePeriod>
+ 	<sy:updateFrequency><?php echo $this->update_frequency; ?></sy:updateFrequency>
+	<?php
+
+	/**
+	 * Fires at the end of channel elements list in RSS feed so plugins can add extra channel elements.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	do_action( 'bp_activity_feed_channel_elements' ); ?>
+
+	<?php if ( bp_has_activities( $this->activity_args ) ) : ?>
+		<?php while ( bp_activities() ) : bp_the_activity(); ?>
+			<item>
+				<guid isPermaLink="false"><?php bp_activity_feed_item_guid(); ?></guid>
+				<title><?php echo stripslashes( bp_get_activity_feed_item_title() ); ?></title>
+				<link><?php bp_activity_thread_permalink() ?></link>
+				<pubDate><?php echo mysql2date( 'D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false ); ?></pubDate>
+
+				<?php if ( bp_get_activity_feed_item_description() ) : ?>
+					<content:encoded><![CDATA[<?php $this->feed_content(); ?>]]></content:encoded>
+				<?php endif; ?>
+
+				<?php if ( bp_activity_can_comment() ) : ?>
+					<slash:comments><?php bp_activity_comment_count(); ?></slash:comments>
+				<?php endif; ?>
+
+				<?php
+
+				/**
+				 * Fires at the end of the individual RSS Item list in RSS feed so plugins can add extra item elements.
+				 *
+				 * @since BuddyPress (1.8.0)
+				 */
+				do_action( 'bp_activity_feed_item_elements' ); ?>
+			</item>
+		<?php endwhile; ?>
+
+	<?php endif; ?>
+</channel>
+</rss><?php
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-query.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..5945f38190cf0c3b29510f91faf7975b4dc5809f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-query.php
@@ -0,0 +1,258 @@
+<?php
+/**
+ * BuddyPress Activity Classes
+ *
+ * @package BuddyPress
+ * @subpackage Activity
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Class for generating the WHERE SQL clause for advanced activity fetching.
+ *
+ * This is notably used in {@link BP_Activity_Activity::get()} with the
+ * 'filter_query' parameter.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+class BP_Activity_Query extends BP_Recursive_Query {
+	/**
+	 * Array of activity queries.
+	 *
+	 * See {@see BP_Activity_Query::__construct()} for information on query arguments.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 * @var array
+	 */
+	public $queries = array();
+
+	/**
+	 * Table alias.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 * @var string
+	 */
+	public $table_alias = '';
+
+	/**
+	 * Supported DB columns.
+	 *
+	 * See the 'wp_bp_activity' DB table schema.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 * @var array
+	 */
+	public $db_columns = array(
+		'id', 'user_id', 'component', 'type', 'action', 'content',
+		'item_id', 'secondary_item_id', 'hide_sitewide', 'is_spam',
+	);
+
+	/**
+	 * Constructor.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $query {
+	 *     Array of query clauses.
+	 *
+	 *     @type array {
+	 *         @type string $column   Required. The column to query against. Basically, any DB column in the main
+	 *                                'wp_bp_activity' table.
+	 *         @type string $value    Required. Value to filter by.
+	 *         @type string $compare  Optional. The comparison operator. Default '='.
+	 *                                Accepts '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'LIKE',
+	 *                                'NOT LIKE', BETWEEN', 'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', 'RLIKE'.
+	 *         @type string $relation Optional. The boolean relationship between the activity queries.
+	 *                                Accepts 'OR', 'AND'. Default 'AND'.
+	 *         @type array {
+	 *             Optional. Another fully-formed activity query. See parameters above.
+	 *         }
+	 *     }
+	 * }
+	 */
+	public function __construct( $query = array() ) {
+		if ( ! is_array( $query ) ) {
+			return;
+		}
+
+		$this->queries = $this->sanitize_query( $query );
+	}
+
+	/**
+	 * Generates WHERE SQL clause to be appended to a main query.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param string $alias An existing table alias that is compatible with the current query clause.
+	 *                      Default: 'a'. BP_Activity_Activity::get() uses 'a', so we default to that.
+	 *
+	 * @return string SQL fragment to append to the main WHERE clause.
+	 */
+	public function get_sql( $alias = 'a' ) {
+		if ( ! empty( $alias ) ) {
+			$this->table_alias = sanitize_title( $alias );
+		}
+
+		$sql = $this->get_sql_clauses();
+
+		// we only need the 'where' clause
+		//
+		// also trim trailing "AND" clause from parent BP_Recursive_Query class
+		// since it's not necessary for our needs
+		return preg_replace( '/^\sAND/', '', $sql['where'] );
+	}
+
+	/**
+	 * Generate WHERE clauses for a first-order clause.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array $clause       Array of arguments belonging to the clause.
+	 * @param  array $parent_query Parent query to which the clause belongs.
+	 *
+	 * @return array {
+	 *     @type array $where Array of subclauses for the WHERE statement.
+	 *     @type array $join  Empty array. Not used.
+	 * }
+	 */
+	protected function get_sql_for_clause( $clause, $parent_query ) {
+		global $wpdb;
+
+		$sql_chunks = array(
+			'where' => array(),
+			'join' => array(),
+		);
+
+		$column = isset( $clause['column'] ) ? $this->validate_column( $clause['column'] ) : '';
+		$value  = isset( $clause['value'] )  ? $clause['value'] : '';
+		if ( empty( $column ) || ! isset( $clause['value'] ) ) {
+			return $sql_chunks;
+		}
+
+		if ( isset( $clause['compare'] ) ) {
+			$clause['compare'] = strtoupper( $clause['compare'] );
+		} else {
+			$clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';
+		}
+
+		// default 'compare' to '=' if no valid operator is found
+		if ( ! in_array( $clause['compare'], array(
+			'=', '!=', '>', '>=', '<', '<=',
+			'LIKE', 'NOT LIKE',
+			'IN', 'NOT IN',
+			'BETWEEN', 'NOT BETWEEN',
+			'REGEXP', 'NOT REGEXP', 'RLIKE'
+		) ) ) {
+			$clause['compare'] = '=';
+		}
+
+		$compare = $clause['compare'];
+
+		$alias = ! empty( $this->table_alias ) ? "{$this->table_alias}." : '';
+
+		// Next, Build the WHERE clause.
+		$where = '';
+
+		// value.
+		if ( isset( $clause['value'] ) ) {
+			if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+				if ( ! is_array( $value ) ) {
+					$value = preg_split( '/[,\s]+/', $value );
+				}
+			}
+
+			// tinyint
+			if ( ! empty( $column ) && true === in_array( $column, array( 'hide_sitewide', 'is_spam' ) ) ) {
+				$sql_chunks['where'][] = $wpdb->prepare( "{$alias}{$column} = %d", $value );
+
+			} else {
+				switch ( $compare ) {
+					// IN uses different syntax
+					case 'IN' :
+					case 'NOT IN' :
+						$in_sql = BP_Activity_Activity::get_in_operator_sql( "{$alias}{$column}", $value );
+
+						// 'NOT IN' operator is as easy as a string replace!
+						if ( 'NOT IN' === $compare ) {
+							$in_sql = str_replace( 'IN', 'NOT IN', $in_sql );
+						}
+
+						$sql_chunks['where'][] = $in_sql;
+						break;
+
+					case 'BETWEEN' :
+					case 'NOT BETWEEN' :
+						$value = array_slice( $value, 0, 2 );
+						$where = $wpdb->prepare( '%s AND %s', $value );
+						break;
+
+					case 'LIKE' :
+					case 'NOT LIKE' :
+						$value = '%' . bp_esc_like( $value ) . '%';
+						$where = $wpdb->prepare( '%s', $value );
+						break;
+
+					default :
+						$where = $wpdb->prepare( '%s', $value );
+						break;
+
+				}
+			}
+
+			if ( $where ) {
+				$sql_chunks['where'][] = "{$alias}{$column} {$compare} {$where}";
+			}
+		}
+
+		/*
+		 * Multiple WHERE clauses should be joined in parentheses.
+		 */
+		if ( 1 < count( $sql_chunks['where'] ) ) {
+			$sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );
+		}
+
+		return $sql_chunks;
+	}
+
+	/**
+	 * Determine whether a clause is first-order.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param array $query Clause to check.
+	 *
+	 * @return bool
+	 */
+	protected function is_first_order_clause( $query ) {
+		return isset( $query['column'] ) || isset( $query['value'] );
+	}
+
+	/**
+	 * Validates a column name parameter.
+	 *
+	 * Column names are checked against a whitelist of known tables.
+	 * See {@link BP_Activity_Query::db_tables}.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param string $column The user-supplied column name.
+	 *
+	 * @return string A validated column name value.
+	 */
+	public function validate_column( $column = '' ) {
+		if ( in_array( $column, $this->db_columns ) ) {
+			return $column;
+		} else {
+			return '';
+		}
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.css b/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.css
index d19c1e03c5727da858f7d1dd65fa1931e43b9ebe..36f8179206500593d86fb31d63d6b198c08f0b76 100644
--- a/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.css
+++ b/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.css
@@ -1,5 +1,5 @@
 .atwho-view {
-	background: #FFF;
+	background: rgba(204, 204, 204, 0.8);
 	border-radius: 2px;
 	border: 1px solid rgb(204, 204, 204);
 	box-shadow: 0 0 5px rgba(204, 204, 204, 0.25), 0 0 1px #FFF;
@@ -16,6 +16,7 @@
 	left: 0; 
 }
 .atwho-view ul {
+	background: #FFF;
 	list-style: none;
 	margin: auto;
 	padding: 0;
@@ -62,9 +63,6 @@
 		float: right;
 		margin: 0 0 0 10px;
 	}
-	.atwho-view small {
-		display: none;
-	}
 }
 @media (max-width: 400px) {
 	.atwho-view ul li {
@@ -77,4 +75,19 @@
 		margin-top: -5px;
 		width: 30px;
 	}
+	.atwho-view {
+		border-radius: 0;
+		height: 100%;
+		right: 0 !important;
+		width: 100%;
+	}
+	.atwho-view ul li .username {
+		display: inline-block;
+		margin: -10px 0 0 0;
+		padding: 10px 0;
+	}
+	.atwho-view ul li small {
+		display: inline-block;
+		margin-right: 20px;
+	}
 }
diff --git a/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.min.css b/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.min.css
index abdf7d67390394cc3fedf010e97eadbec0ec05df..a83e335043c74e8e427afee22ef8d227f1957c49 100644
--- a/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-activity/css/mentions-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-.atwho-view{background:#FFF;border-radius:2px;border:1px solid #ccc;box-shadow:0 0 5px rgba(204,204,204,.25),0 0 1px #FFF;color:#D84800;display:none;font-family:sans-serif;margin-top:18px;position:absolute;top:0;z-index:1000;left:0}.atwho-view ul{list-style:none;margin:auto;padding:0}.atwho-view ul li{border-bottom:1px solid #EFEFEF;box-sizing:content-box;cursor:pointer;display:block;font-size:14px;height:20px;line-height:20px;margin:0;overflow:hidden;padding:5px 10px}.atwho-view img{border-radius:2px;float:left;height:20px;margin-top:0;width:20px}.atwho-view strong{background:#EFEFEF;font:700}.atwho-view .username strong{color:#D54E21}.atwho-view small{color:#AAA;float:left;font-size:smaller;font-weight:400;margin:0 40px 0 10px}.atwho-view .cur{background:rgba(239,239,239,.5)}@media (max-width:900px){.atwho-view img{float:right;margin:0 0 0 10px}.atwho-view small{display:none}}@media (max-width:400px){.atwho-view ul li{font-size:16px;line-height:23px;padding:13px}.atwho-view ul li img{height:30px;margin-top:-5px;width:30px}}
\ No newline at end of file
+.atwho-view{background:rgba(204,204,204,.8);border-radius:2px;border:1px solid #ccc;box-shadow:0 0 5px rgba(204,204,204,.25),0 0 1px #FFF;color:#D84800;display:none;font-family:sans-serif;margin-top:18px;position:absolute;top:0;z-index:1000;left:0}.atwho-view ul{background:#FFF;list-style:none;margin:auto;padding:0}.atwho-view ul li{border-bottom:1px solid #EFEFEF;box-sizing:content-box;cursor:pointer;display:block;font-size:14px;height:20px;line-height:20px;margin:0;overflow:hidden;padding:5px 10px}.atwho-view img{border-radius:2px;float:left;height:20px;margin-top:0;width:20px}.atwho-view strong{background:#EFEFEF;font:700}.atwho-view .username strong{color:#D54E21}.atwho-view small{color:#AAA;float:left;font-size:smaller;font-weight:400;margin:0 40px 0 10px}.atwho-view .cur{background:rgba(239,239,239,.5)}@media (max-width:900px){.atwho-view img{float:right;margin:0 0 0 10px}}@media (max-width:400px){.atwho-view ul li{font-size:16px;line-height:23px;padding:13px}.atwho-view ul li img{height:30px;margin-top:-5px;width:30px}.atwho-view{border-radius:0;height:100%;right:0!important;width:100%}.atwho-view ul li .username{display:inline-block;margin:-10px 0 0;padding:10px 0}.atwho-view ul li small{display:inline-block;margin-right:20px}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/css/mentions.css b/wp-content/plugins/buddypress/bp-activity/css/mentions.css
index 351b9ebf3619f566530b306b069ed11792bb820a..9c7b66640a600feb12275d4529e204358e9c0df8 100644
--- a/wp-content/plugins/buddypress/bp-activity/css/mentions.css
+++ b/wp-content/plugins/buddypress/bp-activity/css/mentions.css
@@ -1,5 +1,5 @@
 .atwho-view {
-	background: #FFF;
+	background: rgba(204, 204, 204, 0.8);
 	border-radius: 2px;
 	border: 1px solid rgb(204, 204, 204);
 	box-shadow: 0 0 5px rgba(204, 204, 204, 0.25), 0 0 1px #FFF;
@@ -16,6 +16,7 @@
 	left: 0; 
 }
 .atwho-view ul {
+	background: #FFF;
 	list-style: none;
 	margin: auto;
 	padding: 0;
@@ -62,9 +63,6 @@
 		float: left;
 		margin: 0 10px 0 0;
 	}
-	.atwho-view small {
-		display: none;
-	}
 }
 @media (max-width: 400px) {
 	.atwho-view ul li {
@@ -77,4 +75,19 @@
 		margin-top: -5px;
 		width: 30px;
 	}
+	.atwho-view {
+		border-radius: 0;
+		height: 100%;
+		left: 0 !important;
+		width: 100%;
+	}
+	.atwho-view ul li .username {
+		display: inline-block;
+		margin: -10px 0 0 0;
+		padding: 10px 0;
+	}
+	.atwho-view ul li small {
+		display: inline-block;
+		margin-left: 20px;
+	}
 }
diff --git a/wp-content/plugins/buddypress/bp-activity/css/mentions.min.css b/wp-content/plugins/buddypress/bp-activity/css/mentions.min.css
index b9cce6d48cac5a4e53efa6de8dbd981fdd8f1cff..2f81cc14bd1ff621051a4c2394cf077d6eeea9eb 100644
--- a/wp-content/plugins/buddypress/bp-activity/css/mentions.min.css
+++ b/wp-content/plugins/buddypress/bp-activity/css/mentions.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-.atwho-view{background:#FFF;border-radius:2px;border:1px solid #ccc;box-shadow:0 0 5px rgba(204,204,204,.25),0 0 1px #FFF;color:#D84800;display:none;font-family:sans-serif;margin-top:18px;position:absolute;top:0;z-index:1000;left:0}.atwho-view ul{list-style:none;margin:auto;padding:0}.atwho-view ul li{border-bottom:1px solid #EFEFEF;box-sizing:content-box;cursor:pointer;display:block;font-size:14px;height:20px;line-height:20px;margin:0;overflow:hidden;padding:5px 10px}.atwho-view img{border-radius:2px;float:right;height:20px;margin-top:0;width:20px}.atwho-view strong{background:#EFEFEF;font:700}.atwho-view .username strong{color:#D54E21}.atwho-view small{color:#AAA;float:right;font-size:smaller;font-weight:400;margin:0 10px 0 40px}.atwho-view .cur{background:rgba(239,239,239,.5)}@media (max-width:900px){.atwho-view img{float:left;margin:0 10px 0 0}.atwho-view small{display:none}}@media (max-width:400px){.atwho-view ul li{font-size:16px;line-height:23px;padding:13px}.atwho-view ul li img{height:30px;margin-top:-5px;width:30px}}
\ No newline at end of file
+.atwho-view{background:rgba(204,204,204,.8);border-radius:2px;border:1px solid #ccc;box-shadow:0 0 5px rgba(204,204,204,.25),0 0 1px #FFF;color:#D84800;display:none;font-family:sans-serif;margin-top:18px;position:absolute;top:0;z-index:1000;left:0}.atwho-view ul{background:#FFF;list-style:none;margin:auto;padding:0}.atwho-view ul li{border-bottom:1px solid #EFEFEF;box-sizing:content-box;cursor:pointer;display:block;font-size:14px;height:20px;line-height:20px;margin:0;overflow:hidden;padding:5px 10px}.atwho-view img{border-radius:2px;float:right;height:20px;margin-top:0;width:20px}.atwho-view strong{background:#EFEFEF;font:700}.atwho-view .username strong{color:#D54E21}.atwho-view small{color:#AAA;float:right;font-size:smaller;font-weight:400;margin:0 10px 0 40px}.atwho-view .cur{background:rgba(239,239,239,.5)}@media (max-width:900px){.atwho-view img{float:left;margin:0 10px 0 0}}@media (max-width:400px){.atwho-view ul li{font-size:16px;line-height:23px;padding:13px}.atwho-view ul li img{height:30px;margin-top:-5px;width:30px}.atwho-view{border-radius:0;height:100%;left:0!important;width:100%}.atwho-view ul li .username{display:inline-block;margin:-10px 0 0;padding:10px 0}.atwho-view ul li small{display:inline-block;margin-left:20px}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-activity/js/mentions.js b/wp-content/plugins/buddypress/bp-activity/js/mentions.js
index 4ee6b349c69ce4d8c843846c03b45da6d7db3be7..65639a15988266942745275f48eed97b43bdf96e 100644
--- a/wp-content/plugins/buddypress/bp-activity/js/mentions.js
+++ b/wp-content/plugins/buddypress/bp-activity/js/mentions.js
@@ -76,20 +76,50 @@
 				 * @since BuddyPress (2.1.0)
 				 */
 				before_reposition: function( offset ) {
-					var $view = $( '#atwho-ground-' + this.id + ' .atwho-view' ),
-						caret = this.$inputor.caret( 'offset', { iframe: $( '#content_ifr' )[0] } ).left,
-						move;
+					// get the iframe, if any, already applied with atwho
+					var caret,
+							line,
+							iframeOffset,
+							move,
+							$view = $( '#atwho-ground-' + this.id + ' .atwho-view' ),
+							$body = $( 'body' ),
+							atwhoDataValue = this.$inputor.data( 'atwho' );
 
-					// If the caret is past horizontal half, then flip it, yo.
-					if ( caret > ( $( 'body' ).width() / 2 ) ) {
+					if ( 'undefined' !== atwhoDataValue && 'undefined' !== atwhoDataValue.iframe && null !== atwhoDataValue.iframe ) {
+						caret = this.$inputor.caret( 'offset', { iframe: atwhoDataValue.iframe } );
+						// Caret.js no longer calculates iframe caret position from the window (it's now just within the iframe).
+						// We need to get the iframe offset from the window and merge that into our object.
+						iframeOffset = $( atwhoDataValue.iframe ).offset();
+						if ( 'undefined' !== iframeOffset ) {
+							caret.left += iframeOffset.left;
+							caret.top  += iframeOffset.top;
+						}
+					} else {
+						caret = this.$inputor.caret( 'offset' );
+					}
+
+					// If the caret is past horizontal half, then flip it, yo
+					if ( caret.left > ( $body.width() / 2 ) ) {
 						$view.addClass( 'right' );
-						move = caret - offset.left - this.view.$el.width();
+						move = caret.left - offset.left - this.view.$el.width();
 					} else {
 						$view.removeClass( 'right' );
-						move = caret - offset.left + 1;
+						move = caret.left - offset.left + 1;
 					}
 
-					offset.top  += 1;
+					// If we're on a small screen, scroll to caret
+					if ( $body.width() <= 400 ) {
+						$( document ).scrollTop( caret.top - 6 );
+					}
+
+					// New position is under the caret (never above) and positioned to follow
+					// Dynamic sizing based on the input area (remove 'px' from end)
+					line = parseInt( this.$inputor.css( 'line-height' ).substr( 0, this.$inputor.css( 'line-height' ).length - 2 ), 10 );
+					if ( !line || line < 5 ) { // sanity check, and catch no line-height
+						line = 19;
+					}
+
+					offset.top   = caret.top + line;
 					offset.left += move;
 				},
 
@@ -103,8 +133,7 @@
 				 * @since BuddyPress (2.1.0)
 				 */
 				inserting_wrapper: function( $inputor, content, suffix ) {
-					var new_suffix = ( suffix === '' ) ? suffix : suffix || ' ';
-					return '' + content + new_suffix;
+					return '' + content + suffix;
 				}
 			}
 		},
@@ -122,7 +151,8 @@
 				 * @since BuddyPress (2.1.0)
 				 */
 				remote_filter: function( query, render_view ) {
-					var self = $( this );
+					var self = $( this ),
+						params = {};
 
 					mentionsItem = mentionsQueryCache[ query ];
 					if ( typeof mentionsItem === 'object' ) {
@@ -134,7 +164,13 @@
 						self.xhr.abort();
 					}
 
-					self.xhr = $.getJSON( ajaxurl, { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' } )
+					params = { 'action': 'bp_get_suggestions', 'term': query, 'type': 'members' };
+
+					if ( $.isNumeric( this.$inputor.data( 'suggestions-group-id' ) ) ) {
+						params['group-id'] = parseInt( this.$inputor.data( 'suggestions-group-id' ), 10 );
+					}
+
+					self.xhr = $.getJSON( ajaxurl, params )
 						/**
 						 * Success callback for the @suggestions lookup.
 						 *
@@ -192,13 +228,34 @@
 	};
 
 	$( document ).ready(function() {
-		var users = [];
+		var loadMentionsInTinyMCE,
+			loadAttempts = 0,
+			users        = [];
 
 		if ( typeof window.BP_Suggestions === 'object' ) {
 			users = window.BP_Suggestions.friends || users;
 		}
 
+		// Dashboard post 'visual' editor.
+		loadMentionsInTinyMCE = function() {
+			if ( loadAttempts < 4 || ! $( 'body' ).hasClass( 'wp-admin' ) ) {
+				loadAttempts++;
+
+				if ( typeof window.tinyMCE === 'undefined' || window.tinyMCE.activeEditor === null || typeof window.tinyMCE.activeEditor === 'undefined' ) {
+					setTimeout( loadMentionsInTinyMCE, 500 );
+					return;
+				}
+			}
+
+			$( window.tinyMCE.activeEditor.contentDocument.activeElement )
+				.atwho( 'setIframe', $( '#content_ifr' )[0] )
+				.bp_mentions( users );
+		};
+
 		// Activity/reply, post comments, dashboard post 'text' editor.
 		$( '.bp-suggestions, #comments form textarea, .wp-editor-area' ).bp_mentions( users );
+
+		// Dashboard post 'visual' editor.
+		loadMentionsInTinyMCE();
 	});
 })( jQuery );
diff --git a/wp-content/plugins/buddypress/bp-activity/js/mentions.min.js b/wp-content/plugins/buddypress/bp-activity/js/mentions.min.js
index f63cef358abefbb085ec76e5bf1b2ebb633e7b10..285cee7a07b31439fb2ba88625070183be50aeb8 100644
--- a/wp-content/plugins/buddypress/bp-activity/js/mentions.min.js
+++ b/wp-content/plugins/buddypress/bp-activity/js/mentions.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-!function(a){var b,c=[];a.fn.bp_mentions=function(d){a.isArray(d)&&(d={data:d});var e={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(b){var c,d=a("#atwho-ground-"+this.id+" .atwho-view"),e=this.$inputor.caret("offset",{iframe:a("#content_ifr")[0]}).left;e>a("body").width()/2?(d.addClass("right"),c=e-b.left-this.view.$el.width()):(d.removeClass("right"),c=e-b.left+1),b.top+=1,b.left+=c},inserting_wrapper:function(a,b,c){var d=""===c?c:c||" ";return""+b+d}}},f={callbacks:{remote_filter:function(d,e){var f=a(this);return b=c[d],"object"==typeof b?void e(b):(f.xhr&&f.xhr.abort(),void(f.xhr=a.getJSON(ajaxurl,{action:"bp_get_suggestions",term:d,type:"members"}).done(function(b){if(b.success){var f=a.map(b.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});c[d]=f,e(f)}})))}},data:a.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=a.extend(!0,{},e,f,d);return a.fn.atwho.call(this,g)},a(document).ready(function(){var b=[];"object"==typeof window.BP_Suggestions&&(b=window.BP_Suggestions.friends||b),a(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(b)})}(jQuery);
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+!function(a){var b,c=[];a.fn.bp_mentions=function(d){a.isArray(d)&&(d={data:d});var e={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(b){var c,d,e,f,g=a("#atwho-ground-"+this.id+" .atwho-view"),h=a("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=a(i.iframe).offset(),"undefined"!==e&&(c.left+=e.left,c.top+=e.top)):c=this.$inputor.caret("offset"),c.left>h.width()/2?(g.addClass("right"),f=c.left-b.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-b.left+1),h.width()<=400&&a(document).scrollTop(c.top-6),d=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),(!d||5>d)&&(d=19),b.top=c.top+d,b.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(d,e){var f=a(this),g={};return b=c[d],"object"==typeof b?void e(b):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:d,type:"members"},a.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=a.getJSON(ajaxurl,g).done(function(b){if(b.success){var f=a.map(b.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});c[d]=f,e(f)}})))}},data:a.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=a.extend(!0,{},e,f,d);return a.fn.atwho.call(this,g)},a(document).ready(function(){var b,c=0,d=[];"object"==typeof window.BP_Suggestions&&(d=window.BP_Suggestions.friends||d),b=function(){return(4>c||!a("body").hasClass("wp-admin"))&&(c++,"undefined"==typeof window.tinyMCE||null===window.tinyMCE.activeEditor||"undefined"==typeof window.tinyMCE.activeEditor)?void setTimeout(b,500):void a(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",a("#content_ifr")[0]).bp_mentions(d)},a(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(d),b()})}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
index e53909059c854fba09b941f7d7700c58bbdc95cd..2d77f1141813fd59a6cae211698f1816a4673858 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Redirect to a random blog in the multisite network.
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
index 8b67a16803cdccdf82d7b29e07f7a89c4f02a7e8..c29e56bc50f1d1efa4999246c7acc8533bfdb903 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php
@@ -8,19 +8,17 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register activity actions for the blogs component.
  *
  * @since BuddyPress (1.0.0)
  *
- * @global object $bp The BuddyPress global settings object.
- *
  * @return bool|null Returns false if activity component is not active.
  */
 function bp_blogs_register_activity_actions() {
-	global $bp;
+	$bp = buddypress();
 
 	// Bail if activity is not active
 	if ( ! bp_is_active( 'activity' ) ) {
@@ -33,28 +31,30 @@ function bp_blogs_register_activity_actions() {
 			'new_blog',
 			__( 'New site created', 'buddypress' ),
 			'bp_blogs_format_activity_action_new_blog',
-			__( 'New Sites', 'buddypress' )
+			__( 'New Sites', 'buddypress' ),
+			array( 'activity', 'member' ),
+			0
 		);
 	}
 
-	bp_activity_set_action(
-		$bp->blogs->id,
-		'new_blog_post',
-		__( 'New post published', 'buddypress' ),
-		'bp_blogs_format_activity_action_new_blog_post',
-		__( 'Posts', 'buddypress' ),
-		array( 'activity', 'member' )
-	);
-
-	bp_activity_set_action(
-		$bp->blogs->id,
-		'new_blog_comment',
-		__( 'New post comment posted', 'buddypress' ),
-		'bp_blogs_format_activity_action_new_blog_comment',
-		__( 'Comments', 'buddypress' ),
-		array( 'activity', 'member' )
-	);
+	// Only add the comment type if the 'post' post type is trackable
+	if ( post_type_supports( 'post', 'buddypress-activity' ) ) {
+		bp_activity_set_action(
+			$bp->blogs->id,
+			'new_blog_comment',
+			__( 'New post comment posted', 'buddypress' ),
+			'bp_blogs_format_activity_action_new_blog_comment',
+			__( 'Comments', 'buddypress' ),
+			array( 'activity', 'member' ),
+			10
+		);
+	}
 
+	/**
+	 * Fires after the registry of the default blog component activity actions.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'bp_blogs_register_activity_actions' );
 }
 add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions' );
@@ -85,6 +85,14 @@ function bp_blogs_format_activity_action_new_blog( $action, $activity ) {
 		}
 	}
 
+	/**
+	 * Filters the new blog activity action for the new blog.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   Constructed activity action.
+	 * @param obj    $activity Activity data object.
+	 */
 	return apply_filters( 'bp_blogs_format_activity_action_new_blog', $action, $activity );
 }
 
@@ -108,27 +116,68 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) {
 		bp_blogs_update_blogmeta( $activity->item_id, 'name', $blog_name );
 	}
 
-	$post_url = add_query_arg( 'p', $activity->secondary_item_id, trailingslashit( $blog_url ) );
+	/**
+	 * When the post is published we are faking an activity object
+	 * to which we add 2 properties :
+	 * - the post url
+	 * - the post title
+	 * This is done to build the 'post link' part of the activity
+	 * action string.
+	 * NB: in this case the activity has not yet been created.
+	 */
+	if ( isset( $activity->post_url ) ) {
+		$post_url = $activity->post_url;
+
+	/**
+	 * The post_url property is not set, we need to build the url
+	 * thanks to the post id which is also saved as the secondary
+	 * item id property of the activity object.
+	 */
+	} else {
+		$post_url = add_query_arg( 'p', $activity->secondary_item_id, trailingslashit( $blog_url ) );
+	}
 
-	$post_title = bp_activity_get_meta( $activity->id, 'post_title' );
+	// Should be the case when the post has just been published
+	if ( isset( $activity->post_title ) ) {
+		$post_title = $activity->post_title;
 
-	// Should only be empty at the time of post creation
+	// If activity already exists try to get the post title from activity meta
+	} else if ( ! empty( $activity->id ) ) {
+		$post_title = bp_activity_get_meta( $activity->id, 'post_title' );
+	}
+
+	/**
+	 * In case the post was published without a title
+	 * or the activity meta was not found
+	 */
 	if ( empty( $post_title ) ) {
+		// Defaults to no title
+		$post_title = esc_html__( '(no title)', 'buddypress' );
+
 		switch_to_blog( $activity->item_id );
 
 		$post = get_post( $activity->secondary_item_id );
 		if ( is_a( $post, 'WP_Post' ) ) {
-			$post_title = $post->post_title;
-			bp_activity_update_meta( $activity->id, 'post_title', $post_title );
+			// Does the post have a title ?
+			if ( ! empty( $post->post_title ) ) {
+				$post_title = $post->post_title;
+			}
+
+			// Make sure the activity exists before saving the post title in activity meta
+			if ( ! empty( $activity->id ) ) {
+				bp_activity_update_meta( $activity->id, 'post_title', $post_title );
+			}
 		}
 
 		restore_current_blog();
 	}
 
-	$post_link  = '<a href="' . $post_url . '">' . $post_title . '</a>';
+	// Build the 'post link' part of the activity action string
+	$post_link  = '<a href="' . esc_url( $post_url ) . '">' . $post_title . '</a>';
 
 	$user_link = bp_core_get_userlink( $activity->user_id );
 
+	// Build the complete activity action string
 	if ( is_multisite() ) {
 		$action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), $user_link, $post_link, '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' );
 	} else {
@@ -146,6 +195,14 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) {
 		}
 	}
 
+	/**
+	 * Filters the new blog post action for the new blog.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   Constructed activity action.
+	 * @param obj    $activity Activity data object.
+	 */
 	return apply_filters( 'bp_blogs_format_activity_action_new_blog_post', $action, $activity );
 }
 
@@ -193,7 +250,7 @@ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity )
 		restore_current_blog();
 	}
 
-	$post_link = '<a href="' . $post_url . '">' . $post_title . '</a>';
+	$post_link = '<a href="' . esc_url( $post_url ) . '">' . $post_title . '</a>';
 	$user_link = bp_core_get_userlink( $activity->user_id );
 
 	if ( is_multisite() ) {
@@ -213,6 +270,14 @@ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity )
 		}
 	}
 
+	/**
+	 * Filters the new blog comment action for the new blog.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   Constructed activity action.
+	 * @param obj    $activity Activity data object.
+	 */
 	return apply_filters( 'bp_blogs_format_activity_action_new_blog_comment', $action, $activity );
 }
 
@@ -255,7 +320,6 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_blogs_prefetch_activity_obje
  * @since BuddyPress (1.0.0)
  *
  * @see bp_activity_add() for description of parameters.
- * @global object $bp The BuddyPress global settings object.
  *
  * @param array $args {
  *     See {@link bp_activity_add()} for complete description of arguments.
@@ -266,13 +330,14 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_blogs_prefetch_activity_obje
  * @return int|bool On success, returns the activity ID. False on failure.
  */
 function bp_blogs_record_activity( $args = '' ) {
-	global $bp;
 
 	// Bail if activity is not active
 	if ( ! bp_is_active( 'activity' ) ) {
 		return false;
 	}
 
+	$bp = buddypress();
+
 	$defaults = array(
 		'user_id'           => bp_loggedin_user_id(),
 		'action'            => '',
@@ -288,17 +353,30 @@ function bp_blogs_record_activity( $args = '' ) {
 
 	$r = wp_parse_args( $args, $defaults );
 
-	// Remove large images and replace them with just one image thumbnail
-	if ( ! empty( $r['content'] ) ) {
-		$r['content'] = bp_activity_thumbnail_content_images( $r['content'], $r['primary_link'], $r );
-	}
-
 	if ( ! empty( $r['action'] ) ) {
+
+		/**
+		 * Filters the action associated with activity for activity stream.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Action for the activity stream.
+		 */
 		$r['action'] = apply_filters( 'bp_blogs_record_activity_action', $r['action'] );
 	}
 
 	if ( ! empty( $r['content'] ) ) {
-		$r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $r['content'] ), $r['content'], $r );
+
+		/**
+		 * Filters the content associated with activity for activity stream.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Generated summary from content for the activity stream.
+		 * @param string $value Content for the activity stream.
+		 * @param array  $r     Array of arguments used for the activity stream item.
+		 */
+		$r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_activity_create_summary( $r['content'], $r ), $r['content'], $r );
 	}
 
 	// Check for an existing entry and update if one exists.
@@ -527,6 +605,16 @@ function bp_blogs_sync_add_from_activity_comment( $comment_id, $params, $parent_
 	// add the comment hook back
 	add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 );
 
+	/**
+	 * Fires after activity comments have been synced and posted as blog comments.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param int    $comment_id      The activity ID for the posted activity comment.
+	 * @param array  $args            Array of args used for the comment syncing.
+	 * @param object $parent_activity Parameters of the blog post parent activity item.
+	 * @param object $user            User data object for the blog comment.
+	 */
 	do_action( 'bp_blogs_sync_add_from_activity_comment', $comment_id, $args, $parent_activity, $user );
 }
 add_action( 'bp_activity_comment_posted', 'bp_blogs_sync_add_from_activity_comment', 10, 3 );
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
index c16fba96fce58b3f797a0aa44db4022b3b8f439c..df751d223ee19154f210932a1f5a41d2f966ce93 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Slurp up blogmeta for a specified set of blogs.
@@ -42,27 +42,19 @@ function bp_blogs_update_meta_cache( $blog_ids = false ) {
  * @param int $blog_id ID of the current blog.
  * @param int $user_id ID of the user whose blog cache should be cleared.
  */
-function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) {
-	wp_cache_delete( 'bp_blogs_of_user_'        . $user_id, 'bp' );
-	wp_cache_delete( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
-}
+function bp_blogs_clear_blog_object_cache( $blog_id = 0, $user_id = 0 ) {
+	if ( ! empty( $user_id ) ) {
+		wp_cache_delete( 'bp_blogs_of_user_'        . $user_id, 'bp' );
+		wp_cache_delete( 'bp_total_blogs_for_user_' . $user_id, 'bp' );
+	}
 
-/**
- * Clear cache when a new blog is created.
- *
- * @since BuddyPress (1.0.0)
- *
- * @param BP_Blogs_Blog $recorded_blog_obj The recorded blog, passed by
- *        'bp_blogs_new_blog'.
- */
-function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) {
-	bp_blogs_clear_blog_object_cache( false, $recorded_blog_obj->user_id );
 	wp_cache_delete( 'bp_total_blogs', 'bp' );
 }
 
 // List actions to clear object caches on
 add_action( 'bp_blogs_remove_blog_for_user', 'bp_blogs_clear_blog_object_cache', 10, 2 );
-add_action( 'bp_blogs_new_blog',             'bp_blogs_format_clear_blog_cache', 10, 2 );
+add_action( 'wpmu_new_blog',                 'bp_blogs_clear_blog_object_cache', 10, 2 );
+add_action( 'bp_blogs_remove_blog',          'bp_blogs_clear_blog_object_cache' );
 
 // List actions to clear super cached pages on, if super cache is installed
 add_action( 'bp_blogs_remove_data_for_blog', 'bp_core_clear_cache' );
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
index 693265b6299de18995c6b5b32627a6672abfc4c6..bd4219227153e2211a7bd062866bed0b41c5b462 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php
@@ -8,524 +8,6 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
-/**
- * The main BuddyPress blog class.
- *
- * A BP_Blogs_Object represents a link between a specific WordPress blog on a
- * network and a specific user on that blog.
- *
- * @since BuddyPress (1.0.0)
- */
-class BP_Blogs_Blog {
-	public $id;
-	public $user_id;
-	public $blog_id;
-
-	/**
-	 * Constructor method.
-	 *
-	 * @param int $id Optional. The ID of the blog.
-	 */
-	public function __construct( $id = null ) {
-		if ( !empty( $id ) ) {
-			$this->id = $id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Populate the object with data about the specific activity item.
-	 */
-	public function populate() {
-		global $wpdb, $bp;
-
-		$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->blogs->table_name} WHERE id = %d", $this->id ) );
-
-		$this->user_id = $blog->user_id;
-		$this->blog_id = $blog->blog_id;
-	}
-
-	/**
-	 * Save the BP blog data to the database.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->user_id = apply_filters( 'bp_blogs_blog_user_id_before_save', $this->user_id, $this->id );
-		$this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id );
-
-		do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) );
-
-		// Don't try and save if there is no user ID or blog ID set.
-		if ( !$this->user_id || !$this->blog_id )
-			return false;
-
-		// Don't save if this blog has already been recorded for the user.
-		if ( !$this->id && $this->exists() )
-			return false;
-
-		if ( $this->id ) {
-			// Update
-			$sql = $wpdb->prepare( "UPDATE {$bp->blogs->table_name} SET user_id = %d, blog_id = %d WHERE id = %d", $this->user_id, $this->blog_id, $this->id );
-		} else {
-			// Save
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->blogs->table_name} ( user_id, blog_id ) VALUES ( %d, %d )", $this->user_id, $this->blog_id );
-		}
-
-		if ( !$wpdb->query($sql) )
-			return false;
-
-		do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) );
-
-		if ( $this->id )
-			return $this->id;
-		else
-			return $wpdb->insert_id;
-	}
-
-	/**
-	 * Check whether an association between this user and this blog exists.
-	 *
-	 * @return int The number of associations between the user and blog
-	 *         saved in the blog component tables.
-	 */
-	public function exists() {
-		global $bp, $wpdb;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $this->user_id, $this->blog_id ) );
-	}
-
-	/** Static Methods ***************************************************/
-
-	/**
-	 * Retrieve a set of blog-user associations.
-	 *
-	 * @param string $type The order in which results should be returned.
-	 *        'active', 'alphabetical', 'newest', or 'random'.
-	 * @param int|bool $limit Optional. The maximum records to return.
-	 *        Default: false.
-	 * @param int|bool $page Optional. The page of records to return.
-	 *        Default: false (unlimited results).
-	 * @param int $user_id Optional. ID of the user whose blogs are being
-	 *        retrieved. Default: 0.
-	 * @param string|bool $search_terms Optional. Search by text stored in
-	 *        blogmeta (such as the blog name). Default: false.
-	 * @param bool $update_meta_cache Whether to pre-fetch metadata for
-	 *        blogs. Default: true.
-	 * @param array $include_blog_ids Array of blog IDs to include.
-	 * @return array Multidimensional results array, structured as follows:
-	 *           'blogs' - Array of located blog objects
-	 *           'total' - A count of the total blogs matching the filter params
-	 */
-	public static function get( $type, $limit = false, $page = false, $user_id = 0, $search_terms = false, $update_meta_cache = true, $include_blog_ids = false ) {
-		global $bp, $wpdb;
-
-		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
-			$hidden_sql = "AND wb.public = 1";
-		else
-			$hidden_sql = '';
-
-		$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
-
-		$user_sql = !empty( $user_id ) ? $wpdb->prepare( " AND b.user_id = %d", $user_id ) : '';
-
-		switch ( $type ) {
-			case 'active': default:
-				$order_sql = "ORDER BY bm.meta_value DESC";
-				break;
-			case 'alphabetical':
-				$order_sql = "ORDER BY bm2.meta_value ASC";
-				break;
-			case 'newest':
-				$order_sql = "ORDER BY wb.registered DESC";
-				break;
-			case 'random':
-				$order_sql = "ORDER BY RAND()";
-				break;
-		}
-
-		$include_sql = '';
-		$include_blog_ids = array_filter( wp_parse_id_list( $include_blog_ids ) );
-		if ( ! empty( $include_blog_ids ) ) {
-			$blog_ids_sql = implode( ',', $include_blog_ids );
-			$include_sql  = " AND b.blog_id IN ({$blog_ids_sql})";
-		}
-
-		if ( !empty( $search_terms ) ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$search_terms_sql  = $wpdb->prepare( 'bm2.meta_value LIKE %s', $search_terms_like );
-			$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND {$search_terms_sql} {$user_sql} {$include_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
-			$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND {$search_terms_sql} {$user_sql} {$include_sql}" );
-		} else {
-			$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' {$include_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
-			$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$include_sql} {$hidden_sql}" );
-		}
-
-		$blog_ids = array();
-		foreach ( (array) $paged_blogs as $blog ) {
-			$blog_ids[] = (int) $blog->blog_id;
-		}
-
-		$paged_blogs = BP_Blogs_Blog::get_blog_extras( $paged_blogs, $blog_ids, $type );
-
-		if ( $update_meta_cache ) {
-			bp_blogs_update_meta_cache( $blog_ids );
-		}
-
-		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
-	}
-
-	/**
-	 * Delete the record of a given blog for all users.
-	 *
-	 * @param int $blog_id The blog being removed from all users.
-	 * @return int|bool Number of rows deleted on success, false on failure.
-	 */
-	public static function delete_blog_for_all( $blog_id ) {
-		global $wpdb, $bp;
-
-		bp_blogs_delete_blogmeta( $blog_id );
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id ) );
-	}
-
-	/**
-	 * Delete the record of a given blog for a specific user.
-	 *
-	 * @param int $blog_id The blog being removed.
-	 * @param int $user_id Optional. The ID of the user from whom the blog
-	 *        is being removed. If absent, defaults to the logged-in user ID.
-	 * @return int|bool Number of rows deleted on success, false on failure.
-	 */
-	public static function delete_blog_for_user( $blog_id, $user_id = null ) {
-		global $wpdb, $bp;
-
-		if ( !$user_id )
-			$user_id = bp_loggedin_user_id();
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $user_id, $blog_id ) );
-	}
-
-	/**
-	 * Delete all of a user's blog associations in the BP tables.
-	 *
-	 * @param int $user_id Optional. The ID of the user whose blog
-	 *        associations are being deleted. If absent, defaults to
-	 *        logged-in user ID.
-	 * @return int|bool Number of rows deleted on success, false on failure.
-	 */
-	public static function delete_blogs_for_user( $user_id = null ) {
-		global $wpdb, $bp;
-
-		if ( !$user_id )
-			$user_id = bp_loggedin_user_id();
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
-	}
-
-	/**
-	 * Get all of a user's blogs, as tracked by BuddyPress.
-	 *
-	 * Note that this is different from the WordPress function
-	 * {@link get_blogs_of_user()}; the current method returns only those
-	 * blogs that have been recorded by BuddyPress, while the WP function
-	 * does a true query of a user's blog capabilities.
-	 *
-	 * @param int $user_id Optional. ID of the user whose blogs are being
-	 *        queried. Defaults to logged-in user.
-	 * @param bool $show_hidden Optional. Whether to include blogs that are
-	 *        not marked public. Defaults to true when viewing one's own
-	 *        profile.
-	 * @return array Multidimensional results array, structured as follows:
-	 *           'blogs' - Array of located blog objects
-	 *           'total' - A count of the total blogs for the user.
-	 */
-	public static function get_blogs_for_user( $user_id = 0, $show_hidden = false ) {
-		global $bp, $wpdb;
-
-		if ( !$user_id )
-			$user_id = bp_displayed_user_id();
-
-		// Show logged in users their hidden blogs.
-		if ( !bp_is_my_profile() && !$show_hidden )
-			$blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id, b.id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.blog_id", $user_id ) );
-		else
-			$blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id, b.id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.blog_id", $user_id ) );
-
-		$total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
-
-		$user_blogs = array();
-		foreach ( (array) $blogs as $blog ) {
-			$user_blogs[$blog->blog_id] = new stdClass;
-			$user_blogs[$blog->blog_id]->id = $blog->id;
-			$user_blogs[$blog->blog_id]->blog_id = $blog->blog_id;
-			$user_blogs[$blog->blog_id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;
-			$user_blogs[$blog->blog_id]->name = $blog->name;
-		}
-
-		return array( 'blogs' => $user_blogs, 'count' => $total_blog_count );
-	}
-
-	/**
-	 * Get IDs of all of a user's blogs, as tracked by BuddyPress.
-	 *
-	 * This method always includes hidden blogs.
-	 *
-	 * @param int $user_id Optional. ID of the user whose blogs are being
-	 *        queried. Defaults to logged-in user.
-	 * @return int The number of blogs associated with the user.
-	 */
-	public static function get_blog_ids_for_user( $user_id = 0 ) {
-		global $bp, $wpdb;
-
-		if ( !$user_id )
-			$user_id = bp_displayed_user_id();
-
-		return $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
-	}
-
-	/**
-	 * Check whether a blog has been recorded by BuddyPress.
-	 *
-	 * @param int $blog_id ID of the blog being queried.
-	 * @return int|null The ID of the first located entry in the BP table
-	 *         on success, otherwise null.
-	 */
-	public static function is_recorded( $blog_id ) {
-		global $bp, $wpdb;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id ) );
-	}
-
-	/**
-	 * Return a count of associated blogs for a given user.
-	 *
-	 * Includes hidden blogs when the logged-in user is the same as the
-	 * $user_id parameter, or when the logged-in user has the bp_moderate
-	 * cap.
-	 *
-	 * @param int $user_id Optional. ID of the user whose blogs are being
-	 *        queried. Defaults to logged-in user.
-	 * @return int Blog count for the user.
-	 */
-	public static function total_blog_count_for_user( $user_id = null ) {
-		global $bp, $wpdb;
-
-		if ( !$user_id )
-			$user_id = bp_displayed_user_id();
-
-		// If the user is logged in return the blog count including their hidden blogs.
-		if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) ) {
-			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) );
-		} else {
-			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) );
-		}
-	}
-
-	/**
-	 * Return a list of blogs matching a search term.
-	 *
-	 * Matches against blog names and descriptions, as stored in the BP
-	 * blogmeta table.
-	 *
-	 * @param string $filter The search term.
-	 * @param int $limit Optional. The maximum number of items to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page of results to return. Default:
-	 *        null (no limit).
-	 * @return array Multidimensional results array, structured as follows:
-	 *           'blogs' - Array of located blog objects
-	 *           'total' - A count of the total blogs matching the query.
-	 */
-	public static function search_blogs( $filter, $limit = null, $page = null ) {
-		global $wpdb, $bp;
-
-		$search_terms_like = '%' . bp_esc_like( $filter ) . '%';
-		$search_terms_sql  = $wpdb->prepare( 'bm.meta_value LIKE %s', $search_terms_like );
-
-		$hidden_sql = '';
-		if ( !bp_current_user_can( 'bp_moderate' ) )
-			$hidden_sql = "AND wb.public = 1";
-
-		$pag_sql = '';
-		if ( $limit && $page ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND {$search_terms_sql} ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC{$pag_sql}" );
-		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND {$search_terms_sql} ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" );
-
-		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
-	}
-
-	/**
-	 * Retrieve a list of all blogs.
-	 *
-	 * Query will include hidden blogs if the logged-in user has the
-	 * 'bp_moderate' cap.
-	 *
-	 * @param int $limit Optional. The maximum number of items to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page of results to return. Default:
-	 *        null (no limit).
-	 * @return array Multidimensional results array, structured as follows:
-	 *           'blogs' - Array of located blog objects
-	 *           'total' - A count of the total blogs.
-	 */
-	public static function get_all( $limit = null, $page = null ) {
-		global $bp, $wpdb;
-
-		$hidden_sql = !bp_current_user_can( 'bp_moderate' ) ? "AND wb.public = 1" : '';
-		$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
-
-		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" );
-		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" );
-
-		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
-	}
-
-	/**
-	 * Retrieve a list of blogs whose names start with a given letter.
-	 *
-	 * Query will include hidden blogs if the logged-in user has the
-	 * 'bp_moderate' cap.
-	 *
-	 * @param string $letter. The letter you're looking for.
-	 * @param int $limit Optional. The maximum number of items to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page of results to return. Default:
-	 *        null (no limit).
-	 * @return array Multidimensional results array, structured as follows:
-	 *           'blogs' - Array of located blog objects.
-	 *           'total' - A count of the total blogs matching the query.
-	 */
-	public static function get_by_letter( $letter, $limit = null, $page = null ) {
-		global $bp, $wpdb;
-
-		$letter_like = '%' . bp_esc_like( $letter ) . '%';
-		$letter_sql  = $wpdb->prepare( 'bm.meta_value LIKE %s', $letter_like );
-
-		$hidden_sql = '';
-		if ( !bp_current_user_can( 'bp_moderate' ) )
-			$hidden_sql = "AND wb.public = 1";
-
-		$pag_sql = '';
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND {$letter_sql} {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" );
-		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND {$letter_sql} {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" );
-
-		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
-	}
-
-	/**
-	 * Fetch blog data not caught in the main query and append it to results array.
-	 *
-	 * Gets the following information, which is either unavailable at the
-	 * time of the original query, or is more efficient to look up in one
-	 * fell swoop:
-	 *   - The latest post for each blog, include Featured Image data
-	 *   - The blog description
-	 *
-	 * @param array $paged_blogs Array of results from the original query.
-	 * @param array $blog_ids Array of IDs returned from the original query.
-	 * @param string|bool $type Not currently used. Default: false.
-	 * @return array $paged_blogs The located blogs array, with the extras added.
-	 */
-	public static function get_blog_extras( &$paged_blogs, &$blog_ids, $type = false ) {
-		global $bp, $wpdb;
-
-		if ( empty( $blog_ids ) )
-			return $paged_blogs;
-
-		$blog_ids = implode( ',', wp_parse_id_list( $blog_ids ) );
-
-		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
-			$blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id );
-			$paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT ID, post_content, post_title, post_excerpt, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" );
-			$images = array();
-
-			// Add URLs to any Featured Image this post might have
-			if ( ! empty( $paged_blogs[$i]->latest_post ) && has_post_thumbnail( $paged_blogs[$i]->latest_post->ID ) ) {
-
-				// Grab 4 sizes of the image. Thumbnail.
-				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'thumbnail', false );
-				if ( ! empty( $image ) )
-					$images['thumbnail'] = $image[0];
-
-				// Medium
-				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'medium', false );
-				if ( ! empty( $image ) )
-					$images['medium'] = $image[0];
-
-				// Large
-				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'large', false );
-				if ( ! empty( $image ) )
-					$images['large'] = $image[0];
-
-				// Post thumbnail
-				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'post-thumbnail', false );
-				if ( ! empty( $image ) )
-					$images['post-thumbnail'] = $image[0];
-
-				// Add the images to the latest_post object
-				$paged_blogs[$i]->latest_post->images = $images;
-			}
-		}
-
-		/* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
-		$blog_descs = $wpdb->get_results( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" );
-
-		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
-			foreach ( (array) $blog_descs as $desc ) {
-				if ( $desc->blog_id == $paged_blogs[$i]->blog_id )
-					$paged_blogs[$i]->description = $desc->description;
-			}
-		}
-
-		return $paged_blogs;
-	}
-
-	/**
-	 * Check whether a given blog is hidden.
-	 *
-	 * Checks the 'public' column in the wp_blogs table.
-	 *
-	 * @param int $blog_id The ID of the blog being checked.
-	 * @return bool True if hidden (public = 0), false otherwise.
-	 */
-	public static function is_hidden( $blog_id ) {
-		global $wpdb;
-
-		if ( !(int) $wpdb->get_var( $wpdb->prepare( "SELECT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) ) {
-			return true;
-		}
-
-		return false;
-	}
-
-	/**
-	 * Get ID of user-blog link.
-	 *
-	 * @param int $user_id ID of user.
-	 * @param int $blog_id ID of blog.
-	 * @return int|bool ID of user-blog link, or false if not found.
-	 */
-	public static function get_user_blog( $user_id, $blog_id ) {
-		global $bp, $wpdb;
-
-		$user_blog = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $user_id, $blog_id ) );
-
-		if ( empty( $user_blog ) ) {
-			$user_blog = false;
-		} else {
-			$user_blog = intval( $user_blog );
-		}
-
-		return $user_blog;
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-blogs-blog.php';
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php
index 9cf0c92a7485157091166af7c17e74d597ff700e..2b96a34252ccfa12121b2d7cfdbcef38541634b0 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php
@@ -33,7 +33,15 @@ add_filter( 'bp_blog_latest_post_content', 'prepend_attachment' );
  * @return string The new URL.
  */
 function bp_blogs_creation_location( $url ) {
-	return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) );
+
+	/**
+	 * Filters the 'Create a new site' link URL.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $value URL for the 'Create a new site' signup page.
+	 */
+	return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_blogs_directory_permalink() . 'create' ), $url );
 }
 add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
 
@@ -42,13 +50,75 @@ add_filter( 'wp_signup_location', 'bp_blogs_creation_location' );
  *
  * @since BuddyPress (2.1.0)
  *
- * @see bp_blogs_update_post()
+ * @see bp_blogs_update_post_activity_meta()
  *
  * @param array Current SQL clauses in array format
  * @return array
  */
 function bp_blogs_comments_clauses_select_by_id( $retval ) {
 	$retval['fields'] = 'comment_ID';
-	
+
 	return $retval;
-}
\ No newline at end of file
+}
+
+/**
+ * Check whether the current post can be published.
+ *
+ * Abstracted from the deprecated `bp_blogs_record_post()`.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  bool $return  Whether the post should be published.
+ * @param  int  $blog_id ID of the blog.
+ * @param  int  $post_id ID of the post.
+ * @param  int  $user_id ID of the post author.
+ * @return bool True to authorize the post to be published, otherwise false.
+ */
+function bp_blogs_post_pre_publish( $return = true, $blog_id = 0, $post_id = 0, $user_id = 0 ) {
+	$bp = buddypress();
+
+	// If blog is not trackable, do not record the activity.
+	if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) {
+		return false;
+	}
+
+	/*
+	 * Stop infinite loops with WordPress MU Sitewide Tags.
+	 * That plugin changed the way its settings were stored at some point. Thus the dual check.
+	 */
+	$sitewide_tags_blog_settings = bp_core_get_root_option( 'sitewide_tags_blog' );
+	if ( ! empty( $sitewide_tags_blog_settings ) ) {
+		$st_options = maybe_unserialize( $sitewide_tags_blog_settings );
+		$tags_blog_id = isset( $st_options['tags_blog_id'] ) ? $st_options['tags_blog_id'] : 0;
+	} else {
+		$tags_blog_id = bp_core_get_root_option( 'sitewide_tags_blog' );
+		$tags_blog_id = intval( $tags_blog_id );
+	}
+
+	/**
+	 * Filters whether or not BuddyPress should block sitewide tags activity.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param bool $value Current status of the sitewide tags activity.
+	 */
+	if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) ) {
+		return false;
+	}
+
+	/**
+	 * Filters whether or not the current blog is public.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param int $value Value from the blog_public option for the current blog.
+	 */
+	$is_blog_public = apply_filters( 'bp_is_blog_public', (int) get_blog_option( $blog_id, 'blog_public' ) );
+
+	if ( 0 === $is_blog_public && is_multisite() ) {
+		return false;
+	}
+
+	return $return;
+}
+add_filter( 'bp_activity_post_pre_publish', 'bp_blogs_post_pre_publish', 10, 4 );
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
index 41f62f62abba5ac300d37fc2bba7dc354b63719d..c45590af743059b70740094555b910332c3b4066 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php
@@ -7,19 +7,17 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Check whether the $bp global lists an activity directory page.
  *
  * @since BuddyPress (1.5.0)
  *
- * @global BuddyPress $bp The one true BuddyPress instance.
- *
  * @return bool True if set, false if empty.
  */
 function bp_blogs_has_directory() {
-	global $bp;
+	$bp = buddypress();
 
 	return (bool) !empty( $bp->pages->blogs->id );
 }
@@ -236,12 +234,12 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
 		return false;
 
 	$name = get_blog_option( $blog_id, 'blogname' );
+	$url  = get_home_url( $blog_id );
 
 	if ( empty( $name ) ) {
-		return false;
+		$name = $url;
 	}
 
-	$url             = get_home_url( $blog_id );
 	$description     = get_blog_option( $blog_id, 'blogdescription' );
 	$close_old_posts = get_blog_option( $blog_id, 'close_comments_for_old_posts' );
 	$close_days_old  = get_blog_option( $blog_id, 'close_comments_days_old' );
@@ -283,6 +281,15 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
 		) );
 	}
 
+	/**
+	 * Fires after BuddyPress has been made aware of a new site for activity tracking.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param BP_Blogs_Blog $recorded_blog Current blog being recorded. Passed by reference.
+	 * @param bool          $is_private    Whether or not the current blog being recorded is private.
+	 * @param bool          $is_recorded   Whether or not the current blog was recorded.
+	 */
 	do_action_ref_array( 'bp_blogs_new_blog', array( &$recorded_blog, $is_private, $is_recorded ) );
 }
 add_action( 'wpmu_new_blog', 'bp_blogs_record_blog', 10, 2 );
@@ -402,199 +409,78 @@ function bp_blogs_update_option_thread_comments_depth( $oldvalue, $newvalue ) {
 add_action( 'update_option_thread_comments_depth', 'bp_blogs_update_option_thread_comments_depth', 10, 2 );
 
 /**
- * Detect a change in post status, and initiate an activity update if necessary.
- *
- * Posts get new activity updates when (a) they are being published, and (b)
- * they have not already been published. This enables proper posting for
- * regular posts as well as scheduled posts, while preventing post bumping.
+ * Deletes the 'url' blogmeta for a site.
  *
- * See #4090, #3746, #2546 for background.
- *
- * @since BuddyPress (2.0.0)
+ * Hooked to 'refresh_blog_details', which is notably used when editing a site
+ * under "Network Admin > Sites".
  *
- * @todo Support untrashing better
+ * @since BuddyPress (2.3.0)
  *
- * @param string $new_status New status for the post.
- * @param string $old_status Old status for the post.
- * @param object $post Post data.
+ * @param int $site_id The site ID
  */
-function bp_blogs_catch_transition_post_status( $new_status, $old_status, $post ) {
-
-	// This is an edit
-	if ( $new_status === $old_status ) {
-		if ( $new_status == 'publish' ) {
-			bp_blogs_update_post( $post );
-			return;
-		}
-	}
-
-	// Publishing a previously unpublished post
-	if ( 'publish' === $new_status ) {
-		// Untrashing the post
-		// Nothing here yet
-		if ( 'trash' == $old_status ) {}
-
-		// Record the post
-		bp_blogs_record_post( $post->ID, $post );
-
-	// Unpublishing a previously published post
-	} else if ( 'publish' === $old_status ) {
-		// Some form of pending status
-		// Only remove the activity entry
-		bp_blogs_delete_activity( array(
-			'item_id'           => get_current_blog_id(),
-			'secondary_item_id' => $post->ID,
-			'component'         => buddypress()->blogs->id,
-			'type'              => 'new_blog_post'
-		) );
-	}
+function bp_blogs_delete_url_blogmeta( $site_id = 0 ) {
+	bp_blogs_delete_blogmeta( (int) $site_id, 'url' );
 }
-add_action( 'transition_post_status', 'bp_blogs_catch_transition_post_status', 10, 3 );
+add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' );
 
 /**
- * Record a new blog post in the BuddyPress activity stream.
+ * Record activity metadata about a published blog post.
  *
- * @param int $post_id ID of the post being recorded.
- * @param object $post The WP post object passed to the 'save_post' action.
- * @param int $user_id Optional. The user to whom the activity item will be
- *        associated. Defaults to the post_author.
- * @return bool|null Returns false on failure.
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  int     $activity_id ID of the activity item.
+ * @param  WP_Post $post        Post object.
  */
-function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
-	global $bp, $wpdb;
-
-	$post_id = (int) $post_id;
-	$blog_id = (int) $wpdb->blogid;
-
-	// If blog is not trackable, do not record the activity.
-	if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) )
-		return false;
+function bp_blogs_publish_post_activity_meta( $activity_id, $post, $args ) {
+	if ( empty( $activity_id ) || 'post' != $post->post_type ) {
+		return;
+	}
 
-	if ( !$user_id )
-		$user_id = (int) $post->post_author;
+	bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
 
-	// Stop infinite loops with WordPress MU Sitewide Tags.
-	// That plugin changed the way its settings were stored at some point. Thus the dual check.
-	if ( !empty( $bp->site_options['sitewide_tags_blog'] ) ) {
-		$st_options = maybe_unserialize( $bp->site_options['sitewide_tags_blog'] );
-		$tags_blog_id = isset( $st_options['tags_blog_id'] ) ? $st_options['tags_blog_id'] : 0;
+	if ( ! empty( $args['post_url'] ) ) {
+		$post_permalink = $args['post_url'];
 	} else {
-		$tags_blog_id = isset( $bp->site_options['tags_blog_id'] ) ? $bp->site_options['tags_blog_id'] : 0;
+		$post_permalink = $post->guid;
 	}
 
-	if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) )
-		return false;
-
-	// Don't record this if it's not a post
-	if ( !in_array( $post->post_type, apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) ) ) )
-		return false;
+	bp_activity_update_meta( $activity_id, 'post_url',   $post_permalink );
 
-	$is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) );
-
-	if ( 'publish' == $post->post_status && empty( $post->post_password ) ) {
-		if ( $is_blog_public || !is_multisite() ) {
-
-			// Record this in activity streams
-			$post_permalink = add_query_arg(
-				'p',
-				$post_id,
-				trailingslashit( get_home_url( $blog_id ) )
-			);
+	// Update the blog's last activity.
+	bp_blogs_update_blogmeta( $args['item_id'], 'last_activity', bp_core_current_time() );
 
-			if ( is_multisite() )
-				$activity_action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
-			else
-				$activity_action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
-
-			// Make sure there's not an existing entry for this post (prevent bumping)
-			if ( bp_is_active( 'activity' ) ) {
-				$existing = bp_activity_get( array(
-					'filter' => array(
-						'action'       => 'new_blog_post',
-						'primary_id'   => $blog_id,
-						'secondary_id' => $post_id,
-					)
-				) );
-
-				if ( !empty( $existing['activities'] ) ) {
-					return;
-				}
-			}
-
-			$activity_content = $post->post_content;
-
-			$activity_id = bp_blogs_record_activity( array(
-				'user_id'           => (int) $post->post_author,
-				'content'           => apply_filters( 'bp_blogs_activity_new_post_content',      $activity_content, $post, $post_permalink ),
-				'primary_link'      => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink,   $post_id               ),
-				'type'              => 'new_blog_post',
-				'item_id'           => $blog_id,
-				'secondary_item_id' => $post_id,
-				'recorded_time'     => $post->post_date_gmt,
-			) );
-
-			// save post title in activity meta
-			if ( bp_is_active( 'activity' ) ) {
-				bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
-				bp_activity_update_meta( $activity_id, 'post_url',   $post_permalink );
-			}
-		}
-
-		// Update the blogs last activity
-		bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() );
-	} else {
-		bp_blogs_remove_post( $post_id, $blog_id, $user_id );
-	}
-
-	do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id );
+	/**
+	 * Fires after BuddyPress has recorded metadata about a published blog post.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int     $ID    ID of the blog post being recorded.
+	 * @param WP_Post $post  WP_Post object for the current blog post.
+	 * @param string  $value ID of the user associated with the current blog post.
+	 */
+	do_action( 'bp_blogs_new_blog_post', $post->ID, $post, $args['user_id'] );
 }
+add_action( 'bp_activity_post_type_published', 'bp_blogs_publish_post_activity_meta', 10, 3 );
 
 /**
- * Updates a blog post's corresponding activity entry during a post edit.
+ * Updates a blog post's activity meta entry during a post edit.
  *
- * @since BuddyPress (2.0.0)
- *
- * @see bp_blogs_catch_transition_post_status()
+ * @since BuddyPress (2.2.0)
  *
- * @param WP_Post $post
+ * @param WP_Post              $post     Post object.
+ * @param BP_Activity_Activity $activity Activity object.
  */
-function bp_blogs_update_post( $post ) {
-	if ( ! bp_is_active( 'activity' ) ) {
-		return;
-	}
-
-	$activity_id = bp_activity_get_activity_id( array(
-		'component'         => buddypress()->blogs->id,
-		'item_id'           => get_current_blog_id(),
-		'secondary_item_id' => $post->ID,
-		'type'              => 'new_blog_post',
-	 ) );
-
-	// activity ID doesn't exist, so stop!
-	if ( empty( $activity_id ) ) {
+function bp_blogs_update_post_activity_meta( $post, $activity ) {
+	if ( empty( $activity->id ) || 'post' != $post->post_type ) {
 		return;
 	}
 
-	// update the activity entry
-	$activity = new BP_Activity_Activity( $activity_id );
-
-	if ( ! empty( $post->post_content ) ) {
-		// Make sure to update the thumbnail image
-		$post_content = bp_activity_thumbnail_content_images( $post->post_content, $activity->primary_link, (array) $activity );
-
-		// Make sure to apply the blop post excerpt
-		$activity->content = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $post_content ), $post_content, (array) $activity );
-	}
-
-	// Save the updated activity
-	$activity->save();
-
-	// update post title in activity meta
-	$existing_title = bp_activity_get_meta( $activity_id, 'post_title' );
+	// Update post title in activity meta.
+	$existing_title = bp_activity_get_meta( $activity->id, 'post_title' );
 	if ( $post->post_title !== $existing_title ) {
-		bp_activity_update_meta( $activity_id, 'post_title', $post->post_title );
+		bp_activity_update_meta( $activity->id, 'post_title', $post->post_title );
 
-		// now update activity meta for post comments... sigh
+		// Now update activity meta for post comments... sigh.
 		add_filter( 'comments_clauses', 'bp_blogs_comments_clauses_select_by_id' );
 		$comments = get_comments( array( 'post_id' => $post->ID ) );
 		remove_filter( 'comments_clauses', 'bp_blogs_comments_clauses_select_by_id' );
@@ -603,14 +489,14 @@ function bp_blogs_update_post( $post ) {
 			$activity_ids = array();
 			$comment_ids  = wp_list_pluck( $comments, 'comment_ID' );
 
-			// setup activity args
+			// Set up activity args.
 			$args = array(
 				'update_meta_cache' => false,
 				'show_hidden'       => true,
 				'per_page'          => 99999,
 			);
 
-			// query for old-style "new_blog_comment" activity items
+			// Query for old-style "new_blog_comment" activity items.
 			$args['filter'] = array(
 				'object'       => buddypress()->blogs->id,
 				'action'       => 'new_blog_comment',
@@ -622,7 +508,7 @@ function bp_blogs_update_post( $post ) {
 				$activity_ids = (array) wp_list_pluck( $activities['activities'], 'id' );
 			}
 
-			// query for activity comments connected to a blog post
+			// Query for activity comments connected to a blog post.
 			unset( $args['filter'] );
 			$args['meta_query'] = array( array(
 				'key'     => 'bp_blogs_post_comment_id',
@@ -637,7 +523,7 @@ function bp_blogs_update_post( $post ) {
 				$activity_ids = array_merge( $activity_ids, (array) wp_list_pluck( $activities['activities'], 'id' ) );
 			}
 
-			// update activity meta for all found activity items
+			// Update activity meta for all found activity items.
 			if ( ! empty( $activity_ids ) ) {
 				foreach ( $activity_ids as $aid ) {
 					bp_activity_update_meta( $aid, 'post_title', $post->post_title );
@@ -648,13 +534,14 @@ function bp_blogs_update_post( $post ) {
 		}
 	}
 
-	// add post comment status to activity meta if closed
+	// Add post comment status to activity meta if closed.
 	if( 'closed' == $post->comment_status ) {
-		bp_activity_update_meta( $activity_id, 'post_comment_status', $post->comment_status );
+		bp_activity_update_meta( $activity->id, 'post_comment_status', $post->comment_status );
 	} else {
-		bp_activity_delete_meta( $activity_id, 'post_comment_status' );
+		bp_activity_delete_meta( $activity->id, 'post_comment_status' );
 	}
 }
+add_action( 'bp_activity_post_type_updated', 'bp_blogs_update_post_activity_meta', 10, 2 );
 
 /**
  * Record a new blog comment in the BuddyPress activity stream.
@@ -932,9 +819,9 @@ add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
  * WordPress catches add-user-to-blog requests at init:10. In some cases, this
  * can precede BP's Blogs component. This function bumps the priority of the
  * core function, so that we can be sure that the Blogs component is loaded
- * first. See http://buddypress.trac.wordpress.org/ticket/3916.
+ * first. See https://buddypress.trac.wordpress.org/ticket/3916.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  * @access private
  */
 function bp_blogs_maybe_add_user_to_blog() {
@@ -952,16 +839,36 @@ add_action( 'init', 'bp_blogs_maybe_add_user_to_blog', 1 );
  * @param int $blog_id ID of the blog being removed.
  */
 function bp_blogs_remove_blog( $blog_id ) {
-	global $bp;
 
 	$blog_id = (int) $blog_id;
+
+	/**
+	 * Fires before a "blog created" item is removed from blogs
+	 * tracker and activity stream.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $blog_id ID of the blog having its item removed.
+	 */
 	do_action( 'bp_blogs_before_remove_blog', $blog_id );
 
 	BP_Blogs_Blog::delete_blog_for_all( $blog_id );
 
 	// Delete activity stream item
-	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) );
+	bp_blogs_delete_activity( array(
+		'item_id'   => $blog_id,
+		'component' => buddypress()->blogs->id,
+		'type'      => 'new_blog'
+	) );
 
+	/**
+	 * Fires after a "blog created" item has been removed from blogs
+	 * tracker and activity stream.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $blog_id ID of the blog who had its item removed.
+	 */
 	do_action( 'bp_blogs_remove_blog', $blog_id );
 }
 add_action( 'delete_blog', 'bp_blogs_remove_blog' );
@@ -973,11 +880,18 @@ add_action( 'delete_blog', 'bp_blogs_remove_blog' );
  * @param int $blog_id ID of the blog being removed.
  */
 function bp_blogs_remove_blog_for_user( $user_id, $blog_id ) {
-	global $bp;
 
 	$blog_id = (int) $blog_id;
 	$user_id = (int) $user_id;
 
+	/**
+	 * Fires before a blog is removed from the tracker for a specific user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $blog_id ID of the blog being removed.
+	 * @param int $user_id ID of the user having the blog removed for.
+	 */
 	do_action( 'bp_blogs_before_remove_blog_for_user', $blog_id, $user_id );
 
 	BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id );
@@ -985,10 +899,18 @@ function bp_blogs_remove_blog_for_user( $user_id, $blog_id ) {
 	// Delete activity stream item
 	bp_blogs_delete_activity( array(
 		'item_id'   => $blog_id,
-		'component' => $bp->blogs->id,
+		'component' => buddypress()->blogs->id,
 		'type'      => 'new_blog'
 	) );
 
+	/**
+	 * Fires after a blog has been removed from the tracker for a specific user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $blog_id ID of the blog that was removed.
+	 * @param int $user_id ID of the user having the blog removed for.
+	 */
 	do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );
 }
 add_action( 'remove_user_from_blog', 'bp_blogs_remove_blog_for_user', 10, 2 );
@@ -1002,7 +924,7 @@ add_action( 'remove_user_from_blog', 'bp_blogs_remove_blog_for_user', 10, 2 );
  *        is currently unused in the function (but is passed to hooks).
  */
 function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
-	global $wpdb, $bp;
+	global $wpdb;
 
 	if ( empty( $wpdb->blogid ) )
 		return false;
@@ -1015,11 +937,34 @@ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
 	if ( !$user_id )
 		$user_id = bp_loggedin_user_id();
 
+	/**
+	 * Fires before removal of a blog post activity item from the activity stream.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $blog_id ID of the blog associated with the post that was removed.
+	 * @param int $post_id ID of the post that was removed.
+	 * @param int $user_id ID of the user having the blog removed for.
+	 */
 	do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id );
 
 	// Delete activity stream item
-	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->id, 'type' => 'new_blog_post' ) );
+	bp_blogs_delete_activity( array(
+		'item_id'           => $blog_id,
+		'secondary_item_id' => $post_id,
+		'component'         => buddypress()->blogs->id,
+		'type'              => 'new_blog_post'
+	) );
 
+	/**
+	 * Fires after removal of a blog post activity item from the activity stream.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $blog_id ID of the blog associated with the post that was removed.
+	 * @param int $post_id ID of the post that was removed.
+	 * @param int $user_id ID of the user having the blog removed for.
+	 */
 	do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $user_id );
 }
 add_action( 'delete_post', 'bp_blogs_remove_post' );
@@ -1079,6 +1024,15 @@ function bp_blogs_remove_comment( $comment_id ) {
 		}
 	}
 
+	/**
+	 * Fires after a blog comment activity item was removed from activity stream.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $blogid     Item ID for the blog associated with the removed comment.
+	 * @param int $comment_id ID of the comment being removed.
+	 * @param int $value      ID of the current logged in user.
+	 */
 	do_action( 'bp_blogs_remove_comment', $wpdb->blogid, $comment_id, bp_loggedin_user_id() );
 }
 add_action( 'delete_comment', 'bp_blogs_remove_comment' );
@@ -1129,14 +1083,11 @@ function bp_blogs_remove_associated_blog_comments( $activity_ids = array(), $for
  *
  * @since BuddyPress (1.6.0)
  *
- * @global object $bp BuddyPress global settings.
- *
  * @param string $new_status New comment status.
  * @param string $old_status Previous comment status.
  * @param object $comment Comment data.
  */
 function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) {
-	global $bp;
 
 	// Check the Activity component is active
 	if ( ! bp_is_active( 'activity' ) )
@@ -1165,7 +1116,12 @@ function bp_blogs_transition_activity_status( $new_status, $old_status, $comment
 
 	// Get the activity
 	if ( bp_disable_blogforum_comments() ) {
-		$activity_id = bp_activity_get_activity_id( array( 'component' => $bp->blogs->id, 'item_id' => get_current_blog_id(), 'secondary_item_id' => $comment->comment_ID, 'type' => 'new_blog_comment', ) );
+		$activity_id = bp_activity_get_activity_id( array(
+			'component'         => buddypress()->blogs->id,
+			'item_id'           => get_current_blog_id(),
+			'secondary_item_id' => $comment->comment_ID,
+			'type'              => 'new_blog_comment'
+		) );
 	} else {
 		$activity_id = get_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', true );
 	}
@@ -1210,7 +1166,9 @@ add_action( 'transition_comment_status', 'bp_blogs_transition_activity_status',
  * @return int $count Total blog count.
  */
 function bp_blogs_total_blogs() {
-	if ( !$count = wp_cache_get( 'bp_total_blogs', 'bp' ) ) {
+	$count = wp_cache_get( 'bp_total_blogs', 'bp' );
+
+	if ( false === $count ) {
 		$blogs = BP_Blogs_Blog::get_all();
 		$count = $blogs['total'];
 		wp_cache_set( 'bp_total_blogs', $count, 'bp' );
@@ -1252,16 +1210,35 @@ function bp_blogs_total_blogs_for_user( $user_id = 0 ) {
  * @param int $blog_id The ID of the blog to expunge.
  */
 function bp_blogs_remove_data_for_blog( $blog_id ) {
-	global $bp;
 
+	/**
+	 * Fires before all data related to a given blog is removed from blogs tracker
+	 * and activity stream.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $blog_id ID of the blog whose data is being removed.
+	 */
 	do_action( 'bp_blogs_before_remove_data_for_blog', $blog_id );
 
 	// If this is regular blog, delete all data for that blog.
 	BP_Blogs_Blog::delete_blog_for_all( $blog_id );
 
 	// Delete activity stream item
-	bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => false ) );
+	bp_blogs_delete_activity( array(
+		'item_id'   => $blog_id,
+		'component' => buddypress()->blogs->id,
+		'type'      => false
+	) );
 
+	/**
+	 * Fires after all data related to a given blog has been removed from blogs tracker
+	 * and activity stream.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $blog_id ID of the blog whose data is being removed.
+	 */
 	do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
 }
 add_action( 'delete_blog', 'bp_blogs_remove_data_for_blog', 1 );
@@ -1328,10 +1305,9 @@ function bp_blogs_is_blog_hidden( $blog_id ) {
  */
 
 /**
- * Delete a metadta from the DB for a blog.
+ * Delete a metadata from the DB for a blog.
  *
  * @global object $wpdb WordPress database access object.
- * @global object $bp BuddyPress global settings.
  *
  * @param int $blog_id ID of the blog whose metadata is being deleted.
  * @param string $meta_key Optional. The key of the metadata being deleted. If
@@ -1345,7 +1321,7 @@ function bp_blogs_is_blog_hidden( $blog_id ) {
  * @return bool True on success, false on failure.
  */
 function bp_blogs_delete_blogmeta( $blog_id, $meta_key = false, $meta_value = false, $delete_all = false ) {
-	global $wpdb, $bp;
+	global $wpdb;
 
 	// Legacy - if no meta_key is passed, delete all for the blog_id
 	if ( empty( $meta_key ) ) {
@@ -1373,7 +1349,6 @@ function bp_blogs_delete_blogmeta( $blog_id, $meta_key = false, $meta_value = fa
  * @since BuddyPress (1.2.0)
  *
  * @global object $wpdb WordPress database access object.
- * @global object $bp BuddyPress global settings.
  *
  * @param int $blog_id ID of the blog whose metadata is being requested.
  * @param string $meta_key Optional. If present, only the metadata matching
@@ -1396,7 +1371,6 @@ function bp_blogs_get_blogmeta( $blog_id, $meta_key = '', $single = true ) {
  * Update a piece of blog meta.
  *
  * @global object $wpdb WordPress database access object.
- * @global object $bp BuddyPress global settings.
  *
  * @param int $blog_id ID of the blog whose metadata is being updated.
  * @param string $meta_key Key of the metadata being updated.
@@ -1446,13 +1420,53 @@ function bp_blogs_remove_data( $user_id ) {
 	if ( !is_multisite() )
 		return false;
 
+	/**
+	 * Fires before all blog associations are removed for a given user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $user_id ID of the user whose blog associations are being removed.
+	 */
 	do_action( 'bp_blogs_before_remove_data', $user_id );
 
 	// If this is regular blog, delete all data for that blog.
 	BP_Blogs_Blog::delete_blogs_for_user( $user_id );
 
+	/**
+	 * Fires after all blog associations are removed for a given user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id ID of the user whose blog associations were removed.
+	 */
 	do_action( 'bp_blogs_remove_data', $user_id );
 }
 add_action( 'wpmu_delete_user',  'bp_blogs_remove_data' );
 add_action( 'delete_user',       'bp_blogs_remove_data' );
 add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' );
+
+/**
+ * Restore all blog associations for a given user
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int $user_id ID whose blog data should be restored.
+ */
+function bp_blogs_restore_data( $user_id = 0 ) {
+	if ( ! is_multisite() ) {
+		return;
+	}
+
+	// Get the user's blogs
+	$user_blogs = get_blogs_of_user( $user_id );
+	if ( empty( $user_blogs ) ) {
+		return;
+	}
+
+	$blogs = array_keys( $user_blogs );
+
+	foreach ( $blogs as $blog_id ) {
+		bp_blogs_add_user_to_blog( $user_id, false, $blog_id );
+	}
+}
+add_action( 'bp_make_ham_user', 'bp_blogs_restore_data', 10, 1 );
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
index 112cc8049e554999950e760da649374f3b03784c..2e36870e6a74396e2a10e4ddc9e4b1faf0a681bf 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php
@@ -5,14 +5,14 @@
  *
  * The blogs component tracks posts and comments to member activity streams,
  * shows blogs the member can post to in their profiles, and caches useful
- * information from those blogs to make quering blogs in bulk more performant.
+ * information from those blogs to make querying blogs in bulk more performant.
  *
  * @package BuddyPress
  * @subpackage Blogs Core
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Blogs_Component extends BP_Component {
 
@@ -66,6 +66,7 @@ class BP_Blogs_Component extends BP_Component {
 			'slug'                  => BP_BLOGS_SLUG,
 			'root_slug'             => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
 			'has_directory'         => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site
+			'directory_title'       => _x( 'Sites', 'component directory title', 'buddypress' ),
 			'notification_callback' => 'bp_blogs_format_notifications',
 			'search_string'         => __( 'Search sites...', 'buddypress' ),
 			'autocomplete_all'      => defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' ),
@@ -75,6 +76,31 @@ class BP_Blogs_Component extends BP_Component {
 
 		// Setup the globals
 		parent::setup_globals( $args );
+
+		/*
+		 * Set up the post post type to track.
+		 *
+		 * In case the config is not multisite, the blog_public option is ignored.
+		 */
+		if ( 0 !== apply_filters( 'bp_is_blog_public', (int) get_option( 'blog_public' ) ) || ! is_multisite() ) {
+
+			/**
+			 * Filters the post types to track for the Blogs component.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 * @deprecated BuddyPress (2.3.0)
+			 *
+			 * @param array $value Array of post types to track.
+			 */
+			$post_types = apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) );
+
+			foreach ( $post_types as $post_type ) {
+				add_post_type_support( $post_type, 'buddypress-activity' );
+			}
+		}
+
+		// Filter the generic track parameters for the 'post' post type.
+		add_filter( 'bp_activity_get_post_type_tracking_args', array( $this, 'post_tracking_args' ), 10, 2 );
 	}
 
 	/**
@@ -129,8 +155,11 @@ class BP_Blogs_Component extends BP_Component {
 		}
 
 		// Add 'Sites' to the main navigation
-		$main_nav =  array(
-			'name'                => sprintf( __( 'Sites <span>%d</span>', 'buddypress' ), bp_get_total_blog_count_for_user() ),
+		$count    = (int) bp_get_total_blog_count_for_user();
+		$class    = ( 0 === $count ) ? 'no-count' : 'count';
+		$nav_text = sprintf( __( 'Sites <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count )  );
+		$main_nav = array(
+			'name'                => $nav_text,
 			'slug'                => $this->slug,
 			'position'            => 30,
 			'screen_function'     => 'bp_blogs_screen_my_blogs',
@@ -246,6 +275,60 @@ class BP_Blogs_Component extends BP_Component {
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'blog_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
+
+	/**
+	 * Set up the tracking arguments for the 'post' post type.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @see bp_activity_get_post_type_tracking_args() for information on parameters.
+	 */
+	public function post_tracking_args( $params = null, $post_type = 0 ) {
+		/**
+		 * Filters the post types to track for the Blogs component.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 * @deprecated BuddyPress (2.3.0)
+		 *
+		 * Make sure plugins still using 'bp_blogs_record_post_post_types'
+		 * to track their post types will generate new_blog_post activities
+		 * See https://buddypress.trac.wordpress.org/ticket/6306
+		 *
+		 * @param array $value Array of post types to track.
+		 */
+		$post_types = apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) );
+		$post_types_array = array_flip( $post_types );
+
+		if ( ! isset( $post_types_array[ $post_type ] ) ) {
+			return $params;
+		}
+
+		// Set specific params for the 'post' post type.
+		$params->component_id    = $this->id;
+		$params->action_id       = 'new_blog_post';
+		$params->admin_filter    = __( 'New post published', 'buddypress' );
+		$params->format_callback = 'bp_blogs_format_activity_action_new_blog_post';
+		$params->front_filter    = __( 'Posts', 'buddypress' );
+		$params->contexts        = array( 'activity', 'member' );
+		$params->position        = 5;
+
+		return $params;
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
index b1ab65184a6784595b47fc26f23dc04bdfc235bb..4b47ef5a1a93a79063c392f4e8e01ee30520a73f 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Load the "My Blogs" screen.
@@ -17,6 +17,11 @@ function bp_blogs_screen_my_blogs() {
 	if ( !is_multisite() )
 		return false;
 
+	/**
+	 * Fires right before the loading of the My Blogs screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'bp_blogs_screen_my_blogs' );
 
 	bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) );
@@ -33,6 +38,11 @@ function bp_blogs_screen_create_a_blog() {
 	if ( !is_user_logged_in() || !bp_blog_signup_enabled() )
 		return false;
 
+	/**
+	 * Fires right before the loading of the Create A Blog screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'bp_blogs_screen_create_a_blog' );
 
 	bp_core_load_template( apply_filters( 'bp_blogs_template_create_a_blog', 'blogs/create' ) );
@@ -46,6 +56,11 @@ function bp_blogs_screen_index() {
 	if ( bp_is_blogs_directory() ) {
 		bp_update_is_directory( true, 'blogs' );
 
+		/**
+		 * Fires right before the loading of the top-level Blogs screen template file.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 */
 		do_action( 'bp_blogs_screen_index' );
 
 		bp_core_load_template( apply_filters( 'bp_blogs_screen_index', 'blogs/index' ) );
@@ -53,12 +68,12 @@ function bp_blogs_screen_index() {
 }
 add_action( 'bp_screens', 'bp_blogs_screen_index', 2 );
 
-/** Theme Compatability *******************************************************/
+/** Theme Compatibility *******************************************************/
 
 /**
  * The main theme compat class for BuddyPress Blogs
  *
- * This class sets up the necessary theme compatability actions to safely output
+ * This class sets up the necessary theme compatibility actions to safely output
  * group template parts to the_title and the_content areas of a theme.
  *
  * @since BuddyPress (1.7.0)
@@ -75,7 +90,7 @@ class BP_Blogs_Theme_Compat {
 	}
 
 	/**
-	 * Are we looking at something that needs Blogs theme compatability?
+	 * Are we looking at something that needs Blogs theme compatibility?
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
@@ -93,6 +108,12 @@ class BP_Blogs_Theme_Compat {
 		if ( is_multisite() && ! bp_current_action() ) {
 			bp_update_is_directory( true, 'blogs' );
 
+			/**
+			 * Fires if in the blog directory and BuddyPress needs Blog theme compatibility,
+			 * before the actions and filters are added.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'bp_blogs_screen_index' );
 
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'directory_template_hierarchy' ) );
@@ -122,7 +143,14 @@ class BP_Blogs_Theme_Compat {
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function directory_template_hierarchy( $templates ) {
-		// Setup our templates based on priority
+
+		/**
+		 * Filters the custom templates used for theme compat with the blog directory page.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of template paths to add to template list to look for.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(
 			'blogs/index-directory.php'
 		) );
@@ -141,11 +169,9 @@ class BP_Blogs_Theme_Compat {
 	 */
 	public function directory_dummy_post() {
 
-		$title = apply_filters( 'bp_blogs_directory_header', __( 'Sites', 'buddypress' ) );
-
 		bp_theme_compat_reset_post( array(
 			'ID'             => 0,
-			'post_title'     => $title,
+			'post_title'     => __( 'Sites', 'buddypress' ),
 			'post_author'    => 0,
 			'post_date'      => 0,
 			'post_content'   => '',
@@ -180,7 +206,14 @@ class BP_Blogs_Theme_Compat {
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function create_template_hierarchy( $templates ) {
-		// Setup our templates based on priority
+
+		/**
+		 * Filters the custom templates used for theme compat with the blog create page.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of template paths to add to template list to look for.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(
 			'blogs/index-create.php'
 		) );
@@ -201,7 +234,7 @@ class BP_Blogs_Theme_Compat {
 
 		// Title based on ability to create blogs
 		if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
-			$title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Sites', 'buddypress' ) . '</a>&nbsp;' . __( 'Create a Site', 'buddypress' );
+			$title = __( 'Create a Site', 'buddypress' );
 		} else {
 			$title = __( 'Sites', 'buddypress' );
 		}
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
index 1cd442514f7bf4ebbed0e63a27f36be91538ab99..d0851fd7cdc0d576bd088414a36d28cfb2e88033 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the blogs component slug.
@@ -28,6 +28,14 @@ function bp_blogs_slug() {
 	 * @return string The 'blogs' slug.
 	 */
 	function bp_get_blogs_slug() {
+
+		/**
+		 * Filters the blogs component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Slug for the blogs component.
+		 */
 		return apply_filters( 'bp_get_blogs_slug', buddypress()->blogs->slug );
 	}
 
@@ -49,6 +57,14 @@ function bp_blogs_root_slug() {
 	 * @return string The 'blogs' root slug.
 	 */
 	function bp_get_blogs_root_slug() {
+
+		/**
+		 * Filters the blogs component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $root_slug Root slug for the blogs component.
+		 */
 		return apply_filters( 'bp_get_blogs_root_slug', buddypress()->blogs->root_slug );
 	}
 
@@ -60,7 +76,7 @@ function bp_blogs_root_slug() {
  * @uses bp_get_blogs_directory_permalink()
  */
 function bp_blogs_directory_permalink() {
-	echo bp_get_blogs_directory_permalink();
+	echo esc_url( bp_get_blogs_directory_permalink() );
 }
 	/**
 	 * Return blog directory permalink.
@@ -74,6 +90,14 @@ function bp_blogs_directory_permalink() {
 	 * @return string The URL of the Blogs directory.
 	 */
 	function bp_get_blogs_directory_permalink() {
+
+		/**
+		 * Filters the blog directory permalink.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Permalink URL for the blog directory.
+		 */
 		return apply_filters( 'bp_get_blogs_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) );
 	}
 
@@ -175,8 +199,9 @@ class BP_Blogs_Template {
 	 */
 	public function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage', $update_meta_cache = true, $include_blog_ids = false ) {
 
-		$this->pag_page = isset( $_REQUEST[ $page_arg ] ) ? intval( $_REQUEST[ $page_arg ] ) : $page;
-		$this->pag_num  = isset( $_REQUEST['num']       ) ? intval( $_REQUEST['num']       ) : $per_page;
+		$this->pag_arg  = sanitize_key( $page_arg );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $page     );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $per_page );
 
 		// Backwards compatibility support for blogs by first letter
 		if ( ! empty( $_REQUEST['letter'] ) ) {
@@ -218,13 +243,14 @@ class BP_Blogs_Template {
 		// Build pagination links based on total blogs and current page number
 		if ( ! empty( $this->total_blog_count ) && ! empty( $this->pag_num ) ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( $page_arg, '%#%' ),
+				'base'      => add_query_arg( $this->pag_arg, '%#%' ),
 				'format'    => '',
 				'total'     => ceil( (int) $this->total_blog_count / (int) $this->pag_num ),
 				'current'   => (int) $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Blog pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Blog pagination next text',     'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => array(),
 			) );
 		}
 	}
@@ -277,6 +303,12 @@ class BP_Blogs_Template {
 		if ( ( $this->current_blog + 1 ) < $this->blog_count ) {
 			return true;
 		} elseif ( ( $this->current_blog + 1 ) === $this->blog_count ) {
+
+			/**
+			 * Fires right before the rewinding of blogs listing after all are shown.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'blog_loop_end' );
 			// Do some cleaning up after the loop
 			$this->rewind_blogs();
@@ -302,6 +334,12 @@ class BP_Blogs_Template {
 
 		// loop has just started
 		if ( 0 === $this->current_blog ) {
+
+			/**
+			 * Fires if on the first blog in the loop.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'blog_loop_start' );
 		}
 	}
@@ -357,7 +395,7 @@ function bp_rewind_blogs() {
 function bp_has_blogs( $args = '' ) {
 	global $blogs_template;
 
-	// Checkfor and use search terms
+	// Check for and use search terms
 	$search_terms = ! empty( $_REQUEST['s'] )
 		? $_REQUEST['s']
 		: false;
@@ -383,7 +421,15 @@ function bp_has_blogs( $args = '' ) {
 	// Get the blogs
 	$blogs_template = new BP_Blogs_Template( $r['type'], $r['page'], $r['per_page'], $r['max'], $r['user_id'], $r['search_terms'], $r['page_arg'], $r['update_meta_cache'], $r['include_blog_ids'] );
 
-	// Filter and return
+	/**
+	 * Filters whether or not there are blogs to list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool              $value          Whether or not there are blogs to list.
+	 * @param BP_Blogs_Template $blogs_template Current blogs template object.
+	 * @param array             $r              Parsed arguments used in blogs template query.
+	 */
 	return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template, $r );
 }
 
@@ -426,7 +472,13 @@ function bp_blogs_pagination_count() {
 	$to_num    = bp_core_number_format( ( $start_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $start_num + ( $blogs_template->pag_num - 1 ) );
 	$total     = bp_core_number_format( $blogs_template->total_blog_count );
 
-	echo sprintf( _n( 'Viewing 1 site', 'Viewing %1$s - %2$s of %3$s sites', $total, 'buddypress' ), $from_num, $to_num, $total );
+	if ( 1 == $blogs_template->total_blog_count ) {
+		$message = __( 'Viewing 1 site', 'buddypress' );
+	} else {
+		$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s site', 'Viewing %1$s - %2$s of %3$s sites', $blogs_template->total_blog_count, 'buddypress' ), $from_num, $to_num, $total );
+	}
+
+	echo $message;
 }
 
 /**
@@ -445,6 +497,13 @@ function bp_blogs_pagination_links() {
 	function bp_get_blogs_pagination_links() {
 		global $blogs_template;
 
+		/**
+		 * Filters the blogs pagination links.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $pag_links HTML pagination links.
+		 */
 		return apply_filters( 'bp_get_blogs_pagination_links', $blogs_template->pag_links );
 	}
 
@@ -526,6 +585,16 @@ function bp_blog_avatar( $args = '' ) {
 		 */
 		$avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, $avatar );
 
+		/**
+		 * Filters a blog's avatar.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $avatar  Formatted HTML <img> element, or raw avatar
+		 *                        URL based on $html arg.
+		 * @param int    $blog_id ID of the blog whose avatar is being displayed.
+		 * @param array  $r       Array of arguments used when fetching avatar.
+		 */
 		return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, $r );
 	}
 
@@ -545,6 +614,13 @@ function bp_blog_permalink() {
 			$permalink = $protocol . $blogs_template->blog->domain . $blogs_template->blog->path;
 		}
 
+		/**
+		 * Filters the blog permalink.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $permalink Permalink URL for the blog.
+		 */
 		return apply_filters( 'bp_get_blog_permalink', $permalink );
 	}
 
@@ -562,6 +638,13 @@ function bp_blog_name() {
 	function bp_get_blog_name() {
 		global $blogs_template;
 
+		/**
+		 * Filters the name of the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $name Name of the current blog in the loop.
+		 */
 		return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name );
 	}
 
@@ -583,6 +666,13 @@ function bp_blog_id() {
 	function bp_get_blog_id() {
 		global $blogs_template;
 
+		/**
+		 * Filters the ID of the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param int $blog_id ID of the current blog in the loop.
+		 */
 		return apply_filters( 'bp_get_blog_id', $blogs_template->blog->blog_id );
 	}
 
@@ -590,6 +680,14 @@ function bp_blog_id() {
  * Output the description of the current blog in the loop.
  */
 function bp_blog_description() {
+
+	/**
+	 * Filters the description of the current blog in the loop.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Description of the current blog in the loop.
+	 */
 	echo apply_filters( 'bp_blog_description', bp_get_blog_description() );
 }
 	/**
@@ -600,6 +698,13 @@ function bp_blog_description() {
 	function bp_get_blog_description() {
 		global $blogs_template;
 
+		/**
+		 * Filters the description of the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Description of the current blog in the loop.
+		 */
 		return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description );
 	}
 
@@ -607,9 +712,11 @@ function bp_blog_description() {
  * Output the row class of the current blog in the loop.
  *
  * @since BuddyPress (1.7.0)
+ *
+ * @param array $classes Array of custom classes
  */
-function bp_blog_class() {
-	echo bp_get_blog_class();
+function bp_blog_class( $classes = array() ) {
+	echo bp_get_blog_class( $classes );
 }
 	/**
 	 * Return the row class of the current blog in the loop.
@@ -617,25 +724,34 @@ function bp_blog_class() {
 	 * @since BuddyPress (1.7.0)
 	 *
 	 * @global BP_Blogs_Template $blogs_template
+	 * @param array $classes Array of custom classes
 	 *
 	 * @return string Row class of the site.
 	 */
-	function bp_get_blog_class() {
+	function bp_get_blog_class( $classes = array() ) {
 		global $blogs_template;
 
-		$classes     = array();
-		$pos_in_loop = (int) $blogs_template->current_blog;
+		// Add even/odd classes, but only if there's more than 1 group
+		if ( $blogs_template->blog_count > 1 ) {
+			$pos_in_loop = (int) $blogs_template->current_blog;
+			$classes[]   = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
 
-		// If we've only one site in the loop, don't bother with odd and even.
-		if ( $blogs_template->blog_count > 1 )
-			$classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
-		else
+		// If we've only one site in the loop, don't bother with odd and even
+		} else {
 			$classes[] = 'bp-single-blog';
+		}
 
+		/**
+		 * Filters the row class of the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array $classes Array of classes to be applied to row.
+		 */
 		$classes = apply_filters( 'bp_get_blog_class', $classes );
 		$classes = array_merge( $classes, array() );
+		$retval  = 'class="' . join( ' ', $classes ) . '"';
 
-		$retval = 'class="' . join( ' ', $classes ) . '"';
 		return $retval;
 	}
 
@@ -665,7 +781,7 @@ function bp_blog_last_active( $args = array() ) {
 			'active_format' => true
 		) );
 
-		// Backwards compatibilty for anyone forcing a 'true' active_format
+		// Backwards compatibility for anyone forcing a 'true' active_format
 		if ( true === $r['active_format'] ) {
 			$r['active_format'] = __( 'active %s', 'buddypress' );
 		}
@@ -683,6 +799,14 @@ function bp_blog_last_active( $args = array() ) {
 			$last_activity = __( 'Never active', 'buddypress' );
 		}
 
+		/**
+		 * Filters the last active date of the current blog in the loop.
+		 *
+		 * @since
+		 *
+		 * @param string $last_activity Last active date.
+		 * @param array  $r             Array of parsed args used to determine formatting.
+		 */
 		return apply_filters( 'bp_blog_last_active', $last_activity, $r );
 	}
 
@@ -716,12 +840,29 @@ function bp_blog_latest_post( $args = array() ) {
 
 		if ( ! empty( $retval ) ) {
 			if ( ! empty( $r['latest_format'] ) ) {
+
+				/**
+				 * Filters the title text of the latest post for the current blog in loop.
+				 *
+				 * @since BuddyPress (1.0.0)
+				 *
+				 * @param string $retval Title of the latest post.
+				 */
 				$retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' );
 			} else {
+
+				/** This filter is documented in bp-blogs/bp-blogs-template.php */
 				$retval = '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>';
 			}
 		}
 
+		/**
+		 * Filters the HTML markup result for the latest blog post in loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $retval HTML markup for the latest post.
+		 */
 		return apply_filters( 'bp_get_blog_latest_post', $retval );
 	}
 
@@ -752,6 +893,13 @@ function bp_blog_latest_post_title() {
 		if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_title ) )
 			$retval = $blogs_template->blog->latest_post->post_title;
 
+		/**
+		 * Filters the title text of the latest post on the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $retval Title text for the latest post.
+		 */
 		return apply_filters( 'bp_get_blog_latest_post_title', $retval );
 	}
 
@@ -763,7 +911,7 @@ function bp_blog_latest_post_title() {
  * @see bp_get_blog_latest_post_title()
  */
 function bp_blog_latest_post_permalink() {
-	echo bp_get_blog_latest_post_permalink();
+	echo esc_url( bp_get_blog_latest_post_permalink() );
 }
 	/**
 	 * Return the permalink of the latest post on the current blog in the loop.
@@ -782,6 +930,13 @@ function bp_blog_latest_post_permalink() {
 		if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->ID ) )
 			$retval = add_query_arg( 'p', $blogs_template->blog->latest_post->ID, bp_get_blog_permalink() );
 
+		/**
+		 * Filters the permalink of the latest post on the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $retval Permalink URL of the latest post.
+		 */
 		return apply_filters( 'bp_get_blog_latest_post_permalink', $retval );
 	}
 
@@ -812,6 +967,13 @@ function bp_blog_latest_post_content() {
 		if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_content ) )
 			$retval = $blogs_template->blog->latest_post->post_content;
 
+		/**
+		 * Filters the content of the latest post on the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $retval Content of the latest post on the current blog in the loop.
+		 */
 		return apply_filters( 'bp_get_blog_latest_post_content', $retval );
 	}
 
@@ -846,6 +1008,13 @@ function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) {
 		if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->images[$size] ) )
 			$retval = $blogs_template->blog->latest_post->images[$size];
 
+		/**
+		 * Filters the featured image of the latest post on the current blog in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $retval The featured image of the latest post on the current blog in the loop.
+		 */
 		return apply_filters( 'bp_get_blog_latest_post_featured_image', $retval );
 	}
 
@@ -862,6 +1031,15 @@ function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) {
 function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) {
 	$image  = bp_get_blog_latest_post_featured_image( $thumbnail );
 
+	/**
+	 * Filters whether or not the latest blog post has a featured image.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param bool   $value     Whether or not the latest blog post has a featured image.
+	 * @param string $thumbnail Image version to return.
+	 * @param string $image     Returned value from bp_get_blog_latest_post_featured_image.
+	 */
 	return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image );
 }
 
@@ -895,6 +1073,14 @@ function bp_total_blog_count() {
 	 * @return int Total number of blogs.
 	 */
 	function bp_get_total_blog_count() {
+
+		/**
+		 * Filters the total number of blogs on the site.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Total number of blogs on the site.
+		 */
 		return apply_filters( 'bp_get_total_blog_count', bp_blogs_total_blogs() );
 	}
 	add_filter( 'bp_get_total_blog_count', 'bp_core_number_format' );
@@ -914,6 +1100,14 @@ function bp_total_blog_count_for_user( $user_id = 0 ) {
 	 * @return int Total number of blogs for the user.
 	 */
 	function bp_get_total_blog_count_for_user( $user_id = 0 ) {
+
+		/**
+		 * Filters the total number of blogs for a given user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Total number of blogs for a given user.
+		 */
 		return apply_filters( 'bp_get_total_blog_count_for_user', bp_blogs_total_blogs_for_user( $user_id ) );
 	}
 	add_filter( 'bp_get_total_blog_count_for_user', 'bp_core_number_format' );
@@ -930,10 +1124,19 @@ function bp_total_blog_count_for_user( $user_id = 0 ) {
  * @return bool True if blog registration is enabled.
  */
 function bp_blog_signup_enabled() {
-	global $bp;
+	$bp = buddypress();
 
-	$active_signup = isset( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : 'all';
+	$active_signup = isset( $bp->site_options['registration'] )
+		? $bp->site_options['registration']
+		: 'all';
 
+	/**
+	 * Filters whether or not blog creation is enabled.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $active_signup Value of the registration site option creation status.
+	 */
 	$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
 
 	if ( 'none' == $active_signup || 'user' == $active_signup )
@@ -960,7 +1163,17 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = ''
 			$errors = new WP_Error();
 		}
 
-		// allow definition of default variables
+		/**
+		 * Filters the default values for Blog name, title, and any current errors.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param array $value {
+		 *      string   $blogname   Default blog name provided.
+		 *      string   $blog_title Default blog title provided.
+		 *      WP_Error $errors     WP_Error object.
+		 * }
+		 */
 		$filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
 		$blogname = $filtered_results['blogname'];
 		$blog_title = $filtered_results['blog_title'];
@@ -977,7 +1190,14 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = ''
 		<form class="standard-form" id="setupform" method="post" action="">
 
 			<input type="hidden" name="stage" value="gimmeanotherblog" />
-			<?php do_action( 'signup_hidden_fields' ); ?>
+			<?php
+
+			/**
+			 * Fires after the default hidden fields in blog signup form markup.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 */
+			do_action( 'signup_hidden_fields' ); ?>
 
 			<?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
 			<p>
@@ -1016,7 +1236,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
 	if ( !is_subdomain_install() )
 		echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />';
 	else
-		echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
+		echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" ' . bp_get_form_field_attributes( 'blogname' ) . '/> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
 
 	if ( !is_user_logged_in() ) {
 		print '(<strong>' . __( 'Your address will be ' , 'buddypress');
@@ -1058,6 +1278,14 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
 	</p>
 
 	<?php
+
+	/**
+	 * Fires at the end of all of the default input fields for blog creation form.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param WP_Error $errors WP_Error object if any present.
+	 */
 	do_action('signup_blogform', $errors);
 }
 
@@ -1091,6 +1319,17 @@ function bp_blogs_validate_blog_signup() {
 	$public = (int) $_POST['blog_public'];
 
 	$meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // depreciated
+
+	/**
+	 * Filters the default values for Blog meta.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $meta {
+	 *      string   $value   Default blog language ID.
+	 *      string   $public  Default public status.
+	 * }
+	 */
 	$meta = apply_filters( 'add_signup_meta', $meta );
 
 	// If this is a subdomain install, set up the site inside the root domain.
@@ -1137,15 +1376,36 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name,
 	</p>
 
 <?php
+
+	/**
+	 * Fires after the default successful blog registration message markup.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action('signup_finished');
 }
 
 /**
  * Output a "Create a Site" link for users viewing their own profiles.
+ *
+ * This function is not used by BuddyPress as of 1.2, but is kept here for older
+ * themes that may still be using it.
  */
 function bp_create_blog_link() {
-	if ( bp_is_my_profile() )
-		echo apply_filters( 'bp_create_blog_link', '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site', 'buddypress' ) . '</a>' );
+
+	// Don't show this link when not on your own profile
+	if ( ! bp_is_my_profile() ) {
+		return;
+	}
+
+	/**
+	 * Filters "Create a Site" links for users viewing their own profiles.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value HTML link for creating a site.
+	 */
+	echo apply_filters( 'bp_create_blog_link', '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site', 'buddypress' ) . '</a>' );
 }
 
 /**
@@ -1156,10 +1416,9 @@ function bp_create_blog_link() {
 function bp_blogs_blog_tabs() {
 
 	// Don't show these tabs on a user's own profile
-	if ( bp_is_my_profile() )
+	if ( bp_is_my_profile() ) {
 		return false;
-
-	?>
+	} ?>
 
 	<ul class="content-header-nav">
 		<li<?php if ( bp_is_current_action( 'my-blogs'        ) || !bp_current_action() ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() . '/my-blogs'        ); ?>"><?php printf( __( "%s's Sites", 'buddypress' ),           bp_get_displayed_user_fullname() ); ?></a></li>
@@ -1168,6 +1427,12 @@ function bp_blogs_blog_tabs() {
 	</ul>
 
 <?php
+
+	/**
+	 * Fires after the markup for the navigation tabs for a user Blogs page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'bp_blogs_blog_tabs' );
 }
 
@@ -1183,6 +1448,13 @@ function bp_directory_blogs_search_form() {
 		<input type="submit" id="blogs_search_submit" name="blogs_search_submit" value="' . __( 'Search', 'buddypress' ) . '" />
 	</form>';
 
+	/**
+	 * Filters the output for the blog directory search form.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $search_form_html HTML markup for blog directory search form.
+	 */
 	echo apply_filters( 'bp_directory_blogs_search_form', $search_form_html );
 }
 
@@ -1215,14 +1487,76 @@ function bp_blog_create_button() {
 			'component'  => 'blogs',
 			'link_text'  => __( 'Create a Site', 'buddypress' ),
 			'link_title' => __( 'Create a Site', 'buddypress' ),
-			'link_class' => 'button blog-create bp-title-button',
-			'link_href'  => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . trailingslashit( 'create' ),
+			'link_class' => 'blog-create no-ajax',
+			'link_href'  => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),
 			'wrapper'    => false,
+			'block_self' => false,
 		);
 
+		/**
+		 * Filters the Create a Site button.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $button_args Array of arguments to be used for the Create a Site button.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_blog_create_button', $button_args ) );
 	}
 
+/**
+ * Output the Create a Site nav item.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_blog_create_nav_item() {
+	echo bp_get_blog_create_nav_item();
+}
+
+	/**
+	 * Get the Create a Site nav item.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @return string
+	 */
+	function bp_get_blog_create_nav_item() {
+		// Get the create a site button
+		$create_blog_button = bp_get_blog_create_button();
+
+		// Make sure the button is available
+		if ( empty( $create_blog_button ) ) {
+			return;
+		}
+
+		$output = '<li id="blog-create-nav">' . $create_blog_button . '</li>';
+
+		return apply_filters( 'bp_get_blog_create_nav_item', $output );
+	}
+
+/**
+ * Checks if a specific theme is still filtering the Blogs directory title
+ * if so, transform the title button into a Blogs directory nav item.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @uses   bp_blog_create_nav_item() to output the Create a Site nav item
+ * @return string HTML Output
+ */
+function bp_blog_backcompat_create_nav_item() {
+	// Bail if Blogs nav item is already used by bp-legacy
+	if ( has_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_nav', 999 ) ) {
+		return;
+	}
+
+	// Bail if the theme is not filtering the Blogs directory title
+	if ( ! has_filter( 'bp_blogs_directory_header' ) ) {
+		return;
+	}
+
+	bp_blog_create_nav_item();
+}
+add_action( 'bp_blogs_directory_blog_types', 'bp_blog_backcompat_create_nav_item', 1000 );
+
 /**
  * Output button for visiting a blog in a loop.
  *
@@ -1269,7 +1603,13 @@ function bp_blogs_visit_blog_button( $args = '' ) {
 
 		$button = wp_parse_args( $args, $defaults );
 
-		// Filter and return the HTML button
+		/**
+		 * Filters the button for visiting a blog in a loop.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param array $button Array of arguments to be used for the button to visit a blog.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
 	}
 
@@ -1323,6 +1663,13 @@ function bp_blogs_get_profile_stats( $args = '' ) {
 		}
 	}
 
-	// Filter and return
+	/**
+	 * Filters the number of blogs in user's profile.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $value Output determined for the profile stats.
+	 * @param array  $r     Array of arguments used for default output if none provided.
+	 */
 	return apply_filters( 'bp_blogs_get_profile_stats', $r['output'], $r );
 }
diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
index a5ad4eeac0ef6ffadeb8ca8d9454d6f2e3737357..5cb224f83774e4b7f1778d48c27d73cc1f37ebb7 100644
--- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
+++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register the widgets for the Blogs component.
@@ -16,8 +16,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
 function bp_blogs_register_widgets() {
 	global $wpdb;
 
-	if ( bp_is_active( 'activity' ) && (int) $wpdb->blogid == bp_get_root_blog_id() )
+	if ( bp_is_active( 'activity' ) && bp_is_root_blog( $wpdb->blogid ) ) {
 		add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Blogs_Recent_Posts_Widget");' ) );
+	}
 }
 add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' );
 
@@ -29,7 +30,7 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 	/**
 	 * Constructor method.
 	 */
-	function __construct() {
+	public function __construct() {
 		$widget_ops = array(
 			'description' => __( 'A list of recently published posts from across your network.', 'buddypress' ),
 			'classname'   => 'widget_bp_blogs_widget buddypress widget',
@@ -45,22 +46,47 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 	 * @param array $args Widget arguments.
 	 * @param array $instance Widget settings, as saved by the user.
 	 */
-	function widget( $args, $instance ) {
+	public function widget( $args, $instance ) {
 
-		$title = ! empty( $instance['title'] ) ? esc_html( $instance['title'] ) : __( 'Recent Networkwide Posts', 'buddypress' );
+		$title = ! empty( $instance['title'] )
+			? esc_html( $instance['title'] )
+			: __( 'Recent Networkwide Posts', 'buddypress' );
 
 		if ( ! empty( $instance['link_title'] ) ) {
-			$title = '<a href="' . trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . '">' . esc_html( $title ) . '</a>';
+			$title = '<a href="' . bp_get_blogs_directory_permalink() . '">' . esc_html( $title ) . '</a>';
 		}
 
+		/**
+		 * Filters the Blogs Recent Posts widget title.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $instance The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
+
 		echo $args['before_widget'];
 		echo $args['before_title'] . $title . $args['after_title'];
 
-		if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] )
-			$instance['max_posts'] = 10; ?>
+		if ( empty( $instance['max_posts'] ) || empty( $instance['max_posts'] ) ) {
+			$instance['max_posts'] = 10;
+		}
 
-		<?php // Override some of the contextually set parameters for bp_has_activities() ?>
-		<?php if ( bp_has_activities( array( 'action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false ) ) ) : ?>
+		// Override some of the contextually set parameters for bp_has_activities()
+		$args = array(
+			'action'     => 'new_blog_post',
+			'max'        => $instance['max_posts'],
+			'per_page'   => $instance['max_posts'],
+			'user_id'    => 0,
+			'scope'      => false,
+			'object'     => false,
+			'primary_id' => false
+		); ?>
+
+		<?php if ( bp_has_activities( $args ) ) : ?>
 
 			<ul id="blog-post-list" class="activity-list item-list">
 
@@ -68,15 +94,12 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 
 					<li>
 						<div class="activity-content" style="margin: 0">
-
-							<div class="activity-header">
-								<?php bp_activity_action() ?>
-							</div>
+							<div class="activity-header"><?php bp_activity_action(); ?></div>
 
 							<?php if ( bp_get_activity_content_body() ) : ?>
-								<div class="activity-inner">
-									<?php bp_activity_content_body() ?>
-								</div>
+
+								<div class="activity-inner"><?php bp_activity_content_body(); ?></div>
+
 							<?php endif; ?>
 
 						</div>
@@ -87,9 +110,11 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 			</ul>
 
 		<?php else : ?>
+
 			<div id="message" class="info">
-				<p><?php _e( 'Sorry, there were no posts found. Why not write one?', 'buddypress' ) ?></p>
+				<p><?php _e( 'Sorry, there were no posts found. Why not write one?', 'buddypress' ); ?></p>
 			</div>
+
 		<?php endif; ?>
 
 		<?php echo $args['after_widget']; ?>
@@ -103,10 +128,10 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 	 * @param array $old_instance The old instance options.
 	 * @return array $instance The parsed options to be saved.
 	 */
-	function update( $new_instance, $old_instance ) {
-		$instance = $old_instance;
-		$instance['title'] = strip_tags( $new_instance['title'] );
-		$instance['max_posts'] = strip_tags( $new_instance['max_posts'] );
+	public function update( $new_instance, $old_instance ) {
+		$instance               = $old_instance;
+		$instance['title']      = strip_tags( $new_instance['title'] );
+		$instance['max_posts']  = strip_tags( $new_instance['max_posts'] );
 		$instance['link_title'] = (bool) $new_instance['link_title'];
 
 		return $instance;
@@ -117,22 +142,22 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
 	 *
 	 * @param $instance Settings for this widget.
 	 */
-	function form( $instance ) {
+	public function form( $instance ) {
 		$instance = wp_parse_args( (array) $instance, array(
 			'title'      => __( 'Recent Networkwide Posts', 'buddypress' ),
 			'max_posts'  => 10,
 			'link_title' => false,
 		) );
 
-		$title = strip_tags( $instance['title'] );
-		$max_posts = strip_tags( $instance['max_posts'] );
+		$title      = strip_tags( $instance['title'] );
+		$max_posts  = strip_tags( $instance['max_posts'] );
 		$link_title = (bool) $instance['link_title'];
 
 		?>
 
-		<p><label for="<?php echo $this->get_field_id( 'title' ) ?>"><?php _ex( 'Title:', 'Label for the Title field of the Recent Networkwide Posts widget', 'buddypress' ) ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ) ?>" name="<?php echo $this->get_field_name( 'title' ) ?>" type="text" value="<?php echo esc_attr( $title ) ?>" style="width: 100%;" /></label></p>
-		<p><label for="<?php echo $this->get_field_id( 'link_title' ) ?>"><input type="checkbox" name="<?php echo $this->get_field_name( 'link_title' ) ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Blogs directory', 'buddypress' ) ?></label></p>
-		<p><label for="<?php echo $this->get_field_id( 'max_posts' ) ?>"><?php _e( 'Max posts to show:', 'buddypress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_posts' ); ?>" name="<?php echo $this->get_field_name( 'max_posts' ); ?>" type="text" value="<?php echo esc_attr( $max_posts ); ?>" style="width: 30%" /></label></p>
+		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _ex( 'Title:', 'Label for the Title field of the Recent Networkwide Posts widget', 'buddypress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%;" /></label></p>
+		<p><label for="<?php echo $this->get_field_id( 'link_title' ); ?>"><input type="checkbox" name="<?php echo $this->get_field_name( 'link_title' ); ?>" value="1" <?php checked( $link_title ); ?> /> <?php _e( 'Link widget title to Blogs directory', 'buddypress' ); ?></label></p>
+		<p><label for="<?php echo $this->get_field_id( 'max_posts' ); ?>"><?php _e( 'Max posts to show:', 'buddypress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_posts' ); ?>" name="<?php echo $this->get_field_name( 'max_posts' ); ?>" type="text" value="<?php echo esc_attr( $max_posts ); ?>" style="width: 30%" /></label></p>
 		<?php
 	}
 }
diff --git a/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-blog.php b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-blog.php
new file mode 100644
index 0000000000000000000000000000000000000000..5e88b89d147e50c52007f3bd1c0abd005ea6a1e5
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-blog.php
@@ -0,0 +1,608 @@
+<?php
+/**
+ * BuddyPress Blogs Classes.
+ *
+ * @package BuddyPress
+ * @subpackage BlogsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * The main BuddyPress blog class.
+ *
+ * A BP_Blogs_Object represents a link between a specific WordPress blog on a
+ * network and a specific user on that blog.
+ *
+ * @since BuddyPress (1.0.0)
+ */
+class BP_Blogs_Blog {
+	public $id;
+	public $user_id;
+	public $blog_id;
+
+	/**
+	 * Constructor method.
+	 *
+	 * @param int $id Optional. The ID of the blog.
+	 */
+	public function __construct( $id = null ) {
+		if ( !empty( $id ) ) {
+			$this->id = $id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Populate the object with data about the specific activity item.
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->blogs->table_name} WHERE id = %d", $this->id ) );
+
+		$this->user_id = $blog->user_id;
+		$this->blog_id = $blog->blog_id;
+	}
+
+	/**
+	 * Save the BP blog data to the database.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function save() {
+		global $wpdb;
+
+		$this->user_id = apply_filters( 'bp_blogs_blog_user_id_before_save', $this->user_id, $this->id );
+		$this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id );
+
+		/**
+		 * Fires before the current blog item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) );
+
+		// Don't try and save if there is no user ID or blog ID set.
+		if ( !$this->user_id || !$this->blog_id )
+			return false;
+
+		// Don't save if this blog has already been recorded for the user.
+		if ( !$this->id && $this->exists() )
+			return false;
+
+		$bp = buddypress();
+
+		if ( $this->id ) {
+			// Update
+			$sql = $wpdb->prepare( "UPDATE {$bp->blogs->table_name} SET user_id = %d, blog_id = %d WHERE id = %d", $this->user_id, $this->blog_id, $this->id );
+		} else {
+			// Save
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->blogs->table_name} ( user_id, blog_id ) VALUES ( %d, %d )", $this->user_id, $this->blog_id );
+		}
+
+		if ( !$wpdb->query($sql) )
+			return false;
+
+		/**
+		 * Fires after the current blog item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) );
+
+		if ( $this->id )
+			return $this->id;
+		else
+			return $wpdb->insert_id;
+	}
+
+	/**
+	 * Check whether an association between this user and this blog exists.
+	 *
+	 * @return int The number of associations between the user and blog
+	 *         saved in the blog component tables.
+	 */
+	public function exists() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $this->user_id, $this->blog_id ) );
+	}
+
+	/** Static Methods ***************************************************/
+
+	/**
+	 * Retrieve a set of blog-user associations.
+	 *
+	 * @param string $type The order in which results should be returned.
+	 *        'active', 'alphabetical', 'newest', or 'random'.
+	 * @param int|bool $limit Optional. The maximum records to return.
+	 *        Default: false.
+	 * @param int|bool $page Optional. The page of records to return.
+	 *        Default: false (unlimited results).
+	 * @param int $user_id Optional. ID of the user whose blogs are being
+	 *        retrieved. Default: 0.
+	 * @param string|bool $search_terms Optional. Search by text stored in
+	 *        blogmeta (such as the blog name). Default: false.
+	 * @param bool $update_meta_cache Whether to pre-fetch metadata for
+	 *        blogs. Default: true.
+	 * @param array $include_blog_ids Array of blog IDs to include.
+	 * @return array Multidimensional results array, structured as follows:
+	 *           'blogs' - Array of located blog objects
+	 *           'total' - A count of the total blogs matching the filter params
+	 */
+	public static function get( $type, $limit = false, $page = false, $user_id = 0, $search_terms = false, $update_meta_cache = true, $include_blog_ids = false ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
+			$hidden_sql = "AND wb.public = 1";
+		else
+			$hidden_sql = '';
+
+		$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
+
+		$user_sql = !empty( $user_id ) ? $wpdb->prepare( " AND b.user_id = %d", $user_id ) : '';
+
+		switch ( $type ) {
+			case 'active': default:
+				$order_sql = "ORDER BY bm.meta_value DESC";
+				break;
+			case 'alphabetical':
+				$order_sql = "ORDER BY bm_name.meta_value ASC";
+				break;
+			case 'newest':
+				$order_sql = "ORDER BY wb.registered DESC";
+				break;
+			case 'random':
+				$order_sql = "ORDER BY RAND()";
+				break;
+		}
+
+		$include_sql = '';
+		$include_blog_ids = array_filter( wp_parse_id_list( $include_blog_ids ) );
+		if ( ! empty( $include_blog_ids ) ) {
+			$blog_ids_sql = implode( ',', $include_blog_ids );
+			$include_sql  = " AND b.blog_id IN ({$blog_ids_sql})";
+		}
+
+		if ( ! empty( $search_terms ) ) {
+			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
+			$search_terms_sql  = $wpdb->prepare( 'AND (bm_name.meta_value LIKE %s OR bm_description.meta_value LIKE %s)', $search_terms_like, $search_terms_like );
+		} else {
+			$search_terms_sql = '';
+		}
+
+		$paged_blogs = $wpdb->get_results( "
+			SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm_name.meta_value as name
+			FROM
+			  {$bp->blogs->table_name} b
+			  LEFT JOIN {$bp->blogs->table_name_blogmeta} bm ON (b.blog_id = bm.blog_id)
+			  LEFT JOIN {$bp->blogs->table_name_blogmeta} bm_name ON (b.blog_id = bm_name.blog_id)
+			  LEFT JOIN {$bp->blogs->table_name_blogmeta} bm_description ON (b.blog_id = bm_description.blog_id)
+			  LEFT JOIN {$wpdb->base_prefix}blogs wb ON (b.blog_id = wb.blog_id)
+			  LEFT JOIN {$wpdb->users} u ON (b.user_id = u.ID)
+			WHERE
+			  wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}
+			  AND bm.meta_key = 'last_activity' AND bm_name.meta_key = 'name' AND bm_description.meta_key = 'description'
+			  {$search_terms_sql} {$user_sql} {$include_sql}
+			GROUP BY b.blog_id {$order_sql} {$pag_sql}
+		" );
+
+		$total_blogs = $wpdb->get_var( "
+			SELECT COUNT(DISTINCT b.blog_id)
+			FROM
+			  {$bp->blogs->table_name} b
+			  LEFT JOIN {$wpdb->base_prefix}blogs wb ON (b.blog_id = wb.blog_id)
+			  LEFT JOIN {$bp->blogs->table_name_blogmeta} bm_name ON (b.blog_id = bm_name.blog_id)
+			  LEFT JOIN {$bp->blogs->table_name_blogmeta} bm_description ON (b.blog_id = bm_description.blog_id)
+			WHERE
+			  wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}
+			  AND
+			  bm_name.meta_key = 'name' AND bm_description.meta_key = 'description'
+			  {$search_terms_sql} {$user_sql} {$include_sql}
+		" );
+
+		$blog_ids = array();
+		foreach ( (array) $paged_blogs as $blog ) {
+			$blog_ids[] = (int) $blog->blog_id;
+		}
+
+		$paged_blogs = BP_Blogs_Blog::get_blog_extras( $paged_blogs, $blog_ids, $type );
+
+		if ( $update_meta_cache ) {
+			bp_blogs_update_meta_cache( $blog_ids );
+		}
+
+		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
+	}
+
+	/**
+	 * Delete the record of a given blog for all users.
+	 *
+	 * @param int $blog_id The blog being removed from all users.
+	 * @return int|bool Number of rows deleted on success, false on failure.
+	 */
+	public static function delete_blog_for_all( $blog_id ) {
+		global $wpdb;
+
+		bp_blogs_delete_blogmeta( $blog_id );
+		
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id ) );
+	}
+
+	/**
+	 * Delete the record of a given blog for a specific user.
+	 *
+	 * @param int $blog_id The blog being removed.
+	 * @param int $user_id Optional. The ID of the user from whom the blog
+	 *        is being removed. If absent, defaults to the logged-in user ID.
+	 * @return int|bool Number of rows deleted on success, false on failure.
+	 */
+	public static function delete_blog_for_user( $blog_id, $user_id = null ) {
+		global $wpdb;
+
+		if ( !$user_id )
+			$user_id = bp_loggedin_user_id();
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $user_id, $blog_id ) );
+	}
+
+	/**
+	 * Delete all of a user's blog associations in the BP tables.
+	 *
+	 * @param int $user_id Optional. The ID of the user whose blog
+	 *        associations are being deleted. If absent, defaults to
+	 *        logged-in user ID.
+	 * @return int|bool Number of rows deleted on success, false on failure.
+	 */
+	public static function delete_blogs_for_user( $user_id = null ) {
+		global $wpdb;
+
+		if ( !$user_id )
+			$user_id = bp_loggedin_user_id();
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
+	}
+
+	/**
+	 * Get all of a user's blogs, as tracked by BuddyPress.
+	 *
+	 * Note that this is different from the WordPress function
+	 * {@link get_blogs_of_user()}; the current method returns only those
+	 * blogs that have been recorded by BuddyPress, while the WP function
+	 * does a true query of a user's blog capabilities.
+	 *
+	 * @param int $user_id Optional. ID of the user whose blogs are being
+	 *        queried. Defaults to logged-in user.
+	 * @param bool $show_hidden Optional. Whether to include blogs that are
+	 *        not marked public. Defaults to true when viewing one's own
+	 *        profile.
+	 * @return array Multidimensional results array, structured as follows:
+	 *           'blogs' - Array of located blog objects
+	 *           'total' - A count of the total blogs for the user.
+	 */
+	public static function get_blogs_for_user( $user_id = 0, $show_hidden = false ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( !$user_id )
+			$user_id = bp_displayed_user_id();
+
+		// Show logged in users their hidden blogs.
+		if ( !bp_is_my_profile() && !$show_hidden )
+			$blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id, b.id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.blog_id", $user_id ) );
+		else
+			$blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id, b.id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.blog_id", $user_id ) );
+
+		$total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
+
+		$user_blogs = array();
+		foreach ( (array) $blogs as $blog ) {
+			$user_blogs[$blog->blog_id] = new stdClass;
+			$user_blogs[$blog->blog_id]->id = $blog->id;
+			$user_blogs[$blog->blog_id]->blog_id = $blog->blog_id;
+			$user_blogs[$blog->blog_id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;
+			$user_blogs[$blog->blog_id]->name = $blog->name;
+		}
+
+		return array( 'blogs' => $user_blogs, 'count' => $total_blog_count );
+	}
+
+	/**
+	 * Get IDs of all of a user's blogs, as tracked by BuddyPress.
+	 *
+	 * This method always includes hidden blogs.
+	 *
+	 * @param int $user_id Optional. ID of the user whose blogs are being
+	 *        queried. Defaults to logged-in user.
+	 * @return int The number of blogs associated with the user.
+	 */
+	public static function get_blog_ids_for_user( $user_id = 0 ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( !$user_id )
+			$user_id = bp_displayed_user_id();
+
+		return $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
+	}
+
+	/**
+	 * Check whether a blog has been recorded by BuddyPress.
+	 *
+	 * @param int $blog_id ID of the blog being queried.
+	 * @return int|null The ID of the first located entry in the BP table
+	 *         on success, otherwise null.
+	 */
+	public static function is_recorded( $blog_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id ) );
+	}
+
+	/**
+	 * Return a count of associated blogs for a given user.
+	 *
+	 * Includes hidden blogs when the logged-in user is the same as the
+	 * $user_id parameter, or when the logged-in user has the bp_moderate
+	 * cap.
+	 *
+	 * @param int $user_id Optional. ID of the user whose blogs are being
+	 *        queried. Defaults to logged-in user.
+	 * @return int Blog count for the user.
+	 */
+	public static function total_blog_count_for_user( $user_id = null ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( !$user_id )
+			$user_id = bp_displayed_user_id();
+
+		// If the user is logged in return the blog count including their hidden blogs.
+		if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) ) {
+			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) );
+		} else {
+			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) );
+		}
+	}
+
+	/**
+	 * Return a list of blogs matching a search term.
+	 *
+	 * Matches against blog names and descriptions, as stored in the BP
+	 * blogmeta table.
+	 *
+	 * @param string $filter The search term.
+	 * @param int $limit Optional. The maximum number of items to return.
+	 *        Default: null (no limit).
+	 * @param int $page Optional. The page of results to return. Default:
+	 *        null (no limit).
+	 * @return array Multidimensional results array, structured as follows:
+	 *           'blogs' - Array of located blog objects
+	 *           'total' - A count of the total blogs matching the query.
+	 */
+	public static function search_blogs( $filter, $limit = null, $page = null ) {
+		global $wpdb;
+
+		$search_terms_like = '%' . bp_esc_like( $filter ) . '%';
+		$search_terms_sql  = $wpdb->prepare( 'bm.meta_value LIKE %s', $search_terms_like );
+
+		$hidden_sql = '';
+		if ( !bp_current_user_can( 'bp_moderate' ) )
+			$hidden_sql = "AND wb.public = 1";
+
+		$pag_sql = '';
+		if ( $limit && $page ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		$bp = buddypress();
+
+		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND {$search_terms_sql} ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC{$pag_sql}" );
+		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND {$search_terms_sql} ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" );
+
+		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
+	}
+
+	/**
+	 * Retrieve a list of all blogs.
+	 *
+	 * Query will include hidden blogs if the logged-in user has the
+	 * 'bp_moderate' cap.
+	 *
+	 * @param int $limit Optional. The maximum number of items to return.
+	 *        Default: null (no limit).
+	 * @param int $page Optional. The page of results to return. Default:
+	 *        null (no limit).
+	 * @return array Multidimensional results array, structured as follows:
+	 *           'blogs' - Array of located blog objects
+	 *           'total' - A count of the total blogs.
+	 */
+	public static function get_all( $limit = null, $page = null ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$hidden_sql = !bp_current_user_can( 'bp_moderate' ) ? "AND wb.public = 1" : '';
+		$pag_sql    = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
+
+		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" );
+		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" );
+
+		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
+	}
+
+	/**
+	 * Retrieve a list of blogs whose names start with a given letter.
+	 *
+	 * Query will include hidden blogs if the logged-in user has the
+	 * 'bp_moderate' cap.
+	 *
+	 * @param string $letter. The letter you're looking for.
+	 * @param int $limit Optional. The maximum number of items to return.
+	 *        Default: null (no limit).
+	 * @param int $page Optional. The page of results to return. Default:
+	 *        null (no limit).
+	 * @return array Multidimensional results array, structured as follows:
+	 *           'blogs' - Array of located blog objects.
+	 *           'total' - A count of the total blogs matching the query.
+	 */
+	public static function get_by_letter( $letter, $limit = null, $page = null ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$letter_like = '%' . bp_esc_like( $letter ) . '%';
+		$letter_sql  = $wpdb->prepare( 'bm.meta_value LIKE %s', $letter_like );
+
+		$hidden_sql = '';
+		if ( !bp_current_user_can( 'bp_moderate' ) )
+			$hidden_sql = "AND wb.public = 1";
+
+		$pag_sql = '';
+		if ( $limit && $page )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		$paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND {$letter_sql} {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" );
+		$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND {$letter_sql} {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" );
+
+		return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
+	}
+
+	/**
+	 * Fetch blog data not caught in the main query and append it to results array.
+	 *
+	 * Gets the following information, which is either unavailable at the
+	 * time of the original query, or is more efficient to look up in one
+	 * fell swoop:
+	 *   - The latest post for each blog, include Featured Image data
+	 *   - The blog description
+	 *
+	 * @param array $paged_blogs Array of results from the original query.
+	 * @param array $blog_ids Array of IDs returned from the original query.
+	 * @param string|bool $type Not currently used. Default: false.
+	 * @return array $paged_blogs The located blogs array, with the extras added.
+	 */
+	public static function get_blog_extras( &$paged_blogs, &$blog_ids, $type = false ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( empty( $blog_ids ) )
+			return $paged_blogs;
+
+		$blog_ids = implode( ',', wp_parse_id_list( $blog_ids ) );
+
+		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
+			$blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id );
+			$paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT ID, post_content, post_title, post_excerpt, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" );
+			$images = array();
+
+			// Add URLs to any Featured Image this post might have
+			if ( ! empty( $paged_blogs[$i]->latest_post ) && has_post_thumbnail( $paged_blogs[$i]->latest_post->ID ) ) {
+
+				// Grab 4 sizes of the image. Thumbnail.
+				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'thumbnail', false );
+				if ( ! empty( $image ) )
+					$images['thumbnail'] = $image[0];
+
+				// Medium
+				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'medium', false );
+				if ( ! empty( $image ) )
+					$images['medium'] = $image[0];
+
+				// Large
+				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'large', false );
+				if ( ! empty( $image ) )
+					$images['large'] = $image[0];
+
+				// Post thumbnail
+				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'post-thumbnail', false );
+				if ( ! empty( $image ) )
+					$images['post-thumbnail'] = $image[0];
+
+				// Add the images to the latest_post object
+				$paged_blogs[$i]->latest_post->images = $images;
+			}
+		}
+
+		/* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
+		$blog_descs = $wpdb->get_results( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" );
+
+		for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
+			foreach ( (array) $blog_descs as $desc ) {
+				if ( $desc->blog_id == $paged_blogs[$i]->blog_id )
+					$paged_blogs[$i]->description = $desc->description;
+			}
+		}
+
+		return $paged_blogs;
+	}
+
+	/**
+	 * Check whether a given blog is hidden.
+	 *
+	 * Checks the 'public' column in the wp_blogs table.
+	 *
+	 * @param int $blog_id The ID of the blog being checked.
+	 * @return bool True if hidden (public = 0), false otherwise.
+	 */
+	public static function is_hidden( $blog_id ) {
+		global $wpdb;
+
+		if ( !(int) $wpdb->get_var( $wpdb->prepare( "SELECT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) ) {
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Get ID of user-blog link.
+	 *
+	 * @param int $user_id ID of user.
+	 * @param int $blog_id ID of blog.
+	 * @return int|bool ID of user-blog link, or false if not found.
+	 */
+	public static function get_user_blog( $user_id, $blog_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$user_blog = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $user_id, $blog_id ) );
+
+		if ( empty( $user_blog ) ) {
+			$user_blog = false;
+		} else {
+			$user_blog = intval( $user_blog );
+		}
+
+		return $user_blog;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-actions.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-actions.php
new file mode 100644
index 0000000000000000000000000000000000000000..32c7204aa85719d0e0346f967984cd32cc83eb88
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-actions.php
@@ -0,0 +1,237 @@
+<?php
+
+/**
+ * BuddyPress Admin Actions.
+ *
+ * This file contains the actions that are used through-out BuddyPress Admin. They
+ * are consolidated here to make searching for them easier, and to help developers
+ * understand at a glance the order in which things occur.
+ *
+ * There are a few common places that additional actions can currently be found.
+ *
+ *  - BuddyPress: In {@link BuddyPress::setup_actions()} in BuddyPress.php
+ *  - Admin: More in {@link bp_Admin::setup_actions()} in admin.php
+ *
+ * @package BuddyPress
+ * @subpackage Admin
+ * @see bp-core-actions.php
+ * @see bp-core-filters.php
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Attach BuddyPress to WordPress.
+ *
+ * BuddyPress uses its own internal actions to help aid in third-party plugin
+ * development, and to limit the amount of potential future code changes when
+ * updates to WordPress core occur.
+ *
+ * These actions exist to create the concept of 'plugin dependencies'. They
+ * provide a safe way for plugins to execute code *only* when BuddyPress is
+ * installed and activated, without needing to do complicated guesswork.
+ *
+ * For more information on how this works, see the 'Plugin Dependency' section
+ * near the bottom of this file.
+ *
+ *           v--WordPress Actions       v--BuddyPress Sub-actions
+ */
+add_action( 'admin_menu',              'bp_admin_menu'                    );
+add_action( 'admin_init',              'bp_admin_init'                    );
+add_action( 'admin_head',              'bp_admin_head'                    );
+add_action( 'admin_notices',           'bp_admin_notices'                 );
+add_action( 'admin_enqueue_scripts',   'bp_admin_enqueue_scripts'         );
+add_action( 'network_admin_menu',      'bp_admin_menu'                    );
+add_action( 'custom_menu_order',       'bp_admin_custom_menu_order'       );
+add_action( 'menu_order',              'bp_admin_menu_order'              );
+add_action( 'wpmu_new_blog',           'bp_new_site',               10, 6 );
+
+// Hook on to admin_init
+add_action( 'bp_admin_init', 'bp_setup_updater',          1000 );
+add_action( 'bp_admin_init', 'bp_core_activation_notice', 1010 );
+add_action( 'bp_admin_init', 'bp_register_importers'           );
+add_action( 'bp_admin_init', 'bp_register_admin_style'         );
+add_action( 'bp_admin_init', 'bp_register_admin_settings'      );
+add_action( 'bp_admin_init', 'bp_do_activation_redirect', 1    );
+
+// Add a new separator
+add_action( 'bp_admin_menu', 'bp_admin_separator' );
+
+/**
+ * When a new site is created in a multisite installation, run the activation
+ * routine on that site.
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @param int $blog_id
+ * @param int $user_id
+ * @param string $domain
+ * @param string $path
+ * @param int $site_id
+ * @param array $meta
+ */
+function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
+
+	// Bail if plugin is not network activated
+	if ( ! is_plugin_active_for_network( buddypress()->basename ) )
+		return;
+
+	// Switch to the new blog
+	switch_to_blog( $blog_id );
+
+	/**
+	 * Fires the activation routine for a new site created in a multisite installation.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param int    $blog_id ID of the blog being installed to.
+	 * @param int    $user_id ID of the user the install is for.
+	 * @param string $domain  Domain to use with the install.
+	 * @param string $path    Path to use with the install.
+	 * @param int    $site_id ID of the site being installed to.
+	 * @param array  $meta    Metadata to use with the site creation.
+	 */
+	do_action( 'bp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta );
+
+	// restore original blog
+	restore_current_blog();
+}
+
+/** Sub-Actions ***************************************************************/
+
+/**
+ * Piggy back admin_init action.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_admin_init'.
+ */
+function bp_admin_init() {
+
+	/**
+	 * Fires inside the bp_admin_init function.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_admin_init' );
+}
+
+/**
+ * Piggy back admin_menu action.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_admin_menu'.
+ */
+function bp_admin_menu() {
+
+	/**
+	 * Fires inside the bp_admin_menu function.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	do_action( 'bp_admin_menu' );
+}
+
+/**
+ * Piggy back admin_head action.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_admin_head'.
+ */
+function bp_admin_head() {
+
+	/**
+	 * Fires inside the bp_admin_head function.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_admin_head' );
+}
+
+/**
+ * Piggy back admin_notices action.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_admin_notices'.
+ */
+function bp_admin_notices() {
+
+	/**
+	 * Fires inside the bp_admin_notices function.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_admin_notices' );
+}
+
+/**
+ * Piggy back admin_enqueue_scripts action.
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @uses do_action() Calls 'bp_admin_enqueue_scripts''.
+ *
+ * @param string $hook_suffix The current admin page, passed to
+ *                            'admin_enqueue_scripts'.
+ */
+function bp_admin_enqueue_scripts( $hook_suffix = '' ) {
+
+	/**
+	 * Fires inside the bp_admin_enqueue_scripts function.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $hook_suffix The current admin page, passed to admin_enqueue_scripts.
+	 */
+	do_action( 'bp_admin_enqueue_scripts', $hook_suffix );
+}
+
+/**
+ * Dedicated action to register BuddyPress importers.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_admin_notices'.
+ */
+function bp_register_importers() {
+
+	/**
+	 * Fires inside the bp_register_importers function.
+	 *
+	 * Used to register a BuddyPress importer.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	do_action( 'bp_register_importers' );
+}
+
+/**
+ * Dedicated action to register admin styles.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_admin_notices'.
+ */
+function bp_register_admin_style() {
+
+	/**
+	 * Fires inside the bp_register_admin_style function.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	do_action( 'bp_register_admin_style' );
+}
+
+/**
+ * Dedicated action to register admin settings.
+ *
+ * @since BuddyPress (1.7.0)
+ * @uses do_action() Calls 'bp_register_admin_settings'.
+ */
+function bp_register_admin_settings() {
+
+	/**
+	 * Fires inside the bp_register_admin_settings function.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_register_admin_settings' );
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-components.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-components.php
new file mode 100644
index 0000000000000000000000000000000000000000..c4e07da8cd9da452ca17a6f4c8e93a705bd3d880
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-components.php
@@ -0,0 +1,445 @@
+<?php
+
+/**
+ * BuddyPress Admin Component Functions
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Renders the Component Setup admin panel.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.6.0)
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_components_settings() {
+?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2>
+		<form action="" method="post" id="bp-admin-component-form">
+
+			<?php bp_core_admin_components_options(); ?>
+
+			<p class="submit clear">
+				<input class="button-primary" type="submit" name="bp-admin-component-submit" id="bp-admin-component-submit" value="<?php esc_attr_e( 'Save Settings', 'buddypress' ) ?>"/>
+			</p>
+
+			<?php wp_nonce_field( 'bp-admin-component-setup' ); ?>
+
+		</form>
+	</div>
+
+<?php
+}
+
+/**
+ * Creates reusable markup for component setup on the Components and Pages dashboard panel.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.6.0)
+ * @todo Use settings API
+ */
+function bp_core_admin_components_options() {
+
+	// Declare local variables
+	$deactivated_components = array();
+
+	/**
+	 * Filters the array of available components.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param mixed $value Active components.
+	 */
+	$active_components      = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
+
+	// The default components (if none are previously selected)
+	$default_components = array(
+		'xprofile' => array(
+			'title'       => __( 'Extended Profiles', 'buddypress' ),
+			'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
+		),
+		'settings' => array(
+			'title'       => __( 'Account Settings', 'buddypress' ),
+			'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
+		),
+		'notifications' => array(
+			'title'       => __( 'Notifications', 'buddypress' ),
+			'description' => __( 'Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.', 'buddypress' )
+		),
+	);
+
+	$optional_components = bp_core_admin_get_components( 'optional' );
+	$required_components = bp_core_admin_get_components( 'required' );
+	$retired_components  = bp_core_admin_get_components( 'retired'  );
+
+	// Don't show Forums component in optional components if it's disabled
+	if ( ! bp_is_active( 'forums' ) ) {
+		unset( $optional_components['forums'] );
+	}
+
+	// Merge optional and required together
+	$all_components = $optional_components + $required_components;
+
+	// If this is an upgrade from before BuddyPress 1.5, we'll have to convert
+	// deactivated components into activated ones.
+	if ( empty( $active_components ) ) {
+		$deactivated_components = bp_get_option( 'bp-deactivated-components' );
+		if ( !empty( $deactivated_components ) ) {
+
+			// Trim off namespace and filename
+			$trimmed = array();
+			foreach ( array_keys( (array) $deactivated_components ) as $component ) {
+				$trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
+			}
+
+			// Loop through the optional components to create an active component array
+			foreach ( array_keys( (array) $optional_components ) as $ocomponent ) {
+				if ( !in_array( $ocomponent, $trimmed ) ) {
+					$active_components[$ocomponent] = 1;
+				}
+			}
+		}
+	}
+
+	// On new install, set active components to default
+	if ( empty( $active_components ) ) {
+		$active_components = $default_components;
+	}
+
+	// Core component is always active
+	$active_components['core'] = $all_components['core'];
+	$inactive_components       = array_diff( array_keys( $all_components ) , array_keys( $active_components ) );
+
+	/** Display ***************************************************************/
+
+	// Get the total count of all plugins
+	$all_count = count( $all_components );
+	$page      = bp_core_do_network_admin()  ? 'settings.php' : 'options-general.php';
+	$action    = !empty( $_GET['action'] ) ? $_GET['action'] : 'all';
+
+	switch( $action ) {
+		case 'all' :
+			$current_components = $all_components;
+			break;
+		case 'active' :
+			foreach ( array_keys( $active_components ) as $component ) {
+				$current_components[$component] = $all_components[$component];
+			}
+			break;
+		case 'inactive' :
+			foreach ( $inactive_components as $component ) {
+				$current_components[$component] = $all_components[$component];
+			}
+			break;
+		case 'mustuse' :
+			$current_components = $required_components;
+			break;
+		case 'retired' :
+			$current_components = $retired_components;
+			break;
+	} ?>
+
+	<ul class="subsubsub">
+		<li><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bp-components', 'action' => 'all'      ), bp_get_admin_url( $page ) ) ); ?>" <?php if ( $action === 'all'      ) : ?>class="current"<?php endif; ?>><?php printf( _nx( 'All <span class="count">(%s)</span>',      'All <span class="count">(%s)</span>',      $all_count,         'plugins', 'buddypress' ), number_format_i18n( $all_count                    ) ); ?></a> | </li>
+		<li><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bp-components', 'action' => 'active'   ), bp_get_admin_url( $page ) ) ); ?>" <?php if ( $action === 'active'   ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Active <span class="count">(%s)</span>',   'Active <span class="count">(%s)</span>',   count( $active_components   ), 'buddypress' ), number_format_i18n( count( $active_components   ) ) ); ?></a> | </li>
+		<li><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bp-components', 'action' => 'inactive' ), bp_get_admin_url( $page ) ) ); ?>" <?php if ( $action === 'inactive' ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', count( $inactive_components ), 'buddypress' ), number_format_i18n( count( $inactive_components ) ) ); ?></a> | </li>
+		<li><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bp-components', 'action' => 'mustuse'  ), bp_get_admin_url( $page ) ) ); ?>" <?php if ( $action === 'mustuse'  ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', count( $required_components ), 'buddypress' ), number_format_i18n( count( $required_components ) ) ); ?></a> | </li>
+		<li><a href="<?php echo esc_url( add_query_arg( array( 'page' => 'bp-components', 'action' => 'retired'  ), bp_get_admin_url( $page ) ) ); ?>" <?php if ( $action === 'retired'  ) : ?>class="current"<?php endif; ?>><?php printf( _n(  'Retired <span class="count">(%s)</span>',  'Retired <span class="count">(%s)</span>',  count( $retired_components ),  'buddypress' ), number_format_i18n( count( $retired_components  ) ) ); ?></a></li>
+	</ul>
+
+	<table class="widefat fixed plugins" cellspacing="0">
+		<thead>
+			<tr>
+				<th scope="col" id="cb" class="manage-column column-cb check-column">&nbsp;</th>
+				<th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
+				<th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
+			</tr>
+		</thead>
+
+		<tfoot>
+			<tr>
+				<th scope="col" class="manage-column column-cb check-column">&nbsp;</th>
+				<th scope="col" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th>
+				<th scope="col" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th>
+			</tr>
+		</tfoot>
+
+		<tbody id="the-list">
+
+			<?php if ( !empty( $current_components ) ) : ?>
+
+				<?php foreach ( $current_components as $name => $labels ) : ?>
+
+					<?php if ( !in_array( $name, array( 'core', 'members' ) ) ) :
+						$class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive';
+					else :
+						$class = 'active';
+					endif; ?>
+
+					<tr id="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $name ) . ' ' . esc_attr( $class ); ?>">
+						<th scope="row">
+
+							<?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?>
+
+								<input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> />
+
+							<?php endif; ?>
+
+						</th>
+						<td class="plugin-title" style="width: 190px;">
+							<span></span>
+							<label for="bp_components[<?php echo esc_attr( $name ); ?>]">
+								<strong><?php echo esc_html( $labels['title'] ); ?></strong>
+							</label>
+
+							<div class="row-actions-visible">
+
+							</div>
+						</td>
+
+						<td class="column-description desc">
+							<div class="plugin-description">
+								<p><?php echo $labels['description']; ?></p>
+							</div>
+							<div class="active second plugin-version-author-uri">
+
+							</div>
+						</td>
+					</tr>
+
+				<?php endforeach ?>
+
+			<?php else : ?>
+
+				<tr class="no-items">
+					<td class="colspanchange" colspan="3"><?php _e( 'No components found.', 'buddypress' ); ?></td>
+				</tr>
+
+			<?php endif; ?>
+
+		</tbody>
+	</table>
+
+	<input type="hidden" name="bp_components[members]" value="1" />
+
+	<?php
+}
+
+/**
+ * Handle saving the Component settings
+ *
+ * @since BuddyPress (1.6.0)
+ * @todo Use settings API when it supports saving network settings
+ */
+function bp_core_admin_components_settings_handler() {
+
+	// Bail if not saving settings
+	if ( ! isset( $_POST['bp-admin-component-submit'] ) )
+		return;
+
+	// Bail if nonce fails
+	if ( ! check_admin_referer( 'bp-admin-component-setup' ) )
+		return;
+
+	// Settings form submitted, now save the settings. First, set active components
+	if ( isset( $_POST['bp_components'] ) ) {
+
+		// Load up BuddyPress
+		$bp = buddypress();
+
+		// Save settings and upgrade schema
+		require_once( $bp->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
+
+		$submitted = stripslashes_deep( $_POST['bp_components'] );
+		$bp->active_components = bp_core_admin_get_active_components_from_submitted_settings( $submitted );
+
+		bp_core_install( $bp->active_components );
+		bp_core_add_page_mappings( $bp->active_components );
+		bp_update_option( 'bp-active-components', $bp->active_components );
+	}
+
+	// Where are we redirecting to?
+	$base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) );
+
+	// Redirect
+	wp_redirect( $base_url );
+	die();
+}
+add_action( 'bp_admin_init', 'bp_core_admin_components_settings_handler' );
+
+/**
+ * Calculates the components that should be active after save, based on submitted settings
+ *
+ * The way that active components must be set after saving your settings must
+ * be calculated differently depending on which of the Components subtabs you
+ * are coming from:
+ * - When coming from All or Active, the submitted checkboxes accurately
+ *   reflect the desired active components, so we simply pass them through
+ * - When coming from Inactive, components can only be activated - already
+ *   active components will not be passed in the $_POST global. Thus, we must
+ *   parse the newly activated components with the already active components
+ *   saved in the $bp global
+ * - When activating a Retired component, the situation is similar to Inactive.
+ * - When deactivating a Retired component, no value is passed in the $_POST
+ *   global (because the component settings are checkboxes). So, in order to
+ *   determine whether a retired component is being deactivated, we retrieve a
+ *   list of retired components, and check each one to ensure that its checkbox
+ *   is not present, before merging the submitted components with the active
+ *   ones.
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @param array This is the array of component settings coming from the POST
+ *   global. You should stripslashes_deep() before passing to this function
+ * @return array The calculated list of component settings
+ */
+function bp_core_admin_get_active_components_from_submitted_settings( $submitted ) {
+	$current_action = 'all';
+
+	if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'active', 'inactive', 'retired' ) ) ) {
+		$current_action = $_GET['action'];
+	}
+
+	$current_components = buddypress()->active_components;
+
+	switch ( $current_action ) {
+		case 'retired' :
+			$retired_components = bp_core_admin_get_components( 'retired' );
+			foreach ( array_keys( $retired_components ) as $retired_component ) {
+				if ( ! isset( $submitted[ $retired_component ] ) ) {
+					unset( $current_components[ $retired_component ] );
+				}
+			}
+			// fall through
+
+		case 'inactive' :
+			$components = array_merge( $submitted, $current_components );
+			break;
+
+		case 'all' :
+		case 'active' :
+		default :
+			$components = $submitted;
+			break;
+	}
+
+	return $components;
+}
+
+/**
+ * Return a list of component information, optionally filtered by type
+ *
+ * We use this information both to build the markup for the admin screens, as
+ * well as to do some processing on settings data submitted from those screens.
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @param string $type 'all', 'optional', 'retired', 'required'
+ * @return array An array of requested component data
+ */
+function bp_core_admin_get_components( $type = 'all' ) {
+
+	// Required components
+	$required_components = array(
+		'core' => array(
+			'title'       => __( 'BuddyPress Core', 'buddypress' ),
+			'description' => __( 'It&#8216;s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' )
+		),
+		'members' => array(
+			'title'       => __( 'Community Members', 'buddypress' ),
+			'description' => __( 'Everything in a BuddyPress community revolves around its members.', 'buddypress' )
+		),
+	);
+
+	// Retired components
+	$retired_components = array(
+		'forums' => array(
+			'title'       => __( 'Group Forums', 'buddypress' ),
+			'description' => sprintf( __( 'BuddyPress Forums are retired. Use %s.', 'buddypress' ), '<a href="https://bbpress.org/">bbPress</a>' )
+		),
+	);
+
+	// Optional core components
+	$optional_components = array(
+		'xprofile' => array(
+			'title'       => __( 'Extended Profiles', 'buddypress' ),
+			'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' )
+		),
+		'settings' => array(
+			'title'       => __( 'Account Settings', 'buddypress' ),
+			'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
+		),
+		'friends'  => array(
+			'title'       => __( 'Friend Connections', 'buddypress' ),
+			'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' )
+		),
+		'messages' => array(
+			'title'       => __( 'Private Messaging', 'buddypress' ),
+			'description' => __( 'Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.', 'buddypress' )
+		),
+		'activity' => array(
+			'title'       => __( 'Activity Streams', 'buddypress' ),
+			'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting, and @mentions, all with full RSS feed and email notification support.', 'buddypress' )
+		),
+		'notifications' => array(
+			'title'       => __( 'Notifications', 'buddypress' ),
+			'description' => __( 'Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.', 'buddypress' )
+		),
+		'groups'   => array(
+			'title'       => __( 'User Groups', 'buddypress' ),
+			'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' )
+		),
+		'forums'   => array(
+			'title'       => __( 'Group Forums (Legacy)', 'buddypress' ),
+			'description' => __( 'Group forums allow for focused, bulletin-board style conversations.', 'buddypress' )
+		),
+		'blogs'    => array(
+			'title'       => __( 'Site Tracking', 'buddypress' ),
+			'description' => __( 'Record activity for new posts and comments from your site.', 'buddypress' )
+		)
+	);
+
+
+	// Add blogs tracking if multisite
+	if ( is_multisite() ) {
+		$optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' );
+	}
+
+	switch ( $type ) {
+		case 'required' :
+			$components = $required_components;
+			break;
+		case 'optional' :
+			$components = $optional_components;
+			break;
+		case 'retired' :
+			$components = $retired_components;
+			break;
+		case 'all' :
+		default :
+			$components = array_merge( $required_components, $optional_components, $retired_components );
+			break;
+
+	}
+
+	/**
+	 * Filters the list of component information.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array  $components Array of component information.
+	 * @param string $type       Type of component list requested.
+	 *                           Possible values include 'all', 'optional',
+	 *							 'retired', 'required'.
+	 */
+	return apply_filters( 'bp_core_admin_get_components', $components, $type );
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-functions.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..eaacaf382b501c14ec8af7ae94e1d37a03f67be3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-functions.php
@@ -0,0 +1,945 @@
+<?php
+
+/**
+ * BuddyPress Common Admin Functions
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/** Menu **********************************************************************/
+
+/**
+ * Initializes the wp-admin area "BuddyPress" menus and sub menus.
+ *
+ * @package BuddyPress Core
+ * @uses bp_current_user_can() returns true if the current user is a site admin, false if not
+ */
+function bp_core_admin_menu_init() {
+	add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
+}
+
+/**
+ * In BP 1.6, the top-level admin menu was removed. For backpat, this function
+ * keeps the top-level menu if a plugin has registered a menu into the old
+ * 'bp-general-settings' menu.
+ *
+ * The old "bp-general-settings" page was renamed "bp-components".
+ *
+ * @global array $_parent_pages
+ * @global array $_registered_pages
+ * @global array $submenu
+ * @since BuddyPress (1.6.0)
+ */
+function bp_core_admin_backpat_menu() {
+	global $_parent_pages, $_registered_pages, $submenu;
+
+	// If there's no bp-general-settings menu (perhaps because the current
+	// user is not an Administrator), there's nothing to do here
+	if ( ! isset( $submenu['bp-general-settings'] ) ) {
+		return;
+	}
+
+	/**
+	 * By default, only the core "Help" submenu is added under the top-level BuddyPress menu.
+	 * This means that if no third-party plugins have registered their admin pages into the
+	 * 'bp-general-settings' menu, it will only contain one item. Kill it.
+	 */
+	if ( 1 != count( $submenu['bp-general-settings'] ) ) {
+		return;
+	}
+
+	// This removes the top-level menu
+	remove_submenu_page( 'bp-general-settings', 'bp-general-settings' );
+	remove_menu_page( 'bp-general-settings' );
+
+	// These stop people accessing the URL directly
+	unset( $_parent_pages['bp-general-settings'] );
+	unset( $_registered_pages['toplevel_page_bp-general-settings'] );
+}
+add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 );
+
+/**
+ * This tells WP to highlight the Settings > BuddyPress menu item,
+ * regardless of which actual BuddyPress admin screen we are on.
+ *
+ * The conditional prevents the behaviour when the user is viewing the
+ * backpat "Help" page, the Activity page, or any third-party plugins.
+ *
+ * @global string $plugin_page
+ * @global array $submenu
+ * @since BuddyPress (1.6.0)
+ */
+function bp_core_modify_admin_menu_highlight() {
+	global $plugin_page, $submenu_file;
+
+	// This tweaks the Settings subnav menu to show only one BuddyPress menu item
+	if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) ) {
+		$submenu_file = 'bp-components';
+	}
+
+	// Network Admin > Tools
+	if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
+		$submenu_file = $plugin_page;
+	}
+}
+
+/**
+ * Generates markup for a fallback top-level BuddyPress menu page, if the site is running
+ * a legacy plugin which hasn't been updated. If the site is up to date, this page
+ * will never appear.
+ *
+ * @see bp_core_admin_backpat_menu()
+ * @since BuddyPress (1.6.0)
+ * @todo Add convenience links into the markup once new positions are finalised.
+ */
+function bp_core_admin_backpat_page() {
+	$url          = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
+	$settings_url = add_query_arg( 'page', 'bp-components', $url ); ?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress' ); ?>
+		<h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2>
+
+		<p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p>
+		<p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>
+	</div>
+
+	<?php
+}
+
+/** Notices *******************************************************************/
+
+/**
+ * Print admin messages to admin_notices or network_admin_notices
+ *
+ * BuddyPress combines all its messages into a single notice, to avoid a preponderance of yellow
+ * boxes.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @uses bp_current_user_can() to check current user permissions before showing the notices
+ * @uses bp_is_root_blog()
+ */
+function bp_core_print_admin_notices() {
+
+	// Only the super admin should see messages
+	if ( ! bp_current_user_can( 'bp_moderate' ) ) {
+		return;
+	}
+
+	// On multisite installs, don't show on a non-root blog, unless
+	// 'do_network_admin' is overridden.
+	if ( is_multisite() && bp_core_do_network_admin() && ! bp_is_root_blog() ) {
+		return;
+	}
+
+	$notice_types = array();
+	foreach ( buddypress()->admin->notices as $notice ) {
+		$notice_types[] = $notice['type'];
+	}
+	$notice_types = array_unique( $notice_types );
+
+	foreach ( $notice_types as $type ) {
+		$notices = wp_list_filter( buddypress()->admin->notices, array( 'type' => $type ) );
+		printf( '<div id="message" class="fade %s">', sanitize_html_class( $type ) );
+
+		foreach ( $notices as $notice ) {
+			printf( '<p>%s</p>', $notice['message'] );
+		}
+
+		printf( '</div>' );
+	}
+}
+add_action( 'admin_notices',         'bp_core_print_admin_notices' );
+add_action( 'network_admin_notices', 'bp_core_print_admin_notices' );
+
+/**
+ * Add an admin notice to the BP queue
+ *
+ * Messages added with this function are displayed in BuddyPress's general purpose admin notices
+ * box. It is recommended that you hook this function to admin_init, so that your messages are
+ * loaded in time.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @param string $notice The notice you are adding to the queue.
+ * @param string $type The notice type; optional. Usually either "updated" or "error".
+ */
+function bp_core_add_admin_notice( $notice = '', $type = 'updated' ) {
+
+	// Do not add if the notice is empty
+	if ( empty( $notice ) ) {
+		return;
+	}
+
+	// Double check the object before referencing it
+	if ( ! isset( buddypress()->admin->notices ) ) {
+		buddypress()->admin->notices = array();
+	}
+
+	// Add the notice
+	buddypress()->admin->notices[] = array(
+		'message' => $notice,
+		'type'    => $type,
+	);
+}
+
+/**
+ * Verify that some BP prerequisites are set up properly, and notify the admin if not
+ *
+ * On every Dashboard page, this function checks the following:
+ *   - that pretty permalinks are enabled
+ *   - that every BP component that needs a WP page for a directory has one
+ *   - that no WP page has multiple BP components associated with it
+ * The administrator will be shown a notice for each check that fails.
+ *
+ * @global WPDB $wpdb WordPress DB object
+ * @global WP_Rewrite $wp_rewrite
+ * @since BuddyPress (1.2.0)
+ */
+function bp_core_activation_notice() {
+	global $wp_rewrite, $wpdb;
+
+	// Only the super admin gets warnings
+	if ( ! bp_current_user_can( 'bp_moderate' ) ) {
+		return;
+	}
+
+	// Bail in user admin
+	if ( is_user_admin() ) {
+		return;
+	}
+
+	// On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden
+	if ( is_multisite() && bp_core_do_network_admin() && ! bp_is_root_blog() ) {
+		return;
+	}
+
+	// Bail if in network admin, and BuddyPress is not network activated
+	if ( is_network_admin() && ! bp_is_network_activated() ) {
+		return;
+	}
+
+	/**
+	 * Check to make sure that the blog setup routine has run. This can't
+	 * happen during the wizard because of the order which the components
+	 * are loaded.
+	 */
+	if ( bp_is_active( 'blogs' ) ) {
+		$bp    = buddypress();
+		$count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" );
+
+		if ( empty( $count ) ) {
+			bp_blogs_record_existing_blogs();
+		}
+	}
+
+	// Add notice if no rewrite rules are enabled
+	if ( empty( $wp_rewrite->permalink_structure ) ) {
+		bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ), 'error' );
+	}
+
+	// Get BuddyPress instance
+	$bp = buddypress();
+
+	/**
+	 * Check for orphaned BP components (BP component is enabled, no WP page exists)
+	 */
+	$orphaned_components = array();
+	$wp_page_components  = array();
+
+	// Only components with 'has_directory' require a WP page to function
+	foreach( array_keys( $bp->loaded_components ) as $component_id ) {
+		if ( !empty( $bp->{$component_id}->has_directory ) ) {
+			$wp_page_components[] = array(
+				'id'   => $component_id,
+				'name' => isset( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $bp->{$component_id}->id )
+			);
+		}
+	}
+
+	// Activate and Register are special cases. They are not components but they need WP pages.
+	// If user registration is disabled, we can skip this step.
+	if ( bp_get_signup_allowed() ) {
+		$wp_page_components[] = array(
+			'id'   => 'activate',
+			'name' => __( 'Activate', 'buddypress' )
+		);
+
+		$wp_page_components[] = array(
+			'id'   => 'register',
+			'name' => __( 'Register', 'buddypress' )
+		);
+	}
+
+	// On the first admin screen after a new installation, this isn't set, so grab it to suppress a misleading error message.
+	if ( empty( $bp->pages->members ) ) {
+		$bp->pages = bp_core_get_directory_pages();
+	}
+
+	foreach( $wp_page_components as $component ) {
+		if ( !isset( $bp->pages->{$component['id']} ) ) {
+			$orphaned_components[] = $component['name'];
+		}
+	}
+
+	// Special case: If the Forums component is orphaned, but the bbPress 1.x installation is
+	// not correctly set up, don't show a nag. (In these cases, it's probably the case that the
+	// user is using bbPress 2.x; see https://buddypress.trac.wordpress.org/ticket/4292
+	if ( isset( $bp->forums->name ) && in_array( $bp->forums->name, $orphaned_components ) && !bp_forums_is_installed_correctly() ) {
+		$forum_key = array_search( $bp->forums->name, $orphaned_components );
+		unset( $orphaned_components[$forum_key] );
+		$orphaned_components = array_values( $orphaned_components );
+	}
+
+	if ( !empty( $orphaned_components ) ) {
+		$admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
+		$notice    = sprintf( __( 'The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s">Repair</a>', 'buddypress' ), esc_url( $admin_url ), '<strong>' . implode( '</strong>, <strong>', $orphaned_components ) . '</strong>' );
+
+		bp_core_add_admin_notice( $notice );
+	}
+
+	// BP components cannot share a single WP page. Check for duplicate assignments, and post a message if found.
+	$dupe_names = array();
+	$page_ids   = (array)bp_core_get_directory_page_ids();
+	$dupes      = array_diff_assoc( $page_ids, array_unique( $page_ids ) );
+
+	if ( !empty( $dupes ) ) {
+		foreach( array_keys( $dupes ) as $dupe_component ) {
+			$dupe_names[] = $bp->pages->{$dupe_component}->title;
+		}
+
+		// Make sure that there are no duplicate duplicates :)
+		$dupe_names = array_unique( $dupe_names );
+	}
+
+	// If there are duplicates, post a message about them
+	if ( !empty( $dupe_names ) ) {
+		$admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
+		$notice    = sprintf( __( 'Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href="%1$s">Repair</a>', 'buddypress' ), esc_url( $admin_url ), '<strong>' . implode( '</strong>, <strong>', $dupe_names ) . '</strong>' );
+
+		bp_core_add_admin_notice( $notice );
+	}
+}
+
+/**
+ * Redirect user to BuddyPress's What's New page on activation
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @internal Used internally to redirect BuddyPress to the about page on activation
+ *
+ * @uses get_transient() To see if transient to redirect exists
+ * @uses delete_transient() To delete the transient if it exists
+ * @uses is_network_admin() To bail if being network activated
+ * @uses wp_safe_redirect() To redirect
+ * @uses add_query_arg() To help build the URL to redirect to
+ * @uses admin_url() To get the admin URL to index.php
+ */
+function bp_do_activation_redirect() {
+
+	// Bail if no activation redirect
+	if ( ! get_transient( '_bp_activation_redirect' ) ) {
+		return;
+	}
+
+	// Delete the redirect transient
+	delete_transient( '_bp_activation_redirect' );
+
+	// Bail if activating from network, or bulk
+	if ( isset( $_GET['activate-multi'] ) ) {
+		return;
+	}
+
+	$query_args = array( 'page' => 'bp-about' );
+	if ( get_transient( '_bp_is_new_install' ) ) {
+		$query_args['is_new_install'] = '1';
+		delete_transient( '_bp_is_new_install' );
+	}
+
+	// Redirect to BuddyPress about page
+	wp_safe_redirect( add_query_arg( $query_args, bp_get_admin_url( 'index.php' ) ) );
+}
+
+/** UI/Styling ****************************************************************/
+
+/**
+ * Output the tabs in the admin area
+ *
+ * @since BuddyPress (1.5.0)
+ * @param string $active_tab Name of the tab that is active. Optional.
+ */
+function bp_core_admin_tabs( $active_tab = '' ) {
+	$tabs_html    = '';
+	$idle_class   = 'nav-tab';
+	$active_class = 'nav-tab nav-tab-active';
+
+	/**
+	 * Filters the admin tabs to be displayed.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $value Array of tabs to output to the admin area.
+	 */
+	$tabs         = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab ) );
+
+	// Loop through tabs and build navigation
+	foreach ( array_values( $tabs ) as $tab_data ) {
+		$is_current = (bool) ( $tab_data['name'] == $active_tab );
+		$tab_class  = $is_current ? $active_class : $idle_class;
+		$tabs_html .= '<a href="' . esc_url( $tab_data['href'] ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab_data['name'] ) . '</a>';
+	}
+
+	echo $tabs_html;
+
+	/**
+	 * Fires after the output of tabs for the admin area.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_admin_tabs' );
+}
+
+/**
+ * Get the data for the tabs in the admin area.
+ *
+ * @since BuddyPress (2.2.0)
+ * @param string $active_tab Name of the tab that is active. Optional.
+ */
+function bp_core_get_admin_tabs( $active_tab = '' ) {
+	$tabs = array(
+		'0' => array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
+			'name' => __( 'Components', 'buddypress' )
+		),
+		'1' => array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
+			'name' => __( 'Pages', 'buddypress' )
+		),
+		'2' => array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
+			'name' => __( 'Settings', 'buddypress' )
+		),
+	);
+
+	// If forums component is active, add additional tab
+	if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) {
+
+		// enqueue thickbox
+		wp_enqueue_script( 'thickbox' );
+		wp_enqueue_style( 'thickbox' );
+
+		$tabs['3'] = array(
+			'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup'  ), 'admin.php' ) ),
+			'name' => __( 'Forums', 'buddypress' )
+		);
+	}
+
+	/**
+	 * Filters the tab data used in our wp-admin screens.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $tabs Tab data.
+	 */
+	return apply_filters( 'bp_core_get_admin_tabs', $tabs );
+}
+
+/** Help **********************************************************************/
+
+/**
+ * adds contextual help to BuddyPress admin pages
+ *
+ * @since BuddyPress (1.7.0)
+ * @todo Make this part of the BP_Component class and split into each component
+ */
+function bp_core_add_contextual_help( $screen = '' ) {
+
+	$screen = get_current_screen();
+
+	switch ( $screen->id ) {
+
+		// Component page
+		case 'settings_page_bp-components' :
+
+			// help tabs
+			$screen->add_help_tab( array(
+				'id'      => 'bp-comp-overview',
+				'title'   => __( 'Overview', 'buddypress' ),
+				'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ),
+			) );
+
+			// help panel - sidebar links
+			$screen->set_help_sidebar(
+				'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
+				'<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/">Managing Components</a>', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			);
+			break;
+
+		// Pages page
+		case 'settings_page_bp-page-settings' :
+
+			// Help tabs
+			$screen->add_help_tab( array(
+				'id' => 'bp-page-overview',
+				'title' => __( 'Overview', 'buddypress' ),
+				'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ),
+			) );
+
+			// Help panel - sidebar links
+			$screen->set_help_sidebar(
+				'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
+				'<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/#settings-buddypress-pages">Managing Pages</a>', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			);
+
+			break;
+
+		// Settings page
+		case 'settings_page_bp-settings' :
+
+			// Help tabs
+			$screen->add_help_tab( array(
+				'id'      => 'bp-settings-overview',
+				'title'   => __( 'Overview', 'buddypress' ),
+				'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ),
+			) );
+
+			// Help panel - sidebar links
+			$screen->set_help_sidebar(
+				'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
+				'<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/#settings-buddypress-settings">Managing Settings</a>', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			);
+
+			break;
+
+		// Profile fields page
+		case 'users_page_bp-profile-setup' :
+
+			// Help tabs
+			$screen->add_help_tab( array(
+				'id'      => 'bp-profile-overview',
+				'title'   => __( 'Overview', 'buddypress' ),
+				'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ),
+			) );
+
+			// Help panel - sidebar links
+			$screen->set_help_sidebar(
+				'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
+				'<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/extended-profiles/">Managing Profile Fields</a>', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			);
+
+			break;
+	}
+}
+add_action( 'contextual_help', 'bp_core_add_contextual_help' );
+
+/**
+ * renders contextual help content to contextual help tabs
+ *
+ * @since BuddyPress (1.7.0)
+ */
+function bp_core_add_contextual_help_content( $tab = '' ) {
+
+	switch ( $tab ) {
+		case 'bp-comp-overview' :
+			$retval = __( 'By default, all but four of the BuddyPress components are enabled. You can selectively enable or disable any of the components by using the form below. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' );
+			break;
+
+		case 'bp-page-overview' :
+			$retval = __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. You can change the page associations for each active component by using the form below.', 'buddypress' );
+			break;
+
+		case 'bp-settings-overview' :
+			$retval = __( 'Extra configuration settings are provided and activated. You can selectively enable or disable any setting by using the form on this screen.', 'buddypress' );
+			break;
+
+		case 'bp-profile-overview' :
+			$retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.<br /><br />Note: Any fields in the first group will appear on the signup page.', 'buddypress' );
+			break;
+
+		default:
+			$retval = false;
+			break;
+	}
+
+	// Wrap text in a paragraph tag
+	if ( !empty( $retval ) ) {
+		$retval = '<p>' . $retval . '</p>';
+	}
+
+	return $retval;
+}
+
+/** Separator *****************************************************************/
+
+/**
+ * Add a separator to the WordPress admin menus
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @uses bp_current_user_can() To check users capability on root blog
+ */
+function bp_admin_separator() {
+
+	// Bail if BuddyPress is not network activated and viewing network admin
+	if ( is_network_admin() && ! bp_is_network_activated() ) {
+		return;
+	}
+
+	// Bail if BuddyPress is network activated and viewing site admin
+	if ( ! is_network_admin() && bp_is_network_activated() ) {
+		return;
+	}
+
+	// Prevent duplicate separators when no core menu items exist
+	if ( ! bp_current_user_can( 'bp_moderate' ) ) {
+		return;
+	}
+
+	// Bail if there are no components with admin UI's. Hardcoded for now, until
+	// there's a real API for determining this later.
+	if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) ) {
+		return;
+	}
+
+	global $menu;
+
+	$menu[] = array( '', 'read', 'separator-buddypress', '', 'wp-menu-separator buddypress' );
+}
+
+/**
+ * Tell WordPress we have a custom menu order
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @param bool $menu_order Menu order
+ * @uses bp_current_user_can() To check users capability on root blog
+ * @return bool Always true
+ */
+function bp_admin_custom_menu_order( $menu_order = false ) {
+
+	// Bail if user cannot see admin pages
+	if ( ! bp_current_user_can( 'bp_moderate' ) ) {
+		return $menu_order;
+	}
+
+	return true;
+}
+
+/**
+ * Move our custom separator above our custom post types
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @param array $menu_order Menu Order
+ * @uses bp_current_user_can() To check users capability on root blog
+ * @return array Modified menu order
+ */
+function bp_admin_menu_order( $menu_order = array() ) {
+
+	// Bail if user cannot see admin pages
+	if ( empty( $menu_order ) || ! bp_current_user_can( 'bp_moderate' ) ) {
+		return $menu_order;
+	}
+
+	// Initialize our custom order array
+	$bp_menu_order = array();
+
+	// Menu values
+	$last_sep     = is_network_admin() ? 'separator1' : 'separator2';
+
+	/**
+	 * Filters the custom admin menus.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $value Empty array.
+	 */
+	$custom_menus = (array) apply_filters( 'bp_admin_menu_order', array() );
+
+	// Bail if no components have top level admin pages
+	if ( empty( $custom_menus ) ) {
+		return $menu_order;
+	}
+
+	// Add our separator to beginning of array
+	array_unshift( $custom_menus, 'separator-buddypress' );
+
+	// Loop through menu order and do some rearranging
+	foreach ( (array) $menu_order as $item ) {
+
+		// Position BuddyPress menus above appearance
+		if ( $last_sep == $item ) {
+
+			// Add our custom menus
+			foreach( (array) $custom_menus as $custom_menu ) {
+				if ( array_search( $custom_menu, $menu_order ) ) {
+					$bp_menu_order[] = $custom_menu;
+				}
+			}
+
+			// Add the appearance separator
+			$bp_menu_order[] = $last_sep;
+
+		// Skip our menu items
+		} elseif ( ! in_array( $item, $custom_menus ) ) {
+			$bp_menu_order[] = $item;
+		}
+	}
+
+	// Return our custom order
+	return $bp_menu_order;
+}
+
+/** Utility  *****************************************************************/
+
+/**
+ * When using a WP_List_Table, get the currently selected bulk action
+ *
+ * WP_List_Tables have bulk actions at the top and at the bottom of the tables,
+ * and the inputs have different keys in the $_REQUEST array. This function
+ * reconciles the two values and returns a single action being performed.
+ *
+ * @since BuddyPress (1.7.0)
+ * @return string
+ */
+function bp_admin_list_table_current_bulk_action() {
+
+	$action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
+
+	// If the bottom is set, let it override the action
+	if ( ! empty( $_REQUEST['action2'] ) && $_REQUEST['action2'] != "-1" ) {
+		$action = $_REQUEST['action2'];
+	}
+
+	return $action;
+}
+
+/** Menus *********************************************************************/
+
+/**
+ * Register meta box and associated JS for BuddyPress WP Nav Menu .
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function bp_admin_wp_nav_menu_meta_box() {
+	if ( ! bp_is_root_blog() ) {
+		return;
+	}
+
+	add_meta_box( 'add-buddypress-nav-menu', __( 'BuddyPress', 'buddypress' ), 'bp_admin_do_wp_nav_menu_meta_box', 'nav-menus', 'side', 'default' );
+
+	add_action( 'admin_print_footer_scripts', 'bp_admin_wp_nav_menu_restrict_items' );
+}
+
+/**
+ * Build and populate the BuddyPress accordion on Appearance > Menus.
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @global $nav_menu_selected_id
+ */
+function bp_admin_do_wp_nav_menu_meta_box() {
+	global $nav_menu_selected_id;
+
+	$walker = new BP_Walker_Nav_Menu_Checklist( false );
+	$args   = array( 'walker' => $walker );
+
+	$post_type_name = 'buddypress';
+
+	$tabs = array();
+
+	$tabs['loggedin']['label']  = __( 'Logged-In', 'buddypress' );
+	$tabs['loggedin']['pages']  = bp_nav_menu_get_loggedin_pages();
+
+	$tabs['loggedout']['label'] = __( 'Logged-Out', 'buddypress' );
+	$tabs['loggedout']['pages'] = bp_nav_menu_get_loggedout_pages();
+
+	?>
+
+	<div id="buddypress-menu" class="posttypediv">
+		<h4><?php _e( 'Logged-In', 'buddypress' ) ?></h4>
+		<p><?php _e( '<em>Logged-In</em> links are relative to the current user, and are not visible to visitors who are not logged in.', 'buddypress' ) ?></p>
+
+		<div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedin" class="tabs-panel tabs-panel-active">
+			<ul id="buddypress-menu-checklist-loggedin" class="categorychecklist form-no-clear">
+				<?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedin']['pages'] ), 0, (object) $args );?>
+			</ul>
+		</div>
+
+		<h4><?php _e( 'Logged-Out', 'buddypress' ) ?></h4>
+		<p><?php _e( '<em>Logged-Out</em> links are not visible to users who are logged in.', 'buddypress' ) ?></p>
+
+		<div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedout" class="tabs-panel tabs-panel-active">
+			<ul id="buddypress-menu-checklist-loggedout" class="categorychecklist form-no-clear">
+				<?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedout']['pages'] ), 0, (object) $args );?>
+			</ul>
+		</div>
+
+		<p class="button-controls">
+			<span class="add-to-menu">
+				<input type="submit"<?php if ( function_exists( 'wp_nav_menu_disabled_check' ) ) : wp_nav_menu_disabled_check( $nav_menu_selected_id ); endif; ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', 'buddypress' ); ?>" name="add-custom-menu-item" id="submit-buddypress-menu" />
+				<span class="spinner"></span>
+			</span>
+		</p>
+	</div><!-- /#buddypress-menu -->
+
+	<?php
+}
+
+/**
+ * Restrict various items from view if editing a BuddyPress menu.
+ *
+ * If a person is editing a BP menu item, that person should not be able to
+ * see or edit the following fields:
+ *
+ * - CSS Classes - We use the 'bp-menu' CSS class to determine if the
+ *   menu item belongs to BP, so we cannot allow manipulation of this field to
+ *   occur.
+ * - URL - This field is automatically generated by BP on output, so this
+ *   field is useless and can cause confusion.
+ *
+ * Note: These restrictions are only enforced if JavaScript is enabled.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+function bp_admin_wp_nav_menu_restrict_items() {
+?>
+	<script type="text/javascript">
+	jQuery( '#menu-to-edit').on( 'click', 'a.item-edit', function() {
+		var settings  = jQuery(this).closest( '.menu-item-bar' ).next( '.menu-item-settings' );
+		var css_class = settings.find( '.edit-menu-item-classes' );
+
+		if( css_class.val().indexOf( 'bp-menu' ) === 0 ) {
+			css_class.attr( 'readonly', 'readonly' );
+			settings.find( '.field-url' ).css( 'display', 'none' );
+		}
+	});
+	</script>
+<?php
+}
+
+/**
+ * Add "Mark as Spam/Ham" button to user row actions.
+ *
+ * @since BuddyPress (2.0.0)
+ *
+ * @param array $actions User row action links.
+ * @param object $user_object Current user information.
+ * @return array $actions User row action links.
+ */
+function bp_core_admin_user_row_actions( $actions, $user_object ) {
+
+	// Setup the $user_id variable from the current user object
+	$user_id = 0;
+	if ( !empty( $user_object->ID ) ) {
+		$user_id = absint( $user_object->ID );
+	}
+
+	// Bail early if user cannot perform this action, or is looking at themselves
+	if ( current_user_can( 'edit_user', $user_id ) && ( bp_loggedin_user_id() !== $user_id ) ) {
+
+		// Admin URL could be single site or network
+		$url = bp_get_admin_url( 'users.php' );
+
+		// If spammed, create unspam link
+		if ( bp_is_user_spammer( $user_id ) ) {
+			$url             = add_query_arg( array( 'action' => 'ham', 'user' => $user_id ), $url );
+			$unspam_link     = wp_nonce_url( $url, 'bp-spam-user' );
+			$actions['ham']  = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $unspam_link ), esc_html__( 'Not Spam', 'buddypress' ) );
+
+		// If not already spammed, create spam link
+		} else {
+			$url             = add_query_arg( array( 'action' => 'spam', 'user' => $user_id ), $url );
+			$spam_link       = wp_nonce_url( $url, 'bp-spam-user' );
+			$actions['spam'] = sprintf( '<a class="submitdelete" href="%1$s">%2$s</a>', esc_url( $spam_link ), esc_html__( 'Spam', 'buddypress' ) );
+		}
+	}
+
+	// Create a "View" link
+	$url             = bp_core_get_user_domain( $user_id );
+	$actions['view'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $url ), esc_html__( 'View', 'buddypress' ) );
+
+	// Return new actions
+	return $actions;
+}
+
+/**
+ * Catch requests to mark individual users as spam/ham from users.php.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_core_admin_user_manage_spammers() {
+
+	// Print our inline scripts on non-Multisite
+	add_action( 'admin_footer', 'bp_core_admin_user_spammed_js' );
+
+	$action  = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : false;
+	$updated = isset( $_REQUEST['updated'] ) ? $_REQUEST['updated'] : false;
+	$mode    = isset( $_POST['mode'] ) ? $_POST['mode'] : false;
+
+	// if this is a multisite, bulk request, stop now!
+	if ( 'list' == $mode ) {
+		return;
+	}
+
+	// Process a spam/ham request
+	if ( ! empty( $action ) && in_array( $action, array( 'spam', 'ham' ) ) ) {
+
+		check_admin_referer( 'bp-spam-user' );
+
+		$user_id = ! empty( $_REQUEST['user'] ) ? intval( $_REQUEST['user'] ) : false;
+
+		if ( empty( $user_id ) ) {
+			return;
+		}
+
+		$redirect = wp_get_referer();
+
+		$status = ( $action == 'spam' ) ? 'spam' : 'ham';
+
+		// Process the user
+		bp_core_process_spammer_status( $user_id, $status );
+
+		$redirect = add_query_arg( array( 'updated' => 'marked-' . $status ), $redirect );
+
+		wp_redirect( $redirect );
+	}
+
+	// Display feedback
+	if ( ! empty( $updated ) && in_array( $updated, array( 'marked-spam', 'marked-ham' ) ) ) {
+
+		if ( 'marked-spam' === $updated ) {
+			$notice = __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' );
+		} else {
+			$notice = __( 'User removed from spam.', 'buddypress' );
+		}
+
+		bp_core_add_admin_notice( $notice );
+	}
+}
+
+/**
+ * Inline script that adds the 'site-spammed' class to spammed users.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_core_admin_user_spammed_js() {
+	?>
+	<script type="text/javascript">
+		jQuery( document ).ready( function($) {
+			$( '.row-actions .ham' ).each( function() {
+				$( this ).closest( 'tr' ).addClass( 'site-spammed' );
+			});
+		});
+	</script>
+	<?php
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-schema.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-schema.php
new file mode 100644
index 0000000000000000000000000000000000000000..9aa6b60ec6b3cb2cb1981a3456882ed3080edd1c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-schema.php
@@ -0,0 +1,527 @@
+<?php
+
+/**
+ * BuddyPress DB schema
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Get the DB schema to use for BuddyPress components
+ *
+ * @since BuddyPress (1.1.0)
+ *
+ * @global $wpdb $wpdb
+ * @return string The default database character-set, if set
+ */
+function bp_core_set_charset() {
+	global $wpdb;
+
+	require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
+
+	return !empty( $wpdb->charset ) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : '';
+}
+
+/**
+ * Main installer
+ *
+ * Can be passed an optional array of components to explicitly run installation
+ * routines on, typically the first time a component is activated in Settings.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param array $active_components Components to install
+ */
+function bp_core_install( $active_components = false ) {
+
+	bp_pre_schema_upgrade();
+
+	// If no components passed, get all the active components from the main site
+	if ( empty( $active_components ) ) {
+
+		/** This filter is documented in bp-core/admin/bp-core-admin-components.php */
+		$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) );
+	}
+
+	// Install Activity Streams even when inactive (to store last_activity data)
+	bp_core_install_activity_streams();
+
+	// Install the signups table
+	bp_core_maybe_install_signups();
+
+	// Notifications
+	if ( !empty( $active_components['notifications'] ) ) {
+		bp_core_install_notifications();
+	}
+
+	// Friend Connections
+	if ( !empty( $active_components['friends'] ) ) {
+		bp_core_install_friends();
+	}
+
+	// Extensible Groups
+	if ( !empty( $active_components['groups'] ) ) {
+		bp_core_install_groups();
+	}
+
+	// Private Messaging
+	if ( !empty( $active_components['messages'] ) ) {
+		bp_core_install_private_messaging();
+	}
+
+	// Extended Profiles
+	if ( !empty( $active_components['xprofile'] ) ) {
+		bp_core_install_extended_profiles();
+	}
+
+	// Blog tracking
+	if ( !empty( $active_components['blogs'] ) ) {
+		bp_core_install_blog_tracking();
+	}
+}
+
+/**
+ * Install database tables for the Notifications component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_notifications() {
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_notifications (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				user_id bigint(20) NOT NULL,
+				item_id bigint(20) NOT NULL,
+				secondary_item_id bigint(20),
+				component_name varchar(75) NOT NULL,
+				component_action varchar(75) NOT NULL,
+				date_notified datetime NOT NULL,
+				is_new bool NOT NULL DEFAULT 0,
+				KEY item_id (item_id),
+				KEY secondary_item_id (secondary_item_id),
+				KEY user_id (user_id),
+				KEY is_new (is_new),
+				KEY component_name (component_name),
+				KEY component_action (component_action),
+				KEY useritem (user_id,is_new)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_notifications_meta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				notification_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY notification_id (notification_id),
+				KEY meta_key (meta_key(191))
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+}
+
+/**
+ * Install database tables for the Activity component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_activity_streams() {
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_activity (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				user_id bigint(20) NOT NULL,
+				component varchar(75) NOT NULL,
+				type varchar(75) NOT NULL,
+				action text NOT NULL,
+				content longtext NOT NULL,
+				primary_link text NOT NULL,
+				item_id bigint(20) NOT NULL,
+				secondary_item_id bigint(20) DEFAULT NULL,
+				date_recorded datetime NOT NULL,
+				hide_sitewide bool DEFAULT 0,
+				mptt_left int(11) NOT NULL DEFAULT 0,
+				mptt_right int(11) NOT NULL DEFAULT 0,
+				is_spam tinyint(1) NOT NULL DEFAULT 0,
+				KEY date_recorded (date_recorded),
+				KEY user_id (user_id),
+				KEY item_id (item_id),
+				KEY secondary_item_id (secondary_item_id),
+				KEY component (component),
+				KEY type (type),
+				KEY mptt_left (mptt_left),
+				KEY mptt_right (mptt_right),
+				KEY hide_sitewide (hide_sitewide),
+				KEY is_spam (is_spam)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_activity_meta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				activity_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY activity_id (activity_id),
+				KEY meta_key (meta_key(191))
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+}
+
+/**
+ * Install database tables for the Notifications component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_friends() {
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_friends (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				initiator_user_id bigint(20) NOT NULL,
+				friend_user_id bigint(20) NOT NULL,
+				is_confirmed bool DEFAULT 0,
+				is_limited bool DEFAULT 0,
+				date_created datetime NOT NULL,
+				KEY initiator_user_id (initiator_user_id),
+				KEY friend_user_id (friend_user_id)
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+}
+
+/**
+ * Install database tables for the Groups component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_groups() {
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				creator_id bigint(20) NOT NULL,
+				name varchar(100) NOT NULL,
+				slug varchar(200) NOT NULL,
+				description longtext NOT NULL,
+				status varchar(10) NOT NULL DEFAULT 'public',
+				enable_forum tinyint(1) NOT NULL DEFAULT '1',
+				date_created datetime NOT NULL,
+				KEY creator_id (creator_id),
+				KEY status (status)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups_members (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				group_id bigint(20) NOT NULL,
+				user_id bigint(20) NOT NULL,
+				inviter_id bigint(20) NOT NULL,
+				is_admin tinyint(1) NOT NULL DEFAULT '0',
+				is_mod tinyint(1) NOT NULL DEFAULT '0',
+				user_title varchar(100) NOT NULL,
+				date_modified datetime NOT NULL,
+				comments longtext NOT NULL,
+				is_confirmed tinyint(1) NOT NULL DEFAULT '0',
+				is_banned tinyint(1) NOT NULL DEFAULT '0',
+				invite_sent tinyint(1) NOT NULL DEFAULT '0',
+				KEY group_id (group_id),
+				KEY is_admin (is_admin),
+				KEY is_mod (is_mod),
+				KEY user_id (user_id),
+				KEY inviter_id (inviter_id),
+				KEY is_confirmed (is_confirmed)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_groups_groupmeta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				group_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY group_id (group_id),
+				KEY meta_key (meta_key(191))
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+}
+
+/**
+ * Install database tables for the Messages component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_private_messaging() {
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_messages (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				thread_id bigint(20) NOT NULL,
+				sender_id bigint(20) NOT NULL,
+				subject varchar(200) NOT NULL,
+				message longtext NOT NULL,
+				date_sent datetime NOT NULL,
+				KEY sender_id (sender_id),
+				KEY thread_id (thread_id)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_recipients (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				user_id bigint(20) NOT NULL,
+				thread_id bigint(20) NOT NULL,
+				unread_count int(10) NOT NULL DEFAULT '0',
+				sender_only tinyint(1) NOT NULL DEFAULT '0',
+				is_deleted tinyint(1) NOT NULL DEFAULT '0',
+				KEY user_id (user_id),
+				KEY thread_id (thread_id),
+				KEY is_deleted (is_deleted),
+				KEY sender_only (sender_only),
+				KEY unread_count (unread_count)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_notices (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				subject varchar(200) NOT NULL,
+				message longtext NOT NULL,
+				date_sent datetime NOT NULL,
+				is_active tinyint(1) NOT NULL DEFAULT '0',
+				KEY is_active (is_active)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_messages_meta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				message_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY message_id (message_id),
+				KEY meta_key (meta_key(191))
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+}
+
+/**
+ * Install database tables for the Profiles component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_extended_profiles() {
+	global $wpdb;
+
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	// These values should only be updated if they are not already present
+	if ( ! bp_get_option( 'bp-xprofile-base-group-name' ) ) {
+		bp_update_option( 'bp-xprofile-base-group-name', _x( 'General', 'First field-group name', 'buddypress' ) );
+	}
+
+	if ( ! bp_get_option( 'bp-xprofile-fullname-field-name' ) ) {
+		bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Display Name', 'Display name field', 'buddypress' ) );
+	}
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
+				id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				name varchar(150) NOT NULL,
+				description mediumtext NOT NULL,
+				group_order bigint(20) NOT NULL DEFAULT '0',
+				can_delete tinyint(1) NOT NULL,
+				KEY can_delete (can_delete)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_fields (
+				id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				group_id bigint(20) unsigned NOT NULL,
+				parent_id bigint(20) unsigned NOT NULL,
+				type varchar(150) NOT NULL,
+				name varchar(150) NOT NULL,
+				description longtext NOT NULL,
+				is_required tinyint(1) NOT NULL DEFAULT '0',
+				is_default_option tinyint(1) NOT NULL DEFAULT '0',
+				field_order bigint(20) NOT NULL DEFAULT '0',
+				option_order bigint(20) NOT NULL DEFAULT '0',
+				order_by varchar(15) NOT NULL DEFAULT '',
+				can_delete tinyint(1) NOT NULL DEFAULT '1',
+				KEY group_id (group_id),
+				KEY parent_id (parent_id),
+				KEY field_order (field_order),
+				KEY can_delete (can_delete),
+				KEY is_required (is_required)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_data (
+				id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				field_id bigint(20) unsigned NOT NULL,
+				user_id bigint(20) unsigned NOT NULL,
+				value longtext NOT NULL,
+				last_updated datetime NOT NULL,
+				KEY field_id (field_id),
+				KEY user_id (user_id)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_meta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				object_id bigint(20) NOT NULL,
+				object_type varchar(150) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY object_id (object_id),
+				KEY meta_key (meta_key(191))
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+
+	// Insert the default group and fields
+	$insert_sql = array();
+
+	if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_groups WHERE id = 1" ) ) {
+		$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) . ", '', 0 );";
+	}
+
+	if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_fields WHERE id = 1" ) ) {
+		$insert_sql[] = "INSERT INTO {$bp_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( bp_get_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );";
+	}
+
+	dbDelta( $insert_sql );
+}
+
+/**
+ * Install database tables for the Sites component
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @uses bp_core_set_charset()
+ * @uses bp_core_get_table_prefix()
+ * @uses dbDelta()
+ */
+function bp_core_install_blog_tracking() {
+	$sql             = array();
+	$charset_collate = bp_core_set_charset();
+	$bp_prefix       = bp_core_get_table_prefix();
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				user_id bigint(20) NOT NULL,
+				blog_id bigint(20) NOT NULL,
+				KEY user_id (user_id),
+				KEY blog_id (blog_id)
+			) {$charset_collate};";
+
+	$sql[] = "CREATE TABLE {$bp_prefix}bp_user_blogs_blogmeta (
+				id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+				blog_id bigint(20) NOT NULL,
+				meta_key varchar(255) DEFAULT NULL,
+				meta_value longtext DEFAULT NULL,
+				KEY blog_id (blog_id),
+				KEY meta_key (meta_key(191))
+			) {$charset_collate};";
+
+	dbDelta( $sql );
+}
+
+/** Signups *******************************************************************/
+
+/**
+ * Install the signups table.
+ *
+ * @since BuddyPress (2.0.0)
+ *
+ * @global $wpdb
+ * @uses wp_get_db_schema() to get WordPress ms_global schema
+ */
+function bp_core_install_signups() {
+	global $wpdb;
+
+	// Signups is not there and we need it so let's create it
+	require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
+	require_once( ABSPATH                  . 'wp-admin/includes/upgrade.php'     );
+
+	// Never use bp_core_get_table_prefix() for any global users tables
+	$wpdb->signups = $wpdb->base_prefix . 'signups';
+
+	// Use WP's core CREATE TABLE query
+	$create_queries = wp_get_db_schema( 'ms_global' );
+	if ( ! is_array( $create_queries ) ) {
+		$create_queries = explode( ';', $create_queries );
+		$create_queries = array_filter( $create_queries );
+	}
+
+	// Filter out all the queries except wp_signups
+	foreach ( $create_queries as $key => $query ) {
+		if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) {
+			if ( trim( $matches[1], '`' ) !== $wpdb->signups ) {
+				unset( $create_queries[ $key ] );
+			}
+		}
+	}
+
+	// Run WordPress's database upgrader
+	if ( ! empty( $create_queries ) ) {
+		dbDelta( $create_queries );
+	}
+}
+
+/**
+ * Update the signups table, adding `signup_id` column and drop `domain` index.
+ *
+ * This is necessary because WordPress's `pre_schema_upgrade()` function wraps
+ * table ALTER's in multisite checks, and other plugins may have installed their
+ * own sign-ups table; Eg: Gravity Forms User Registration Add On
+ *
+ * @since BuddyPress (2.0.1)
+ *
+ * @see pre_schema_upgrade()
+ * @link https://core.trac.wordpress.org/ticket/27855 WordPress Trac Ticket
+ * @link https://buddypress.trac.wordpress.org/ticket/5563 BuddyPress Trac Ticket
+ *
+ * @global WPDB $wpdb
+ */
+function bp_core_upgrade_signups() {
+	global $wpdb;
+
+	// Bail if global tables should not be upgraded
+	if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+		return;
+	}
+
+	// Never use bp_core_get_table_prefix() for any global users tables
+	$wpdb->signups = $wpdb->base_prefix . 'signups';
+
+	// Attempt to alter the signups table
+	$wpdb->query( "ALTER TABLE {$wpdb->signups} ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
+	$wpdb->query( "ALTER TABLE {$wpdb->signups} DROP INDEX domain" );
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-settings.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..8b02f4f9fa83f910d55cf62382853117cce80bc6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-settings.php
@@ -0,0 +1,379 @@
+<?php
+
+/**
+ * BuddyPress Admin Settings
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Main settings section description for the settings page
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_setting_callback_main_section() { }
+
+/**
+ * Admin bar for logged out users setting field
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_form_option() To output the option value
+ */
+function bp_admin_setting_callback_admin_bar() {
+?>
+
+	<input id="hide-loggedout-adminbar" name="hide-loggedout-adminbar" type="checkbox" value="1" <?php checked( !bp_hide_loggedout_adminbar( false ) ); ?> />
+	<label for="hide-loggedout-adminbar"><?php _e( 'Show the Toolbar for logged out users', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow members to delete their accounts setting field
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_account_deletion() {
+?>
+
+	<input id="bp-disable-account-deletion" name="bp-disable-account-deletion" type="checkbox" value="1" <?php checked( !bp_disable_account_deletion( false ) ); ?> />
+	<label for="bp-disable-account-deletion"><?php _e( 'Allow registered members to delete their own accounts', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/** Activity *******************************************************************/
+
+/**
+ * Groups settings section description for the settings page
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_setting_callback_activity_section() { }
+
+/**
+ * Allow Akismet setting field
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_activity_akismet() {
+?>
+
+	<input id="_bp_enable_akismet" name="_bp_enable_akismet" type="checkbox" value="1" <?php checked( bp_is_akismet_active( true ) ); ?> />
+	<label for="_bp_enable_akismet"><?php _e( 'Allow Akismet to scan for activity stream spam', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow activity comments on blog posts and forum posts
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_setting_callback_blogforum_comments() {
+?>
+
+	<input id="bp-disable-blogforum-comments" name="bp-disable-blogforum-comments" type="checkbox" value="1" <?php checked( !bp_disable_blogforum_comments( false ) ); ?> />
+	<label for="bp-disable-blogforum-comments"><?php _e( 'Allow activity stream commenting on blog and forum posts', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow Heartbeat to refresh activity stream.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_admin_setting_callback_heartbeat() {
+?>
+
+	<input id="_bp_enable_heartbeat_refresh" name="_bp_enable_heartbeat_refresh" type="checkbox" value="1" <?php checked( bp_is_activity_heartbeat_active( true ) ); ?> />
+	<label for="_bp_enable_heartbeat_refresh"><?php _e( 'Automatically check for new items while viewing the activity stream', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Sanitization for bp-disable-blogforum-comments setting
+ *
+ * In the UI, a checkbox asks whether you'd like to *enable* blog/forum activity comments. For
+ * legacy reasons, the option that we store is 1 if these comments are *disabled*. So we use this
+ * function to flip the boolean before saving the intval.
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_sanitize_callback_blogforum_comments( $value = false ) {
+	return $value ? 0 : 1;
+}
+
+/** XProfile ******************************************************************/
+
+/**
+ * Profile settings section description for the settings page
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_setting_callback_xprofile_section() { }
+
+/**
+ * Enable BP->WP profile syncing field
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_form_option() To output the option value
+ */
+function bp_admin_setting_callback_profile_sync() {
+?>
+
+	<input id="bp-disable-profile-sync" name="bp-disable-profile-sync" type="checkbox" value="1" <?php checked( !bp_disable_profile_sync( false ) ); ?> />
+	<label for="bp-disable-profile-sync"><?php _e( 'Enable BuddyPress to WordPress profile syncing', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/**
+ * Allow members to upload avatars field
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_avatar_uploads() {
+?>
+
+	<input id="bp-disable-avatar-uploads" name="bp-disable-avatar-uploads" type="checkbox" value="1" <?php checked( !bp_disable_avatar_uploads( false ) ); ?> />
+	<label for="bp-disable-avatar-uploads"><?php _e( 'Allow registered members to upload avatars', 'buddypress' ); ?></label>
+
+<?php
+}
+
+/** Groups Section ************************************************************/
+
+/**
+ * Groups settings section description for the settings page
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_setting_callback_groups_section() { }
+
+/**
+ * Allow all users to create groups field
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses checked() To display the checked attribute
+ */
+function bp_admin_setting_callback_group_creation() {
+?>
+
+	<input id="bp_restrict_group_creation" name="bp_restrict_group_creation" type="checkbox"value="1" <?php checked( !bp_restrict_group_creation( false ) ); ?> />
+	<label for="bp_restrict_group_creation"><?php _e( 'Enable group creation for all users', 'buddypress' ); ?></label>
+	<p class="description"><?php _e( 'Administrators can always create groups, regardless of this setting.', 'buddypress' ); ?></p>
+
+<?php
+}
+
+/**
+ * 'Enable group avatars' field markup.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_admin_setting_callback_group_avatar_uploads() {
+?>
+	<input id="bp-disable-group-avatar-uploads" name="bp-disable-group-avatar-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_avatar_uploads() ); ?> />
+	<label for="bp-disable-group-avatar-uploads"><?php _e( 'Allow customizable avatars for groups', 'buddypress' ); ?></label>
+<?php
+}
+
+/** Forums Section ************************************************************/
+
+/**
+ * Forums settings section description for the settings page
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_admin_setting_callback_bbpress_section() { }
+
+/**
+ * bb-config.php location field
+ *
+ * @since BuddyPress (1.6.0)
+ * @uses checked() To display the checked attribute
+ * @uses bp_get_option() To get the config location
+ * @uses bp_form_option() To get the sanitized form option
+ */
+function bp_admin_setting_callback_bbpress_configuration() {
+
+	$config_location = bp_get_option( 'bb-config-location' );
+	$file_exists     = (bool) ( file_exists( $config_location ) || is_file( $config_location ) ); ?>
+
+	<input name="bb-config-location" type="text" id="bb-config-location" value="<?php bp_form_option( 'bb-config-location', '' ); ?>" class="medium-text" style="width: 300px;" />
+
+	<?php if ( false === $file_exists ) : ?>
+
+		<a class="button" href="<?php bp_admin_url( 'admin.php?page=bb-forums-setup&repair=1' ); ?>" title="<?php esc_attr_e( 'Attempt to save a new config file.', 'buddypress' ); ?>"><?php _e( 'Repair', 'buddypress' ) ?></a>
+		<span class="attention"><?php _e( 'File does not exist', 'buddypress' ); ?></span>
+
+	<?php endif; ?>
+
+	<p class="description"><?php _e( 'Absolute path to your bbPress configuration file.', 'buddypress' ); ?></p>
+
+<?php
+}
+
+/** Settings Page *************************************************************/
+
+/**
+ * The main settings page
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses screen_icon() To display the screen icon
+ * @uses settings_fields() To output the hidden fields for the form
+ * @uses do_settings_sections() To output the settings sections
+ */
+function bp_core_admin_settings() {
+
+	// We're saving our own options, until the WP Settings API is updated to work with Multisite
+	$form_action = add_query_arg( 'page', 'bp-settings', bp_get_admin_url( 'admin.php' ) );
+
+	?>
+
+	<div class="wrap">
+
+		<?php screen_icon( 'buddypress' ); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Settings', 'buddypress' ) ); ?></h2>
+
+		<form action="<?php echo esc_url( $form_action ) ?>" method="post">
+
+			<?php settings_fields( 'buddypress' ); ?>
+
+			<?php do_settings_sections( 'buddypress' ); ?>
+
+			<p class="submit">
+				<input type="submit" name="submit" class="button-primary" value="<?php esc_attr_e( 'Save Settings', 'buddypress' ); ?>" />
+			</p>
+		</form>
+	</div>
+
+<?php
+}
+
+/**
+ * Save our settings
+ *
+ * @since BuddyPress (1.6.0)
+ */
+function bp_core_admin_settings_save() {
+	global $wp_settings_fields;
+
+	if ( isset( $_GET['page'] ) && 'bp-settings' == $_GET['page'] && !empty( $_POST['submit'] ) ) {
+		check_admin_referer( 'buddypress-options' );
+
+		// Because many settings are saved with checkboxes, and thus will have no values
+		// in the $_POST array when unchecked, we loop through the registered settings
+		if ( isset( $wp_settings_fields['buddypress'] ) ) {
+			foreach( (array) $wp_settings_fields['buddypress'] as $section => $settings ) {
+				foreach( $settings as $setting_name => $setting ) {
+					$value = isset( $_POST[$setting_name] ) ? $_POST[$setting_name] : '';
+
+					bp_update_option( $setting_name, $value );
+				}
+			}
+		}
+
+		// Some legacy options are not registered with the Settings API, or are reversed in the UI.
+		$legacy_options = array(
+			'bp-disable-account-deletion',
+			'bp-disable-avatar-uploads',
+			'bp-disable-group-avatar-uploads',
+			'bp_disable_blogforum_comments',
+			'bp-disable-profile-sync',
+			'bp_restrict_group_creation',
+			'hide-loggedout-adminbar',
+		);
+
+		foreach( $legacy_options as $legacy_option ) {
+			// Note: Each of these options is represented by its opposite in the UI
+			// Ie, the Profile Syncing option reads "Enable Sync", so when it's checked,
+			// the corresponding option should be unset
+			$value = isset( $_POST[$legacy_option] ) ? '' : 1;
+			bp_update_option( $legacy_option, $value );
+		}
+
+		bp_core_redirect( add_query_arg( array( 'page' => 'bp-settings', 'updated' => 'true' ), bp_get_admin_url( 'admin.php' ) ) );
+	}
+}
+add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 );
+
+/**
+ * Output settings API option
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @uses bp_get_bp_form_option()
+ *
+ * @param string $option
+ * @param string $default
+ * @param bool $slug
+ */
+function bp_form_option( $option, $default = '' , $slug = false ) {
+	echo bp_get_form_option( $option, $default, $slug );
+}
+	/**
+	 * Return settings API option
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @uses bp_get_option()
+	 * @uses esc_attr()
+	 * @uses apply_filters()
+	 *
+	 * @param string $option
+	 * @param string $default
+	 * @param bool $slug
+	 */
+	function bp_get_form_option( $option, $default = '', $slug = false ) {
+
+		// Get the option and sanitize it
+		$value = bp_get_option( $option, $default );
+
+		// Slug?
+		if ( true === $slug ) {
+
+			/**
+			 * Filters the slug value in the form field.
+			 *
+			 * @since BuddyPress (1.6.0)
+			 *
+			 * @param string $value Value being returned for the requested option.
+			 */
+			$value = esc_attr( apply_filters( 'editable_slug', $value ) );
+		} else { // Not a slug
+			$value = esc_attr( $value );
+		}
+
+		// Fallback to default
+		if ( empty( $value ) )
+			$value = $default;
+
+		/**
+		 * Filters the settings API option.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $value  Value being returned for the requested option.
+		 * @param string $option Option whose value is being requested.
+		 */
+		return apply_filters( 'bp_get_form_option', $value, $option );
+	}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-slugs.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-slugs.php
new file mode 100644
index 0000000000000000000000000000000000000000..e1da411e546c436d3525e2a2aa7cc92bec49099c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-slugs.php
@@ -0,0 +1,246 @@
+<?php
+
+/**
+ * BuddyPress Admin Slug Functions
+ *
+ * @package BuddyPress
+ * @subpackage CoreAdministration
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Renders the page mapping admin panel.
+ *
+ * @since BuddyPress (1.6.0)
+ * @todo Use settings API
+ * @uses bp_core_admin_component_options()
+ */
+function bp_core_admin_slugs_settings() {
+?>
+
+	<div class="wrap">
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Pages', 'buddypress' ) ); ?></h2>
+		<form action="" method="post" id="bp-admin-page-form">
+
+			<?php bp_core_admin_slugs_options(); ?>
+
+			<p class="submit clear">
+				<input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php esc_attr_e( 'Save Settings', 'buddypress' ) ?>"/>
+			</p>
+
+			<?php wp_nonce_field( 'bp-admin-pages-setup' ); ?>
+
+		</form>
+	</div>
+
+<?php
+}
+
+/**
+ * Creates reusable markup for page setup on the Components and Pages dashboard panel.
+ *
+ * @package BuddyPress
+ * @since BuddyPress (1.6.0)
+ * @todo Use settings API
+ */
+function bp_core_admin_slugs_options() {
+	$bp = buddypress();
+
+	// Get the existing WP pages
+	$existing_pages = bp_core_get_directory_page_ids();
+
+	// Set up an array of components (along with component names) that have
+	// directory pages.
+	$directory_pages = array();
+
+	// Loop through loaded components and collect directories
+	if ( is_array( $bp->loaded_components ) ) {
+		foreach( $bp->loaded_components as $component_slug => $component_id ) {
+
+			// Only components that need directories should be listed here
+			if ( isset( $bp->{$component_id} ) && !empty( $bp->{$component_id}->has_directory ) ) {
+
+				// component->name was introduced in BP 1.5, so we must provide a fallback
+				$directory_pages[$component_id] = !empty( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $component_id );
+			}
+		}
+	}
+
+	/** Directory Display *****************************************************/
+
+	/**
+	 * Filters the loaded components needing directory page association to a WordPress page.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $directory_pages Array of available components to set associations for.
+	 */
+	$directory_pages = apply_filters( 'bp_directory_pages', $directory_pages );
+
+	if ( !empty( $directory_pages ) ) : ?>
+
+		<h3><?php _e( 'Directories', 'buddypress' ); ?></h3>
+
+		<p><?php _e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
+
+		<table class="form-table">
+			<tbody>
+
+				<?php foreach ( $directory_pages as $name => $label ) : ?>
+
+					<tr valign="top">
+						<th scope="row">
+							<label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
+						</th>
+
+						<td>
+
+							<?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?>
+
+							<?php echo wp_dropdown_pages( array(
+								'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
+								'echo'             => false,
+								'show_option_none' => __( '- None -', 'buddypress' ),
+								'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
+							) ); ?>
+
+							<?php if ( !empty( $existing_pages[$name] ) ) : ?>
+
+								<a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
+
+							<?php endif; ?>
+
+							<?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
+
+						</td>
+					</tr>
+
+
+				<?php endforeach ?>
+
+				<?php
+
+				/**
+				 * Fires after the display of default directories.
+				 *
+				 * Allows plugins to add their own directory associations.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 */
+				do_action( 'bp_active_external_directories' ); ?>
+
+			</tbody>
+		</table>
+
+	<?php
+
+	endif;
+
+	/** Static Display ********************************************************/
+
+	// Static pages
+	$static_pages = array(
+		'register' => __( 'Register', 'buddypress' ),
+		'activate' => __( 'Activate', 'buddypress' ),
+	);
+
+	/**
+	 * Filters the default static pages for BuddyPress setup.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $static_pages Array of static default static pages.
+	 */
+	$static_pages = apply_filters( 'bp_static_pages', $static_pages );
+
+	if ( !empty( $static_pages ) ) : ?>
+
+		<h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
+
+		<p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
+
+		<table class="form-table">
+			<tbody>
+
+				<?php foreach ( $static_pages as $name => $label ) : ?>
+
+					<tr valign="top">
+						<th scope="row">
+							<label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
+						</th>
+
+						<td>
+
+							<?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?>
+
+							<?php echo wp_dropdown_pages( array(
+								'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
+								'echo'             => false,
+								'show_option_none' => __( '- None -', 'buddypress' ),
+								'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
+							) ) ?>
+
+							<?php if ( !empty( $existing_pages[$name] ) ) : ?>
+
+								<a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
+
+							<?php endif; ?>
+
+							<?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
+
+						</td>
+					</tr>
+
+				<?php endforeach ?>
+
+				<?php
+
+				/**
+				 * Fires after the display of default static pages for BuddyPress setup.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 */
+				do_action( 'bp_active_external_pages' ); ?>
+
+			</tbody>
+		</table>
+
+		<?php
+	endif;
+}
+
+/**
+ * Handle saving of the BuddyPress slugs
+ *
+ * @since BuddyPress (1.6.0)
+ * @todo Use settings API
+ */
+function bp_core_admin_slugs_setup_handler() {
+
+	if ( isset( $_POST['bp-admin-pages-submit'] ) ) {
+		if ( !check_admin_referer( 'bp-admin-pages-setup' ) )
+			return false;
+
+		// Then, update the directory pages
+		if ( isset( $_POST['bp_pages'] ) ) {
+
+			$directory_pages = array();
+
+			foreach ( (array) $_POST['bp_pages'] as $key => $value ) {
+				if ( !empty( $value ) ) {
+					$directory_pages[$key] = (int) $value;
+				}
+			}
+			bp_core_update_directory_page_ids( $directory_pages );
+		}
+
+		$base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings', 'updated' => 'true' ), 'admin.php' ) );
+
+		wp_redirect( $base_url );
+	}
+}
+add_action( 'bp_admin_init', 'bp_core_admin_slugs_setup_handler' );
diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-tools.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-tools.php
new file mode 100644
index 0000000000000000000000000000000000000000..7b426ae44ce8a635cde9374406ec97a7d6368355
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-tools.php
@@ -0,0 +1,408 @@
+<?php
+
+/**
+ * BuddyPress Tools panel
+ *
+ * @since BuddyPress (2.0.0)
+ */
+
+/**
+ * Render the BuddyPress Tools page.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_core_admin_tools() {
+	?>
+	<div class="wrap">
+		<?php screen_icon( 'buddypress'); ?>
+
+		<h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2>
+
+		<p>
+			<?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?>
+			<?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
+		</p>
+		<p class="description"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than one repair job at a time.', 'buddypress' ); ?></p>
+
+		<form class="settings" method="post" action="">
+			<table class="form-table">
+				<tbody>
+					<tr valign="top">
+						<th scope="row"><?php esc_html_e( 'Data to Repair:', 'buddypress' ) ?></th>
+						<td>
+							<fieldset>
+								<legend class="screen-reader-text"><span><?php esc_html_e( 'Repair', 'buddypress' ) ?></span></legend>
+
+								<?php foreach ( bp_admin_repair_list() as $item ) : ?>
+
+									<label><input type="checkbox" class="checkbox" name="<?php echo esc_attr( $item[0] ) . '" id="' . esc_attr( str_replace( '_', '-', $item[0] ) ); ?>" value="1" /> <?php echo esc_html( $item[1] ); ?></label><br />
+
+								<?php endforeach; ?>
+
+							</fieldset>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+
+			<fieldset class="submit">
+				<input class="button-primary" type="submit" name="bp-tools-submit" value="<?php esc_attr_e( 'Repair Items', 'buddypress' ); ?>" />
+				<?php wp_nonce_field( 'bp-do-counts' ); ?>
+			</fieldset>
+		</form>
+	</div>
+	<?php
+}
+
+/**
+ * Handle the processing and feedback of the admin tools page.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_admin_repair_handler() {
+	if ( ! bp_is_post_request() ) {
+		return;
+	}
+
+	if ( empty( $_POST['bp-tools-submit'] ) ) {
+		return;
+	}
+
+	check_admin_referer( 'bp-do-counts' );
+
+	// Stores messages
+	$messages = array();
+
+	wp_cache_flush();
+
+	foreach ( (array) bp_admin_repair_list() as $item ) {
+		if ( isset( $item[2] ) && isset( $_POST[$item[0]] ) && 1 === absint( $_POST[$item[0]] ) && is_callable( $item[2] ) ) {
+			$messages[] = call_user_func( $item[2] );
+		}
+	}
+
+	if ( count( $messages ) ) {
+		foreach ( $messages as $message ) {
+			bp_admin_tools_feedback( $message[1] );
+		}
+	}
+}
+add_action( bp_core_admin_hook(), 'bp_admin_repair_handler' );
+
+/**
+ * Get the array of the repair list.
+ *
+ * @return array
+ */
+function bp_admin_repair_list() {
+	$repair_list = array();
+
+	// Members:
+	// - member count
+	// - last_activity migration (2.0)
+	$repair_list[20] = array(
+		'bp-total-member-count',
+		__( 'Count total members', 'buddypress' ),
+		'bp_admin_repair_count_members',
+	);
+
+	$repair_list[25] = array(
+		'bp-last-activity',
+		__( 'Repair user "last activity" data', 'buddypress' ),
+		'bp_admin_repair_last_activity',
+	);
+
+	// Friends:
+	// - user friend count
+	if ( bp_is_active( 'friends' ) ) {
+		$repair_list[0] = array(
+			'bp-user-friends',
+			__( 'Count friends for each user', 'buddypress' ),
+			'bp_admin_repair_friend_count',
+		);
+	}
+
+	// Groups:
+	// - user group count
+	if ( bp_is_active( 'groups' ) ) {
+		$repair_list[10] = array(
+			'bp-group-count',
+			__( 'Count groups for each user', 'buddypress' ),
+			'bp_admin_repair_group_count',
+		);
+	}
+
+	// Blogs:
+	// - user blog count
+	if ( bp_is_active( 'blogs' ) ) {
+		$repair_list[90] = array(
+			'bp-blog-records',
+			__( 'Repopulate blogs records', 'buddypress' ),
+			'bp_admin_repair_blog_records',
+		);
+	}
+
+	ksort( $repair_list );
+
+	/**
+	 * Filters the array of the repair list.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $repair_list Array of values for the Repair list options.
+	 */
+	return (array) apply_filters( 'bp_repair_list', $repair_list );
+}
+
+/**
+ * Recalculate friend counts for each user.
+ *
+ * @since BuddyPress (2.0.0)
+ *
+ * @return array
+ */
+function bp_admin_repair_friend_count() {
+	global $wpdb;
+
+	if ( ! bp_is_active( 'friends' ) ) {
+		return;
+	}
+
+	$statement = __( 'Counting the number of friends for each user&hellip; %s', 'buddypress' );
+	$result    = __( 'Failed!', 'buddypress' );
+
+	$sql_delete = "DELETE FROM {$wpdb->usermeta} WHERE meta_key IN ( 'total_friend_count' );";
+	if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) {
+		return array( 1, sprintf( $statement, $result ) );
+	}
+
+	$bp = buddypress();
+
+	// Walk through all users on the site
+	$total_users = $wpdb->get_row( "SELECT count(ID) as c FROM {$wpdb->users}" )->c;
+
+	$updated = array();
+	if ( $total_users > 0 ) {
+		$per_query = 500;
+		$offset = 0;
+		while ( $offset < $total_users ) {
+			// Only bother updating counts for users who actually have friendships
+			$friendships = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id FROM {$bp->friends->table_name} WHERE is_confirmed = 1 AND ( ( initiator_user_id > %d AND initiator_user_id <= %d ) OR ( friend_user_id > %d AND friend_user_id <= %d ) )", $offset, $offset + $per_query, $offset, $offset + $per_query ) );
+
+			// The previous query will turn up duplicates, so we
+			// filter them here
+			foreach ( $friendships as $friendship ) {
+				if ( ! isset( $updated[ $friendship->initiator_user_id ] ) ) {
+					BP_Friends_Friendship::total_friend_count( $friendship->initiator_user_id );
+					$updated[ $friendship->initiator_user_id ] = 1;
+				}
+
+				if ( ! isset( $updated[ $friendship->friend_user_id ] ) ) {
+					BP_Friends_Friendship::total_friend_count( $friendship->friend_user_id );
+					$updated[ $friendship->friend_user_id ] = 1;
+				}
+			}
+
+			$offset += $per_query;
+		}
+	} else {
+		return array( 2, sprintf( $statement, $result ) );
+	}
+
+	return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
+}
+
+/**
+ * Recalculate group counts for each user.
+ *
+ * @since BuddyPress (2.0.0)
+ *
+ * @return array
+ */
+function bp_admin_repair_group_count() {
+	global $wpdb;
+
+	if ( ! bp_is_active( 'groups' ) ) {
+		return;
+	}
+
+	$statement = __( 'Counting the number of groups for each user&hellip; %s', 'buddypress' );
+	$result    = __( 'Failed!', 'buddypress' );
+
+	$sql_delete = "DELETE FROM {$wpdb->usermeta} WHERE meta_key IN ( 'total_group_count' );";
+	if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) {
+		return array( 1, sprintf( $statement, $result ) );
+	}
+
+	$bp = buddypress();
+
+	// Walk through all users on the site
+	$total_users = $wpdb->get_row( "SELECT count(ID) as c FROM {$wpdb->users}" )->c;
+
+	if ( $total_users > 0 ) {
+		$per_query = 500;
+		$offset = 0;
+		while ( $offset < $total_users ) {
+			// But only bother to update counts for users that have groups
+			$users = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE is_confirmed = 1 AND is_banned = 0 AND user_id > %d AND user_id <= %d", $offset, $offset + $per_query ) );
+
+			foreach ( $users as $user ) {
+				BP_Groups_Member::refresh_total_group_count_for_user( $user );
+			}
+
+			$offset += $per_query;
+		}
+	} else {
+		return array( 2, sprintf( $statement, $result ) );
+	}
+
+	return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
+}
+
+/**
+ * Recalculate user-to-blog relationships and useful blog meta data
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @return array
+ */
+function bp_admin_repair_blog_records() {
+
+	// Description of this tool, displayed to the user
+	$statement = __( 'Repopulating Blogs records&hellip; %s', 'buddypress' );
+
+	// Default to failure text
+	$result    = __( 'Failed!',   'buddypress' );
+
+	// Default to unrepaired
+	$repair    = false;
+
+	// Run function if blogs component is active
+	if ( bp_is_active( 'blogs' ) ) {
+		$repair = bp_blogs_record_existing_blogs();
+	}
+
+	// Setup success/fail messaging
+	if ( true === $repair ) {
+		$result = __( 'Complete!', 'buddypress' );
+	}
+
+	// All done!
+	return array( 0, sprintf( $statement, $result ) );
+}
+
+/**
+ * Recalculate the total number of active site members.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_admin_repair_count_members() {
+	$statement = __( 'Counting the number of active members on the site&hellip; %s', 'buddypress' );
+	delete_transient( 'bp_active_member_count' );
+	bp_core_get_active_member_count();
+	return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
+}
+
+/**
+ * Repair user last_activity data.
+ *
+ * Re-runs the migration from usermeta introduced in BP 2.0.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_admin_repair_last_activity() {
+	$statement = __( 'Determining last activity dates for each user&hellip; %s', 'buddypress' );
+	bp_last_activity_migrate();
+	return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
+}
+
+/**
+ * Assemble admin notices relating success/failure of repair processes.
+ *
+ * @since BuddyPress (2.0.0)
+ *
+ * @param string $message Feedback message.
+ * @param unknown $class Unused.
+ */
+function bp_admin_tools_feedback( $message, $class = false ) {
+	if ( is_string( $message ) ) {
+		$message = '<p>' . $message . '</p>';
+		$class = $class ? $class : 'updated';
+	} elseif ( is_wp_error( $message ) ) {
+		$errors = $message->get_error_messages();
+
+		switch ( count( $errors ) ) {
+			case 0:
+				return false;
+
+			case 1:
+				$message = '<p>' . $errors[0] . '</p>';
+				break;
+
+			default:
+				$message = '<ul>' . "\n\t" . '<li>' . implode( '</li>' . "\n\t" . '<li>', $errors ) . '</li>' . "\n" . '</ul>';
+				break;
+		}
+
+		$class = $class ? $class : 'error';
+	} else {
+		return false;
+	}
+
+	$message = '<div id="message" class="' . esc_attr( $class ) . '">' . $message . '</div>';
+	$message = str_replace( "'", "\'", $message );
+	$lambda  = create_function( '', "echo '$message';" );
+
+	add_action( bp_core_do_network_admin() ? 'network_admin_notices' : 'admin_notices', $lambda );
+
+	return $lambda;
+}
+
+/**
+ * Render the Available Tools page.
+ *
+ * We register this page on Network Admin as a top-level home for our
+ * BuddyPress tools. This displays the default content.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_core_admin_available_tools_page() {
+	?>
+	<div class="wrap">
+		<h2><?php esc_attr_e( 'Tools', 'buddypress' ) ?></h2>
+
+		<?php
+
+		/**
+		 * Fires inside the markup used to display the Available Tools page.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 */
+		do_action( 'bp_network_tool_box' ); ?>
+
+	</div>
+	<?php
+}
+
+/**
+ * Render an introduction of BuddyPress tools on Available Tools page.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+function bp_core_admin_available_tools_intro() {
+	$query_arg = array(
+		'page' => 'bp-tools'
+	);
+
+	$page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
+	$url  = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
+	?>
+	<div class="tool-box">
+		<h3 class="title"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h3>
+		<p>
+			<?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?>
+			<?php printf( esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ), '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Tools', 'buddypress' ) . '</a>' ); ?>
+		</p>
+	</div>
+	<?php
+}
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.css b/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.css
index 661e09c6502e5709210874021682871ea9b8900d..44168ebd65a0b8b15a4c095274a6d309f0b332bd 100644
--- a/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.css
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.css
@@ -4,6 +4,26 @@
  * @since BuddyPress (1.6)
  */
 
+/* Welcome Screen
+------------------------------------------------------------------------------*/
+
+body.dashboard_page_bp-about span.dashicons,
+body.index_page_bp-about span.dashicons {
+	float: right;
+	clear: right;
+	margin: 15px 0 0 15px ;
+	height: 90px;
+	width: 90px;
+	background-color: #cccccc;
+	-webkit-border-radius: 50%;
+	border-radius: 50%;
+	border: 1px solid #c1c1c1;
+	font-size: 65px;
+	line-height: 90px;
+	color: #999;
+	text-align: center;
+}
+
 /* User's Lists
 ------------------------------------------------------------------------------*/
 
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.min.css b/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.min.css
index 8231fd8ab9923a9ef2a1a436221c06fbbe7c27e0..4f14a219e609e7f506bd4ec957b94cf91855b061 100644
--- a/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/common-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url(../images/icons32.png) -370px -6px no-repeat}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url(../images/icons32.png) -10px -6px no-repeat}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url(../images/icons32.png) -250px -6px no-repeat}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url(../images/menu.png)!important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url(../images/menu.png);background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu.png);background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:400 150px/1 dashicons!important;color:#D84800;display:inline-block}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;left:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url(../images/icons64.png);background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu-2x.png)!important;background-size:209px 64px}}
\ No newline at end of file
+body.dashboard_page_bp-about span.dashicons,body.index_page_bp-about span.dashicons{float:right;clear:right;margin:15px 0 0 15px;height:90px;width:90px;background-color:#ccc;-webkit-border-radius:50%;border-radius:50%;border:1px solid #c1c1c1;font-size:65px;line-height:90px;color:#999;text-align:center}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url(../images/icons32.png) -370px -6px no-repeat}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url(../images/icons32.png) -10px -6px no-repeat}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url(../images/icons32.png) -250px -6px no-repeat}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url(../images/menu.png)!important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url(../images/menu.png);background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu.png);background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:right;width:18px;height:18px;margin-left:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:400 150px/1 dashicons!important;color:#D84800;display:inline-block}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;left:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url(../images/icons64.png);background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu-2x.png)!important;background-size:209px 64px}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common.css b/wp-content/plugins/buddypress/bp-core/admin/css/common.css
index 0899ce738d973962dc7171e2e45b899ea2a7d9aa..0bd33ed3cec62e1438c9d8ed8f4084f76c3d2a48 100644
--- a/wp-content/plugins/buddypress/bp-core/admin/css/common.css
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.css
@@ -4,6 +4,26 @@
  * @since BuddyPress (1.6)
  */
 
+/* Welcome Screen
+------------------------------------------------------------------------------*/
+
+body.dashboard_page_bp-about span.dashicons,
+body.index_page_bp-about span.dashicons {
+	float: left;
+	clear: left;
+	margin: 15px 15px 0 0 ;
+	height: 90px;
+	width: 90px;
+	background-color: #cccccc;
+	-webkit-border-radius: 50%;
+	border-radius: 50%;
+	border: 1px solid #c1c1c1;
+	font-size: 65px;
+	line-height: 90px;
+	color: #999;
+	text-align: center;
+}
+
 /* User's Lists
 ------------------------------------------------------------------------------*/
 
diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css b/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css
index 4d7f480969319719007382b53bc7d21046731a05..26894e74f6d5ef96f64d626508387af035d27dbf 100644
--- a/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css
+++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url(../images/icons32.png) -370px -6px no-repeat}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url(../images/icons32.png) -10px -6px no-repeat}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url(../images/icons32.png) -250px -6px no-repeat}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url(../images/menu.png)!important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url(../images/menu.png);background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu.png);background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:400 150px/1 dashicons!important;color:#D84800;display:inline-block}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;right:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url(../images/icons64.png);background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu-2x.png)!important;background-size:209px 64px}}
\ No newline at end of file
+body.dashboard_page_bp-about span.dashicons,body.index_page_bp-about span.dashicons{float:left;clear:left;margin:15px 15px 0 0;height:90px;width:90px;background-color:#ccc;-webkit-border-radius:50%;border-radius:50%;border:1px solid #c1c1c1;font-size:65px;line-height:90px;color:#999;text-align:center}body.site-users-php th#role,body.users-php th#role,body.users_page_bp-signups th#count_sent{width:10%}body.site-users-php th#email,body.site-users-php th#name,body.users-php th#email,body.users-php th#name,body.users-php th#registered,body.users_page_bp-signups th#date_sent,body.users_page_bp-signups th#email,body.users_page_bp-signups th#name,body.users_page_bp-signups th#registered{width:15%}body.users-php th#blogs,body.users_page_bp-signups th#blogs{width:20%}body.users_page_bp-signups td.count_sent,body.users_page_bp-signups th.column-count_sent{text-align:center}body.branch-3-6 div#icon-buddypress,body.branch-3-7 div#icon-buddypress{background:url(../images/icons32.png) -370px -6px no-repeat}body.branch-3-6 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-activity{background:url(../images/icons32.png) -10px -6px no-repeat}body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress-groups{background:url(../images/icons32.png) -250px -6px no-repeat}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url(../images/menu.png)!important;background-position:-178px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image{background-position:-178px -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url(../images/menu.png);background-position:0 -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image{background-position:0 -2px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu.png);background-position:-61px -34px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image{background-position:-61px -2px}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}#adminmenu #toplevel_page_bp-activity .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before{content:"\f452"}#adminmenu #toplevel_page_bp-groups .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-groups_user .wp-menu-image:before{content:"\f456"}#adminmenu #toplevel_page_bp-notifications .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-notifications_user .wp-menu-image:before{content:"\f439"}#adminmenu #toplevel_page_bp-messages .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-messages_user .wp-menu-image:before{content:"\f457"}#adminmenu #toplevel_page_bp-friends .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-friends_user .wp-menu-image:before{content:"\f454"}#adminmenu #toplevel_page_bp-settings .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_network .wp-menu-image:before,#adminmenu #toplevel_page_bp-settings_user .wp-menu-image:before{content:"\f108"}#adminmenu li.toplevel_page_bp-components .wp-menu-image,#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:"\f448"}body.branch-3-6 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-6 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-6 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 #adminmenu #toplevel_page_bp-activity .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups .wp-menu-image:before,body.branch-3-7 #adminmenu #toplevel_page_bp-groups_network .wp-menu-image:before,body.branch-3-7 #adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{content:""}.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;margin-right:5px}.settings_page_bp-components td.plugin-title span:before{font-family:dashicons;font-size:18px}.settings_page_bp-components tr.activity td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.notifications td.plugin-title span:before{content:"\f339"}.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:"\f336"}.settings_page_bp-components tr.settings td.plugin-title span:before{content:"\f108"}.settings_page_bp-components tr.groups td.plugin-title span:before{content:"\f456"}.settings_page_bp-components tr.messages td.plugin-title span:before{content:"\f457"}.settings_page_bp-components tr.forums td.plugin-title span:before{content:"\f452"}.settings_page_bp-components tr.blogs td.plugin-title span:before{content:"\f120"}.settings_page_bp-components tr.friends td.plugin-title span:before{content:"\f454"}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.notifications td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span:before,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span:before{content:""}body.branch-3-6.settings_page_bp-components td.plugin-title span,body.branch-3-7.settings_page_bp-components td.plugin-title span{background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat}body.branch-3-6.settings_page_bp-components tr.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}body.branch-3-6.settings_page_bp-components tr.activity td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity td.plugin-title span{background-position:-4px -40px}body.branch-3-6.settings_page_bp-components tr.activity.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.activity.active td.plugin-title span{background-position:-4px -7px}body.branch-3-6.settings_page_bp-components tr.xprofile td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-305px -40px}body.branch-3-6.settings_page_bp-components tr.xprofile.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.xprofile.active td.plugin-title span{background-position:-305px -7px}body.branch-3-6.settings_page_bp-components tr.settings td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-334px -40px}body.branch-3-6.settings_page_bp-components tr.settings.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.settings.active td.plugin-title span{background-position:-334px -7px}body.branch-3-6.settings_page_bp-components tr.groups td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups td.plugin-title span{background-position:-66px -40px}body.branch-3-6.settings_page_bp-components tr.groups.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.groups.active td.plugin-title span{background-position:-66px -7px}body.branch-3-6.settings_page_bp-components tr.messages td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages td.plugin-title span{background-position:-154px -40px}body.branch-3-6.settings_page_bp-components tr.messages.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.messages.active td.plugin-title span{background-position:-154px -7px}body.branch-3-6.settings_page_bp-components tr.forums td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.forums.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.forums.active td.plugin-title span{background-position:-36px -7px}body.branch-3-6.settings_page_bp-components tr.blogs td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs td.plugin-title span{background-position:-125px -40px}body.branch-3-6.settings_page_bp-components tr.blogs.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.blogs.active td.plugin-title span{background-position:-125px -7px}body.branch-3-6.settings_page_bp-components tr.friends td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends td.plugin-title span{background-position:-95px -40px}body.branch-3-6.settings_page_bp-components tr.friends.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.friends.active td.plugin-title span{background-position:-95px -7px}body.branch-3-6.settings_page_bp-components tr.core td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core td.plugin-title span{background-position:-184px -40px}body.branch-3-6.settings_page_bp-components tr.core.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.core.active td.plugin-title span{background-position:-184px -7px}body.branch-3-6.settings_page_bp-components tr.members td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members td.plugin-title span{background-position:-36px -40px}body.branch-3-6.settings_page_bp-components tr.members.active td.plugin-title span,body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title span{background-position:-36px -7px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{font:400 150px/1 dashicons!important;color:#D84800;display:inline-block}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;right:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body.branch-3-6 div#icon-buddypress,body.branch-3-6 div#icon-buddypress-activity,body.branch-3-6 div#icon-buddypress-groups,body.branch-3-7 div#icon-buddypress,body.branch-3-7 div#icon-buddypress-activity,body.branch-3-7 div#icon-buddypress-groups{background-image:url(../images/icons64.png);background-size:419px 45px}body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-6 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url(../images/menu-2x.png)!important;background-size:209px 64px}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/avatar-ui.gif b/wp-content/plugins/buddypress/bp-core/admin/images/avatar-ui.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d35ee67b73393b5760c889275070a50d87b2ec37
Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/avatar-ui.gif differ
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-actions.php b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php
index 2bb2334cdd7005969af7d8bf1e53f406cebc77bc..3d5cf148a5adfa95674b09406eeebfaf32e75a00 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-actions.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php
@@ -13,7 +13,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Attach BuddyPress to WordPress.
@@ -53,7 +53,9 @@ add_action( 'generate_rewrite_rules',  'bp_generate_rewrite_rules', 10    );
  */
 add_action( 'bp_loaded', 'bp_setup_components',         2  );
 add_action( 'bp_loaded', 'bp_include',                  4  );
+add_action( 'bp_loaded', 'bp_setup_cache_groups',       5  );
 add_action( 'bp_loaded', 'bp_setup_widgets',            6  );
+add_action( 'bp_loaded', 'bp_register_member_types',    8  );
 add_action( 'bp_loaded', 'bp_register_theme_packages',  12 );
 add_action( 'bp_loaded', 'bp_register_theme_directory', 14 );
 
@@ -65,6 +67,7 @@ add_action( 'bp_loaded', 'bp_register_theme_directory', 14 );
  *                                                   v---Load order
  */
 add_action( 'bp_init', 'bp_core_set_uri_globals',    2  );
+add_action( 'bp_init', 'bp_register_taxonomies',     3  );
 add_action( 'bp_init', 'bp_setup_globals',           4  );
 add_action( 'bp_init', 'bp_setup_canonical_stack',   5  );
 add_action( 'bp_init', 'bp_setup_nav',               6  );
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php
index 217eb083c0120593d1405156bb5346aff5988fd3..94b7a13a325eddefe633937da3fc517e45493c0e 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 if ( !class_exists( 'BP_Admin' ) ) :
 /**
@@ -16,6 +16,7 @@ if ( !class_exists( 'BP_Admin' ) ) :
  *
  * @package BuddyPress
  * @subpackage CoreAdministration
+ * @todo Break this apart into each applicable Component
  *
  * @since BuddyPress (1.6.0)
  */
@@ -116,12 +117,12 @@ class BP_Admin {
 	 * @access private
 	 */
 	private function includes() {
-		require( $this->admin_dir . 'bp-core-actions.php'    );
-		require( $this->admin_dir . 'bp-core-settings.php'   );
-		require( $this->admin_dir . 'bp-core-functions.php'  );
-		require( $this->admin_dir . 'bp-core-components.php' );
-		require( $this->admin_dir . 'bp-core-slugs.php'      );
-		require( $this->admin_dir . 'bp-core-tools.php'      );
+		require( $this->admin_dir . 'bp-core-admin-actions.php'    );
+		require( $this->admin_dir . 'bp-core-admin-settings.php'   );
+		require( $this->admin_dir . 'bp-core-admin-functions.php'  );
+		require( $this->admin_dir . 'bp-core-admin-components.php' );
+		require( $this->admin_dir . 'bp-core-admin-slugs.php'      );
+		require( $this->admin_dir . 'bp-core-admin-tools.php'      );
 	}
 
 	/**
@@ -158,7 +159,7 @@ class BP_Admin {
 		add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 );
 
 		// Add a description of new BuddyPress tools in the available tools page
-		add_action( 'tool_box', 'bp_core_admin_available_tools_intro' );
+		add_action( 'tool_box',            'bp_core_admin_available_tools_intro' );
 		add_action( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' );
 
 		// On non-multisite, catch
@@ -178,7 +179,7 @@ class BP_Admin {
 	/**
 	 * Add the navigational menu elements.
 	 *
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
 	 *
 	 * @uses add_management_page() To add the Recount page in Tools section.
 	 * @uses add_options_page() To add the Forums settings page in Settings
@@ -187,8 +188,9 @@ class BP_Admin {
 	public function admin_menus() {
 
 		// Bail if user cannot moderate
-		if ( ! bp_current_user_can( 'manage_options' ) )
+		if ( ! bp_current_user_can( 'manage_options' ) ) {
 			return;
+		}
 
 		// About
 		add_dashboard_page(
@@ -313,11 +315,11 @@ class BP_Admin {
 		/** Main Section ******************************************************/
 
 		// Add the main section
-		add_settings_section( 'bp_main',            __( 'Main Settings',    'buddypress' ), 'bp_admin_setting_callback_main_section',     'buddypress'            );
+		add_settings_section( 'bp_main', __( 'Main Settings', 'buddypress' ), 'bp_admin_setting_callback_main_section', 'buddypress' );
 
 		// Hide toolbar for logged out users setting
-		add_settings_field( 'hide-loggedout-adminbar',        __( 'Toolbar',        'buddypress' ), 'bp_admin_setting_callback_admin_bar',        'buddypress', 'bp_main' );
-	 	register_setting  ( 'buddypress',           'hide-loggedout-adminbar',        'intval'                                                                              );
+		add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
+	 	register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
 
 		// Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade
 		if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
@@ -327,7 +329,7 @@ class BP_Admin {
 
 		// Allow account deletion
 		add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
-	 	register_setting  ( 'buddypress',           'bp-disable-account-deletion', 'intval'                                                                              );
+	 	register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
 
 		/** XProfile Section **************************************************/
 
@@ -336,11 +338,12 @@ class BP_Admin {
 			// Add the main section
 			add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
 
-			$avatar_setting = 'bp_xprofile';
+			add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' );
+			register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
 
 			// Profile sync setting
-			add_settings_field( 'bp-disable-profile-sync',   __( 'Profile Syncing',  'buddypress' ), 'bp_admin_setting_callback_profile_sync',     'buddypress', 'bp_xprofile' );
-			register_setting  ( 'buddypress',         'bp-disable-profile-sync',     'intval'                                                                                  );
+			add_settings_field( 'bp-disable-profile-sync',   __( 'Profile Syncing',  'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' );
+			register_setting  ( 'buddypress', 'bp-disable-profile-sync', 'intval' );
 		}
 
 		/** Groups Section ****************************************************/
@@ -348,14 +351,15 @@ class BP_Admin {
 		if ( bp_is_active( 'groups' ) ) {
 
 			// Add the main section
-			add_settings_section( 'bp_groups',        __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section',   'buddypress'              );
-
-			if ( empty( $avatar_setting ) )
-				$avatar_setting = 'bp_groups';
+			add_settings_section( 'bp_groups', __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' );
 
 			// Allow subscriptions setting
-			add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation',   'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
-			register_setting  ( 'buddypress',         'bp_restrict_group_creation',   'intval'                                                                                );
+			add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
+			register_setting( 'buddypress', 'bp_restrict_group_creation', 'intval' );
+
+			// Allow group avatars.
+			add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' );
+			register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' );
 		}
 
 		/** Forums ************************************************************/
@@ -363,11 +367,11 @@ class BP_Admin {
 		if ( bp_is_active( 'forums' ) ) {
 
 			// Add the main section
-			add_settings_section( 'bp_forums',        __( 'Legacy Group Forums',       'buddypress' ), 'bp_admin_setting_callback_bbpress_section',       'buddypress'              );
+			add_settings_section( 'bp_forums', __( 'Legacy Group Forums', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' );
 
 			// Allow subscriptions setting
 			add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' );
-			register_setting  ( 'buddypress',         'bb-config-location',        ''                                                                                           );
+			register_setting( 'buddypress', 'bb-config-location', '' );
 		}
 
 		/** Activity Section **************************************************/
@@ -375,7 +379,7 @@ class BP_Admin {
 		if ( bp_is_active( 'activity' ) ) {
 
 			// Add the main section
-			add_settings_section( 'bp_activity',      __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress'                );
+			add_settings_section( 'bp_activity', __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress' );
 
 			// Activity commenting on blog and forum posts
 			add_settings_field( 'bp-disable-blogforum-comments', __( 'Blog &amp; Forum Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' );
@@ -387,18 +391,10 @@ class BP_Admin {
 
 			// Allow activity akismet
 			if ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) {
-				add_settings_field( '_bp_enable_akismet', __( 'Akismet',          'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' );
-				register_setting  ( 'buddypress',         '_bp_enable_akismet',   'intval'                                                                                  );
+				add_settings_field( '_bp_enable_akismet', __( 'Akismet', 'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' );
+				register_setting( 'buddypress', '_bp_enable_akismet', 'intval' );
 			}
 		}
-
-		/** Avatar upload for users or groups ************************************/
-
-		if ( ! empty( $avatar_setting ) ) {
-		    // Allow avatar uploads
-		    add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads',   'buddypress' ), 'bp_admin_setting_callback_avatar_uploads',   'buddypress', $avatar_setting );
-		    register_setting  ( 'buddypress',         'bp-disable-avatar-uploads',   'intval'                                                                                    );
-		}
 	}
 
 	/**
@@ -431,13 +427,14 @@ class BP_Admin {
 	public function modify_plugin_action_links( $links, $file ) {
 
 		// Return normal links if not BuddyPress
-		if ( plugin_basename( buddypress()->basename ) != $file )
+		if ( plugin_basename( buddypress()->basename ) != $file ) {
 			return $links;
+		}
 
 		// Add a few links to the existing links array
 		return array_merge( $links, array(
-			'settings' => '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
-			'about'    => '<a href="' . add_query_arg( array( 'page' => 'bp-about'      ), bp_get_admin_url( 'index.php'          ) ) . '">' . esc_html__( 'About',    'buddypress' ) . '</a>'
+			'settings' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
+			'about'    => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-about'      ), bp_get_admin_url( 'index.php'          ) ) ) . '">' . esc_html__( 'About',    'buddypress' ) . '</a>'
 		) );
 	}
 
@@ -469,6 +466,14 @@ class BP_Admin {
 		$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 
 		$file = $this->css_url . "common{$min}.css";
+
+		/**
+		 * Filters the BuddyPress Core Admin CSS file path.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $file File path for the admin CSS.
+		 */
 		$file = apply_filters( 'bp_core_admin_common_css', $file );
 		wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() );
 
@@ -486,49 +491,31 @@ class BP_Admin {
 	 * @since BuddyPress (1.7.0)
 	 */
 	public function about_screen() {
-		global $wp_rewrite;
-
-		$is_new_install            = ! empty( $_GET['is_new_install'] );
-		$pretty_permalinks_enabled = ! empty( $wp_rewrite->permalink_structure );
-		list( $display_version )   = explode( '-', bp_get_version() ); ?>
+	?>
 
 		<div class="wrap about-wrap">
-			<h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1>
-			<div class="about-text">
-				<?php if ( $is_new_install ) : ?>
-					<?php printf( __( 'Thank you for installing BuddyPress! BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
-				<?php else : ?>
-					<?php printf( __( 'Howdy. BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
-				<?php endif; ?>
-			</div>
 
-			<div class="bp-badge"></div>
+			<?php self::welcome_text(); ?>
 
-			<h2 class="nav-tab-wrapper">
-				<a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>">
-					<?php _e( 'What&#8217;s New', 'buddypress' ); ?>
-				</a><a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>">
-					<?php _e( 'Credits', 'buddypress' ); ?>
-				</a>
-			</h2>
+			<?php self::tab_navigation( __METHOD__ ); ?>
 
-			<?php if ( $is_new_install ) : ?> 
+			<?php if ( self::is_new_install() ) : ?>
 
 				<div id="welcome-panel" class="welcome-panel">
 					<div class="welcome-panel-content">
 						<h3 style="margin:0"><?php _e( 'Getting Started with BuddyPress', 'buddypress' ); ?></h3>
 						<div class="welcome-panel-column-container">
 							<div class="welcome-panel-column">
-								<h4><?php _e( 'Configure Buddypress', 'buddypress' ); ?></h4>
+								<h4><?php _e( 'Configure BuddyPress', 'buddypress' ); ?></h4>
 								<ul>
-									<li><?php printf( 
-									'<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Set Up Components', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
+									<li><?php printf(
+									'<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Set Up Components', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) )
 									); ?></li>
-									<li><?php printf( 
-									'<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Assign Components to Pages', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), $this->settings_page ) )
+									<li><?php printf(
+									'<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Assign Components to Pages', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), $this->settings_page ) ) )
 									); ?></li>
 									<li><?php printf(
-									'<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Customize Settings', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), $this->settings_page ) )
+									'<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Customize Settings', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), $this->settings_page ) ) )
 									); ?></li>
 								</ul>
 								<a class="button button-primary button-hero" style="margin-bottom:20px;margin-top:0;" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Get Started', 'buddypress' ); ?></a>
@@ -537,23 +524,23 @@ class BP_Admin {
 								<h4><?php _e( 'Administration Tools', 'buddypress' ); ?></h4>
 								<ul>
 									<?php if ( bp_is_active( 'members' ) ) : ?>
-										<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ) ); ?></li>
+										<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ) ) ); ?></li>
 									<?php endif; ?>
-									<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ), 'users.php' ) ) ); ?></li>
+									<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ), 'users.php' ) ) ) ); ?></li>
 									<?php if ( bp_is_active( 'activity' ) ) : ?>
-										<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ), 'admin.php' ) ) ); ?></li>
+										<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ), 'admin.php' ) ) ) ); ?></li>
 									<?php endif; ?>
 									<?php if ( bp_is_active( 'groups' ) ) : ?>
-										<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) ); ?></li>
+										<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) ) ); ?></li>
 									<?php endif; ?>
-									<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'tools.php' ) ) ); ?>
+									<li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'tools.php' ) ) ) ); ?>
 									</li>
 								</ul>
 							</div>
 							<div class="welcome-panel-column welcome-panel-last">
 								<h4><?php _e( 'Community and Support', 'buddypress'  ); ?></h4>
-								<p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Looking for help? The <a href="http://codex.buddypress.org/">BuddyPress Codex</a> has you covered.', 'buddypress' ) ?></p> 
-								<p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Can&#8217;t find what you need? Stop by <a href="http://buddypress.org/support/">our support forums</a>, where active BuddyPress users and developers are waiting to share tips and more.', 'buddypress' ) ?></p>
+								<p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Looking for help? The <a href="https://codex.buddypress.org/">BuddyPress Codex</a> has you covered.', 'buddypress' ) ?></p>
+								<p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Can&#8217;t find what you need? Stop by <a href="https://buddypress.org/support/">our support forums</a>, where active BuddyPress users and developers are waiting to share tips and more.', 'buddypress' ) ?></p>
 							</div>
 						</div>
 					</div>
@@ -561,101 +548,75 @@ class BP_Admin {
 
 			<?php endif; ?>
 
-			<hr />
+			<div class="headline-feature">
+				<h3><?php esc_html_e( 'Upload Profile Pictures with Drag and Drop', 'buddypress' ); ?></h3>
 
-			<div class="changelog">
-				<h2 class="about-headline-callout"><?php _e( 'Revamped @mentions Interface', 'buddypress' ); ?></h2>
-				<p><?php _e( 'Forget the old days of trying to remember someone&#8217;s username when you want to @mention them in a conversation! With BuddyPress 2.1, type a <code>@</code> when leaving a status update or commenting on an activity item or blog post, and the new suggestions panel will open.', 'buddypress' ) ?></p>
-				<p style="text-align: center"><img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/mentions.gif' ); ?>" alt="<?php esc_attr_e( 'Demo of at-mentions feature', 'buddypress' ); ?>" style="margin-bottom: 20px"></p>
- 			</div>
+				<div class="featured-image">
+					<img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/avatar-ui.gif' ); ?>" alt="<?php esc_attr_e( 'Revamped Profile Picture Upload UI', 'buddypress' ); ?>">
+				</div>
 
-			<hr />
+				<div class="feature-section">
+					<h3><?php esc_html_e( 'Built with the Attachments API, the new foundation for BuddyPress media management.', 'buddypress' ); ?></h3>
+					<p><?php esc_html_e( 'You can drag and drop any image you choose to upload as your profile photo. The interface is mobile-ready and now includes integration with phone and laptop cameras. This is an example of what can be developed using the new Attachments API, the long-awaited foundation for media-related BuddyPress components and features.', 'buddypress' ); ?> <a href="https://codex.buddypress.org/plugindev/bp_attachment/"><?php esc_html_e( 'Learn more &rarr;', 'buddypress' ); ?></a></p>
+				</div>
 
-			<div class="changelog">
-				<h2 class="about-headline-callout"><?php _e( 'Continuous Improvement', 'buddypress' ); ?></h2>
+				<div class="clear"></div>
+			</div>
+
+			<div class="feature-list finer-points">
+				<h2><?php esc_html_e( 'The Finer Points', 'buddypress' ); ?></h2>
+
+				<div class="feature-section col two-col">
+					<div>
+						<span class=" dashicons dashicons-admin-users"></span>
+						<h4><?php esc_html_e( 'Member Type Directories', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'Create directories of member types in your site using the Member Type API.', 'buddypress' ); ?></p>
+					</div>
 
-				<div class="feature-section col three-col">
-					<div class="col-1">
-						<h4><?php esc_html_e( 'New Profile Field Type: URL', 'buddypress' ); ?></h4>
-						<p><?php esc_html_e( 'Built to hold the address of another website, this new field type automatically creates a link to that site.', 'buddypress' ); ?></p>
+					<div class="template-pack last-feature">
+						<span class=" dashicons dashicons-admin-appearance"></span>
+						<h4><?php esc_html_e( 'Companion Stylesheets For Themes', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'Improved styling and integration of BuddyPress components with bundled WordPress themes, Twenty Fifteen and Twenty Fourteen.', 'buddypress' ); ?></p>
 					</div>
 
-					<div class="col-2">
-						<h4><?php esc_html_e( 'Awesome Translations', 'buddypress' ); ?></h4>
-						<p><?php esc_html_e( 'BuddyPress supports high-quality translations that are automatically fetched by WordPress. Many thanks to our translation volunteers for making this possible.', 'buddypress' ); ?></p>
+					<div class="group-invites">
+						<span class=" dashicons dashicons-admin-post"></span>
+						<h4><?php esc_html_e( 'Blog Post Activity', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'BuddyPress now generates better excerpts in the activity streams for posts containing images or other embedded media content.', 'buddypress' ); ?></p>
 					</div>
 
-					<div class="col-3 last-feature">
-						<h4><?php esc_html_e( 'Performance Improvements', 'buddypress' ); ?></h4>
-						<p><?php _e( 'Like we do with every release, we&#8217ve made further optimizations to increase BuddyPress&#8217 performance and reduce its query overhead.', 'buddypress' ); ?></p>
+					<div class="last-feature">
+						<span class=" dashicons dashicons-star-filled"></span>
+						<h4><?php esc_html_e( 'Star Private Messages ', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'Mark important messages in your inbox from your friends with a star.', 'buddypress' ); ?></p>
 					</div>
 				</div>
 			</div>
 
-			<hr />
+			<div class="feature-list">
+				<h2><?php esc_html_e( 'Under the Hood', 'buddypress' ); ?></h2>
 
-			<div class="changelog">
-				<h2 class="about-headline-callout"><?php esc_html_e( 'Enhancements for Plugin &amp; Theme Developers', 'buddypress' ); ?></h2>
 				<div class="feature-section col two-col">
-					<div class="col-1">
-						<p><?php _e( 'If you&#8217re a plugin developer, or make custom themes, or want to contribute back to the BuddyPress project, here&#8217s what you should know about this release:', 'buddypress' ); ?></p>
-						<p><?php _e( 'If you&#8217ve used BuddyPress for a very long time, you might remember the <em>BuddyBar</em>; it was our toolbar before WordPress had its own toolbar. We started to deprecate it in BuddyPress 1.6. It is now formally deprecated, which means you should not use it for new sites.', 'buddypress' ); ?></p>
-						<p>
-							<?php printf(
-								__( 'The classic <a href="%s">BP Default theme has moved to Github</a>. We moved it because BuddyPress development is now focused on our <a href="%s">theme compatibility</a> templates, which were introduced in BuddyPress 1.7. Don&#8217t worry, BP-Default is still bundled with BuddyPress releases.', 'buddypress' ),
-								esc_url( 'https://github.com/buddypress/BP-Default' ),
-								esc_url( 'http://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/' )
-							); ?>
-						</p>
-						<p>
-							<?php
-							/* translators: don't translate the insides of the <code> block */
-							_e( 'In BuddyPress 2.0, we added a new <code>BP_XProfile_Field_Type</code> API for managing profile field types. In this release, we&#8217ve added a new <code>bp_core_get_suggestions</code> API which powers our new @mentions interface. Both are cool, and are worth checking out.', 'buddypress' );
-							?>
-						</p>
+					<div>
+						<h4><?php esc_html_e( 'Components can register new features', 'buddypress' ); ?></h4>
+						<p><?php _e( 'Plugin developers can register new features or check if a component feature is registered using the <code>BP_Component</code> class.', 'buddypress' ); ?></p>
+
+						<h4><?php esc_html_e( 'Cache Improvements', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'Improved caching for the following components: Messages, Profiles, Members &amp; Member Types, and Friends.', 'buddypress' ); ?></p>
 					</div>
+					<div class="last-feature">
+						<h4><?php esc_html_e( 'Developer Reference', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'Continued improvements to inline code documentation make it easier for developers to understand how BuddyPress works.', 'buddypress' ); ?></p>
 
-					<div class="col-2 last-feature">
-						<p><?php esc_html_e( 'Other interesting changes:', 'buddypress' ); ?>
-
-						<ul>
-							<li>
-								<?php
-								/* translators: don't translate the insides of the <code> block */
-								_e( 'In <code>BP_Group_Extension</code>, the <code>visibility</code> and <code>enable_nav_item</code> properties have been phased out in favor of new <code>access</code> and <code>show_tab</code> parameters.', 'buddypress' );
-								?>
-							</li>
-							<li>
-								<?php
-								/* translators: don't translate the insides of the <code> block */
-								_e( 'A new <code>group_activity</code> sort order has been added for Groups queries, to let you query for recently active members.', 'buddypress' );
-								?>
-							</li>
-							<li>
-								<?php
-								/* translators: don't translate the insides of the <code> block */
-								_e( 'Extra CSS classes have been added to Profile Field visibility field elements, allowing greater CSS customization.', 'buddypress' );
-								?>
-							</li>
-							<li>
-								<?php
-								/* translators: don't translate the insides of the <code> block */
-								_e( 'A <code>no_access_url</code> parameter has been added to <code>bp_core_new_subnav_item()</code>. This allows you to set the URL that users are redirected to when they do not have permission to access a sub-navigation item.', 'buddypress' );
-								?>
-							</li>
-							<li>
-								<?php
-								/* translators: don't translate the insides of the <code> block */
-								_e( 'When making searches with <code>BP_User_Query</code>, a new <code>search_wildcard</code> parameter gives you finer control over how the search SQL is constructed.', 'buddypress' );
-								?>
-							</li>
-	
-
-							<li><?php printf( __( '<a href="%s">&hellip;and lots more!</a>', 'buddypress' ), 'https://codex.buddypress.org/releases/version-2-1' ); ?></li>
-						</ul>
+						<h4><?php esc_html_e( 'User Documentation', 'buddypress' ); ?></h4>
+						<p><?php esc_html_e( 'The BuddyPress Codex is maintained and updated regularly with new articles and tutorials.', 'buddypress' ); ?></p>
 					</div>
 				</div>
 			</div>
+
+			<p><?php _ex( 'Learn more:', 'About screen, website links', 'buddypress' ); ?> <a href="https://buddypress.org/blog/"><?php _ex( 'News', 'About screen, link to project blog', 'buddypress' ); ?></a> &bullet; <a href="https://buddypress.org/suppport/"><?php _ex( 'Support', 'About screen, link to support site', 'buddypress' ); ?></a> &bullet; <a href="https://codex.buddypress.org/"><?php _ex( 'Documentation', 'About screen, link to documentation', 'buddypress' ); ?></a> &bullet; <a href="https://bpdevel.wordpress.com/"><?php _ex( 'Development Blog', 'About screen, link to development blog', 'buddypress' ); ?></a></p>
+			<p><?php _ex( 'Twitter:', 'official Twitter accounts:', 'buddypress' ); ?> <a href="https://twitter.com/buddypress/"><?php _ex( 'BuddyPress', '@buddypress twitter account name', 'buddypress' ); ?></a> &bullet; <a href="https://twitter.com/bptrac/"><?php _ex( 'Trac', '@bptrac twitter account name', 'buddypress' ); ?></a> &bullet; <a href="https://twitter.com/buddypressdev/"><?php _ex( 'Development', '@buddypressdev twitter account name', 'buddypress' ); ?></a></p>
+
 		<?php
 	}
 
@@ -668,48 +629,31 @@ class BP_Admin {
 	 * @since BuddyPress (1.7.0)
 	 */
 	public function credits_screen() {
-
-		$is_new_install = ! empty( $_GET['is_new_install'] );
-
-		list( $display_version ) = explode( '-', bp_get_version() ); ?>
+	?>
 
 		<div class="wrap about-wrap">
-			<h1><?php printf( __( 'Welcome to BuddyPress %s', 'buddypress' ), $display_version ); ?></h1>
-			<div class="about-text">
-				<?php if ( $is_new_install ) : ?>
-					<?php printf( __( 'Thank you for installing BuddyPress! BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
-				<?php else : ?>
-					<?php printf( __( 'Howdy. BuddyPress %s is our most streamlined and easy-to-use release to date, and we think you&#8217;re going to love it.', 'buddypress' ), $display_version ); ?>
-				<?php endif; ?>
-			</div>
 
-			<div class="bp-badge"></div>
+			<?php self::welcome_text(); ?>
 
-			<h2 class="nav-tab-wrapper">
-				<a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>">
-					<?php _e( 'What&#8217;s New', 'buddypress' ); ?>
-				</a><a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>">
-					<?php _e( 'Credits', 'buddypress' ); ?>
-				</a>
-			</h2>
+			<?php self::tab_navigation( __METHOD__ ); ?>
 
-			<p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks.', 'buddypress' ); ?></p>
+			<p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks like these.', 'buddypress' ); ?></p>
 
 			<h4 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h4>
 			<ul class="wp-people-group " id="wp-people-group-project-leaders">
 				<li class="wp-person" id="wp-person-johnjamesjacoby">
-					<a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
-					<a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
+					<a href="https://profiles.wordpress.org/johnjamesjacoby"><img src="//www.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a>
+					<a class="web" href="https://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a>
 					<span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span>
 				</li>
 				<li class="wp-person" id="wp-person-boonebgorges">
-					<a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a>
-					<a class="web" href="http://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a>
+					<a href="https://profiles.wordpress.org/boonebgorges"><img src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a>
+					<a class="web" href="https://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a>
 					<span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
 				</li>
 				<li class="wp-person" id="wp-person-djpaul">
-					<a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a>
-					<a class="web" href="http://profiles.wordpress.org/djpaul">Paul Gibbs</a>
+					<a href="https://profiles.wordpress.org/djpaul"><img src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a>
+					<a class="web" href="https://profiles.wordpress.org/djpaul">Paul Gibbs</a>
 					<span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
 				</li>
 			</ul>
@@ -717,91 +661,104 @@ class BP_Admin {
 			<h4 class="wp-people-group"><?php _e( 'Core Team', 'buddypress' ); ?></h4>
 			<ul class="wp-people-group " id="wp-people-group-core-team">
 				<li class="wp-person" id="wp-person-r-a-y">
-					<a href="http://profiles.wordpress.org/r-a-y"><img src="http://0.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a>
-					<a class="web" href="http://profiles.wordpress.org/r-a-y">Ray</a>
+					<a href="https://profiles.wordpress.org/r-a-y"><img src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a>
+					<a class="web" href="https://profiles.wordpress.org/r-a-y">Ray</a>
 					<span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 				</li>
 				<li class="wp-person" id="wp-person-imath">
-					<a href="http://profiles.wordpress.org/imath"><img src="http://0.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=60" class="gravatar" alt="Mathieu Viet" /></a>
-					<a class="web" href="http://profiles.wordpress.org/imath">Mathieu Viet</a>
+					<a href="https://profiles.wordpress.org/imath"><img src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=60" class="gravatar" alt="Mathieu Viet" /></a>
+					<a class="web" href="https://profiles.wordpress.org/imath">Mathieu Viet</a>
 					<span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 				</li>
 				<li class="wp-person" id="wp-person-mercime">
-					<a href="http://profiles.wordpress.org/mercime"><img src="http://0.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a>
-					<a class="web" href="http://profiles.wordpress.org/mercime">Mercime</a>
+					<a href="https://profiles.wordpress.org/mercime"><img src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a>
+					<a class="web" href="https://profiles.wordpress.org/mercime">Mercime</a>
 					<span class="title"><?php _e( 'Navigator', 'buddypress' ); ?></span>
 				</li>
+				<li class="wp-person" id="wp-person-dcavins">
+					<a href="https://profiles.wordpress.org/dcavins"><img src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=60" class="gravatar" alt="David Cavins" /></a>
+					<a class="web" href="https://profiles.wordpress.org/dcavins">David Cavins</a>
+					<span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
+				</li>
+				<li class="wp-person" id="wp-person-tw2113">
+					<a href="https://profiles.wordpress.org/tw2113"><img src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=60" class="gravatar" alt="Michael Beckwith" /></a>
+					<a class="web" href="https://profiles.wordpress.org/tw2113">Michael Beckwith</a>
+					<span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
+				</li>
+				<li class="wp-person" id="wp-person-hnla">
+					<a href="https://profiles.wordpress.org/hnla"><img src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=60" class="gravatar" alt="Hugo Ashmore" /></a>
+					<a class="web" href="https://profiles.wordpress.org/hnla">Hugo</a>
+					<span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
+				</li>
 			</ul>
 
 			<h4 class="wp-people-group"><?php _e( 'Recent Rockstars', 'buddypress' ); ?></h4>
 			<ul class="wp-people-group " id="wp-people-group-rockstars">
-				<li class="wp-person" id="wp-person-dcavins">
-					<a href="http://profiles.wordpress.org/dcavins"><img src="http://0.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=60" class="gravatar" alt="David Cavins" /></a>
-					<a class="web" href="http://profiles.wordpress.org/dcavins">David Cavins</a>
-				</li>
 				<li class="wp-person" id="wp-person-henry-wright">
-					<a href="http://profiles.wordpress.org/henry.wright"><img src="http://0.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60" class="gravatar" alt="Henry Wright" /></a>
-					<a class="web" href="http://profiles.wordpress.org/henry.wright">Henry Wright</a>
+					<a href="https://profiles.wordpress.org/henry.wright"><img src="//www.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60" class="gravatar" alt="Henry Wright" /></a>
+					<a class="web" href="https://profiles.wordpress.org/henry.wright">Henry Wright</a>
 				</li>
 				<li class="wp-person" id="wp-person-danbp">
-					<a href="http://profiles.wordpress.org/danbp"><img src="http://0.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=60" class="gravatar" alt="danbp" /></a>
-					<a class="web" href="http://profiles.wordpress.org/danbp">danbp</a>
+					<a href="https://profiles.wordpress.org/danbp"><img src="//www.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=60" class="gravatar" alt="danbp" /></a>
+					<a class="web" href="https://profiles.wordpress.org/danbp">danbp</a>
 				</li>
 				<li class="wp-person" id="wp-person-shanebp">
-					<a href="http://profiles.wordpress.org/shanebp"><img src="http://0.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=60" class="gravatar" alt="shanebp" /></a>
-					<a class="web" href="http://profiles.wordpress.org/shanebp">shanebp</a>
+					<a href="https://profiles.wordpress.org/shanebp"><img src="//www.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=60" class="gravatar" alt="shanebp" /></a>
+					<a class="web" href="https://profiles.wordpress.org/shanebp">shanebp</a>
 				</li>
 				<li class="wp-person" id="wp-person-netweb">
-					<a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
-					<a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a>
+					<a href="https://profiles.wordpress.org/netweb"><img src="//www.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a>
+					<a class="web" href="https://profiles.wordpress.org/netweb">Stephen Edgar</a>
+				</li>
+				<li class="wp-person" id="wp-person-dimensionmedia">
+					<a href="https://profiles.wordpress.org/dimensionmedia"><img src="//www.gravatar.com/avatar/7735aada1ec39d0c1118bd92ed4551f1?s=60" class="gravatar" alt="David Bisset" /></a>
+					<a class="web" href="https://profiles.wordpress.org/dimensionmedia">David Bisset</a>
 				</li>
+
 			</ul>
 
-			<h4 class="wp-people-group"><?php printf( __( 'Contributors to BuddyPress %s', 'buddypress' ), $display_version ); ?></h4>
+			<h4 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h4>
 			<p class="wp-credits-list">
-				<a href="https://profiles.wordpress.org/adamt19/">adamt19</a>,
-				<a href="https://profiles.wordpress.org/Viper007Bond/">Alex Mills (Viper007Bond)</a>,
-				<a href="https://profiles.wordpress.org/allendav/">allendav</a>,
-				<a href="https://profiles.wordpress.org/alternatekev/">alternatekev</a>,
-				<a href="https://profiles.wordpress.org/automattic/">Automattic</a>,
-				<a href="https://profiles.wordpress.org/beaulebens/">Beau Lebens (beaulebens)</a>,
+				<a href="https://profiles.wordpress.org/jorbin/">Aaron Jorbin (aaronjorbin)</a>,
 				<a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
-				<a href="https://profiles.wordpress.org/williamsba1/">Brad Williams (williamsba1)</a>,
 				<a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
-				<a href="https://profiles.wordpress.org/danbp/">danbp</a>,
+				<a href="https://profiles.wordpress.org/CristinaCannon/">CristinaCannon</a>,
 				<a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
-				<a href="https://profiles.wordpress.org/ebellempire/">Erin B. (ebellempire)</a>,
-				<a href="https://profiles.wordpress.org/esroyo/">esroyo</a>,
-				<a href="https://profiles.wordpress.org/godavid33">godavid33</a>,
-				<a href="http://profiles.wordpress.org/henry.wright">Henry Wright (henry.wright)</a>,
+				<a href="https://profiles.wordpress.org/wpdennis/">Dennis (wpdennis)</a>,
+				<a href="https://profiles.wordpress.org/ocean90/">Dominik Schilling (ocean90)</a>,
+				ecehren,
+				<a href="https://profiles.wordpress.org/finzend/">finzend</a>,
+				<a href="https://profiles.wordpress.org/Mamaduka/">George Mamadashvili (Mamaduka)</a>,
+				<a href="https://profiles.wordpress.org/gregrickaby/">Greg Rickaby (gregrickaby)</a>,
+				<a href="https://profiles.wordpress.org/henrywright/">Henry Wright (henry.wright)</a>,
 				<a href="https://profiles.wordpress.org/hnla/">Hugo (hnla)</a>,
-				<a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
+				<a href="https://profiles.wordpress.org/jaimieolmstead/">jaimieolmstead</a>,
 				<a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
-				<a href="https://profiles.wordpress.org/jconti/">Jose Conti (jconti)</a>,
 				<a href="https://profiles.wordpress.org/jreeve/">jreeve</a>,
+				<a href="https://profiles.wordpress.org/JustinSainton/">Justin Sainton (JustinSainton)</a>,
+				<a href="https://profiles.wordpress.org/kadamwhite/">K.Adam White (kadamwhite)</a>,
 				<a href="https://profiles.wordpress.org/Offereins">Laurens Offereins (Offereins)</a>
 				<a href="https://profiles.wordpress.org/lenasterg/">lenasterg</a>,
+				<a href="https://profiles.wordpress.org/natrio/">Marc (natrio)</a>,
+				<a href="https://profiles.wordpress.org/mechter/">Markus Echterhoff (mechter)</a>,
+				<a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
+				<a href="https://profiles.wordpress.org/melhop/">melhop</a>,
 				<a href="https://profiles.wordpress.org/mercime/">mercime</a>,
 				<a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith (tw2113)</a>,
-				<a href="https://profiles.wordpress.org/milesstewart88/">Miles Stewart (milesstewart88)</a>,
-				<a href="https://profiles.wordpress.org/needle/">needle</a>,
-				<a href="https://profiles.wordpress.org/sooskriszta/">OC2PS (sooskriszta)</a>,
+				<a href="https://profiles.wordpress.org/pareshradadiya/">paresh.radadiya (pareshradadiya)</a>,
 				<a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
+				<a href="https://profiles.wordpress.org/prometheus-fire/">Prometheus Fire</a>,
 				<a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
 				<a href="https://profiles.wordpress.org/rogercoathup/">Roger Coathup (rogercoathup)</a>,
-				<a href="https://profiles.wordpress.org/pollyplummer/">Sarah Gooding (pollyplummer)</a>,
-				<a href="https://profiles.wordpress.org/SGr33n/">Sergio De Falco (SGr33n)</a>,
+				<a href="https://profiles.wordpress.org/dtc7240/">Scott Seitz (dtc7240)</a>,
+				<a href="https://profiles.wordpress.org/wonderboymusic/">Scott Taylor (wonderboymusic)</a>.
+				<a href="https://profiles.wordpress.org/SergeyBiryukov/">Sergey Biryukov (SergeyBiryukov)</a>,
 				<a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
-				<a href="https://profiles.wordpress.org/slaFFik/">Slava UA (slaFFik)</a>,
 				<a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
-				<a href="https://profiles.wordpress.org/karmatosed/">Tammie (karmatosed)</a>,
-				<a href="https://profiles.wordpress.org/tomdxw/">tomdxw</a>,
-				<a href="https://profiles.wordpress.org/treyhunner/">treyhunner</a>,
-				<a href="https://profiles.wordpress.org/ubernaut/">ubernaut</a>,
-				<a href="https://profiles.wordpress.org/wbajzek/">wbajzek</a>,
-				<a href="https://profiles.wordpress.org/WCUADD/">WCUADD</a>,
-				<a href="https://profiles.wordpress.org/wpdennis/">wpdennis</a>,
-				<a href="https://profiles.wordpress.org/wolfhoundjesse/">wolfhoundjesse</a>.
+				<a href="https://profiles.wordpress.org/svenl77/">svenl77</a>,
+				<a href="https://profiles.wordpress.org/WeddyWood/">WeddyWood</a>,
+				<a href="https://profiles.wordpress.org/wolfhoundjesse/">wolfhoundjesse</a>,
+				<a href="https://profiles.wordpress.org/xgz/">xgz</a>.
 			</p>
 
 			<h4 class="wp-people-group"><?php _e( 'External Libraries', 'buddypress' ); ?></h4>
@@ -815,6 +772,94 @@ class BP_Admin {
 
 		<?php
 	}
+
+	/**
+	 * Output welcome text and badge for What's New and Credits pages
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public static function welcome_text() {
+
+		// Switch welcome text based on whether this is a new installation or not
+		$welcome_text = ( self::is_new_install() )
+			? __( 'Thank you for installing BuddyPress! BuddyPress %s gives you the components you need to turn your WordPress powered site into a thriving membership community.', 'buddypress' )
+			: __( 'BuddyPress %s comes with a bunch of great improvements we think you&#8217;re really going to like.', 'buddypress' );
+
+		?>
+
+		<h1><?php printf( esc_html__( 'Welcome to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h1>
+		<div class="about-text">
+			<?php printf( $welcome_text, self::display_version() ); ?>
+		</div>
+
+		<div class="bp-badge"></div>
+
+		<?php
+	}
+
+	/**
+	 * Output tab navigation for `What's New` and `Credits` pages
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @param string $tab
+	 */
+	public static function tab_navigation( $tab = 'whats_new' ) {
+	?>
+
+		<h2 class="nav-tab-wrapper">
+			<a class="nav-tab <?php if ( 'BP_Admin::about_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>">
+				<?php esc_html_e( 'What&#8217;s New', 'buddypress' ); ?>
+			</a><a class="nav-tab <?php if ( 'BP_Admin::credits_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>">
+				<?php esc_html_e( 'Credits', 'buddypress' ); ?>
+			</a>
+		</h2>
+
+	<?php
+	}
+
+	/** Helpers ***************************************************************/
+
+	/**
+	 * Return true/false based on whether a query argument is set
+	 *
+	 * @see bp_do_activation_redirect()
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @return bool
+	 */
+	public static function is_new_install() {
+		return (bool) isset( $_GET['is_new_install'] );
+	}
+
+	/**
+	 * Return a user-friendly version-number string, for use in translations
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @return string
+	 */
+	public static function display_version() {
+
+		// Use static variable to prevent recalculations
+		static $display = '';
+
+		// Only calculate on first run
+		if ( '' === $display ) {
+
+			// Get current version
+			$version = bp_get_version();
+
+			// Check for prerelease hyphen
+			$pre     = strpos( $version, '-' );
+
+			// Strip prerelease suffix
+			$display = ( false !== $pre )
+				? substr( $version, 0, $pre )
+				: $version;
+		}
+
+		// Done!
+		return $display;
+	}
 }
 endif; // class_exists check
 
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
index a875c49bca56e0a1a550e6ea5aa263f787601fe7..7949e0bf09a01d64502a02aa4e9e4cf07cca1d19 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Add the secondary BuddyPress area to the my-account menu.
@@ -96,7 +96,7 @@ function bp_core_load_admin_bar() {
 add_action( 'init', 'bp_core_load_admin_bar', 9 );
 
 /**
- * Handle the enqueuing of toolbar CSS.
+ * Handle the enqueueing of toolbar CSS.
  *
  * This function exists mostly for backwards compatibility reasons, so anyone
  * previously unhooking this function can continue to do so. It's hooked to
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php b/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php
new file mode 100644
index 0000000000000000000000000000000000000000..3156e8be02b84212c06fbbcdd8699a6fddff262d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php
@@ -0,0 +1,406 @@
+<?php
+/**
+ * BuddyPress Attachments functions.
+ *
+ * @package BuddyPress
+ * @subpackage Attachments
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Check if the current WordPress version is using Plupload 2.1.1
+ *
+ * Plupload 2.1.1 was introduced in WordPress 3.9. Our bp-plupload.js
+ * script requires it. So we need to make sure the current WordPress
+ * match with our needs.
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @return bool True if WordPress is 3.9+, false otherwise
+ */
+function bp_attachments_is_wp_version_supported() {
+	return (bool) version_compare( bp_get_major_wp_version(), '3.9', '>=' );
+}
+
+/**
+ * Get the BuddyPress Plupload settings
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @return array list of BuddyPress Plupload settings
+ */
+function bp_attachments_get_plupload_default_settings() {
+
+	$max_upload_size = wp_max_upload_size();
+
+	if ( ! $max_upload_size ) {
+		$max_upload_size = 0;
+	}
+
+	$defaults = array(
+		'runtimes'            => 'html5,flash,silverlight,html4',
+		'file_data_name'      => 'file',
+		'multipart_params'    => array(
+			'action'          => 'bp_upload_attachment',
+			'_wpnonce'        => wp_create_nonce( 'bp-uploader' ),
+		),
+		'url'                 => admin_url( 'admin-ajax.php', 'relative' ),
+		'flash_swf_url'       => includes_url( 'js/plupload/plupload.flash.swf' ),
+		'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
+		'filters' => array(
+			'max_file_size'   => $max_upload_size . 'b',
+		),
+		'multipart'           => true,
+		'urlstream_upload'    => true,
+	);
+
+	// WordPress is not allowing multi selection for iOs 7 device.. See #29602.
+	if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
+		strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) {
+
+		$defaults['multi_selection'] = false;
+	}
+
+	$settings = array(
+		'defaults' => $defaults,
+		'browser'  => array(
+			'mobile'    => wp_is_mobile(),
+			'supported' => _device_can_upload(),
+		),
+		'limitExceeded' => is_multisite() && ! is_upload_space_available(),
+	);
+
+	/**
+	 * Filter the BuddyPress Plupload default settings.
+	 *
+	 * @since 2.3.0
+	 *
+	 * @param array $params Default Plupload parameters array.
+	 */
+	return apply_filters( 'bp_attachments_get_plupload_default_settings', $settings );
+}
+
+/**
+ * Builds localization strings for the BuddyPress Uploader scripts
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @return array Plupload default localization strings
+ */
+function bp_attachments_get_plupload_l10n() {
+	// Localization strings
+	return apply_filters( 'bp_attachments_get_plupload_l10n', array(
+			'queue_limit_exceeded'      => __( 'You have attempted to queue too many files.', 'buddypress' ),
+			'file_exceeds_size_limit'   => __( '%s exceeds the maximum upload size for this site.', 'buddypress' ),
+			'zero_byte_file'            => __( 'This file is empty. Please try another.', 'buddypress' ),
+			'invalid_filetype'          => __( 'This file type is not allowed. Please try another.', 'buddypress' ),
+			'not_an_image'              => __( 'This file is not an image. Please try another.', 'buddypress' ),
+			'image_memory_exceeded'     => __( 'Memory exceeded. Please try another smaller file.', 'buddypress' ),
+			'image_dimensions_exceeded' => __( 'This is larger than the maximum size. Please try another.', 'buddypress' ),
+			'default_error'             => __( 'An error occurred. Please try again later.', 'buddypress' ),
+			'missing_upload_url'        => __( 'There was a configuration error. Please contact the server administrator.', 'buddypress' ),
+			'upload_limit_exceeded'     => __( 'You may only upload 1 file.', 'buddypress' ),
+			'http_error'                => __( 'HTTP error.', 'buddypress' ),
+			'upload_failed'             => __( 'Upload failed.', 'buddypress' ),
+			'big_upload_failed'         => __( 'Please try uploading this file with the %1$sbrowser uploader%2$s.', 'buddypress' ),
+			'big_upload_queued'         => __( '%s exceeds the maximum upload size for the multi-file uploader when used in your browser.', 'buddypress' ),
+			'io_error'                  => __( 'IO error.', 'buddypress' ),
+			'security_error'            => __( 'Security error.', 'buddypress' ),
+			'file_cancelled'            => __( 'File canceled.', 'buddypress' ),
+			'upload_stopped'            => __( 'Upload stopped.', 'buddypress' ),
+			'dismiss'                   => __( 'Dismiss', 'buddypress' ),
+			'crunching'                 => __( 'Crunching&hellip;', 'buddypress' ),
+			'unique_file_warning'       => __( 'Make sure to upload a unique file', 'buddypress' ),
+			'error_uploading'           => __( '&#8220;%s&#8221; has failed to upload.', 'buddypress' ),
+			'has_avatar_warning'        => __( 'If you&#39;d like to delete the existing profile photo but not upload a new one, please use the delete tab.', 'buddypress' )
+	) );
+}
+
+/**
+ * Enqueues the script needed for the Uploader UI
+ *
+ * @see  BP_Attachment::script_data() && BP_Attachment_Avatar::script_data() for examples showing how
+ * to set specific script data
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @param  string $class name of the class extending BP_Attachment (eg: BP_Attachment_Avatar)
+ */
+function bp_attachments_enqueue_scripts( $class = '' ) {
+	// Enqueue me just once per page, please.
+	if ( did_action( 'bp_attachments_enqueue_scripts' ) ) {
+		return;
+	}
+
+	if ( ! $class || ! class_exists( $class ) ) {
+		return new WP_Error( 'missing_parameter' );
+	}
+
+	// Get an instance of the class and get the script data
+	$attachment = new $class;
+	$script_data  = $attachment->script_data();
+
+	$args = bp_parse_args( $script_data, array(
+		'action'            => '',
+		'file_data_name'    => '',
+		'max_file_size'     => 0,
+		'browse_button'     => 'bp-browse-button',
+		'container'         => 'bp-upload-ui',
+		'drop_element'      => 'drag-drop-area',
+		'bp_params'         => array(),
+		'extra_css'         => array(),
+		'extra_js'          => array(),
+		'feedback_messages' => array(),
+	), 'attachments_enqueue_scripts' );
+
+	if ( empty( $args['action'] ) || empty( $args['file_data_name'] ) ) {
+		return new WP_Error( 'missing_parameter' );
+	}
+
+	// Get the BuddyPress uploader strings
+	$strings = bp_attachments_get_plupload_l10n();
+
+	// Get the BuddyPress uploader settings
+	$settings = bp_attachments_get_plupload_default_settings();
+
+	// Set feedback messages
+	if ( ! empty( $args['feedback_messages'] ) ) {
+		$strings['feedback_messages'] = $args['feedback_messages'];
+	}
+
+	// Use a temporary var to ease manipulation
+	$defaults = $settings['defaults'];
+
+	// Set the upload action
+	$defaults['multipart_params']['action'] = $args['action'];
+
+	// Set BuddyPress upload parameters if provided
+	if ( ! empty( $args['bp_params'] ) ) {
+		$defaults['multipart_params']['bp_params'] = $args['bp_params'];
+	}
+
+	// Merge other arguments
+	$ui_args = array_intersect_key( $args, array(
+		'file_data_name' => true,
+		'browse_button'  => true,
+		'container'      => true,
+		'drop_element'   => true,
+	) );
+
+	$defaults = array_merge( $defaults, $ui_args );
+
+	if ( ! empty( $args['max_file_size'] ) ) {
+		$defaults['filters']['max_file_size'] = $args['max_file_size'] . 'b';
+	}
+
+	// Specific to BuddyPress Avatars
+	if ( 'bp_avatar_upload' === $defaults['multipart_params']['action'] ) {
+
+		// Include the cropping informations for avatars
+		$settings['crop'] = array(
+			'full_h'  => bp_core_avatar_full_height(),
+			'full_w'  => bp_core_avatar_full_width(),
+		);
+
+		// Avatar only need 1 file and 1 only!
+		$defaults['multi_selection'] = false;
+
+		// Does the object already has an avatar set
+		$has_avatar = $defaults['multipart_params']['bp_params']['has_avatar'];
+
+		// What is the object the avatar belongs to
+		$object = $defaults['multipart_params']['bp_params']['object'];
+
+		// Init the Avatar nav
+		$avatar_nav = array(
+			'upload' => array( 'id' => 'upload', 'caption' => __( 'Upload', 'buddypress' ), 'order' => 0  ),
+
+			// The delete view will only show if the object has an avatar
+			'delete' => array( 'id' => 'delete', 'caption' => __( 'Delete', 'buddypress' ), 'order' => 100, 'hide' => (int) ! $has_avatar ),
+		);
+
+		// Create the Camera Nav if the WebCam capture feature is enabled
+		if ( bp_avatar_use_webcam() && 'user' === $object ) {
+			$avatar_nav['camera'] = array( 'id' => 'camera', 'caption' => __( 'Take Photo', 'buddypress' ), 'order' => 10 );
+
+			// Set warning messages
+			$strings['camera_warnings'] = array(
+				'requesting'  => __( 'Please allow us to access to your camera.', 'buddypress'),
+				'loading'     => __( 'Please wait as we access your camera.', 'buddypress' ),
+				'loaded'      => __( 'Camera loaded. Click on the "Capture" button to take your photo.', 'buddypress' ),
+				'noaccess'    => __( 'It looks like you do not have a webcam or we were unable to get permission to use your webcam. Please upload a photo instead.', 'buddypress' ),
+				'errormsg'    => __( 'Your browser is not supported. Please upload a photo instead.', 'buddypress' ),
+				'videoerror'  => __( 'Video error. Please upload a photo instead.', 'buddypress' ),
+				'ready'       => __( 'Your profile photo is ready. Click on the "Save" button to use this photo.', 'buddypress' ),
+				'nocapture'   => __( 'No photo was captured. Click on the "Capture" button to take your photo.', 'buddypress' ),
+			);
+		}
+
+		/**
+		 * Use this filter to add a navigation to a custom tool to set the object's avatar
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array $avatar_nav An associative array of available nav items where each item is an array organized this way:
+		 * $avatar_nav[ $nav_item_id ] {
+		 *     @type string $nav_item_id the nav item id in lower case without special characters or space
+		 *     @type string $caption     the name of the item nav that will be displayed in the nav
+		 *     @type int    $order       An integer to specify the priority of the item nav, choose one
+		 *                               between 1 and 99 to be after the uploader nav item and before the delete nav item
+		 *     @type int    $hide        if set to 1 the item nav will be hidden
+		 *                               (only used for the delete nav item)
+		 * }
+		 * @param string $object the object the avatar belongs to (eg: user or group)
+		 */
+		$settings['nav'] = bp_sort_by_key( apply_filters( 'bp_attachments_avatar_nav', $avatar_nav, $object ), 'order', 'num' );
+	}
+
+	// Set Plupload settings
+	$settings['defaults'] = $defaults;
+
+	/**
+	 * Enqueue some extra styles if required
+	 *
+	 * Extra styles need to be registered.
+	 */
+	if ( ! empty( $args['extra_css'] ) ) {
+		foreach ( (array) $args['extra_css'] as $css ) {
+			if ( empty( $css ) ) {
+				continue;
+			}
+
+			wp_enqueue_style( $css );
+		}
+	}
+
+	wp_enqueue_script ( 'bp-plupload' );
+	wp_localize_script( 'bp-plupload', 'BP_Uploader', array( 'strings' => $strings, 'settings' => $settings ) );
+
+	/**
+	 * Enqueue some extra scripts if required
+	 *
+	 * Extra scripts need to be registered.
+	 */
+	if ( ! empty( $args['extra_js'] ) ) {
+		foreach ( (array) $args['extra_js'] as $js ) {
+			if ( empty( $js ) ) {
+				continue;
+			}
+
+			wp_enqueue_script( $js );
+		}
+	}
+
+	/**
+	 * Fires at the conclusion of bp_attachments_enqueue_scripts()
+	 * to avoid the scripts to be loaded more than once.
+	 *
+	 * @since BuddyPress 2.3.0
+	 */
+	do_action( 'bp_attachments_enqueue_scripts' );
+}
+
+/**
+ * Check the current user's capability to edit an avatar for a given object
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @param  string $capability the capability to check
+ * @param  array  $args an array containing the item_id and the object to check
+ */
+function bp_attachments_current_user_can( $capability, $args = array() ) {
+	$can = false;
+
+	if ( 'edit_avatar' === $capability ) {
+		/**
+		 * Needed avatar arguments are set.
+		 */
+		if ( isset( $args['item_id'] ) && isset( $args['object'] ) ) {
+			// Group profile photo
+			if ( bp_is_active( 'groups' ) && 'group' === $args['object'] ) {
+				if ( bp_is_group_create() ) {
+					$can = (bool) groups_is_user_creator( bp_loggedin_user_id(), $args['item_id'] ) || bp_current_user_can( 'bp_moderate' );
+				} else {
+					$can = (bool) groups_is_user_admin( bp_loggedin_user_id(), $args['item_id'] ) || bp_current_user_can( 'bp_moderate' );
+				}
+			// User profile photo
+			} elseif ( bp_is_active( 'xprofile' ) && 'user' === $args['object'] ) {
+				$can = bp_loggedin_user_id() === (int) $args['item_id'] || bp_current_user_can( 'bp_moderate' );
+			}
+		/**
+		 * No avatar arguments, fallback to bp_user_can_create_groups()
+		 * or bp_is_item_admin()
+		 */
+		} else {
+			if ( bp_is_group_create() ) {
+				$can = bp_user_can_create_groups();
+			} else {
+				$can = bp_is_item_admin();
+			}
+		}
+	}
+
+	return apply_filters( 'bp_attachments_current_user_can', $can, $capability, $args );
+}
+
+/**
+ * Send a JSON response back to an Ajax upload request.
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @param  bool true for a success, false otherwise
+ * @param  bool true if the Plupload runtime used is html4, false otherwise.
+ * @param  mixed $data Data to encode as JSON, then print and die.
+ */
+function bp_attachments_json_response( $success, $is_html4 = false, $data = null ) {
+	$response = array( 'success' => $success );
+
+	if ( isset( $data ) ) {
+		$response['data'] = $data;
+	}
+
+	// Send regular json response
+	if ( ! $is_html4 ) {
+		wp_send_json( $response );
+
+	/**
+	 * Send specific json response
+	 * the html4 Plupload handler requires a text/html content-type for older IE.
+	 * See https://core.trac.wordpress.org/ticket/31037
+	 */
+	} else {
+		echo wp_json_encode( $response );
+
+		wp_die();
+	}
+}
+
+/**
+ * Get an Attachment template part.
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @param  string Template part slug. eg 'uploader' for 'uploader.php'.
+ */
+function bp_attachments_get_template_part( $slug ) {
+	$attachment_template_part = 'assets/_attachments/' . $slug;
+
+	// Load the attachment template in WP Administratin screens
+	if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
+		$attachment_admin_template_part = buddypress()->themes_dir . '/bp-legacy/buddypress/' . $attachment_template_part . '.php';
+
+		// Check the template part exists
+		if ( ! file_exists( $attachment_admin_template_part ) ) {
+			return false;
+		}
+
+		// load the template part
+		require( $attachment_admin_template_part );
+
+	// Load the attachment template in WP_USE_THEMES env.
+	} else {
+		bp_get_template_part( $attachment_template_part );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
index 7992132005c0c2dbda3a1503dcc3b3286a4181d5..bef77356b78b555e38a5531d5a357789420f01ec 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php
@@ -5,7 +5,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /***
  * Set up the constants we need for avatar support.
@@ -31,10 +31,11 @@ function bp_core_set_avatar_constants() {
 
 	if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
 
-		if ( !isset( $bp->site_options['fileupload_maxk'] ) ) {
+		$fileupload_maxk = bp_core_get_root_option( 'fileupload_maxk' );
+		if ( '' === $fileupload_maxk ) {
 			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb
 		} else {
-			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
+			define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $fileupload_maxk * 1024 );
 		}
 	}
 
@@ -86,6 +87,11 @@ function bp_core_set_avatar_globals() {
 	if ( ! defined( 'BP_AVATAR_URL' ) )
 		define( 'BP_AVATAR_URL', $bp->avatar->url );
 
+	/**
+	 * Fires at the end of the core avatar globals setup.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_core_set_avatar_globals' );
 }
 add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
@@ -174,184 +180,283 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
  * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg.
  */
 function bp_core_fetch_avatar( $args = '' ) {
+	$bp = buddypress();
 
 	// If avatars are disabled for the root site, obey that request and bail
-	if ( ! buddypress()->avatar->show_avatars )
+	if ( ! $bp->avatar->show_avatars ) {
 		return;
+	}
 
 	global $current_blog;
 
-	$bp = buddypress();
-
-	// Set a few default variables
-	$def_object = 'user';
-	$def_type   = 'thumb';
-	$def_class  = 'avatar';
-
-	// Set the default variables array
+	// Set the default variables array and parse it against incoming $args array.
 	$params = wp_parse_args( $args, array(
 		'item_id'    => false,
-		'object'     => $def_object, // user/group/blog/custom type (if you use filters)
-		'type'       => $def_type,   // thumb or full
-		'avatar_dir' => false,       // Specify a custom avatar directory for your object
-		'width'      => false,       // Custom width (int)
-		'height'     => false,       // Custom height (int)
-		'class'      => $def_class,  // Custom <img> class (string)
-		'css_id'     => false,       // Custom <img> ID (string)
-		'alt'        => '',    	     // Custom <img> alt (string)
-		'email'      => false,       // Pass the user email (for gravatar) to prevent querying the DB for it
-		'no_grav'    => false,       // If there is no avatar found, return false instead of a grav?
-		'html'       => true,        // Wrap the return img URL in <img />
-		'title'      => ''           // Custom <img> title (string)
+		'object'     => 'user',
+		'type'       => 'thumb',
+		'avatar_dir' => false,
+		'width'      => false,
+		'height'     => false,
+		'class'      => 'avatar',
+		'css_id'     => false,
+		'alt'        => '',
+		'email'      => false,
+		'no_grav'    => false,
+		'html'       => true,
+		'title'      => '',
 	) );
-	extract( $params, EXTR_SKIP );
 
 	/** Set item_id ***********************************************************/
 
-	if ( empty( $item_id ) ) {
+	if ( empty( $params['item_id'] ) ) {
 
-		switch ( $object ) {
+		switch ( $params['object'] ) {
 
 			case 'blog'  :
-				$item_id = $current_blog->id;
+				$params['item_id'] = $current_blog->id;
 				break;
 
 			case 'group' :
 				if ( bp_is_active( 'groups' ) ) {
-					$item_id = $bp->groups->current_group->id;
+					$params['item_id'] = $bp->groups->current_group->id;
 				} else {
-					$item_id = false;
+					$params['item_id'] = false;
 				}
 
 				break;
 
 			case 'user'  :
 			default      :
-				$item_id = bp_displayed_user_id();
+				$params['item_id'] = bp_displayed_user_id();
 				break;
 		}
 
-		$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object, $params );
-
-		if ( empty( $item_id ) ) {
+		/**
+		 * Filters the ID of the item being requested.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value  ID of avatar item being requested.
+		 * @param string $value  Avatar type being requested.
+		 * @param array  $params Array of parameters for the request.
+		 */
+		$params['item_id'] = apply_filters( 'bp_core_avatar_item_id', $params['item_id'], $params['object'], $params );
+
+		if ( empty( $params['item_id'] ) ) {
 			return false;
 		}
 	}
 
-	$class = apply_filters( 'bp_core_avatar_class', $class, $item_id, $object, $params );
-
 	/** Set avatar_dir ********************************************************/
 
-	if ( empty( $avatar_dir ) ) {
+	if ( empty( $params['avatar_dir'] ) ) {
 
-		switch ( $object ) {
+		switch ( $params['object'] ) {
 
 			case 'blog'  :
-				$avatar_dir = 'blog-avatars';
+				$params['avatar_dir'] = 'blog-avatars';
 				break;
 
 			case 'group' :
 				if ( bp_is_active( 'groups' ) ) {
-					$avatar_dir = 'group-avatars';
+					$params['avatar_dir'] = 'group-avatars';
 				} else {
-					$avatar_dir = false;
+					$params['avatar_dir'] = false;
 				}
 
 				break;
 
 			case 'user'  :
 			default      :
-				$avatar_dir = 'avatars';
+				$params['avatar_dir'] = 'avatars';
 				break;
 		}
 
-		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object, $params );
-
-		if ( empty( $avatar_dir ) ) {
+		/**
+		 * Filters the avatar directory to use.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value  Name of the subdirectory where the requested avatar should be found.
+		 * @param string $value  Avatar type being requested.
+		 * @param array  $params Array of parameters for the request.
+		 */
+		$params['avatar_dir'] = apply_filters( 'bp_core_avatar_dir', $params['avatar_dir'], $params['object'], $params );
+
+		if ( empty( $params['avatar_dir'] ) ) {
 			return false;
 		}
 	}
 
 	/** <img> alt *************************************************************/
 
-	if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) {
+	if ( false !== strpos( $params['alt'], '%s' ) || false !== strpos( $params['alt'], '%1$s' ) ) {
 
-		switch ( $object ) {
+		switch ( $params['object'] ) {
 
 			case 'blog'  :
-				$item_name = get_blog_option( $item_id, 'blogname' );
+				$item_name = get_blog_option( $params['item_id'], 'blogname' );
 				break;
 
 			case 'group' :
-				$item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) );
+				$item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $params['item_id'] ) ) );
 				break;
 
 			case 'user'  :
 			default :
-				$item_name = bp_core_get_user_displayname( $item_id );
+				$item_name = bp_core_get_user_displayname( $params['item_id'] );
 				break;
 		}
 
-		$item_name = apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object, $params );
-		$alt       = sprintf( $alt, $item_name );
+		/**
+		 * Filters the alt attribute value to be applied to avatar.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value  alt to be applied to avatar.
+		 * @param string $value  ID of avatar item being requested.
+		 * @param string $value  Avatar type being requested.
+		 * @param array  $params Array of parameters for the request.
+		 */
+		$item_name = apply_filters( 'bp_core_avatar_alt', $item_name, $params['item_id'], $params['object'], $params );
+		$params['alt'] = sprintf( $params['alt'], $item_name );
 	}
 
 	/** Sanity Checks *********************************************************/
 
-	// Get a fallback for the 'alt' parameter
-	if ( empty( $alt ) )
-		$alt = __( 'Profile Photo', 'buddypress' );
+	// Get a fallback for the 'alt' parameter, create html output
+	if ( empty( $params['alt'] ) ) {
+		$params['alt'] = __( 'Profile Photo', 'buddypress' );
+	}
+	$html_alt = ' alt="' . esc_attr( $params['alt'] ) . '"';
 
-	$html_alt = ' alt="' . esc_attr( $alt ) . '"';
+	// Filter image title and create html string
+	$html_title = '';
+
+	/**
+	 * Filters the title attribute value to be applied to avatar.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value  Title to be applied to avatar.
+	 * @param string $value  ID of avatar item being requested.
+	 * @param string $value  Avatar type being requested.
+	 * @param array  $params Array of parameters for the request.
+	 */
+	$params['title'] = apply_filters( 'bp_core_avatar_title', $params['title'], $params['item_id'], $params['object'], $params );
 
-	// Set title tag, if it's been provided
-	if ( !empty( $title ) ) {
-		$title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object, $params ) ) . "'";
+	if ( ! empty( $params['title'] ) ) {
+		$html_title = ' title="' . esc_attr( $params['title'] ) . '"';
 	}
 
-	// Set CSS ID if passed
-	if ( !empty( $css_id ) ) {
-		$css_id = ' id="' . esc_attr( $css_id ) . '"';
+	// Set CSS ID and create html string
+	$html_css_id = '';
+
+	/**
+	 * Filters the ID attribute to be applied to avatar.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string $value  ID to be applied to avatar.
+	 * @param string $value  ID of avatar item being requested.
+	 * @param string $value  Avatar type being requested.
+	 * @param array  $params Array of parameters for the request.
+	 */
+	$params['css_id'] = apply_filters( 'bp_core_css_id', $params['css_id'], $params['item_id'], $params['object'], $params );
+
+	if ( ! empty( $params['css_id'] ) ) {
+		$html_css_id = ' id="' . esc_attr( $params['css_id'] ) . '"';
 	}
 
 	// Set image width
-	if ( false !== $width ) {
-		$html_width = ' width="' . $width . '"';
-	} elseif ( 'thumb' == $type ) {
-		$html_width = ' width="' . bp_core_avatar_thumb_width() . '"';
+	if ( false !== $params['width'] ) {
+		// Width has been specified. No modification necessary.
+	} elseif ( 'thumb' == $params['type'] ) {
+		$params['width'] = bp_core_avatar_thumb_width();
 	} else {
-		$html_width = ' width="' . bp_core_avatar_full_width() . '"';
+		$params['width'] = bp_core_avatar_full_width();
 	}
+	$html_width = ' width="' . $params['width'] . '"';
 
 	// Set image height
-	if ( false !== $height ) {
-		$html_height = ' height="' . $height . '"';
-	} elseif ( 'thumb' == $type ) {
-		$html_height = ' height="' . bp_core_avatar_thumb_height() . '"';
+	if ( false !== $params['height'] ) {
+		// Height has been specified. No modification necessary.
+	} elseif ( 'thumb' == $params['type'] ) {
+		$params['height'] = bp_core_avatar_thumb_height();
 	} else {
-		$html_height = ' height="' . bp_core_avatar_full_height() . '"';
+		$params['height'] = bp_core_avatar_full_height();
 	}
+	$html_height = ' height="' . $params['height'] . '"';
+
+	/**
+	 * Filters the classes to be applied to the avatar.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array|string $value  Class(es) to be applied to the avatar.
+	 * @param string       $value  ID of the avatar item being requested.
+	 * @param string       $value  Avatar type being requested.
+	 * @param array        $params Array of parameters for the request.
+	 */
+	$params['class'] = apply_filters( 'bp_core_avatar_class', $params['class'], $params['item_id'], $params['object'], $params );
+
+	// Use an alias to leave the param unchanged
+	$avatar_classes = $params['class'];
+	if ( ! is_array( $avatar_classes ) ) {
+		$avatar_classes = explode( ' ', $avatar_classes );
+	}
+
+	// merge classes
+	$avatar_classes = array_merge( $avatar_classes, array(
+		$params['object'] . '-' . $params['item_id'] . '-avatar',
+		'avatar-' . $params['width'],
+	) );
+
+	// Sanitize each class
+	$avatar_classes = array_map( 'sanitize_html_class', $avatar_classes );
+
+	// populate the class attribute
+	$html_class = ' class="' . join( ' ', $avatar_classes ) . ' photo"';
 
 	// Set img URL and DIR based on prepopulated constants
 	$avatar_loc        = new stdClass();
 	$avatar_loc->path  = trailingslashit( bp_core_avatar_upload_path() );
 	$avatar_loc->url   = trailingslashit( bp_core_avatar_url() );
 
-	$avatar_loc->dir   = trailingslashit( $avatar_dir );
-	$avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', ( $avatar_loc->url  . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
-	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
+	$avatar_loc->dir   = trailingslashit( $params['avatar_dir'] );
+
+	/**
+	 * Filters the avatar folder directory URL.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value Path to the avatar folder URL.
+	 * @param int    $value ID of the avatar item being requested.
+	 * @param string $value Avatar type being requested.
+	 * @param string $value Subdirectory where the requested avatar should be found.
+	 */
+	$avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', ( $avatar_loc->url  . $avatar_loc->dir . $params['item_id'] ), $params['item_id'], $params['object'], $params['avatar_dir'] );
 
-	// Add an identifying class
-	$class .= ' ' . $object . '-' . $item_id . '-avatar ' . sanitize_html_class( "avatar-$width" ) . ' photo';
+	/**
+	 * Filters the avatar folder directory path.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value Path to the avatar folder directory.
+	 * @param int    $value ID of the avatar item being requested.
+	 * @param string $value Avatar type being requested.
+	 * @param string $value Subdirectory where the requested avatar should be found.
+	 */
+	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $params['item_id'] ), $params['item_id'], $params['object'], $params['avatar_dir'] );
 
 	/**
 	 * Look for uploaded avatar first. Use it if it exists.
 	 * Set the file names to search for, to select the full size
 	 * or thumbnail image.
 	 */
-	$avatar_size              = ( 'full' == $type ) ? '-bpfull' : '-bpthumb';
-	$legacy_user_avatar_name  = ( 'full' == $type ) ? '-avatar2' : '-avatar1';
-	$legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb';
+	$avatar_size              = ( 'full' == $params['type'] ) ? '-bpfull' : '-bpthumb';
+	$legacy_user_avatar_name  = ( 'full' == $params['type'] ) ? '-avatar2' : '-avatar1';
+	$legacy_group_avatar_name = ( 'full' == $params['type'] ) ? '-groupavatar-full' : '-groupavatar-thumb';
 
 	// Check for directory
 	if ( file_exists( $avatar_folder_dir ) ) {
@@ -405,57 +510,99 @@ function bp_core_fetch_avatar( $args = '' ) {
 		if ( isset( $avatar_url ) ) {
 
 			// Return it wrapped in an <img> element
-			if ( true === $html ) {
-				return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
+			if ( true === $params['html'] ) {
+
+				/**
+				 * Filters an avatar URL wrapped in an <img> element.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 *
+				 * @param string $value             Full <img> element for an avatar.
+				 * @param array  $params            Array of parameters for the request.
+				 * @param string $value             ID of the item requested.
+				 * @param string $value             Subdirectory where the requested avatar should be found.
+				 * @param string $html_css_id       ID attribute for avatar.
+				 * @param string $html_width        Width attribute for avatar.
+				 * @param string $html_height       Height attribtue for avatar.
+				 * @param string $avatar_folder_url Avatar URL path.
+				 * @param string $avatar_folder_dir Avatar dir path.
+				 */
+				return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id  . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
 
 			// ...or only the URL
 			} else {
+
+				/**
+				 * Filters a locally uploaded avatar URL.
+				 *
+				 * @since BuddyPress (1.2.5)
+				 *
+				 * @param string $avatar_url URL for a locally uploaded avatar.
+				 * @param array  $params     Array of parameters for the request.
+				 */
 				return apply_filters( 'bp_core_fetch_avatar_url', $avatar_url, $params );
 			}
 		}
 	}
 
-	// If no avatars could be found, try to display a gravatar
-
-	// Skips gravatar check if $no_grav is passed
-	if ( ! apply_filters( 'bp_core_fetch_avatar_no_grav', $no_grav ) ) {
-
-		// Set gravatar size
-		if ( false !== $width ) {
-			$grav_size = $width;
-		} else if ( 'full' == $type ) {
-			$grav_size = bp_core_avatar_full_width();
-		} else if ( 'thumb' == $type ) {
-			$grav_size = bp_core_avatar_thumb_width();
-		}
+	/**
+	 * Filters whether or not to skip Gravatar check.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool  $value  Whether or not to skip Gravatar.
+	 * @param array $params Array of parameters for the avatar request.
+	 */
+	if ( ! apply_filters( 'bp_core_fetch_avatar_no_grav', $params['no_grav'], $params ) ) {
 
 		// Set gravatar type
-		if ( empty( $bp->grav_default->{$object} ) ) {
+		if ( empty( $bp->grav_default->{$params['object']} ) ) {
 			$default_grav = 'wavatar';
-		} else if ( 'mystery' == $bp->grav_default->{$object} ) {
-			$default_grav = apply_filters( 'bp_core_mysteryman_src', 'mm', $grav_size );
+		} elseif ( 'mystery' == $bp->grav_default->{$params['object']} ) {
+
+			/**
+			 * Filters the Mysteryman avatar src value.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @param string $value Avatar value.
+			 * @param string $value Width to display avatar at.
+			 */
+			$default_grav = apply_filters( 'bp_core_mysteryman_src', 'mm', $params['width'] );
 		} else {
-			$default_grav = $bp->grav_default->{$object};
+			$default_grav = $bp->grav_default->{$params['object']};
 		}
 
 		// Set gravatar object
-		if ( empty( $email ) ) {
-			if ( 'user' == $object ) {
-				$email = bp_core_get_user_email( $item_id );
-			} else if ( 'group' == $object || 'blog' == $object ) {
-				$email = "{$item_id}-{$object}@{bp_get_root_domain()}";
+		if ( empty( $params['email'] ) ) {
+			if ( 'user' == $params['object'] ) {
+				$params['email'] = bp_core_get_user_email( $params['item_id'] );
+			} elseif ( 'group' == $params['object'] || 'blog' == $params['object'] ) {
+				$params['email'] = $params['item_id'] . '-' . $params['object'] . '@' . bp_get_root_domain();
 			}
 		}
 
-		// Set host based on if using ssl
-		$host = 'http://gravatar.com/avatar/';
-		if ( is_ssl() ) {
-			$host = 'https://secure.gravatar.com/avatar/';
-		}
-
-		// Filter gravatar vars
-		$email    = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object );
-		$gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $email ) ) . '?d=' . $default_grav . '&amp;s=' . $grav_size;
+		$host = '//www.gravatar.com/avatar/';
+
+		/**
+		 * Filters the Gravatar email to use.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Email to use in Gravatar request.
+		 * @param string $value ID of the item being requested.
+		 * @param string $value Object type being requested.
+		 */
+		$params['email'] = apply_filters( 'bp_core_gravatar_email', $params['email'], $params['item_id'], $params['object'] );
+
+		/**
+		 * Filters the Gravatar URL path.
+		 *
+		 * @since BuddyPress (1.0.2)
+		 *
+		 * @param string $value Gravatar URL path.
+		 */
+		$gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $params['email'] ) ) . '?d=' . $default_grav . '&amp;s=' . $params['width'];
 
 		// Gravatar rating; http://bit.ly/89QxZA
 		$rating = get_option( 'avatar_rating' );
@@ -465,12 +612,27 @@ function bp_core_fetch_avatar( $args = '' ) {
 
 	// No avatar was found, and we've been told not to use a gravatar.
 	} else {
-		$gravatar = apply_filters( "bp_core_default_avatar_$object", bp_core_avatar_default( 'local' ), $params );
+
+		/**
+		 * Filters the avatar default when Gravatar is not used.
+		 *
+		 * This is a variable filter dependent on the avatar type being requested.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value  Default avatar for non-gravatar requests.
+		 * @param array  $params Array of parameters for the avatar request.
+		 */
+		$gravatar = apply_filters( 'bp_core_default_avatar_' . $params['object'], bp_core_avatar_default( 'local' ), $params );
 	}
 
-	if ( true === $html ) {
-		return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
+	if ( true === $params['html'] ) {
+
+		/** This filter is documented in bp-core/bp-core-avatars.php */
+		return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '"' . $html_css_id . $html_class . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
 	} else {
+
+		/** This filter is documented in bp-core/bp-core-avatars.php */
 		return apply_filters( 'bp_core_fetch_avatar_url', $gravatar, $params );
 	}
 }
@@ -504,11 +666,12 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 	if ( empty( $item_id ) ) {
 		if ( 'user' == $object )
 			$item_id = bp_displayed_user_id();
-		else if ( 'group' == $object )
+		elseif ( 'group' == $object )
 			$item_id = buddypress()->groups->current_group->id;
-		else if ( 'blog' == $object )
+		elseif ( 'blog' == $object )
 			$item_id = $current_blog->id;
 
+		/** This filter is documented in bp-core/bp-core-avatars.php */
 		$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
 
 		if ( !$item_id ) return false;
@@ -517,16 +680,18 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 	if ( empty( $avatar_dir ) ) {
 		if ( 'user' == $object )
 			$avatar_dir = 'avatars';
-		else if ( 'group' == $object )
+		elseif ( 'group' == $object )
 			$avatar_dir = 'group-avatars';
-		else if ( 'blog' == $object )
+		elseif ( 'blog' == $object )
 			$avatar_dir = 'blog-avatars';
 
+		/** This filter is documented in bp-core/bp-core-avatars.php */
 		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
 
 		if ( !$avatar_dir ) return false;
 	}
 
+	/** This filter is documented in bp-core/bp-core-avatars.php */
 	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
 
 	if ( !file_exists( $avatar_folder_dir ) )
@@ -542,11 +707,73 @@ function bp_core_delete_existing_avatar( $args = '' ) {
 
 	@rmdir( $avatar_folder_dir );
 
+	/**
+	 * Fires after deleting an existing avatar.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array $args Array of arguments used for avatar deletion.
+	 */
 	do_action( 'bp_core_delete_existing_avatar', $args );
 
 	return true;
 }
 
+/**
+ * Ajax delete an avatar for a given object and item id
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @return  string a json object containing success data if the avatar was deleted
+ *                 error message otherwise
+ */
+function bp_avatar_ajax_delete() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
+		wp_send_json_error();
+	}
+
+	$avatar_data = $_POST;
+
+	if ( empty( $avatar_data['object'] ) || empty( $avatar_data['item_id'] ) ) {
+		wp_send_json_error();
+	}
+
+	$nonce = 'bp_delete_avatar_link';
+	if ( 'group' === $avatar_data['object'] ) {
+		$nonce = 'bp_group_avatar_delete';
+	}
+
+	// Check the nonce
+	check_admin_referer( $nonce, 'nonce' );
+
+	// Capability check
+	if ( ! bp_attachments_current_user_can( 'edit_avatar', $avatar_data ) ) {
+		wp_send_json_error();
+	}
+
+	// Handle delete
+	if ( bp_core_delete_existing_avatar( array( 'item_id' => $avatar_data['item_id'], 'object' => $avatar_data['object'] ) ) ) {
+		$return = array(
+			'avatar' => html_entity_decode( bp_core_fetch_avatar( array(
+				'object'  => $avatar_data['object'],
+				'item_id' => $avatar_data['item_id'],
+				'html'    => false,
+				'type'    => 'full',
+			) ) ),
+			'feedback_code' => 4,
+			'item_id'       => $avatar_data['item_id'],
+		);
+
+		wp_send_json_success( $return );
+	} else {
+		wp_send_json_error( array(
+			'feedback_code' => 3,
+		) );
+	}
+}
+add_action( 'wp_ajax_bp_avatar_delete', 'bp_avatar_ajax_delete' );
+
 /**
  * Handle avatar uploading.
  *
@@ -559,130 +786,268 @@ function bp_core_delete_existing_avatar( $args = '' ) {
  * @see bp_core_check_avatar_upload()
  * @see bp_core_check_avatar_type()
  *
- * @param array $file The appropriate entry the from $_FILES superglobal.
+ * @param array  $file              The appropriate entry the from $_FILES superglobal.
  * @param string $upload_dir_filter A filter to be applied to 'upload_dir'.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
 
-	/***
-	 * You may want to hook into this filter if you want to override this function.
-	 * Make sure you return false.
+	/**
+	 * Filters whether or not to handle uploading.
+	 *
+	 * If you want to override this function, make sure you return false.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param bool   $value             Whether or not to crop.
+	 * @param array  $file              Appropriate entry from $_FILES superglobal.
+	 * @parma string $upload_dir_filter A filter to be applied to 'upload_dir'.
 	 */
-	if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
+	if ( ! apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) ) {
 		return true;
+	}
 
-	require_once( ABSPATH . '/wp-admin/includes/file.php' );
+	// Setup some variables
+	$bp          = buddypress();
+	$upload_path = bp_core_avatar_upload_path();
 
-	$uploadErrors = array(
-		0 => __( 'The image was uploaded successfully', 'buddypress' ),
-		1 => __( 'The image exceeds the maximum allowed file size of: ', 'buddypress' ) . size_format( bp_core_avatar_original_max_filesize() ),
-		2 => __( 'The image exceeds the maximum allowed file size of: ', 'buddypress' ) . size_format( bp_core_avatar_original_max_filesize() ),
-		3 => __( 'The uploaded file was only partially uploaded.', 'buddypress' ),
-		4 => __( 'The image was not uploaded.', 'buddypress' ),
-		6 => __( 'Missing a temporary folder.', 'buddypress' )
-	);
+	// Upload the file
+	$avatar_attachment = new BP_Attachment_Avatar();
+	$bp->avatar_admin->original = $avatar_attachment->upload( $file, $upload_dir_filter );
 
-	if ( ! bp_core_check_avatar_upload( $file ) ) {
-		bp_core_add_message( sprintf( __( 'Your upload failed, please try again. Error was: %s', 'buddypress' ), $uploadErrors[$file['file']['error']] ), 'error' );
+	// In case of an error, stop the process and display a feedback to the user
+	if ( ! empty( $bp->avatar_admin->original['error'] ) ) {
+		bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' );
 		return false;
 	}
 
-	if ( ! bp_core_check_avatar_size( $file ) ) {
-		bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress' ), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' );
-		return false;
+	// Maybe resize
+	$bp->avatar_admin->resized = $avatar_attachment->shrink( $bp->avatar_admin->original['file'] );
+	$bp->avatar_admin->image   = new stdClass();
+
+	// We only want to handle one image after resize.
+	if ( empty( $bp->avatar_admin->resized ) ) {
+		$bp->avatar_admin->image->file = $bp->avatar_admin->original['file'];
+		$bp->avatar_admin->image->dir  = str_replace( $upload_path, '', $bp->avatar_admin->original['file'] );
+	} else {
+		$bp->avatar_admin->image->file = $bp->avatar_admin->resized['path'];
+		$bp->avatar_admin->image->dir  = str_replace( $upload_path, '', $bp->avatar_admin->resized['path'] );
+		@unlink( $bp->avatar_admin->original['file'] );
 	}
 
-	if ( ! bp_core_check_avatar_type( $file ) ) {
-		bp_core_add_message( __( 'Please upload only JPG, GIF or PNG photos.', 'buddypress' ), 'error' );
+	// Check for WP_Error on what should be an image
+	if ( is_wp_error( $bp->avatar_admin->image->dir ) ) {
+		bp_core_add_message( sprintf( __( 'Upload failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->image->dir->get_error_message() ), 'error' );
 		return false;
 	}
 
-	// Filter the upload location
-	add_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
+	// If the uploaded image is smaller than the "full" dimensions, throw a warning
+	if ( $avatar_attachment->is_too_small( $bp->avatar_admin->image->file ) ) {
+		bp_core_add_message( sprintf( __( 'You have selected an image that is smaller than recommended. For best results, upload a picture larger than %d x %d pixels.', 'buddypress' ), bp_core_avatar_full_width(), bp_core_avatar_full_height() ), 'error' );
+	}
 
-	$bp = buddypress();
+	// Set the url value for the image
+	$bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir;
 
-	$bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) );
+	return true;
+}
 
-	// Remove the upload_dir filter, so that other upload URLs on the page
-	// don't break
-	remove_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
+/**
+ * Ajax upload an avatar
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @return  string a json object containing success data if the upload succeeded
+ *                 error message otherwise
+ */
+function bp_avatar_ajax_upload() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
+		wp_die();
+	}
 
-	// Move the file to the correct upload location.
-	if ( !empty( $bp->avatar_admin->original['error'] ) ) {
-		bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' );
-		return false;
+	/**
+	 * Sending the json response will be different if
+	 * the current Plupload runtime is html4
+	 */
+	$is_html4 = false;
+	if ( ! empty( $_POST['html4' ] ) ) {
+		$is_html4 = true;
 	}
 
-	// Get image size
-	$size  = @getimagesize( $bp->avatar_admin->original['file'] );
-	$error = false;
+	// Check the nonce
+	check_admin_referer( 'bp-uploader' );
 
-	// Check image size and shrink if too large
-	if ( $size[0] > bp_core_avatar_original_max_width() ) {
-		$editor = wp_get_image_editor( $bp->avatar_admin->original['file'] );
+	// Init the BuddyPress parameters
+	$bp_params = array();
 
-		if ( ! is_wp_error( $editor ) ) {
-			$editor->set_quality( 100 );
+	// We need it to carry on
+	if ( ! empty( $_POST['bp_params' ] ) ) {
+		$bp_params = $_POST['bp_params' ];
+	} else {
+		bp_attachments_json_response( false, $is_html4 );
+	}
 
-			$resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
-			if ( ! is_wp_error( $resized ) ) {
-				$thumb = $editor->save( $editor->generate_filename() );
-			} else {
-				$error = $resized;
-			}
+	// We need the object to set the uploads dir filter
+	if ( empty( $bp_params['object'] ) ) {
+		bp_attachments_json_response( false, $is_html4 );
+	}
 
-			// Check for thumbnail creation errors
-			if ( false === $error && is_wp_error( $thumb ) ) {
-				$error = $thumb;
-			}
+	// Capability check
+	if ( ! bp_attachments_current_user_can( 'edit_avatar', $bp_params ) ) {
+		bp_attachments_json_response( false, $is_html4 );
+	}
 
-			// Thumbnail is good so proceed
-			if ( false === $error ) {
-				$bp->avatar_admin->resized = $thumb;
-			}
+	$bp = buddypress();
+	$bp_params['upload_dir_filter'] = '';
+	$needs_reset = array();
+
+	if ( 'user' === $bp_params['object'] && bp_is_active( 'xprofile' ) ) {
+		$bp_params['upload_dir_filter'] = 'xprofile_avatar_upload_dir';
+
+		if ( ! bp_displayed_user_id() && ! empty( $bp_params['item_id'] ) ) {
+			$needs_reset = array( 'key' => 'displayed_user', 'value' => $bp->displayed_user );
+			$bp->displayed_user->id = $bp_params['item_id'];
+		}
+	} elseif ( 'group' === $bp_params['object'] && bp_is_active( 'groups' ) ) {
+		$bp_params['upload_dir_filter'] = 'groups_avatar_upload_dir';
+
+		if ( ! bp_get_current_group_id() && ! empty( $bp_params['item_id'] ) ) {
+			$needs_reset = array( 'component' => 'groups', 'key' => 'current_group', 'value' => $bp->groups->current_group );
+			$bp->groups->current_group = groups_get_group( array(
+				'group_id'        => $bp_params['item_id'],
+				'populate_extras' => false,
+			) );
+		}
+	} else {
+		/**
+		 * Filter here to deal with other components
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @var array $bp_params the BuddyPress Ajax parameters
+		 */
+		$bp_params = apply_filters( 'bp_core_avatar_ajax_upload_params', $bp_params );
+	}
+
+	if ( ! isset( $bp->avatar_admin ) ) {
+		$bp->avatar_admin = new stdClass();
+	}
+
+	// Upload the avatar
+	$avatar = bp_core_avatar_handle_upload( $_FILES, $bp_params['upload_dir_filter'] );
 
+	// Reset objects
+	if ( ! empty( $needs_reset ) ) {
+		if ( ! empty( $needs_reset['component'] ) ) {
+			$bp->{$needs_reset['component']}->{$needs_reset['key']} = $needs_reset['value'];
 		} else {
-			$error = $editor;
+			$bp->{$needs_reset['key']} = $needs_reset['value'];
 		}
+	}
 
-		if ( false !== $error ) {
-			bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $error->get_error_message() ), 'error' );
-			return false;
+	// Init the feedback message
+	$feedback_message = false;
+
+	if ( ! empty( $bp->template_message ) ) {
+		$feedback_message = $bp->template_message;
+
+		// Remove template message.
+		$bp->template_message      = false;
+		$bp->template_message_type = false;
+		@setcookie( 'bp-message', false, time() - 1000, COOKIEPATH );
+		@setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH );
+	}
+
+	if ( empty( $avatar ) ) {
+		// Default upload error
+		$message = __( 'Upload failed.', 'buddypress' );
+
+		// Use the template message if set
+		if ( ! empty( $feedback_message ) ) {
+			$message = $feedback_message;
 		}
+
+		// Upload error reply
+		bp_attachments_json_response( false, $is_html4, array(
+			'type'    => 'upload_error',
+			'message' => $message,
+		) );
 	}
 
-	if ( ! isset( $bp->avatar_admin->image ) )
-		$bp->avatar_admin->image = new stdClass();
+	if ( empty( $bp->avatar_admin->image->file ) ) {
+		bp_attachments_json_response( false, $is_html4 );
+	}
 
-	// We only want to handle one image after resize.
-	if ( empty( $bp->avatar_admin->resized ) ) {
-		$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
-	} else {
-		$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] );
-		@unlink( $bp->avatar_admin->original['file'] );
+	$uploaded_image = @getimagesize( $bp->avatar_admin->image->file );
+
+	// Set the name of the file
+	$name = $_FILES['file']['name'];
+	$name_parts = pathinfo( $name );
+	$name = trim( substr( $name, 0, - ( 1 + strlen( $name_parts['extension'] ) ) ) );
+
+	if ( 'user' === $bp_params['object'] ) {
+		do_action( 'xprofile_avatar_uploaded' );
 	}
 
-	// Check for WP_Error on what should be an image
-	if ( is_wp_error( $bp->avatar_admin->image->dir ) ) {
-		bp_core_add_message( sprintf( __( 'Upload failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->image->dir->get_error_message() ), 'error' );
+	// Finally return the avatar to the editor
+	bp_attachments_json_response( true, $is_html4, array(
+		'name'      => $name,
+		'url'       => $bp->avatar_admin->image->url,
+		'width'     => $uploaded_image[0],
+		'height'    => $uploaded_image[1],
+		'feedback'  => $feedback_message,
+	) );
+}
+add_action( 'wp_ajax_bp_avatar_upload', 'bp_avatar_ajax_upload' );
+
+ /**
+ * Handle avatar webcam capture.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param string $data base64 encoded image.
+ * @param int $item_id.
+ * @return bool True on success, false on failure.
+ */
+function bp_avatar_handle_capture( $data = '', $item_id = 0 ) {
+	if ( empty( $data ) || empty( $item_id ) ) {
 		return false;
 	}
 
-	// If the uploaded image is smaller than the "full" dimensions, throw
-	// a warning
-	$uploaded_image = @getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir );
-	$full_width     = bp_core_avatar_full_width();
-	$full_height    = bp_core_avatar_full_height();
-	if ( isset( $uploaded_image[0] ) && $uploaded_image[0] < $full_width || $uploaded_image[1] < $full_height ) {
-		bp_core_add_message( sprintf( __( 'You have selected an image that is smaller than recommended. For best results, upload a picture larger than %d x %d pixels.', 'buddypress' ), $full_width, $full_height ), 'error' );
+	$avatar_dir = bp_core_avatar_upload_path() . '/avatars';
+
+	// It's not a regular upload, we may need to create this folder
+	if ( ! file_exists( $avatar_dir ) ) {
+		if ( ! wp_mkdir_p( $avatar_dir ) ) {
+			return false;
+		}
 	}
 
-	// Set the url value for the image
-	$bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir;
+	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $avatar_dir . '/' . $item_id, $item_id, 'user', 'avatars' );
 
-	return true;
+	// It's not a regular upload, we may need to create this folder
+	if( ! is_dir( $avatar_folder_dir ) ) {
+		if ( ! wp_mkdir_p( $avatar_folder_dir ) ) {
+			return false;
+		}
+	}
+
+	$original_file = $avatar_folder_dir . '/webcam-capture-' . $item_id . '.png';
+
+	if ( file_put_contents( $original_file, $data ) ) {
+		$avatar_to_crop = str_replace( bp_core_avatar_upload_path(), '', $original_file );
+
+		// Crop to default values
+		$crop_args = array( 'item_id' => $item_id, 'original_file' => $avatar_to_crop, 'crop_x' => 0, 'crop_y' => 0 );
+
+		do_action( 'xprofile_avatar_uploaded' );
+
+		return bp_core_avatar_handle_crop( $crop_args );
+	} else {
+		return false;
+	}
 }
 
 /**
@@ -705,7 +1070,7 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
  *     @type string $avatar_dir Subdirectory where avatar should be stored.
  *           Default: 'avatars'.
  *     @type bool|int $item_id ID of the item that the avatar belongs to.
- *     @type bool|string $original_file Absolute papth to the original avatar
+ *     @type bool|string $original_file Absolute path to the original avatar
  *           file.
  *     @type int $crop_w Crop width. Default: the global 'full' avatar width,
  *           as retrieved by bp_core_avatar_full_width().
@@ -729,86 +1094,146 @@ function bp_core_avatar_handle_crop( $args = '' ) {
 		'crop_y'        => 0
 	) );
 
-	/***
-	 * You may want to hook into this filter if you want to override this function.
-	 * Make sure you return false.
+	/**
+	 * Filters whether or not to handle cropping.
+	 *
+	 * If you want to override this function, make sure you return false.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param bool  $value Whether or not to crop.
+	 * @param array $r     Array of parsed arguments for function
 	 */
-	if ( !apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) )
+	if ( ! apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) ) {
 		return true;
+	}
 
-	extract( $r, EXTR_SKIP );
+	// Crop the file
+	$avatar_attachment = new BP_Attachment_Avatar();
+	$cropped           = $avatar_attachment->crop( $r );
 
-	if ( empty( $original_file ) )
+	// Check for errors
+	if ( empty( $cropped['full'] ) || empty( $cropped['thumb'] ) || is_wp_error( $cropped['full'] ) || is_wp_error( $cropped['thumb'] ) ) {
 		return false;
+	}
 
-	$original_file = bp_core_avatar_upload_path() . $original_file;
-
-	if ( !file_exists( $original_file ) )
-		return false;
+	return true;
+}
 
-	if ( empty( $item_id ) ) {
-		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
-	} else {
-		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
+/**
+ * Ajax set an avatar for a given object and item id
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @return  string a json object containing success data if the crop/capture succeeded
+ *                 error message otherwise
+ */
+function bp_avatar_ajax_set() {
+	// Bail if not a POST action
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
+		wp_send_json_error();
 	}
 
-	if ( !file_exists( $avatar_folder_dir ) )
-		return false;
-
-	require_once( ABSPATH . '/wp-admin/includes/image.php' );
-	require_once( ABSPATH . '/wp-admin/includes/file.php' );
+	// Check the nonce
+	check_admin_referer( 'bp_avatar_cropstore', 'nonce' );
 
-	// Delete the existing avatar files for the object
-	$existing_avatar = bp_core_fetch_avatar( array(
-		'object'  => $object,
-		'item_id' => $item_id,
-		'html' => false,
+	$avatar_data = wp_parse_args( $_POST, array(
+		'crop_w' => bp_core_avatar_full_width(),
+		'crop_h' => bp_core_avatar_full_height(),
+		'crop_x' => 0,
+		'crop_y' => 0
 	) );
 
-	if ( ! empty( $existing_avatar ) ) {
-		// Check that the new avatar doesn't have the same name as the
-		// old one before deleting
-		$upload_dir           = wp_upload_dir();
-		$existing_avatar_path = str_replace( $upload_dir['baseurl'], '', $existing_avatar );
-		$new_avatar_path      = str_replace( $upload_dir['basedir'], '', $original_file );
+	if ( empty( $avatar_data['object'] ) || empty( $avatar_data['item_id'] ) || empty( $avatar_data['original_file'] ) ) {
+		wp_send_json_error();
+	}
 
-		if ( $existing_avatar_path !== $new_avatar_path ) {
-			bp_core_delete_existing_avatar( array( 'object' => $object, 'item_id' => $item_id, 'avatar_path' => $avatar_folder_dir ) );
-		}
+	// Capability check
+	if ( ! bp_attachments_current_user_can( 'edit_avatar', $avatar_data ) ) {
+		wp_send_json_error();
 	}
 
+	if ( ! empty( $avatar_data['type'] ) && 'camera' === $avatar_data['type'] && 'user' === $avatar_data['object'] ) {
+		$webcam_avatar = false;
+
+		if ( ! empty( $avatar_data['original_file'] ) ) {
+			$webcam_avatar = str_replace( array( 'data:image/png;base64,', ' ' ), array( '', '+' ), $avatar_data['original_file'] );
+			$webcam_avatar = base64_decode( $webcam_avatar );
+		}
 
+		if ( ! bp_avatar_handle_capture( $webcam_avatar, $avatar_data['item_id'] ) ) {
+			wp_send_json_error( array(
+				'feedback_code' => 1
+			) );
 
-	// Make sure we at least have a width and height for cropping
-	if ( empty( $crop_w ) ) {
-		$crop_w = bp_core_avatar_full_width();
-	}
+		} else {
+			$return = array(
+				'avatar' => html_entity_decode( bp_core_fetch_avatar( array(
+					'object'  => $avatar_data['object'],
+					'item_id' => $avatar_data['item_id'],
+					'html'    => false,
+					'type'    => 'full',
+				) ) ),
+				'feedback_code' => 2,
+				'item_id'       => $avatar_data['item_id'],
+			);
+
+			do_action( 'xprofile_screen_change_avatar' );
+
+			wp_send_json_success( $return );
+		}
 
-	if ( empty( $crop_h ) ) {
-		$crop_h = bp_core_avatar_full_height();
+		return;
 	}
 
-	// Get the file extension
-	$data = @getimagesize( $original_file );
-	$ext  = $data['mime'] == 'image/png' ? 'png' : 'jpg';
+	$original_file = str_replace( bp_core_avatar_url(), '', $avatar_data['original_file'] );
 
-	// Set the full and thumb filenames
-	$full_filename  = wp_hash( $original_file . time() ) . '-bpfull.'  . $ext;
-	$thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.' . $ext;
+	// Set avatars dir & feedback part
+	if ( 'user' === $avatar_data['object'] ) {
+		$avatar_dir = 'avatars';
 
-	// Crop the image
-	$full_cropped  = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_full_width(),  bp_core_avatar_full_height(),  false, $avatar_folder_dir . '/' . $full_filename  );
-	$thumb_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
+	// Defaults to object-avatars dir
+	} else {
+		$avatar_dir = sanitize_key( $avatar_data['object'] ) . '-avatars';
+	}
 
-	// Check for errors
-	if ( empty( $full_cropped ) || empty( $thumb_cropped ) || is_wp_error( $full_cropped ) || is_wp_error( $thumb_cropped ) )
-		return false;
+	// Crop args
+	$r = array(
+		'item_id'       => $avatar_data['item_id'],
+		'object'        => $avatar_data['object'],
+		'avatar_dir'    => $avatar_dir,
+		'original_file' => $original_file,
+		'crop_w'        => $avatar_data['crop_w'],
+		'crop_h'        => $avatar_data['crop_h'],
+		'crop_x'        => $avatar_data['crop_x'],
+		'crop_y'        => $avatar_data['crop_y']
+	);
 
-	// Remove the original
-	@unlink( $original_file );
+	// Handle crop
+	if ( bp_core_avatar_handle_crop( $r ) ) {
+		$return = array(
+			'avatar' => html_entity_decode( bp_core_fetch_avatar( array(
+				'object'  => $avatar_data['object'],
+				'item_id' => $avatar_data['item_id'],
+				'html'    => false,
+				'type'    => 'full',
+			) ) ),
+			'feedback_code' => 2,
+			'item_id'       => $avatar_data['item_id'],
+		);
+
+		if ( 'user' === $avatar_data['object'] ) {
+			do_action( 'xprofile_screen_change_avatar' );
+		}
 
-	return true;
+		wp_send_json_success( $return );
+	} else {
+		wp_send_json_error( array(
+			'feedback_code' => 1,
+		) );
+	}
 }
+add_action( 'wp_ajax_bp_avatar_set', 'bp_avatar_ajax_set' );
 
 /**
  * Replace default WordPress avatars with BP avatars, if available.
@@ -838,7 +1263,7 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = ''
 		}
 
 	// If passed a number, assume it was a $user_id
-	} else if ( is_numeric( $user ) ) {
+	} elseif ( is_numeric( $user ) ) {
 		$id = $user;
 
 	// If passed a string and that string returns a user, get the $id
@@ -903,6 +1328,53 @@ function bp_core_check_avatar_size( $file ) {
 	return true;
 }
 
+/**
+ * Get allowed avatar types
+ *
+ * @since  BuddyPress (2.3.0)
+ */
+function bp_core_get_allowed_avatar_types() {
+	$allowed_types = array( 'jpeg', 'gif', 'png' );
+
+	/**
+ 	 * Use this filter to restrict image types
+ 	 *
+ 	 * @since BuddyPress (2.3.0)
+ 	 *
+ 	 * @param array list of image types
+ 	 */
+ 	$avatar_types = (array) apply_filters( 'bp_core_get_allowed_avatar_types', $allowed_types );
+
+ 	if ( empty( $avatar_types ) ) {
+ 		$avatar_types = $allowed_types;
+ 	} else {
+ 		$avatar_types = array_intersect( $allowed_types, $avatar_types );
+ 	}
+
+ 	return array_values( $avatar_types );
+}
+
+/**
+ * Get allowed avatar mime types
+ *
+ * @since  BuddyPress (2.3.0)
+ */
+function bp_core_get_allowed_avatar_mimes() {
+	$allowed_types  = bp_core_get_allowed_avatar_types();
+	$validate_mimes = wp_match_mime_types( join( ',', $allowed_types ), wp_get_mime_types() );
+	$allowed_mimes  = array_map( 'implode', $validate_mimes );
+
+	/**
+	 * Include jpg type if needed so that bp_core_check_avatar_type()
+	 * will check for jpeg and jpg extensions.
+	 */
+	if ( isset( $allowed_mimes['jpeg'] ) ) {
+		$allowed_mimes['jpg'] = $allowed_mimes['jpeg'];
+	}
+
+	return $allowed_mimes;
+}
+
 /**
  * Does the current avatar upload have an allowed file type?
  *
@@ -911,26 +1383,21 @@ function bp_core_check_avatar_size( $file ) {
  * @param array $file The $_FILES array.
  * @return bool True if the file extension is permitted, otherwise false.
  */
-function bp_core_check_avatar_type($file) {
-	if ( ( !empty( $file['file']['type'] ) && !preg_match('/(jpe?g|gif|png)$/i', $file['file']['type'] ) ) || !preg_match( '/(jpe?g|gif|png)$/i', $file['file']['name'] ) )
-		return false;
+function bp_core_check_avatar_type( $file ) {
+	$avatar_filetype = wp_check_filetype_and_ext( $file['file']['tmp_name'], $file['file']['name'], bp_core_get_allowed_avatar_mimes() );
 
-	return true;
+	if ( ! empty( $avatar_filetype['ext'] ) && ! empty( $avatar_filetype['type'] ) ) {
+		return true;
+	}
+
+	return false;
 }
 
 /**
  * Fetch data from the BP root blog's upload directory.
  *
- * Handy for multisite instances because all uploads are made on the BP root
- * blog and we need to query the BP root blog for the upload directory data.
- *
- * This function ensures that we only need to use {@link switch_to_blog()}
- * once to get what we need.
- *
  * @since BuddyPress (1.8.0)
  *
- * @uses wp_upload_dir()
- *
  * @param string $type The variable we want to return from the $bp->avatars
  *        object. Only 'upload_path' and 'url' are supported. Default: 'upload_path'.
  * @return string The avatar upload directory path.
@@ -972,16 +1439,9 @@ function bp_core_get_upload_dir( $type = 'upload_path' ) {
 
 			// No cache, so query for it
 			} else {
-				// We need to switch to the root blog on multisite installs
-				if ( is_multisite() ) {
-					switch_to_blog( bp_get_root_blog_id() );
-				}
 
 				// Get upload directory information from current site
-				$upload_dir = wp_upload_dir();
-
-				// Will bail if not switched
-				restore_current_blog();
+				$upload_dir = bp_upload_dir();
 
 				// Stash upload directory data for later use
 				$bp->avatar->upload_dir = $upload_dir;
@@ -1013,22 +1473,38 @@ function bp_core_get_upload_dir( $type = 'upload_path' ) {
 /**
  * Get the absolute upload path for the WP installation.
  *
- * @uses wp_upload_dir To get upload directory info
+ * @uses bp_core_get_upload_dir() To get upload directory info
  *
  * @return string Absolute path to WP upload directory.
  */
 function bp_core_avatar_upload_path() {
+
+	/**
+	 * Filters the absolute upload path for the WP installation.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Absolute upload path for the WP installation.
+	 */
 	return apply_filters( 'bp_core_avatar_upload_path', bp_core_get_upload_dir() );
 }
 
 /**
  * Get the raw base URL for root site upload location.
  *
- * @uses wp_upload_dir To get upload directory info.
+ * @uses bp_core_get_upload_dir() To get upload directory info.
  *
  * @return string Full URL to current upload location.
  */
 function bp_core_avatar_url() {
+
+	/**
+	 * Filters the raw base URL for root site upload location.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Raw base URL for the root site upload location.
+	 */
 	return apply_filters( 'bp_core_avatar_url', bp_core_get_upload_dir( 'url' ) );
 }
 
@@ -1049,6 +1525,14 @@ function bp_get_user_has_avatar( $user_id = 0 ) {
 	if ( bp_core_fetch_avatar( array( 'item_id' => $user_id, 'no_grav' => true, 'html' => false ) ) != bp_core_avatar_default( 'local' ) )
 		$retval = true;
 
+	/**
+	 * Filters whether or not a user has an uploaded avatar.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $retval  Whether or not a user has an uploaded avatar.
+	 * @param int  $user_id ID of the user being checked.
+	 */
 	return (bool) apply_filters( 'bp_get_user_has_avatar', $retval, $user_id );
 }
 
@@ -1067,6 +1551,15 @@ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
 	$bp  = buddypress();
 	$dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;
 
+	/**
+	 * Filters the avatar dimension setting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int    $dim    Dimension setting for the type.
+	 * @param string $type   The type of avatar whose dimensions are requested. Default 'thumb'.
+	 * @param string $h_or_w The dimension parameter being requested. Default 'height'.
+	 */
 	return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
 }
 
@@ -1078,6 +1571,14 @@ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
  * @return int The 'thumb' width.
  */
 function bp_core_avatar_thumb_width() {
+
+	/**
+	 * Filters the 'thumb' avatar width setting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Value for the 'thumb' avatar width setting.
+	 */
 	return apply_filters( 'bp_core_avatar_thumb_width', bp_core_avatar_dimension( 'thumb', 'width' ) );
 }
 
@@ -1089,6 +1590,14 @@ function bp_core_avatar_thumb_width() {
  * @return int The 'thumb' height.
  */
 function bp_core_avatar_thumb_height() {
+
+	/**
+	 * Filters the 'thumb' avatar height setting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Value for the 'thumb' avatar height setting.
+	 */
 	return apply_filters( 'bp_core_avatar_thumb_height', bp_core_avatar_dimension( 'thumb', 'height' ) );
 }
 
@@ -1100,6 +1609,14 @@ function bp_core_avatar_thumb_height() {
  * @return int The 'full' width.
  */
 function bp_core_avatar_full_width() {
+
+	/**
+	 * Filters the 'full' avatar width setting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Value for the 'full' avatar width setting.
+	 */
 	return apply_filters( 'bp_core_avatar_full_width', bp_core_avatar_dimension( 'full', 'width' ) );
 }
 
@@ -1111,6 +1628,14 @@ function bp_core_avatar_full_width() {
  * @return int The 'full' height.
  */
 function bp_core_avatar_full_height() {
+
+	/**
+	 * Filters the 'full' avatar height setting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Value for the 'full' avatar height setting.
+	 */
 	return apply_filters( 'bp_core_avatar_full_height', bp_core_avatar_dimension( 'full', 'height' ) );
 }
 
@@ -1122,6 +1647,14 @@ function bp_core_avatar_full_height() {
  * @return int The max width for original avatar uploads.
  */
 function bp_core_avatar_original_max_width() {
+
+	/**
+	 * Filters the max width for original avatar uploads.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Value for the max width.
+	 */
 	return apply_filters( 'bp_core_avatar_original_max_width', (int) buddypress()->avatar->original_max_width );
 }
 
@@ -1133,6 +1666,14 @@ function bp_core_avatar_original_max_width() {
  * @return int The max filesize for original avatar uploads.
  */
 function bp_core_avatar_original_max_filesize() {
+
+	/**
+	 * Filters the max filesize for original avatar uploads.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Value for the max filesize.
+	 */
 	return apply_filters( 'bp_core_avatar_original_max_filesize', (int) buddypress()->avatar->original_max_filesize );
 }
 
@@ -1152,20 +1693,21 @@ function bp_core_avatar_default( $type = 'gravatar' ) {
 		$avatar = BP_AVATAR_DEFAULT;
 
 	// Use the local default image
-	} else if ( 'local' === $type ) {
+	} elseif ( 'local' === $type ) {
 		$avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man.jpg';
 
 	// Use Gravatar's mystery man as fallback
 	} else {
-		if ( is_ssl() ) {
-			$host = 'https://secure.gravatar.com';
-		} else {
-			$host = 'http://www.gravatar.com';
-		}
-
-		$avatar = $host . '/avatar/00000000000000000000000000000000?d=mm&amp;s=' . bp_core_avatar_full_width();
+		$avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;s=' . bp_core_avatar_full_width();
 	}
 
+	/**
+	 * Filters the URL of the 'full' default avatar.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $avatar URL of the default avatar.
+	 */
 	return apply_filters( 'bp_core_avatar_default', $avatar );
 }
 
@@ -1188,19 +1730,176 @@ function bp_core_avatar_default_thumb( $type = 'gravatar' ) {
 		$avatar = BP_AVATAR_DEFAULT_THUMB;
 
 	// Use the local default image
-	} else if ( 'local' === $type ) {
+	} elseif ( 'local' === $type ) {
 		$avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man-50.jpg';
 
 	// Use Gravatar's mystery man as fallback
 	} else {
-		if ( is_ssl() ) {
-			$host = 'https://secure.gravatar.com';
-		} else {
-			$host = 'http://www.gravatar.com';
+		$avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;s=' . bp_core_avatar_thumb_width();
+	}
+
+	/**
+	 * Filters the URL of the 'thumb' default avatar.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $avatar URL of the default avatar.
+	 */
+	return apply_filters( 'bp_core_avatar_thumb', $avatar );
+}
+
+/**
+ * Reset the week parameter of the WordPress main query if needed
+ *
+ * When cropping an avatar, a $_POST['w'] var is sent, setting the 'week'
+ * parameter of the WordPress main query to this posted var. To avoid
+ * notices, we need to make sure this 'week' query var is reset to 0
+ *
+ * @since  BuddyPress (2.2.0)
+ *
+ * @param  WP_Query $posts_query the main query object
+ * @uses   bp_is_group_create()
+ * @uses   bp_is_group_admin_page()
+ * @uses   bp_is_group_admin_screen() to check for a group admin screen
+ * @uses   bp_action_variable() to check for the group's avatar creation step
+ * @uses   bp_is_user_change_avatar() to check for the user's change profile screen
+ */
+function bp_core_avatar_reset_query( $posts_query = null ) {
+	$reset_w = false;
+
+	// Group's avatar edit screen
+	if ( bp_is_group_admin_page() ) {
+		$reset_w = bp_is_group_admin_screen( 'group-avatar' );
+
+	// Group's avatar create screen
+	} elseif ( bp_is_group_create() ) {
+		/**
+		 * we can't use bp_get_groups_current_create_step()
+		 * as it's not set yet
+		 */
+		$reset_w = 'group-avatar' === bp_action_variable( 1 );
+
+	// User's change avatar screen
+	} else {
+		$reset_w = bp_is_user_change_avatar();
+	}
+
+	// A user or a group is cropping an avatar
+	if ( true === $reset_w && isset( $_POST['avatar-crop-submit'] ) ) {
+		$posts_query->set( 'w', 0 );
+	}
+}
+add_action( 'bp_parse_query', 'bp_core_avatar_reset_query', 10, 1 );
+
+/**
+ * Checks whether Avatar UI should be loaded
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @return bool True if Avatar UI should load, false otherwise
+ */
+function bp_avatar_is_front_edit() {
+	$retval = false;
+
+	// No need to carry on if the current WordPress version is not supported.
+	if ( ! bp_attachments_is_wp_version_supported() ) {
+		return $retval;
+	}
+
+	if ( bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step() ) {
+		$retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' );
+	}
+
+	if ( bp_is_active( 'groups' ) ) {
+		// Group creation
+		if ( bp_is_group_create() && bp_is_group_creation_step( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) {
+			$retval = ! bp_disable_group_avatar_uploads();
+
+		// Group Manage
+		} elseif ( bp_is_group_admin_page() && bp_is_group_admin_screen( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) {
+			$retval = ! bp_disable_group_avatar_uploads();
 		}
+	}
+
+	/**
+	 * Use this filter if you need to :
+	 * - Load the avatar UI for a component that is !groups or !user (return true regarding your conditions)
+	 * - Completely disable the avatar UI introduced in 2.3 (eg: __return_false())
+	 *
+	 * @since  BuddyPress (2.3.0)
+	 *
+	 * @var  bool whether to load the Avatar UI
+	 */
+	return apply_filters( 'bp_avatar_is_front_edit', $retval );
+}
+
+/**
+ * Checks whether the Webcam Avatar UI part should be loaded
+ *
+ * @since  BuddyPress (2.3.0)
+ *
+ * @global $is_safari
+ * @global $is_IE
+ * @return bool True to load the Webcam Avatar UI part. False otherwise.
+ */
+function bp_avatar_use_webcam() {
+	global $is_safari, $is_IE;
 
-		$avatar = $host . '/avatar/00000000000000000000000000000000?d=mm&amp;s=' . bp_core_avatar_thumb_width();
+	/**
+	 * Do not use the webcam feature for mobile devices
+	 * to avoid possible confusions.
+	 */
+	if ( wp_is_mobile() ) {
+		return false;
 	}
 
-	return apply_filters( 'bp_core_avatar_thumb', $avatar );
+	/**
+	 * Bail when the browser does not support getUserMedia.
+	 *
+	 * @see  http://caniuse.com/#feat=stream
+	 */
+	if ( $is_safari || $is_IE ) {
+		return false;
+	}
+
+	/**
+	 * Use this filter if you need to disable the webcam capture feature
+	 * by returning false.
+	 *
+	 * @since  BuddyPress (2.3.0)
+	 *
+	 * @var  bool whether to load Webcam Avatar UI part
+	 */
+	return apply_filters( 'bp_avatar_use_webcam', true );
+}
+
+/**
+ * Template function to load the Avatar UI javascript templates
+ *
+ * @since  BuddyPress (2.3.0)
+ */
+function bp_avatar_get_templates() {
+	if ( ! bp_avatar_is_front_edit() ) {
+		return;
+	}
+
+	bp_attachments_get_template_part( 'avatars/index' );
+}
+
+/**
+ * Trick to check if the theme's BuddyPress templates are up to date
+ *
+ * If the "avatar templates" are not including the new template tag, this will
+ * help users to get the avatar UI.
+ *
+ * @since  BuddyPress (2.3.0)
+ */
+function bp_avatar_template_check() {
+	if ( ! bp_avatar_is_front_edit() ) {
+		return;
+	}
+
+	if ( ! did_action( 'bp_attachments_avatar_check_template' ) ) {
+		bp_attachments_get_template_part( 'avatars/index' );
+	}
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
index 8a675053c89b7f4655b0d228941fd35753ba589e..ca87d9a123cbec5114b380be29e53bcd8f9ef639 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php
@@ -9,13 +9,11 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Add an item to the main BuddyPress navigation array.
  *
- * @global BuddyPress $bp The one true BuddyPress instance.
- *
  * @param array $args {
  *     Array describing the new nav item.
  *     @type string $name Display name for the nav item.
@@ -38,7 +36,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @return bool|null Returns false on failure.
  */
 function bp_core_new_nav_item( $args = '' ) {
-	global $bp;
+	$bp = buddypress();
 
 	$defaults = array(
 		'name'                    => false, // Display name for the nav item
@@ -108,19 +106,36 @@ function bp_core_new_nav_item( $args = '' ) {
 			}
 
 			if ( !empty( $default_subnav_slug ) ) {
+
+				/**
+				 * Filters the default component subnav item.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string $default_subnav_slug The slug of the default subnav item
+				 *                                    to select when clicked.
+				 * @param array  $r                   Parsed arguments for the nav item.
+				 */
 				$bp->current_action = apply_filters( 'bp_default_component_subnav', $default_subnav_slug, $r );
 			}
 		}
 	}
 
+	/**
+	 * Fires after adding an item to the main BuddyPress navigation array.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $r        Parsed arguments for the nav item.
+	 * @param array $args     Originally passed in arguments for the nav item.
+	 * @param array $defaults Default arguments for a nav item.
+	 */
 	do_action( 'bp_core_new_nav_item', $r, $args, $defaults );
 }
 
 /**
  * Modify the default subnav item that loads when a top level nav item is clicked.
  *
- * @global BuddyPress $bp The one true BuddyPress instance.
- *
  * @param array $args {
  *     @type string $parent_slug The slug of the nav item whose default is
  *           being changed.
@@ -130,7 +145,7 @@ function bp_core_new_nav_item( $args = '' ) {
  * }
  */
 function bp_core_new_nav_default( $args = '' ) {
-	global $bp;
+	$bp = buddypress();
 
 	$defaults = array(
 		'parent_slug'     => false, // Slug of the parent
@@ -195,12 +210,10 @@ function bp_core_new_nav_default( $args = '' ) {
  * The sorting is split into a separate function because it can only happen
  * after all plugins have had a chance to register their navigation items.
  *
- * @global BuddyPress $bp The one true BuddyPress instance
- *
  * @return bool|null Returns false on failure.
  */
 function bp_core_sort_nav_items() {
-	global $bp;
+	$bp = buddypress();
 
 	if ( empty( $bp->bp_nav ) || !is_array( $bp->bp_nav ) )
 		return false;
@@ -229,8 +242,6 @@ add_action( 'admin_head', 'bp_core_sort_nav_items' );
 /**
  * Add a subnav item to the BuddyPress navigation.
  *
- * @global BuddyPress $bp The one true BuddyPress instance.
- *
  * @param array $args {
  *     Array describing the new subnav item.
  *     @type string $name Display name for the subnav item.
@@ -253,24 +264,28 @@ add_action( 'admin_head', 'bp_core_sort_nav_items' );
  *           when the nav item is clicked.
  *     @type string $link Optional. The URL that the subnav item should point
  *           to. Defaults to a value generated from the $parent_url + $slug.
+ *     @type bool $show_in_admin_bar Optional. Whether the nav item should be
+ *           added into the group's "Edit" Admin Bar menu for group admins.
+ *           Default: false.
  * }
  * @return bool|null Returns false on failure.
  */
 function bp_core_new_subnav_item( $args = '' ) {
-	global $bp;
+	$bp = buddypress();
 
 	$r = wp_parse_args( $args, array(
-		'name'            => false, // Display name for the nav item
-		'slug'            => false, // URL slug for the nav item
-		'parent_slug'     => false, // URL slug of the parent nav item
-		'parent_url'      => false, // URL of the parent item
-		'item_css_id'     => false, // The CSS ID to apply to the HTML of the nav item
-		'user_has_access' => true,  // Can the logged in user see this nav item?
-		'no_access_url'   => '',
-		'site_admin_only' => false, // Can only site admins see this nav item?
-		'position'        => 90,    // Index of where this nav item should be positioned
-		'screen_function' => false, // The name of the function to run when clicked
-		'link'            => ''     // The link for the subnav item; optional, not usually required.
+		'name'              => false, // Display name for the nav item
+		'slug'              => false, // URL slug for the nav item
+		'parent_slug'       => false, // URL slug of the parent nav item
+		'parent_url'        => false, // URL of the parent item
+		'item_css_id'       => false, // The CSS ID to apply to the HTML of the nav item
+		'user_has_access'   => true,  // Can the logged in user see this nav item?
+		'no_access_url'     => '',
+		'site_admin_only'   => false, // Can only site admins see this nav item?
+		'position'          => 90,    // Index of where this nav item should be positioned
+		'screen_function'   => false, // The name of the function to run when clicked
+		'link'              => '',    // The link for the subnav item; optional, not usually required.
+		'show_in_admin_bar' => false, // Show the Manage link in the current group's "Edit" Admin Bar menu
 	) );
 
 	extract( $r, EXTR_SKIP );
@@ -281,11 +296,11 @@ function bp_core_new_subnav_item( $args = '' ) {
 
 	// Link was not forced, so create one
 	if ( empty( $link ) ) {
-		$link = $parent_url . $slug;
+		$link = trailingslashit( $parent_url . $slug );
 
 		// If this sub item is the default for its parent, skip the slug
 		if ( ! empty( $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) && $slug == $bp->bp_nav[$parent_slug]['default_subnav_slug'] ) {
-			$link = $parent_url;
+			$link = trailingslashit( $parent_url );
 		}
 	}
 
@@ -297,15 +312,17 @@ function bp_core_new_subnav_item( $args = '' ) {
 		$item_css_id = $slug;
 
 	$subnav_item = array(
-		'name'            => $name,
-		'link'            => trailingslashit( $link ),
-		'slug'            => $slug,
-		'css_id'          => $item_css_id,
-		'position'        => $position,
-		'user_has_access' => $user_has_access,
-		'no_access_url'   => $no_access_url,
-		'screen_function' => &$screen_function
+		'name'              => $name,
+		'link'              => $link,
+		'slug'              => $slug,
+		'css_id'            => $item_css_id,
+		'position'          => $position,
+		'user_has_access'   => $user_has_access,
+		'no_access_url'     => $no_access_url,
+		'screen_function'   => &$screen_function,
+		'show_in_admin_bar' => (bool) $r['show_in_admin_bar'],
 	);
+
 	$bp->bp_options_nav[$parent_slug][$slug] = $subnav_item;
 
 	/**
@@ -385,7 +402,7 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) {
 
 			// In the case of a user page, we try to assume a
 			// redirect URL
-			} else if ( bp_is_user() ) {
+			} elseif ( bp_is_user() ) {
 
 				// Redirect to the displayed user's default
 				// component, as long as that component is
@@ -435,12 +452,10 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) {
 /**
  * Sort all subnavigation arrays.
  *
- * @global BuddyPress $bp The one true BuddyPress instance
- *
  * @return bool|null Returns false on failure.
  */
 function bp_core_sort_subnav_items() {
-	global $bp;
+	$bp = buddypress();
 
 	if ( empty( $bp->bp_options_nav ) || !is_array( $bp->bp_options_nav ) )
 		return false;
@@ -480,13 +495,22 @@ add_action( 'admin_head', 'bp_core_sort_subnav_items' );
  *        items; false otherwise.
  */
 function bp_nav_item_has_subnav( $nav_item = '' ) {
-	global $bp;
+	$bp = buddypress();
 
 	if ( !$nav_item )
 		$nav_item = bp_current_component();
 
 	$has_subnav = isset( $bp->bp_options_nav[$nav_item] ) && count( $bp->bp_options_nav[$nav_item] ) > 0;
 
+	/**
+	 * Filters whether or not a given nav item has subnav items.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $has_subnav Whether or not there is any subnav items.
+	 * @param string $nav_item   The slug of the top-level nav item whose subnav
+	 *                           items you're checking.
+	 */
 	return apply_filters( 'bp_nav_item_has_subnav', $has_subnav, $nav_item );
 }
 
@@ -497,7 +521,7 @@ function bp_nav_item_has_subnav( $nav_item = '' ) {
  * @param bool Returns false on failure, ie if the nav item can't be found.
  */
 function bp_core_remove_nav_item( $parent_id ) {
-	global $bp;
+	$bp = buddypress();
 
 	// Unset subnav items for this nav item
 	if ( isset( $bp->bp_options_nav[$parent_id] ) && is_array( $bp->bp_options_nav[$parent_id] ) ) {
@@ -526,9 +550,11 @@ function bp_core_remove_nav_item( $parent_id ) {
  * @param string $slug The slug of the subnav item to be removed.
  */
 function bp_core_remove_subnav_item( $parent_id, $slug ) {
-	global $bp;
+	$bp = buddypress();
 
-	$screen_function = isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) ? $bp->bp_options_nav[$parent_id][$slug]['screen_function'] : false;
+	$screen_function = isset( $bp->bp_options_nav[$parent_id][$slug]['screen_function'] )
+		? $bp->bp_options_nav[$parent_id][$slug]['screen_function']
+		: false;
 
 	if ( ! empty( $screen_function ) ) {
 		// Remove our screen hook if screen function is callable
@@ -546,12 +572,10 @@ function bp_core_remove_subnav_item( $parent_id, $slug ) {
 /**
  * Clear all subnav items from a specific nav item.
  *
- * @global BuddyPress $bp The one true BuddyPress instance.
- *
  * @param string $parent_slug The slug of the parent navigation item.
  */
 function bp_core_reset_subnav_items( $parent_slug ) {
-	global $bp;
+	$bp = buddypress();
 
 	unset( $bp->bp_options_nav[$parent_slug] );
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
index 340bbb2db33eb9d7b75500adc69e5b68c6e8977c..05e3625498bdda581524ed67eee34a25238b9859 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Prune the WP Super Cache.
@@ -21,21 +21,17 @@ function bp_core_clear_cache() {
 	global $cache_path;
 
 	if ( function_exists( 'prune_super_cache' ) ) {
+
+		/**
+		 * Fires before the pruning of WP Super Cache.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 */
 		do_action( 'bp_core_clear_cache' );
 		return prune_super_cache( $cache_path, true );
 	}
 }
 
-/**
- * Add 'bp' to global group of network wide cachable objects.
- */
-function bp_core_add_global_group() {
-	if ( function_exists( 'wp_cache_add_global_groups' ) ) {
-		wp_cache_add_global_groups( array( 'bp' ) );
-	}
-}
-add_action( 'bp_loaded', 'bp_core_add_global_group' );
-
 /**
  * Clear all cached objects for a user, or those that a user is part of.
  */
@@ -73,7 +69,7 @@ function bp_core_clear_directory_pages_cache_page_edit( $post_id ) {
 		return;
 	}
 
-	$page_ids = bp_core_get_directory_page_ids();
+	$page_ids = bp_core_get_directory_page_ids( 'all' );
 
 	if ( ! in_array( $post_id, (array) $page_ids ) ) {
 		return;
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-caps.php b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php
index 4c36796060a9250d9098c5952a0a90b0bfded8da..f6e30bb0dd46c3e6d7ec8f4b2fa802dce41a2452 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-caps.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php
@@ -1,14 +1,14 @@
 <?php
 
 /**
- * BuddyPress Capabilites.
+ * BuddyPress Capabilities.
  *
  * @package BuddyPress
  * @subpackage Capabilities
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Return an array of roles from the currently loaded blog
@@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * WordPress roles are dynamically flipped when calls to switch_to_blog() and
  * restore_current_blog() are made, so we use and trust WordPress core to have
  * loaded the correct results for us here. As enhancements are made to
- * WordPresss's RBAC, so should our capability functions here.
+ * WordPress's RBAC, so should our capability functions here.
  *
  * @since BuddyPress (2.1.0)
  *
@@ -30,10 +30,23 @@ function bp_get_current_blog_roles() {
 		? $wp_roles->roles
 		: array();
 
-	// Apply WordPress core filter to editable roles
+	/**
+	 * Filters the list of editable roles.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $roles List of roles.
+	 */
 	$roles = apply_filters( 'editable_roles', $roles );
 
-	// Return the editable roles
+	/**
+	 * Filters the array of roles from the currently loaded blog.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array    $roles    Available roles.
+	 * @param WP_Roles $wp_roles Object of WordPress roles.
+	 */
 	return apply_filters( 'bp_get_current_blog_roles', $roles, $wp_roles );
 }
 
@@ -62,6 +75,13 @@ function bp_add_caps() {
 		}
 	}
 
+	/**
+	 * Fires after the addition of capabilities to WordPress user roles.
+	 *
+	 * This is called on plugin activation.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_add_caps' );
 }
 
@@ -90,6 +110,13 @@ function bp_remove_caps() {
 		}
 	}
 
+	/**
+	 * Fires after the removal of capabilities from WordPress user roles.
+	 *
+	 * This is called on plugin deactivation.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_remove_caps' );
 }
 
@@ -110,6 +137,17 @@ function bp_remove_caps() {
  * @return array Actual capabilities for meta capability. See {@link WP_User::has_cap()}.
  */
 function bp_map_meta_caps( $caps, $cap, $user_id, $args ) {
+
+	/**
+	 * Filters the community caps mapping to be built in WordPress caps.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array  $caps    Returns the user's actual capabilities.
+	 * @param string $cap     Capability name.
+	 * @param int    $user_id The user ID.
+	 * @param array  $args    Adds the context to the cap. Typically the object ID.
+	 */
 	return apply_filters( 'bp_map_meta_caps', $caps, $cap, $user_id, $args );
 }
 
@@ -127,6 +165,13 @@ function bp_get_community_caps() {
 	// Forum meta caps
 	$caps = array();
 
+	/**
+	 * Filters community capabilities.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $caps Array of capabilities to add. Empty by default.
+	 */
 	return apply_filters( 'bp_get_community_caps', $caps );
 }
 
@@ -163,6 +208,14 @@ function bp_get_caps_for_role( $role = '' ) {
 			break;
 	}
 
+	/**
+	 * Filters the array of capabilities based on the role that is being requested.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array  $caps Array of capabilities to return.
+	 * @param string $role The role currently being loaded.
+	 */
 	return apply_filters( 'bp_get_caps_for_role', $caps, $role );
 }
 
@@ -220,6 +273,15 @@ function bp_current_user_can( $capability, $blog_id = 0 ) {
 
 	$retval = current_user_can_for_blog( $blog_id, $capability );
 
+	/**
+	 * Filters whether or not the current user has a given capability.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool   $retval     Whether or not the current user has the capability.
+	 * @param string $capability The capability being checked for.
+	 * @param int    $blog_id    Blog ID. Defaults to the BP root blog.
+	 */
 	return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id );
 }
 
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
index c9b6be565790886a44aef51fcfff8a2db629cf9f..3c6bc5b3e372dc227d77360e479ff03b63e296c8 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Analyze the URI and break it down into BuddyPress-usable chunks.
@@ -21,11 +21,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * URI structures with very little work.
  *
  * The URIs are broken down as follows:
- *   - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
- *   - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
+ *   - http:// example.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
+ *   - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
  *
  *	Example:
- *    - http://domain.com/members/andy/profile/edit/group/5/
+ *    - http://example.com/members/andy/profile/edit/group/5/
  *    - $bp->current_component: string 'xprofile'
  *    - $bp->current_action: string 'edit'
  *    - $bp->action_variables: array ['group', 5]
@@ -33,12 +33,14 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @since BuddyPress (1.0.0)
  */
 function bp_core_set_uri_globals() {
-	global $bp, $current_blog, $wp_rewrite;
+	global $current_blog, $wp_rewrite;
 
 	// Don't catch URIs on non-root blogs unless multiblog mode is on
 	if ( !bp_is_root_blog() && !bp_is_multiblog_mode() )
 		return false;
 
+	$bp = buddypress();
+
 	// Define local variables
 	$root_profile = $match   = false;
 	$key_slugs    = $matches = $uri_chunks = array();
@@ -49,11 +51,17 @@ function bp_core_set_uri_globals() {
 
 	// Ajax or not?
 	if ( defined( 'DOING_AJAX' ) && DOING_AJAX || strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
-		$path = bp_core_referrer();
+		$path = bp_get_referer_path();
 	else
 		$path = esc_url( $_SERVER['REQUEST_URI'] );
 
-	// Filter the path
+	/**
+	 * Filters the BuddyPress global URI path.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $path Path to set.
+	 */
 	$path = apply_filters( 'bp_uri', $path );
 
 	// Take GET variables off the URL to avoid problems
@@ -250,37 +258,54 @@ function bp_core_set_uri_globals() {
 		// If members component, do more work to find the actual component
 		if ( 'members' == $match->key ) {
 
-			// Viewing a specific user
-			if ( !empty( $bp_uri[$uri_offset + 1] ) ) {
+			$after_member_slug = false;
+			if ( ! empty( $bp_uri[ $uri_offset + 1 ] ) ) {
+				$after_member_slug = $bp_uri[ $uri_offset + 1 ];
+			}
 
-				// Switch the displayed_user based on compatbility mode
+			// Are we viewing a specific user?
+			if ( $after_member_slug ) {
+				// Switch the displayed_user based on compatibility mode
 				if ( bp_is_username_compatibility_mode() ) {
-					$bp->displayed_user->id = (int) bp_core_get_userid( urldecode( $bp_uri[$uri_offset + 1] ) );
+					$bp->displayed_user->id = (int) bp_core_get_userid( urldecode( $after_member_slug ) );
 				} else {
-					$bp->displayed_user->id = (int) bp_core_get_userid_from_nicename( urldecode( $bp_uri[$uri_offset + 1] ) );
+					$bp->displayed_user->id = (int) bp_core_get_userid_from_nicename( $after_member_slug );
 				}
+			}
 
-				if ( !bp_displayed_user_id() ) {
+			// Is this a member type directory?
+			if ( ! bp_displayed_user_id() && $after_member_slug === apply_filters( 'bp_members_member_type_base', _x( 'type', 'member type URL base', 'buddypress' ) ) && ! empty( $bp_uri[ $uri_offset + 2 ] ) ) {
+				$matched_types = bp_get_member_types( array(
+					'has_directory'  => true,
+					'directory_slug' => $bp_uri[ $uri_offset + 2 ],
+				) );
 
-					// Prevent components from loading their templates
-					$bp->current_component = '';
+				if ( ! empty( $matched_types ) ) {
+					$bp->current_member_type = reset( $matched_types );
+					unset( $bp_uri[ $uri_offset + 1 ] );
+				}
+			}
+
+			// If the slug matches neither a member type nor a specific member, 404.
+			if ( ! bp_displayed_user_id() && ! bp_get_current_member_type() && $after_member_slug ) {
+				// Prevent components from loading their templates.
+				$bp->current_component = '';
+				bp_do_404();
+				return;
+			}
 
+			// If the displayed user is marked as a spammer, 404 (unless logged-in user is a super admin)
+			if ( bp_displayed_user_id() && bp_is_user_spammer( bp_displayed_user_id() ) ) {
+				if ( bp_current_user_can( 'bp_moderate' ) ) {
+					bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'warning' );
+				} else {
 					bp_do_404();
 					return;
 				}
+			}
 
-				// If the displayed user is marked as a spammer, 404 (unless logged-
-				// in user is a super admin)
-				if ( bp_displayed_user_id() && bp_is_user_spammer( bp_displayed_user_id() ) ) {
-					if ( bp_current_user_can( 'bp_moderate' ) ) {
-						bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'warning' );
-					} else {
-						bp_do_404();
-						return;
-					}
-				}
-
-				// Bump the offset
+			// Bump the offset.
+			if ( bp_displayed_user_id() ) {
 				if ( isset( $bp_uri[$uri_offset + 2] ) ) {
 					$bp_uri                = array_merge( array(), array_slice( $bp_uri, $uri_offset + 2 ) );
 					$bp->current_component = $bp_uri[0];
@@ -325,6 +350,13 @@ function bp_core_enable_root_profiles() {
 	if ( defined( 'BP_ENABLE_ROOT_PROFILES' ) && ( true == BP_ENABLE_ROOT_PROFILES ) )
 		$retval = true;
 
+	/**
+	 * Filters whether or not root profiles are enabled and allowed.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $retval Whether or not root profiles are available.
+	 */
 	return apply_filters( 'bp_core_enable_root_profiles', $retval );
 }
 
@@ -342,34 +374,12 @@ function bp_core_enable_root_profiles() {
 function bp_core_load_template( $templates ) {
 	global $wp_query;
 
-	// check if BP page belongs to, or is a child of, a BP directory page
-	$page_id = false;
-	foreach ( (array) buddypress()->pages as $page ) {
-		if ( $page->name == buddypress()->unfiltered_uri[buddypress()->unfiltered_uri_offset] ) {
-			$page_id = $page->id;
-			break;
-		}
-	}
-
-	// Set up reset post args
-	$reset_post_args = array(
+	// Reset the post
+	bp_theme_compat_reset_post( array(
+		'ID'          => 0,
 		'is_404'      => true,
 		'post_status' => 'publish',
-	);
-
-	// BP page exists - fill in the $wp_query->post object
-	//
-	// bp_theme_compat_reset_post() looks at the $wp_query->post object to fill in
-	// the post globals
-	if ( ! empty( $page_id ) ) {
-		$wp_query->post = get_post( $page_id );
-		$reset_post_args['ID'] = $page_id;
-	} else {
-		$reset_post_args['ID'] = 0;
-	}
-
-	// Reset the post
-	bp_theme_compat_reset_post( $reset_post_args );
+	) );
 
 	// Set theme compat to false since the reset post function automatically sets
 	// theme compat to true
@@ -390,26 +400,55 @@ function bp_core_load_template( $templates ) {
 		$template = '';
 	}
 
-	// Filter the template locations so that plugins can alter where they are located
+	/**
+	 * Filters the template locations.
+	 *
+	 * Allows plugins to alter where the template files are located.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $template           Located template path.
+	 * @param array  $filtered_templates Array of templates to attempt to load.
+	 */
 	$located_template = apply_filters( 'bp_located_template', $template, $filtered_templates );
 	if ( !empty( $located_template ) ) {
-
 		// Template was located, lets set this as a valid page and not a 404.
 		status_header( 200 );
 		$wp_query->is_page     = true;
 		$wp_query->is_singular = true;
 		$wp_query->is_404      = false;
 
+		/**
+		 * Fires before the loading of a located template file.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $located_template Template found to be loaded.
+		 */
 		do_action( 'bp_core_pre_load_template', $located_template );
 
+		/**
+		 * Filters the selected template right before loading.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $located_template Template found to be loaded.
+		 */
 		load_template( apply_filters( 'bp_load_template', $located_template ) );
 
+		/**
+		 * Fires after the loading of a located template file.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $located_template Template found that was loaded.
+		 */
 		do_action( 'bp_core_post_load_template', $located_template );
 
 		// Kill any other output after this.
 		exit();
 
-	// No template found, so setup theme compatability
+	// No template found, so setup theme compatibility
 	// @todo Some other 404 handling if theme compat doesn't kick in
 	} else {
 
@@ -422,6 +461,11 @@ function bp_core_load_template( $templates ) {
 			$wp_query->is_404      = false;
 		}
 
+		/**
+		 * Fires if there are no found templates to load and theme compat is needed.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 */
 		do_action( 'bp_setup_theme_compat' );
 	}
 }
@@ -431,6 +475,14 @@ function bp_core_load_template( $templates ) {
  */
 function bp_core_catch_profile_uri() {
 	if ( !bp_is_active( 'xprofile' ) ) {
+
+		/**
+		 * Filters the path to redirect users to if XProfile is not enabled.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Path to redirect users to.
+		 */
 		bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) );
 	}
 }
@@ -441,7 +493,9 @@ function bp_core_catch_profile_uri() {
  * @since BuddyPress (1.5.0)
  */
 function bp_core_catch_no_access() {
-	global $bp, $wp_query;
+	global $wp_query;
+
+	$bp = buddypress();
 
 	// If coming from bp_core_redirect() and $bp_no_status_set is true,
 	// we are redirecting to an accessible page so skip this check.
@@ -464,7 +518,7 @@ add_action( 'bp_template_redirect', 'bp_core_catch_no_access', 1 );
  * @since BuddyPress (1.5.0)
  *
  * @param array $args {
- *     @type int $mode Specifies the destintation of the redirect. 1 will
+ *     @type int $mode Specifies the destination of the redirect. 1 will
  *           direct to the root domain (home page), which assumes you have a
  *           log-in form there; 2 directs to wp-login.php. Default: 2.
  *     @type string $redirect The URL the user will be redirected to after
@@ -491,6 +545,14 @@ function bp_core_no_access( $args = '' ) {
 	);
 
 	$r = wp_parse_args( $args, $defaults );
+
+	/**
+	 * Filters the arguments used for user redirecting when visiting access controlled areas.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $r Array of parsed arguments for redirect determination.
+	 */
 	$r = apply_filters( 'bp_core_no_access', $r );
 	extract( $r, EXTR_SKIP );
 
@@ -522,8 +584,9 @@ function bp_core_no_access( $args = '' ) {
 		default :
 
 			$url = $root;
-			if ( !empty( $redirect ) )
+			if ( !empty( $redirect ) ) {
 				$url = add_query_arg( 'redirect_to', urlencode( $redirect ), $root );
+			}
 
 			if ( !empty( $message ) ) {
 				bp_core_add_message( $message, 'error' );
@@ -547,6 +610,14 @@ function bp_core_no_access( $args = '' ) {
 function bp_core_no_access_wp_login_error() {
 	global $error;
 
+	/**
+	 * Filters the error message for wp-login.php when needing to log in before accessing.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value Error message to display.
+	 * @param string $value URL to redirect user to after successful login.
+	 */
 	$error = apply_filters( 'bp_wp_login_error', __( 'You must log in to access the page you requested.', 'buddypress' ), $_REQUEST['redirect_to'] );
 
 	// shake shake shake!
@@ -572,8 +643,14 @@ add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' );
  * @uses bp_get_requested_url()
  */
 function bp_redirect_canonical() {
-	global $bp;
 
+	/**
+	 * Filters whether or not to do canonical redirects on BuddyPress URLs.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not to do canonical redirects. Default true.
+	 */
 	if ( !bp_is_blog_page() && apply_filters( 'bp_do_redirect_canonical', true ) ) {
 		// If this is a POST request, don't do a canonical redirect.
 		// This is for backward compatibility with plugins that submit form requests to
@@ -596,6 +673,8 @@ function bp_redirect_canonical() {
 		// Only redirect if we've assembled a URL different from the request
 		if ( $canonical_url !== $req_url_clean ) {
 
+			$bp = buddypress();
+
 			// Template messages have been deleted from the cookie by this point, so
 			// they must be readded before redirecting
 			if ( isset( $bp->template_message ) ) {
@@ -641,13 +720,14 @@ function bp_rel_canonical() {
  * @return string Canonical URL for the current page.
  */
 function bp_get_canonical_url( $args = array() ) {
-	global $bp;
 
 	// For non-BP content, return the requested url, and let WP do the work
 	if ( bp_is_blog_page() ) {
 		return bp_get_requested_url();
 	}
 
+	$bp = buddypress();
+
 	$defaults = array(
 		'include_query_args' => false // Include URL arguments, eg ?foo=bar&foo2=bar2
 	);
@@ -670,8 +750,16 @@ function bp_get_canonical_url( $args = array() ) {
 		// Except when the front page is set to the registration page
 		// and the current user is logged in. In this case we send to
 		// the members directory to avoid redirect loops
-		} else if ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {
-			$bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) );
+		} elseif ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {
+
+			/**
+			 * Filters the logged in register page redirect URL.
+			 *
+			 * @since BuddyPress (1.5.1)
+			 *
+			 * @param string $value URL to redirect logged in members to.
+			 */
+			$bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', bp_get_members_directory_permalink() );
 		}
 	}
 
@@ -712,6 +800,14 @@ function bp_get_canonical_url( $args = array() ) {
 		$canonical_url = array_pop( $canonical_url );
 	}
 
+	/**
+	 * Filters the canonical url of the current page.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $canonical_url Canonical URL of the current page.
+	 * @param array  $args          Array of arguments to help determine canonical URL.
+	 */
 	return apply_filters( 'bp_get_canonical_url', $canonical_url, $args );
 }
 
@@ -723,13 +819,20 @@ function bp_get_canonical_url( $args = array() ) {
  * @return string Requested URL string.
  */
 function bp_get_requested_url() {
-	global $bp;
+	$bp = buddypress();
 
 	if ( empty( $bp->canonical_stack['requested_url'] ) ) {
 		$bp->canonical_stack['requested_url']  = is_ssl() ? 'https://' : 'http://';
 		$bp->canonical_stack['requested_url'] .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
 	}
 
+	/**
+	 * Filters the URL as requested on the current page load by the user agent.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $value Requested URL string.
+	 */
 	return apply_filters( 'bp_get_requested_url', $bp->canonical_stack['requested_url'] );
 }
 
@@ -776,8 +879,8 @@ add_action( 'bp_init', '_bp_maybe_remove_redirect_canonical' );
  *
  * @since BuddyPress (1.6.1)
  *
- * @link http://buddypress.trac.wordpress.org/ticket/4329
- * @link http://buddypress.trac.wordpress.org/ticket/4415
+ * @link https://buddypress.trac.wordpress.org/ticket/4329
+ * @link https://buddypress.trac.wordpress.org/ticket/4415
  */
 function _bp_rehook_maybe_redirect_404() {
 	if ( defined( 'NOBLOGREDIRECT' ) ) {
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
index 897749478f57fb3a5f21fc0ebfc0d61a97ea0ba7..41be0654d5003d08960c0fb1e6a0f5ed121010de 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php
@@ -7,2694 +7,19 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
-
-/**
- * BuddyPress User Query class.
- *
- * Used for querying users in a BuddyPress context, in situations where
- * WP_User_Query won't do the trick: Member directories, the Friends component,
- * etc.
- *
- * @since BuddyPress (1.7.0)
- *
- * @param array $query {
- *     Query arguments. All items are optional.
- *     @type string $type Determines sort order. Select from 'newest', 'active',
- *           'online', 'random', 'popular', 'alphabetical'. Default: 'newest'.
- *     @type int $per_page Number of results to return. Default: 0 (no limit).
- *     @type int $page Page offset (together with $per_page). Default: 1.
- *     @type int $user_id ID of a user. If present, and if the friends
- *           component is activated, results will be limited to the friends of
- *           that user. Default: 0.
- *     @type string|bool $search_terms Terms to search by. Search happens
- *           across xprofile fields. Requires XProfile component.
- *           Default: false.
- *     @type string $search_wildcard When searching with $search_terms,
- *           set where wildcards around the term should be positioned.
- *           Default: 'both'. Other values: 'left', 'right'.
- *     @type array|string|bool $include An array or comma-separated list of
- *           user IDs to which query should be limited.
- *           Default: false.
- *     @type array|string|bool $exclude An array or comma-separated list of
- *           user IDs that will be excluded from query results. Default: false.
- *     @type array|string|bool $user_ids An array or comma-separated list of
- *           IDs corresponding to the users that should be returned. When this
- *           parameter is passed, it will override all others; BP User objects
- *           will be constructed using these IDs only. Default: false.
- *     @type string|bool $meta_key Limit results to users that have usermeta
- *           associated with this meta_key. Usually used with $meta_value.
- *           Default: false.
- *     @type string|bool $meta_value When used with $meta_key, limits results
- *           to users whose usermeta value associated with $meta_key matches
- *           $meta_value. Default: false.
- *     @type bool $populate_extras True if you want to fetch extra metadata
- *           about returned users, such as total group and friend counts.
- *     @type string $count_total Determines how BP_User_Query will do a count
- *           of total users matching the other filter criteria. Default value
- *           is 'count_query', which does a separate SELECT COUNT query to
- *           determine the total. 'sql_count_found_rows' uses
- *           SQL_COUNT_FOUND_ROWS and SELECT FOUND_ROWS(). Pass an empty string
- *           to skip the total user count query.
- * }
- */
-class BP_User_Query {
-
-	/** Variables *************************************************************/
-
-	/**
-	 * Unaltered params as passed to the constructor.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @var array
-	 */
-	public $query_vars_raw = array();
-
-	/**
-	 * Array of variables to query with.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 * @var array
-	 */
-	public $query_vars = array();
-
-	/**
-	 * List of found users and their respective data.
-	 *
-	 * @access public To allow components to manipulate them.
-	 * @since BuddyPress (1.7.0)
-	 * @var array
-	 */
-	public $results = array();
-
-	/**
-	 * Total number of found users for the current query.
-	 *
-	 * @access public To allow components to manipulate it.
-	 * @since BuddyPress (1.7.0)
-	 * @var int
-	 */
-	public $total_users = 0;
-
-	/**
-	 * List of found user IDs.
-	 *
-	 * @access public To allow components to manipulate it.
-	 * @since BuddyPress (1.7.0)
-	 * @var array
-	 */
-	public $user_ids = array();
-
-	/**
-	 * SQL clauses for the user ID query.
-	 *
-	 * @access public To allow components to manipulate it.
-	 * @since BuddyPress (1.7.0)
-	 * @var array
-	 */
-	public $uid_clauses = array();
-
-	/**
-	 * SQL database column name to order by.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 * @var string
-	 */
-	public $uid_name = '';
-
-	/**
-	 * Standard response when the query should not return any rows.
-	 *
-	 * @access protected
-	 * @since BuddyPress (1.7.0)
-	 * @var string
-	 */
-	protected $no_results = array( 'join' => '', 'where' => '0 = 1' );
-
-
-	/** Methods ***************************************************************/
-
-	/**
-	 * Constructor.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 *
-	 * @param string|array $query See {@link BP_User_Query}.
-	 */
-	public function __construct( $query = null ) {
-
-		// Store the raw query vars for later access
-		$this->query_vars_raw = $query;
-
-		// Allow extending classes to register action/filter hooks
-		$this->setup_hooks();
-
-		if ( ! empty( $this->query_vars_raw ) ) {
-			$this->query_vars = wp_parse_args( $this->query_vars_raw, array(
-				'type'            => 'newest',
-				'per_page'        => 0,
-				'page'            => 1,
-				'user_id'         => 0,
-				'search_terms'    => false,
-				'search_wildcard' => 'both',
-				'include'         => false,
-				'exclude'         => false,
-				'user_ids'        => false,
-				'meta_key'        => false,
-				'meta_value'      => false,
-				'populate_extras' => true,
-				'count_total'     => 'count_query'
-			) );
-
-			// Plugins can use this filter to modify query args
-			// before the query is constructed
-			do_action_ref_array( 'bp_pre_user_query_construct', array( &$this ) );
-
-			// Get user ids
-			// If the user_ids param is present, we skip the query
-			if ( false !== $this->query_vars['user_ids'] ) {
-				$this->user_ids = wp_parse_id_list( $this->query_vars['user_ids'] );
-			} else {
-				$this->prepare_user_ids_query();
-				$this->do_user_ids_query();
-			}
-		}
-
-		// Bail if no user IDs were found
-		if ( empty( $this->user_ids ) ) {
-			return;
-		}
-
-		// Fetch additional data. First, using WP_User_Query
-		$this->do_wp_user_query();
-
-		// Get BuddyPress specific user data
-		$this->populate_extras();
-	}
-
-	/**
-	 * Allow extending classes to set up action/filter hooks.
-	 *
-	 * When extending BP_User_Query, you may need to use some of its
-	 * internal hooks to modify the output. It's not convenient to call
-	 * add_action() or add_filter() in your class constructor, because
-	 * BP_User_Query::__construct() contains a fair amount of logic that
-	 * you may not want to override in your class. Define this method in
-	 * your own class if you need a place where your extending class can
-	 * add its hooks early in the query-building process. See
-	 * {@link BP_Group_Member_Query::setup_hooks()} for an example.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function setup_hooks() {}
-
-	/**
-	 * Prepare the query for user_ids.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 */
-	public function prepare_user_ids_query() {
-		global $wpdb, $bp;
-
-		// Default query variables used here
-		$type         = '';
-		$per_page     = 0;
-		$page         = 1;
-		$user_id      = 0;
-		$include      = false;
-		$search_terms = false;
-		$exclude      = false;
-		$meta_key     = false;
-		$meta_value   = false;
-
-		extract( $this->query_vars );
-
-		// Setup the main SQL query container
-		$sql = array(
-			'select'  => '',
-			'where'   => array(),
-			'orderby' => '',
-			'order'   => '',
-			'limit'   => ''
-		);
-
-		/** TYPE **************************************************************/
-
-		// Determines the sort order, which means it also determines where the
-		// user IDs are drawn from (the SELECT and WHERE statements)
-		switch ( $type ) {
-
-			// 'online' query happens against the last_activity usermeta key
-			// Filter 'bp_user_query_online_interval' to modify the
-			// number of minutes used as an interval
-			case 'online' :
-				$this->uid_name = 'user_id';
-				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$bp->members->table_name_last_activity} u";
-				$sql['where'][] = $wpdb->prepare( "u.component = %s AND u.type = 'last_activity'", buddypress()->members->id );
-				$sql['where'][] = $wpdb->prepare( "u.date_recorded >= DATE_SUB( UTC_TIMESTAMP(), INTERVAL %d MINUTE )", apply_filters( 'bp_user_query_online_interval', 15 ) );
-				$sql['orderby'] = "ORDER BY u.date_recorded";
-				$sql['order']   = "DESC";
-
-				break;
-
-			// 'active', 'newest', and 'random' queries
-			// all happen against the last_activity usermeta key
-			case 'active' :
-			case 'newest' :
-			case 'random' :
-				$this->uid_name = 'user_id';
-				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$bp->members->table_name_last_activity} u";
-				$sql['where'][] = $wpdb->prepare( "u.component = %s AND u.type = 'last_activity'", buddypress()->members->id );
-
-				if ( 'newest' == $type ) {
-					$sql['orderby'] = "ORDER BY u.user_id";
-					$sql['order'] = "DESC";
-				} else if ( 'random' == $type ) {
-					$sql['orderby'] = "ORDER BY rand()";
-				} else {
-					$sql['orderby'] = "ORDER BY u.date_recorded";
-					$sql['order'] = "DESC";
-				}
-
-				break;
-
-			// 'popular' sorts by the 'total_friend_count' usermeta
-			case 'popular' :
-				$this->uid_name = 'user_id';
-				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u";
-				$sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
-				$sql['orderby'] = "ORDER BY CONVERT(u.meta_value, SIGNED)";
-				$sql['order']   = "DESC";
-
-				break;
-
-			// 'alphabetical' sorts depend on the xprofile setup
-			case 'alphabetical' :
-
-				// We prefer to do alphabetical sorts against the display_name field
-				// of wp_users, because the table is smaller and better indexed. We
-				// can do so if xprofile sync is enabled, or if xprofile is inactive.
-				//
-				// @todo remove need for bp_is_active() check
-				if ( ! bp_disable_profile_sync() || ! bp_is_active( 'xprofile' ) ) {
-					$this->uid_name = 'ID';
-					$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$wpdb->users} u";
-					$sql['orderby'] = "ORDER BY u.display_name";
-					$sql['order']   = "ASC";
-
-				// When profile sync is disabled, alphabetical sorts must happen against
-				// the xprofile table
-				} else {
-					$this->uid_name = 'user_id';
-					$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$bp->profile->table_name_data} u";
-					$sql['where'][] = $wpdb->prepare( "u.field_id = %d", bp_xprofile_fullname_field_id() );
-					$sql['orderby'] = "ORDER BY u.value";
-					$sql['order']   = "ASC";
-				}
-
-				// Alphabetical queries ignore last_activity, while BP uses last_activity
-				// to infer spam/deleted/non-activated users. To ensure that these users
-				// are filtered out, we add an appropriate sub-query.
-				$sql['where'][] = "u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE " . bp_core_get_status_sql( '' ) . " )";
-
-				break;
-
-			// Any other 'type' falls through
-			default :
-				$this->uid_name = 'ID';
-				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$wpdb->users} u";
-
-				// In this case, we assume that a plugin is
-				// handling order, so we leave those clauses
-				// blank
-
-				break;
-		}
-
-		/** WHERE *************************************************************/
-
-		// 'include' - User ids to include in the results
-		$include     = false !== $include ? wp_parse_id_list( $include ) : array();
-		$include_ids = $this->get_include_ids( $include );
-		if ( ! empty( $include_ids ) ) {
-			$include_ids    = implode( ',', wp_parse_id_list( $include_ids ) );
-			$sql['where'][] = "u.{$this->uid_name} IN ({$include_ids})";
-		}
-
-		// 'exclude' - User ids to exclude from the results
-		if ( false !== $exclude ) {
-			$exclude_ids    = implode( ',', wp_parse_id_list( $exclude ) );
-			$sql['where'][] = "u.{$this->uid_name} NOT IN ({$exclude_ids})";
-		}
-
-		// 'user_id' - When a user id is passed, limit to the friends of the user
-		// @todo remove need for bp_is_active() check
-		if ( ! empty( $user_id ) && bp_is_active( 'friends' ) ) {
-			$friend_ids = friends_get_friend_user_ids( $user_id );
-			$friend_ids = implode( ',', wp_parse_id_list( $friend_ids ) );
-
-			if ( ! empty( $friend_ids ) ) {
-				$sql['where'][] = "u.{$this->uid_name} IN ({$friend_ids})";
-
-			// If the user has no friends, the query should always
-			// return no users
-			} else {
-				$sql['where'][] = $this->no_results['where'];
-			}
-		}
-
-		/** Search Terms ******************************************************/
-
-		// 'search_terms' searches user_login and user_nicename
-		// xprofile field matches happen in bp_xprofile_bp_user_query_search()
-		if ( false !== $search_terms ) {
-			$search_terms = bp_esc_like( wp_kses_normalize_entities( $search_terms ) );
-
-			if ( $search_wildcard === 'left' ) {
-				$search_terms_nospace = '%' . $search_terms;
-				$search_terms_space   = '%' . $search_terms . ' %';
-			} elseif ( $search_wildcard === 'right' ) {
-				$search_terms_nospace =        $search_terms . '%';
-				$search_terms_space   = '% ' . $search_terms . '%';
-			} else {
-				$search_terms_nospace = '%' . $search_terms . '%';
-				$search_terms_space   = '%' . $search_terms . '%';
-			}
-
-			$sql['where']['search'] = $wpdb->prepare(
-				"u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE ( user_login LIKE %s OR user_login LIKE %s OR user_nicename LIKE %s OR user_nicename LIKE %s ) )",
-				$search_terms_nospace,
-				$search_terms_space,
-				$search_terms_nospace,
-				$search_terms_space
-			);
-		}
-
-		// 'meta_key', 'meta_value' allow usermeta search
-		// To avoid global joins, do a separate query
-		if ( false !== $meta_key ) {
-			$meta_sql = $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = %s", $meta_key );
-
-			if ( false !== $meta_value ) {
-				$meta_sql .= $wpdb->prepare( " AND meta_value = %s", $meta_value );
-			}
-
-			$found_user_ids = $wpdb->get_col( $meta_sql );
-
-			if ( ! empty( $found_user_ids ) ) {
-				$sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")";
-			}
-		}
-
-		// 'per_page', 'page' - handles LIMIT
-		if ( !empty( $per_page ) && !empty( $page ) ) {
-			$sql['limit'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
-		} else {
-			$sql['limit'] = '';
-		}
-
-		// Allow custom filters
-		$sql = apply_filters_ref_array( 'bp_user_query_uid_clauses', array( $sql, &$this ) );
-
-		// Assemble the query chunks
-		$this->uid_clauses['select']  = $sql['select'];
-		$this->uid_clauses['where']   = ! empty( $sql['where'] ) ? 'WHERE ' . implode( ' AND ', $sql['where'] ) : '';
-		$this->uid_clauses['orderby'] = $sql['orderby'];
-		$this->uid_clauses['order']   = $sql['order'];
-		$this->uid_clauses['limit']   = $sql['limit'];
-
-		do_action_ref_array( 'bp_pre_user_query', array( &$this ) );
-	}
-
-	/**
-	 * Query for IDs of users that match the query parameters.
-	 *
-	 * Perform a database query to specifically get only user IDs, using
-	 * existing query variables set previously in the constructor.
-	 *
-	 * Also used to quickly perform user total counts.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 */
-	public function do_user_ids_query() {
-		global $wpdb;
-
-		// If counting using SQL_CALC_FOUND_ROWS, set it up here
-		if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) {
-			$this->uid_clauses['select'] = str_replace( 'SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $this->uid_clauses['select'] );
-		}
-
-		// Get the specific user ids
-		$this->user_ids = $wpdb->get_col( "{$this->uid_clauses['select']} {$this->uid_clauses['where']} {$this->uid_clauses['orderby']} {$this->uid_clauses['order']} {$this->uid_clauses['limit']}" );
-
-		// Get the total user count
-		if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) {
-			$this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "SELECT FOUND_ROWS()", $this ) );
-		} elseif ( 'count_query' == $this->query_vars['count_total'] ) {
-			$count_select      = preg_replace( '/^SELECT.*?FROM (\S+) u/', "SELECT COUNT(u.{$this->uid_name}) FROM $1 u", $this->uid_clauses['select'] );
-			$this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "{$count_select} {$this->uid_clauses['where']}", $this ) );
-		}
-	}
-
-	/**
-	 * Use WP_User_Query() to pull data for the user IDs retrieved in the main query.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 */
-	public function do_wp_user_query() {
-		$fields = array( 'ID', 'user_login', 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_activation_key', 'user_status', 'display_name' );
-
-		if ( is_multisite() ) {
-			$fields[] = 'spam';
-			$fields[] = 'deleted';
-		}
-
-		$wp_user_query = new WP_User_Query( apply_filters( 'bp_wp_user_query_args', array(
-
-			// Relevant
-			'fields'      => $fields,
-			'include'     => $this->user_ids,
-
-			// Overrides
-			'blog_id'     => 0,    // BP does not require blog roles
-			'count_total' => false // We already have a count
-
-		), $this ) );
-
-		// WP_User_Query doesn't cache the data it pulls from wp_users,
-		// and it does not give us a way to save queries by fetching
-		// only uncached users. However, BP does cache this data, so
-		// we set it here.
-		foreach ( $wp_user_query->results as $u ) {
-			wp_cache_set( 'bp_core_userdata_' . $u->ID, $u, 'bp' );
-		}
-
-		// We calculate total_users using a standalone query, except
-		// when a whitelist of user_ids is passed to the constructor.
-		// This clause covers the latter situation, and ensures that
-		// pagination works when querying by $user_ids.
-		if ( empty( $this->total_users ) ) {
-			$this->total_users = count( $wp_user_query->results );
-		}
-
-		// Reindex for easier matching
-		$r = array();
-		foreach ( $wp_user_query->results as $u ) {
-			$r[ $u->ID ] = $u;
-		}
-
-		// Match up to the user ids from the main query
-		foreach ( $this->user_ids as $uid ) {
-			if ( isset( $r[ $uid ] ) ) {
-				$this->results[ $uid ] = $r[ $uid ];
-
-				// The BP template functions expect an 'id'
-				// (as opposed to 'ID') property
-				$this->results[ $uid ]->id = $uid;
-			}
-		}
-	}
-
-	/**
-	 * Fetch the IDs of users to put in the IN clause of the main query.
-	 *
-	 * By default, returns the value passed to it
-	 * ($this->query_vars['include']). Having this abstracted into a
-	 * standalone method means that extending classes can override the
-	 * logic, parsing together their own user_id limits with the 'include'
-	 * ids passed to the class constructor. See {@link BP_Group_Member_Query}
-	 * for an example.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param array Sanitized array of user IDs, as passed to the 'include'
-	 *        parameter of the class constructor.
-	 * @return array The list of users to which the main query should be
-	 *         limited.
-	 */
-	public function get_include_ids( $include = array() ) {
-		return $include;
-	}
-
-	/**
-	 * Perform a database query to populate any extra metadata we might need.
-	 *
-	 * Different components will hook into the 'bp_user_query_populate_extras'
-	 * action to loop in the things they want.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 *
-	 * @global BuddyPress $bp Global BuddyPress settings object.
-	 * @global WPDB $wpdb Global WordPress database access object.
-	 */
-	public function populate_extras() {
-		global $wpdb;
-
-		// Bail if no users
-		if ( empty( $this->user_ids ) || empty( $this->results ) ) {
-			return;
-		}
-
-		// Bail if the populate_extras flag is set to false
-		// In the case of the 'popular' sort type, we force
-		// populate_extras to true, because we need the friend counts
-		if ( 'popular' == $this->query_vars['type'] ) {
-			$this->query_vars['populate_extras'] = 1;
-		}
-
-		if ( ! (bool) $this->query_vars['populate_extras'] ) {
-			return;
-		}
-
-		// Turn user ID's into a query-usable, comma separated value
-		$user_ids_sql = implode( ',', wp_parse_id_list( $this->user_ids ) );
-
-		$bp = buddypress();
-
-		/**
-		 * Use this action to independently populate your own custom extras.
-		 *
-		 * Note that anything you add here should query using $user_ids_sql, to
-		 * avoid running multiple queries per user in the loop.
-		 *
-		 * Two BuddyPress components currently do this:
-		 * - XProfile: To override display names
-		 * - Friends:  To set whether or not a user is the current users friend
-		 *
-		 * @see bp_xprofile_filter_user_query_populate_extras()
-		 * @see bp_friends_filter_user_query_populate_extras()
-		 */
-		do_action_ref_array( 'bp_user_query_populate_extras', array( $this, $user_ids_sql ) );
-
-		// Fetch last_active data from the activity table
-		$last_activities = BP_Core_User::get_last_activity( $this->user_ids );
-
-		// Set a last_activity value for each user, even if it's empty
-		foreach ( $this->results as $user_id => $user ) {
-			$user_last_activity = isset( $last_activities[ $user_id ] ) ? $last_activities[ $user_id ]['date_recorded'] : '';
-			$this->results[ $user_id ]->last_activity = $user_last_activity;
-		}
-
-		// Fetch usermeta data
-		// We want the three following pieces of info from usermeta:
-		// - friend count
-		// - latest update
-		$total_friend_count_key = bp_get_user_meta_key( 'total_friend_count' );
-		$bp_latest_update_key   = bp_get_user_meta_key( 'bp_latest_update'   );
-
-		// total_friend_count must be set for each user, even if its
-		// value is 0
-		foreach ( $this->results as $uindex => $user ) {
-			$this->results[$uindex]->total_friend_count = 0;
-		}
-
-		// Create, prepare, and run the seperate usermeta query
-		$user_metas = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, meta_key, meta_value FROM {$wpdb->usermeta} WHERE meta_key IN (%s,%s) AND user_id IN ({$user_ids_sql})", $total_friend_count_key, $bp_latest_update_key ) );
-
-		// The $members_template global expects the index key to be different
-		// from the meta_key in some cases, so we rejig things here.
-		foreach ( $user_metas as $user_meta ) {
-			switch ( $user_meta->meta_key ) {
-				case $total_friend_count_key :
-					$key = 'total_friend_count';
-					break;
-
-				case $bp_latest_update_key :
-					$key = 'latest_update';
-					break;
-			}
-
-			if ( isset( $this->results[ $user_meta->user_id ] ) ) {
-				$this->results[ $user_meta->user_id ]->{$key} = $user_meta->meta_value;
-			}
-		}
-
-		// When meta_key or meta_value have been passed to the query,
-		// fetch the resulting values for use in the template functions
-		if ( ! empty( $this->query_vars['meta_key'] ) ) {
-			$meta_sql = array(
-				'select' => "SELECT user_id, meta_key, meta_value",
-				'from'   => "FROM $wpdb->usermeta",
-				'where'  => $wpdb->prepare( "WHERE meta_key = %s", $this->query_vars['meta_key'] )
-			);
-
-			if ( false !== $this->query_vars['meta_value'] ) {
-				$meta_sql['where'] .= $wpdb->prepare( " AND meta_value = %s", $this->query_vars['meta_value'] );
-			}
-
-			$metas = $wpdb->get_results( "{$meta_sql['select']} {$meta_sql['from']} {$meta_sql['where']}" );
-
-			if ( ! empty( $metas ) ) {
-				foreach ( $metas as $meta ) {
-					if ( isset( $this->results[ $meta->user_id ] ) ) {
-						$this->results[ $meta->user_id ]->meta_key = $meta->meta_key;
-
-						if ( ! empty( $meta->meta_value ) ) {
-							$this->results[ $meta->user_id ]->meta_value = $meta->meta_value;
-						}
-					}
-				}
-			}
-		}
-	}
-}
-
-/**
- * Fetch data about a BuddyPress user.
- *
- * BP_Core_User class can be used by any component. It will fetch useful
- * details for any user when provided with a user_id.
- *
- * Example:
- *    $user = new BP_Core_User( $user_id );
- *    $user_avatar = $user->avatar;
- *	  $user_email = $user->email;
- *    $user_status = $user->status;
- *    etc.
- */
-class BP_Core_User {
-
-	/**
-	 * ID of the user which the object relates to.
-	 *
-	 * @var integer
-	 */
-	public $id;
-
-	/**
-	 * The URL to the full size of the avatar for the user.
-	 *
-	 * @var string
-	 */
-	public $avatar;
-
-	/**
-	 * The URL to the thumb size of the avatar for the user.
-	 *
-	 * @var string
-	 */
-	public $avatar_thumb;
-
-	/**
-	 * The URL to the mini size of the avatar for the user.
-	 *
-	 * @var string
-	 */
-	public $avatar_mini;
-
-	/**
-	 * The full name of the user
-	 *
-	 * @var string
-	 */
-	public $fullname;
-
-	/**
-	 * The email for the user.
-	 *
-	 * @var string
-	 */
-	public $email;
-
-	/**
-	 * The absolute url for the user's profile.
-	 *
-	 * @var string
-	 */
-	public $user_url;
-
-	/**
-	 * The HTML for the user link, with the link text being the user's full name.
-	 *
-	 * @var string
-	 */
-	public $user_link;
-
-	/**
-	 * Contains a formatted string when the last time the user was active.
-	 *
-	 * Example: "active 2 hours and 50 minutes ago"
-	 *
-	 * @var string
-	 */
-	public $last_active;
-
-	/* Extras */
-
-	/**
-	 * The total number of "Friends" the user has on site.
-	 *
-	 * @var integer
-	 */
-	public $total_friends;
-
-	/**
-	 * The total number of blog posts posted by the user
-	 *
-	 * @var integer
-	 * @deprecated No longer used
-	 */
-	public $total_blogs;
-
-	/**
-	 * The total number of groups the user is a part of.
-	 *
-	 * Example: "1 group", "2 groups"
-	 *
-	 * @var string
-	 */
-	public $total_groups;
-
-	/**
-	 * Profile information for the specific user.
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var array
-	 */
-	public $profile_data;
-
-	/** Public Methods *******************************************************/
-
-	/**
-	 * Class constructor.
-	 *
-	 * @param integer $user_id The ID for the user being queried.
-	 * @param bool $populate_extras Whether to fetch extra information
-	 *        such as group/friendship counts or not. Default: false.
-	 */
-	public function __construct( $user_id, $populate_extras = false ) {
-		if ( !empty( $user_id ) ) {
-			$this->id = $user_id;
-			$this->populate();
-
-			if ( !empty( $populate_extras ) ) {
-				$this->populate_extras();
-			}
-		}
-	}
-
-	/**
-	 * Populate the instantiated class with data based on the User ID provided.
-	 *
-	 * @uses bp_core_get_userurl() Returns the URL with no HTML markup for
-	 *       a user based on their user id.
-	 * @uses bp_core_get_userlink() Returns a HTML formatted link for a
-	 *       user with the user's full name as the link text.
-	 * @uses bp_core_get_user_email() Returns the email address for the
-	 *       user based on user ID.
-	 * @uses bp_get_user_meta() BP function returns the value of passed
-	 *       usermeta name from usermeta table.
-	 * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user
-	 * @uses bp_profile_last_updated_date() Returns the last updated date
-	 *       for a user.
-	 */
-	public function populate() {
-
-		if ( bp_is_active( 'xprofile' ) )
-			$this->profile_data = $this->get_profile_data();
-
-		if ( !empty( $this->profile_data ) ) {
-			$full_name_field_name = bp_xprofile_fullname_field_name();
-
-			$this->user_url  = bp_core_get_user_domain( $this->id, $this->profile_data['user_nicename'], $this->profile_data['user_login'] );
-			$this->fullname  = esc_attr( $this->profile_data[$full_name_field_name]['field_data'] );
-			$this->user_link = "<a href='{$this->user_url}' title='{$this->fullname}'>{$this->fullname}</a>";
-			$this->email     = esc_attr( $this->profile_data['user_email'] );
-		} else {
-			$this->user_url  = bp_core_get_user_domain( $this->id );
-			$this->user_link = bp_core_get_userlink( $this->id );
-			$this->fullname  = esc_attr( bp_core_get_user_displayname( $this->id ) );
-			$this->email     = esc_attr( bp_core_get_user_email( $this->id ) );
-		}
-
-		// Cache a few things that are fetched often
-		wp_cache_set( 'bp_user_fullname_' . $this->id, $this->fullname, 'bp' );
-		wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
-		wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
-
-		$this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
-		$this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
-		$this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) );
-		$this->last_active  = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), __( 'active %s', 'buddypress' ) );
-	}
-
-	/**
-	 * Populates extra fields such as group and friendship counts.
-	 */
-	public function populate_extras() {
-
-		if ( bp_is_active( 'friends' ) ) {
-			$this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id );
-		}
-
-		if ( bp_is_active( 'groups' ) ) {
-			$this->total_groups = BP_Groups_Member::total_group_count( $this->id );
-			$this->total_groups = sprintf( _n( '%d group', '%d groups', $this->total_groups, 'buddypress' ), $this->total_groups );
-		}
-	}
-
-	/**
-	 * Fetch xprofile data for the current user.
-	 *
-	 * @see BP_XProfile_ProfileData::get_all_for_user() for description of
-	 *      return value.
-	 *
-	 * @return array See {@link BP_XProfile_Profile_Data::get_all_for_user()}.
-	 */
-	public function get_profile_data() {
-		return BP_XProfile_ProfileData::get_all_for_user( $this->id );
-	}
-
-	/** Static Methods ********************************************************/
-
-	/**
-	 * Get a list of users that match the query parameters.
-	 *
-	 * Since BuddyPress 1.7, use {@link BP_User_Query} instead.
-	 *
-	 * @deprecated 1.7.0 Use {@link BP_User_Query}.
-	 *
-	 * @see BP_User_Query for a description of parameters, most of which
-	 *      are used there in the same way.
-	 *
-	 * @param string $type See {@link BP_User_Query}.
-	 * @param int $limit See {@link BP_User_Query}. Default: 0.
-	 * @param int $page See {@link BP_User_Query}. Default: 1.
-	 * @param int $user_id See {@link BP_User_Query}. Default: 0.
-	 * @param mixed $include See {@link BP_User_Query}. Default: false.
-	 * @param string|bool $search_terms See {@link BP_User_Query}.
-	 *        Default: false.
-	 * @param bool $populate_extras See {@link BP_User_Query}.
-	 *        Default: true.
-	 * @param mixed $exclude See {@link BP_User_Query}. Default: false.
-	 * @param string|bool $meta_key See {@link BP_User_Query}.
-	 *        Default: false.
-	 * @param string|bool $meta_value See {@link BP_User_Query}.
-	 *        Default: false.
-	 * @return array {
-	 *     @type int $total_users Total number of users matched by query
-	 *           params.
-	 *     @type array $paged_users The current page of users matched by
-	 *           query params.
-	 * }
-	 */
-	public static function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
-		global $wpdb, $bp;
-
-		_deprecated_function( __METHOD__, '1.7', 'BP_User_Query' );
-
-		$sql = array();
-
-		$sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
-
-		if ( 'active' == $type || 'online' == $type || 'newest' == $type  ) {
-			$sql['select_active'] = ", um.meta_value as last_activity";
-		}
-
-		if ( 'popular' == $type ) {
-			$sql['select_popular'] = ", um.meta_value as total_friend_count";
-		}
-
-		if ( 'alphabetical' == $type ) {
-			$sql['select_alpha'] = ", pd.value as fullname";
-		}
-
-		if ( $meta_key ) {
-			$sql['select_meta'] = ", umm.meta_key";
-
-			if ( $meta_value ) {
-				$sql['select_meta'] .= ", umm.meta_value";
-			}
-		}
-
-		$sql['from'] = "FROM {$wpdb->users} u LEFT JOIN {$wpdb->usermeta} um ON um.user_id = u.ID";
-
-		// We search against xprofile fields, so we must join the table
-		if ( $search_terms && bp_is_active( 'xprofile' ) ) {
-			$sql['join_profiledata_search'] = "LEFT JOIN {$bp->profile->table_name_data} spd ON u.ID = spd.user_id";
-		}
-
-		// Alphabetical sorting is done by the xprofile Full Name field
-		if ( 'alphabetical' == $type ) {
-			$sql['join_profiledata_alpha'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
-		}
-
-		if ( $meta_key ) {
-			$sql['join_meta'] = "LEFT JOIN {$wpdb->usermeta} umm ON umm.user_id = u.ID";
-		}
-
-		$sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );
-
-		if ( 'active' == $type || 'online' == $type || 'newest' == $type ) {
-			$sql['where_active'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) );
-		}
-
-		if ( 'popular' == $type ) {
-			$sql['where_popular'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
-		}
-
-		if ( 'online' == $type ) {
-			$sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()";
-		}
-
-		if ( 'alphabetical' == $type ) {
-			$sql['where_alpha'] = "AND pd.field_id = 1";
-		}
-
-		if ( !empty( $exclude ) ) {
-			$exclude              = implode( ',', wp_parse_id_list( $exclude ) );
-			$sql['where_exclude'] = "AND u.ID NOT IN ({$exclude})";
-		}
-
-		// Passing an $include value of 0 or '0' will necessarily result in an empty set
-		// returned. The default value of false will hit the 'else' clause.
-		if ( 0 === $include || '0' === $include ) {
-			$sql['where_users'] = "AND 0 = 1";
-		} else {
-			if ( !empty( $include ) ) {
-				$include = implode( ',',  wp_parse_id_list( $include ) );
-				$sql['where_users'] = "AND u.ID IN ({$include})";
-			} elseif ( !empty( $user_id ) && bp_is_active( 'friends' ) ) {
-				$friend_ids = friends_get_friend_user_ids( $user_id );
-
-				if ( !empty( $friend_ids ) ) {
-					$friend_ids = implode( ',', wp_parse_id_list( $friend_ids ) );
-					$sql['where_friends'] = "AND u.ID IN ({$friend_ids})";
-
-				// User has no friends, return false since there will be no users to fetch.
-				} else {
-					return false;
-				}
-			}
-		}
-
-		if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) {
-			$search_terms_like        = '%' . bp_esc_like( $search_terms ) . '%';
-			$sql['where_searchterms'] = $wpdb->prepare( "AND spd.value LIKE %s", $search_terms_like );
-		}
-
-		if ( !empty( $meta_key ) ) {
-			$sql['where_meta'] = $wpdb->prepare( " AND umm.meta_key = %s", $meta_key );
-
-			// If a meta value is provided, match it
-			if ( $meta_value ) {
-				$sql['where_meta'] .= $wpdb->prepare( " AND umm.meta_value = %s", $meta_value );
-			}
-		}
-
-		switch ( $type ) {
-			case 'active': case 'online': default:
-				$sql[] = "ORDER BY um.meta_value DESC";
-				break;
-			case 'newest':
-				$sql[] = "ORDER BY u.ID DESC";
-				break;
-			case 'alphabetical':
-				$sql[] = "ORDER BY pd.value ASC";
-				break;
-			case 'random':
-				$sql[] = "ORDER BY rand()";
-				break;
-			case 'popular':
-				$sql[] = "ORDER BY CONVERT(um.meta_value, SIGNED) DESC";
-				break;
-		}
-
-		if ( !empty( $limit ) && !empty( $page ) ) {
-			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		// Get paginated results
-		$paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array) $sql ), $sql );
-		$paged_users     = $wpdb->get_results( $paged_users_sql );
-
-		// Re-jig the SQL so we can get the total user count
-		unset( $sql['select_main'] );
-
-		if ( !empty( $sql['select_active'] ) ) {
-			unset( $sql['select_active'] );
-		}
-
-		if ( !empty( $sql['select_popular'] ) ) {
-			unset( $sql['select_popular'] );
-		}
-
-		if ( !empty( $sql['select_alpha'] ) ) {
-			unset( $sql['select_alpha'] );
-		}
-
-		if ( !empty( $sql['pagination'] ) ) {
-			unset( $sql['pagination'] );
-		}
-
-		array_unshift( $sql, "SELECT COUNT(u.ID)" );
-
-		// Get total user results
-		$total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array) $sql ), $sql );
-		$total_users     = $wpdb->get_var( $total_users_sql );
-
-		/***
-		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
-		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
-		 */
-		if ( !empty( $populate_extras ) ) {
-			$user_ids = array();
-
-			foreach ( (array) $paged_users as $user ) {
-				$user_ids[] = $user->id;
-			}
-
-			// Add additional data to the returned results
-			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids, $type );
-		}
-
-		return array( 'users' => $paged_users, 'total' => $total_users );
-	}
-
-
-	/**
-	 * Fetch the details for all users whose usernames start with the given letter.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param string $letter The letter the users names are to start with.
-	 * @param int $limit The number of users we wish to retrive.
-	 * @param int $page The page number we are currently on, used in
-	 *        conjunction with $limit to get the start position for the
-	 *        limit.
-	 * @param bool $populate_extras Populate extra user fields?
-	 * @param string $exclude Comma-separated IDs of users whose results
-	 *        aren't to be fetched.
-	 * @return mixed False on error, otherwise associative array of results.
-	 */
-	public static function get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true, $exclude = '' ) {
-		global $bp, $wpdb;
-
-		$pag_sql = '';
-		if ( $limit && $page ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		// Multibyte compliance
-		if ( function_exists( 'mb_strlen' ) ) {
-			if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) {
-				return false;
-			}
-		} else {
-			if ( strlen( $letter ) > 1 || is_numeric( $letter ) || !$letter ) {
-				return false;
-			}
-		}
-
-		$letter_like = bp_esc_like( $letter ) . '%';
-		$status_sql  = bp_core_get_status_sql( 'u.' );
-
-		if ( !empty( $exclude ) ) {
-			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
-			$exclude_sql = " AND u.id NOT IN ({$exclude})";
-		} else {
-			$exclude_sql = '';
-		}
-
-		$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", bp_xprofile_fullname_field_name(), $letter_like ) );
-		$paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name(), $letter_like ) );
-
-		$total_users = $wpdb->get_var( $total_users_sql );
-		$paged_users = $wpdb->get_results( $paged_users_sql );
-
-		/***
-		 * Lets fetch some other useful data in a separate queries, this will be
-		 * faster than querying the data for every user in a list. We can't add
-		 * these to the main query above since only users who have this
-		 * information will be returned (since the much of the data is in
-		 * usermeta and won't support any type of directional join)
-		 */
-		$user_ids = array();
-		foreach ( (array) $paged_users as $user )
-			$user_ids[] = (int) $user->id;
-
-		// Add additional data to the returned results
-		if ( $populate_extras ) {
-			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
-		}
-
-		return array( 'users' => $paged_users, 'total' => $total_users );
-	}
-
-	/**
-	 * Get details of specific users from the database.
-	 *
-	 * Use {@link BP_User_Query} with the 'user_ids' param instead.
-	 *
-	 * @global wpdb $wpdb WordPress database object.
-	 * @param array $user_ids The user IDs of the users who we wish to
-	 *        fetch information on.
-	 * @param int $limit The limit of results we want.
-	 * @param int $page The page we are on for pagination.
-	 * @param bool $populate_extras Populate extra user fields?
-	 * @return array Associative array.
-	 */
-	public static function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
-		global $wpdb;
-
-		$pag_sql = '';
-		if ( $limit && $page )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		$user_ids   = implode( ',', wp_parse_id_list( $user_ids ) );
-		$status_sql = bp_core_get_status_sql();
-
-		$total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ({$user_ids})" );
-		$paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ({$user_ids}) {$pag_sql}" );
-
-		$total_users = $wpdb->get_var( $total_users_sql );
-		$paged_users = $wpdb->get_results( $paged_users_sql );
-
-		/***
-		 * Lets fetch some other useful data in a separate queries, this will be
-		 * faster than querying the data for every user in a list. We can't add
-		 * these to the main query above since only users who have this
-		 * information will be returned (since the much of the data is in
-		 * usermeta and won't support any type of directional join)
-		 */
-
-		// Add additional data to the returned results
-		if ( !empty( $populate_extras ) ) {
-			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
-		}
-
-		return array( 'users' => $paged_users, 'total' => $total_users );
-	}
-
-	/**
-	 * Find users who match on the value of an xprofile data.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param string $search_terms The terms to search the profile table
-	 *        value column for.
-	 * @param integer $limit The limit of results we want.
-	 * @param integer $page The page we are on for pagination.
-	 * @param boolean $populate_extras Populate extra user fields?
-	 * @return array Associative array.
-	 */
-	public static function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
-		global $bp, $wpdb;
-
-		$user_ids = array();
-		$pag_sql  = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
-
-		$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-		$status_sql        = bp_core_get_status_sql( 'u.' );
-
-		$total_users_sql = apply_filters( 'bp_core_search_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", $search_terms_like ), $search_terms );
-		$paged_users_sql = apply_filters( 'bp_core_search_users_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", $search_terms_like ), $search_terms, $pag_sql );
-
-		$total_users = $wpdb->get_var( $total_users_sql );
-		$paged_users = $wpdb->get_results( $paged_users_sql );
-
-		/***
-		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
-		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
-		 */
-		foreach ( (array) $paged_users as $user )
-			$user_ids[] = $user->id;
-
-		// Add additional data to the returned results
-		if ( $populate_extras )
-			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
-
-		return array( 'users' => $paged_users, 'total' => $total_users );
-	}
-
-	/**
-	 * Fetch extra user information, such as friend count and last profile update message.
-	 *
-	 * Accepts multiple user IDs to fetch data for.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param array $paged_users An array of stdClass containing the users.
-	 * @param string $user_ids The user ids to select information about.
-	 * @param string $type The type of fields we wish to get.
-	 * @return mixed False on error, otherwise associative array of results.
-	 */
-	public static function get_user_extras( &$paged_users, &$user_ids, $type = false ) {
-		global $bp, $wpdb;
-
-		if ( empty( $user_ids ) )
-			return $paged_users;
-
-		// Sanitize user IDs
-		$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
-
-		// Fetch the user's full name
-		if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) {
-			$names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", bp_xprofile_fullname_field_name() ) );
-			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array) $names as $name ) {
-					if ( $name->id == $paged_users[$i]->id )
-						$paged_users[$i]->fullname = $name->fullname;
-				}
-			}
-		}
-
-		// Fetch the user's total friend count
-		if ( 'popular' != $type ) {
-			$friend_count = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as total_friend_count FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'total_friend_count' ) ) );
-			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array) $friend_count as $fcount ) {
-					if ( $fcount->id == $paged_users[$i]->id )
-						$paged_users[$i]->total_friend_count = (int) $fcount->total_friend_count;
-				}
-			}
-		}
-
-		// Fetch whether or not the user is a friend
-		if ( bp_is_active( 'friends' ) ) {
-			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
-			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array) $friend_status as $status ) {
-					if ( $status->initiator_user_id == $paged_users[$i]->id || $status->friend_user_id == $paged_users[$i]->id )
-						$paged_users[$i]->is_friend = $status->is_confirmed;
-				}
-			}
-		}
-
-		if ( 'active' != $type ) {
-			$user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
-			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array) $user_activity as $activity ) {
-					if ( $activity->id == $paged_users[$i]->id )
-						$paged_users[$i]->last_activity = $activity->last_activity;
-				}
-			}
-		}
-
-		// Fetch the user's last_activity
-		if ( 'active' != $type ) {
-			$user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
-			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-				foreach ( (array) $user_activity as $activity ) {
-					if ( $activity->id == $paged_users[$i]->id )
-						$paged_users[$i]->last_activity = $activity->last_activity;
-				}
-			}
-		}
-
-		// Fetch the user's latest update
-		$user_update = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as latest_update FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'bp_latest_update' ) ) );
-		for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
-			foreach ( (array) $user_update as $update ) {
-				if ( $update->id == $paged_users[$i]->id )
-					$paged_users[$i]->latest_update = $update->latest_update;
-			}
-		}
-
-		return $paged_users;
-	}
-
-	/**
-	 * Get WordPress user details for a specified user.
-	 *
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @param integer $user_id User ID.
-	 * @return array Associative array.
-	 */
-	public static function get_core_userdata( $user_id ) {
-		global $wpdb;
-
-		if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE ID = %d LIMIT 1", $user_id ) ) )
-			return false;
-
-		return $user;
-	}
-
-	/**
-	 * Get last activity data for a user or set of users.
-	 *
-	 * @param int|array User IDs or multiple user IDs.
-	 * @return array
-	 */
-	public static function get_last_activity( $user_id ) {
-		global $wpdb;
-
-		// Sanitize and remove empty values
-		$user_ids = array_filter( wp_parse_id_list( $user_id ) );
-
-		if ( empty( $user_ids ) ) {
-			return false;
-		}
-
-		$uncached_user_ids = bp_get_non_cached_ids( $user_ids, 'bp_last_activity' );
-		if ( ! empty( $uncached_user_ids ) ) {
-			$bp = buddypress();
-
-			$user_ids_sql = implode( ',', $uncached_user_ids );
-			$user_count   = count( $uncached_user_ids );
-
-			$last_activities = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_recorded FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity' AND user_id IN ({$user_ids_sql}) LIMIT {$user_count}", $bp->members->id ) );
-
-			foreach ( $last_activities as $last_activity ) {
-				wp_cache_set( $last_activity->user_id, array(
-					'user_id'       => $last_activity->user_id,
-					'date_recorded' => $last_activity->date_recorded,
-					'activity_id'   => $last_activity->id,
-				), 'bp_last_activity' );
-			}
-		}
-
-		// Fetch all user data from the cache
-		$retval = array();
-		foreach ( $user_ids as $user_id ) {
-			$retval[ $user_id ] = wp_cache_get( $user_id, 'bp_last_activity' );
-		}
-
-		return $retval;
-	}
-
-	/**
-	 * Set a user's last_activity value.
-	 *
-	 * Will create a new entry if it does not exist. Otherwise updates the
-	 * existing entry.
-	 *
-	 * @since 2.0
-	 *
-	 * @param int $user_id ID of the user whose last_activity you are updating.
-	 * @param string $time MySQL-formatted time string.
-	 * @return bool True on success, false on failure.
-	 */
-	public static function update_last_activity( $user_id, $time ) {
-		global $wpdb;
-
-		$table_name = buddypress()->members->table_name_last_activity;
-
-		$activity = self::get_last_activity( $user_id );
-
-		if ( ! empty( $activity[ $user_id ] ) ) {
-			$updated = $wpdb->update(
-				$table_name,
-
-				// Data to update
-				array(
-					'date_recorded' => $time,
-				),
-
-				// WHERE
-				array(
-					'id' => $activity[ $user_id ]['activity_id'],
-				),
-
-				// Data sanitization format
-				array(
-					'%s',
-				),
-
-				// WHERE sanitization format
-				array(
-					'%d',
-				)
-			);
-
-			// add new date to existing activity entry for caching
-			$activity[ $user_id ]['date_recorded'] = $time;
-
-		} else {
-			$updated = $wpdb->insert(
-				$table_name,
-
-				// Data
-				array(
-					'user_id'       => $user_id,
-					'component'     => buddypress()->members->id,
-					'type'          => 'last_activity',
-					'action'        => '',
-					'content'       => '',
-					'primary_link'  => '',
-					'item_id'       => 0,
-					'date_recorded' => $time,
-				),
-
-				// Data sanitization format
-				array(
-					'%d',
-					'%s',
-					'%s',
-					'%s',
-					'%s',
-					'%s',
-					'%d',
-					'%s',
-				)
-			);
-
-			// set up activity array for caching
-			// view the foreach loop in the get_last_activity() method for format
-			$activity = array();
-			$activity[ $user_id ] = array(
-				'user_id'       => $user_id,
-				'date_recorded' => $time,
-				'activity_id'   => $wpdb->insert_id,
-			);
-		}
-
-		// set cache
-		wp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' );
-
-		return $updated;
-	}
-
-	/**
-	 * Delete a user's last_activity value.
-	 *
-	 * @since 2.0
-	 *
-	 * @param int $user_id
-	 * @return bool True on success, false on failure or if no last_activity
-	 *         is found for the user.
-	 */
-	public static function delete_last_activity( $user_id ) {
-		global $wpdb;
-
-		$existing = self::get_last_activity( $user_id );
-
-		if ( empty( $existing ) ) {
-			return false;
-		}
-
-		$deleted = $wpdb->delete(
-			buddypress()->members->table_name_last_activity,
-
-			// WHERE
-			array(
-				'id' => $existing[ $user_id ]['activity_id'],
-			),
-
-			// WHERE sanitization format
-			array(
-				'%s',
-			)
-		);
-
-		wp_cache_delete( $user_id, 'bp_last_activity' );
-
-		return $deleted;
-	}
-}
-
-if ( class_exists( 'WP_Date_Query' ) ) :
-/**
- * BuddyPress date query class.
- *
- * Extends the {@link WP_Date_Query} class for use with BuddyPress.
- *
- * @since BuddyPress (2.1.0)
- *
- * @param array $date_query {
- *     Date query arguments.  See first parameter of {@link WP_Date_Query::__construct()}.
- * }
- * @param string $column The DB column to query against.
- */
-class BP_Date_Query extends WP_Date_Query {
-	/**
-	 * The column to query against. Can be changed via the query arguments.
-	 *
-	 * @var string
-	 */
-	public $column;
-
-	/**
-	 * Constructor.
-	 *
-	 * @see WP_Date_Query::__construct()
-	 */
-	public function __construct( $date_query, $column = '' ) {
-		if ( ! empty( $column ) ) {
-			$this->column = $column;
-			add_filter( 'date_query_valid_columns', array( $this, 'register_date_column' ) );
-		}
-
-		parent::__construct( $date_query, $column );
-	}
-
-	/**
-	 * Destructor.
-	 */
-	public function __destruct() {
-		remove_filter( 'date_query_valid_columns', array( $this, 'register_date_column' ) );	
-	}
-
-	/**
-	 * Registers our date column with WP Date Query to pass validation.
-	 *
-	 * @param array $retval Current DB columns
-	 * @return array
-	 */
-	public function register_date_column( $retval = array() ) {
-		$retval[] = $this->column;
-		return $retval;
-	}
-}
-endif;
-
-/**
- * BP_Core_Notification is deprecated.
- *
- * Use BP_Notifications_Notification instead.
- *
- * @package BuddyPress Core
- * @deprecated since BuddyPress (1.9)
- */
-class BP_Core_Notification {
-
-	/**
-	 * The notification id
-	 *
-	 * @var integer
-	 */
-	public $id;
-
-	/**
-	 * The ID to which the notification relates to within the component.
-	 *
-	 * @var integer
-	 */
-	public $item_id;
-
-	/**
-	 * The secondary ID to which the notification relates to within the component.
-	 *
-	 * @var integer
-	 */
-	public $secondary_item_id = null;
-
-	/**
-	 * The user ID for who the notification is for.
-	 *
-	 * @var integer
-	 */
-	public $user_id;
-
-	/**
-	 * The name of the component that the notification is for.
-	 *
-	 * @var string
-	 */
-	public $component_name;
-
-	/**
-	 * The action within the component which the notification is related to.
-	 *
-	 * @var string
-	 */
-	public $component_action;
-
-	/**
-	 * The date the notification was created.
-	 *
-	 * @var string
-	 */
-	public $date_notified;
-
-	/**
-	 * Is the notification new or has it already been read.
-	 *
-	 * @var boolean
-	 */
-	public $is_new;
-
-	/** Public Methods ********************************************************/
-
-	/**
-	 * Constructor
-	 *
-	 * @param integer $id
-	 */
-	public function __construct( $id = 0 ) {
-		if ( !empty( $id ) ) {
-			$this->id = $id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Update or insert notification details into the database.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 * @return bool Success or failure
-	 */
-	public function save() {
-		global $bp, $wpdb;
-
-		// Update
-		if ( !empty( $this->id ) ) {
-			$sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = %s, is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
-
-		// Save
-		} else {
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
-		}
-
-		if ( !$result = $wpdb->query( $sql ) )
-			return false;
-
-		$this->id = $wpdb->insert_id;
-
-		return true;
-	}
-
-	/** Private Methods *******************************************************/
-
-	/**
-	 * Fetches the notification data from the database.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 */
-	public function populate() {
-		global $bp, $wpdb;
-
-		if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
-			$this->item_id = $notification->item_id;
-			$this->secondary_item_id = $notification->secondary_item_id;
-			$this->user_id           = $notification->user_id;
-			$this->component_name    = $notification->component_name;
-			$this->component_action  = $notification->component_action;
-			$this->date_notified     = $notification->date_notified;
-			$this->is_new            = $notification->is_new;
-		}
-	}
-
-	/** Static Methods ********************************************************/
-
-	public static function check_access( $user_id, $notification_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
-	}
-
-	/**
-	 * Fetches all the notifications in the database for a specific user.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 * @param integer $user_id User ID
-	 * @param string $status 'is_new' or 'all'
-	 * @return array Associative array
-	 * @static
-	 */
-	public static function get_all_for_user( $user_id, $status = 'is_new' ) {
-		global $bp, $wpdb;
-
-		$is_new = ( 'is_new' == $status ) ? ' AND is_new = 1 ' : '';
-
- 		return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) );
-	}
-
-	/**
-	 * Delete all the notifications for a user based on the component name and action.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 * @param integer $user_id
-	 * @param string $component_name
-	 * @param string $component_action
-	 * @static
-	 */
-	public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) {
-		global $bp, $wpdb;
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
-	}
-
-	/**
-	 * Delete all the notifications that have a specific item id, component name and action.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 * @param integer $user_id The ID of the user who the notifications are for.
-	 * @param integer $item_id The item ID of the notifications we wish to delete.
-	 * @param string $component_name The name of the component that the notifications we wish to delete.
-	 * @param string $component_action The action of the component that the notifications we wish to delete.
-	 * @param integer $secondary_item_id (optional) The secondary item id of the notifications that we wish to use to delete.
-	 * @static
-	 */
-	public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
-		global $bp, $wpdb;
-
-		$secondary_item_sql = !empty( $secondary_item_id ) ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id ) : '';
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND item_id = %d AND component_name = %s AND component_action = %s{$secondary_item_sql}", $user_id, $item_id, $component_name, $component_action ) );
-	}
-
-	/**
-	 * Deletes all the notifications sent by a specific user, by component and action.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 * @param integer $user_id The ID of the user whose sent notifications we wish to delete.
-	 * @param string $component_name The name of the component the notification was sent from.
-	 * @param string $component_action The action of the component the notification was sent from.
-	 * @static
-	 */
-	public static function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
-		global $bp, $wpdb;
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
-	}
-
-	/**
-	 * Deletes all the notifications for all users by item id, and optional secondary item id, and component name and action.
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 * @global wpdb $wpdb WordPress database object
-	 * @param string $item_id The item id that they notifications are to be for.
-	 * @param string $component_name The component that the notifications are to be from.
-	 * @param string $component_action The action that the notificationsa are to be from.
-	 * @param string $secondary_item_id Optional secondary item id that the notifications are to have.
-	 * @static
-	 */
-	public static function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
-		global $bp, $wpdb;
-
-		if ( $component_action )
-			$component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action );
-		else
-			$component_action_sql = '';
-
-		if ( $secondary_item_id )
-			$secondary_item_sql = $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id );
-		else
-			$secondary_item_sql = '';
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s {$component_action_sql} {$secondary_item_sql}", $item_id, $component_name ) );
-	}
-}
-
-/**
- * API to create BuddyPress buttons.
- *
- * @since BuddyPress (1.2.6)
- *
- * @param array $args {
- *     Array of arguments.
- *     @type string $id String describing the button type.
- *     @type string $component The name of the component the button belongs to.
- *           Default: 'core'.
- *     @type bool $must_be_logged_in Optional. Does the user need to be logged
- *           in to see this button? Default: true.
- *     @type bool $block_self Optional. True if the button should be hidden
- *           when a user is viewing his own profile. Default: true.
- *     @type string|bool $wrapper Optional. HTML element type that should wrap
- *           the button: 'div', 'span', 'p', or 'li'. False for no wrapper at
- *           all. Default: 'div'.
- *     @type string $wrapper_id Optional. DOM ID of the button wrapper element.
- *           Default: ''.
- *     @type string $wrapper_class Optional. DOM class of the button wrapper
- *           element. Default: ''.
- *     @type string $link_href Optional. Destination link of the button.
- *           Default: ''.
- *     @type string $link_class Optional. DOM class of the button. Default: ''.
- *     @type string $link_id Optional. DOM ID of the button. Default: ''.
- *     @type string $link_rel Optional. DOM 'rel' attribute of the button.
- *           Default: ''.
- *     @type string $link_title Optional. Title attribute of the button.
- *           Default: ''.
- *     @type string $link_text Optional. Text to appear on the button.
- *           Default: ''.
- * }
- */
-class BP_Button {
-
-	/** Button properties *****************************************************/
-
-	/**
-	 * The button ID.
-	 *
-	 * @var string
-	 */
-	public $id = '';
-
-	/**
-	 * The name of the component that the button belongs to.
-	 *
-	 * @var string
-	 */
-	public $component = 'core';
-
-	/**
-	 * Does the user need to be logged in to see this button?
-	 *
-	 * @var bool
-	 */
-	public $must_be_logged_in = true;
-
-	/**
-	 * Whether the button should be hidden when viewing your own profile.
-	 *
-	 * @var bool
-	 */
-	public $block_self = true;
-
-	/** Wrapper ***************************************************************/
-
-	/**
-	 * The type of DOM element to use for a wrapper.
-	 *
-	 * @var string|bool 'div', 'span', 'p', 'li', or false for no wrapper.
-	 */
-	public $wrapper = 'div';
-
-	/**
-	 * The DOM class of the button wrapper.
-	 *
-	 * @var string
-	 */
-	public $wrapper_class = '';
-
-	/**
-	 * The DOM ID of the button wrapper.
-	 *
-	 * @var string
-	 */
-	public $wrapper_id = '';
-
-	/** Button ****************************************************************/
-
-	/**
-	 * The destination link of the button.
-	 *
-	 * @var string
-	 */
-	public $link_href = '';
-
-	/**
-	 * The DOM class of the button link.
-	 *
-	 * @var string
-	 */
-	public $link_class = '';
-
-	/**
-	 * The DOM ID of the button link.
-	 *
-	 * @var string
-	 */
-	public $link_id = '';
-
-	/**
-	 * The DOM rel value of the button link.
-	 *
-	 * @var string
-	 */
-	public $link_rel = '';
-
-	/**
-	 * Title of the button link.
-	 *
-	 * @var string
-	 */
-	public $link_title = '';
-
-	/**
-	 * The contents of the button link.
-	 *
-	 * @var string
-	 */
-	public $link_text = '';
-
-	/** HTML result ***********************************************************/
-
-	public $contents = '';
-
-	/** Methods ***************************************************************/
-
-	/**
-	 * Builds the button based on class parameters.
-	 *
-	 * @since BuddyPress (1.2.6)
-	 *
-	 * @param array $args See {@BP_Button}.
-	 * @return bool|null Returns false when the button is not allowed for
-	 *         the current context.
-	 */
-	public function __construct( $args = '' ) {
-
-		$r = wp_parse_args( $args, get_class_vars( __CLASS__ ) );
-
-		// Required button properties
-		$this->id                = $r['id'];
-		$this->component         = $r['component'];
-		$this->must_be_logged_in = (bool) $r['must_be_logged_in'];
-		$this->block_self        = (bool) $r['block_self'];
-		$this->wrapper           = $r['wrapper'];
-
-		// $id and $component are required
-		if ( empty( $r['id'] ) || empty( $r['component'] ) )
-			return false;
-
-		// No button if component is not active
-		if ( ! bp_is_active( $this->component ) )
-			return false;
-
-		// No button for guests if must be logged in
-		if ( true == $this->must_be_logged_in && ! is_user_logged_in() )
-			return false;
-
-		// block_self
-		if ( true == $this->block_self ) {
-			// No button if you are the current user in a members loop
-			// This condition takes precedence, because members loops
-			// can be found on user profiles
-			if ( bp_get_member_user_id() ) {
-				if ( is_user_logged_in() && bp_loggedin_user_id() == bp_get_member_user_id() ) {
-					return false;
-				}
-
-			// No button if viewing your own profile (and not in
-			// a members loop)
-			} else if ( bp_is_my_profile() ) {
-				return false;
-			}
-		}
-
-		// Wrapper properties
-		if ( false !== $this->wrapper ) {
-
-			// Wrapper ID
-			if ( !empty( $r['wrapper_id'] ) ) {
-				$this->wrapper_id    = ' id="' . $r['wrapper_id'] . '"';
-			}
-
-			// Wrapper class
-			if ( !empty( $r['wrapper_class'] ) ) {
-				$this->wrapper_class = ' class="generic-button ' . $r['wrapper_class'] . '"';
-			} else {
-				$this->wrapper_class = ' class="generic-button"';
-			}
-
-			// Set before and after
-			$before = '<' . $r['wrapper'] . $this->wrapper_class . $this->wrapper_id . '>';
-			$after  = '</' . $r['wrapper'] . '>';
-
-		// No wrapper
-		} else {
-			$before = $after = '';
-		}
-
-		// Link properties
-		if ( !empty( $r['link_id']    ) ) $this->link_id    = ' id="' .    $r['link_id']    . '"';
-		if ( !empty( $r['link_href']  ) ) $this->link_href  = ' href="' .  $r['link_href']  . '"';
-		if ( !empty( $r['link_title'] ) ) $this->link_title = ' title="' . $r['link_title'] . '"';
-		if ( !empty( $r['link_rel']   ) ) $this->link_rel   = ' rel="' .   $r['link_rel']   . '"';
-		if ( !empty( $r['link_class'] ) ) $this->link_class = ' class="' . $r['link_class'] . '"';
-		if ( !empty( $r['link_text']  ) ) $this->link_text  =              $r['link_text'];
-
-		// Build the button
-		$this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after;
-
-		// Allow button to be manipulated externally
-		$this->contents = apply_filters( 'bp_button_' . $this->component . '_' . $this->id, $this->contents, $this, $before, $after );
-	}
-
-	/**
-	 * Return the markup for the generated button.
-	 *
-	 * @since BuddyPress (1.2.6)
-	 *
-	 * @return string Button markup.
-	 */
-	public function contents() {
-		return $this->contents;
-	}
-
-	/**
-	 * Output the markup of button.
-	 *
-	 * @since BuddyPress (1.2.6)
-	 */
-	public function display() {
-		if ( !empty( $this->contents ) )
-			echo $this->contents;
-	}
-}
-
-/**
- * Enable oEmbeds in BuddyPress contexts.
- *
- * Extends WP_Embed class for use with BuddyPress.
- *
- * @since BuddyPress (1.5.0)
- *
- * @see WP_Embed
- */
-class BP_Embed extends WP_Embed {
-
-	/**
-	 * Constructor
-	 *
-	 * @global WP_Embed $wp_embed
-	 */
-	public function __construct() {
-		global $wp_embed;
-
-		// Make sure we populate the WP_Embed handlers array.
-		// These are providers that use a regex callback on the URL in question.
-		// Do not confuse with oEmbed providers, which require an external ping.
-		// Used in WP_Embed::shortcode()
-		$this->handlers = $wp_embed->handlers;
-
-		if ( bp_use_embed_in_activity() ) {
-			add_filter( 'bp_get_activity_content_body', array( &$this, 'autoembed' ), 8 );
-			add_filter( 'bp_get_activity_content_body', array( &$this, 'run_shortcode' ), 7 );
-		}
-
-		if ( bp_use_embed_in_activity_replies() ) {
-			add_filter( 'bp_get_activity_content', array( &$this, 'autoembed' ), 8 );
-			add_filter( 'bp_get_activity_content', array( &$this, 'run_shortcode' ), 7 );
-		}
-
-		if ( bp_use_embed_in_forum_posts() ) {
-			add_filter( 'bp_get_the_topic_post_content', array( &$this, 'autoembed' ), 8 );
-			add_filter( 'bp_get_the_topic_post_content', array( &$this, 'run_shortcode' ), 7 );
-		}
-
-		if ( bp_use_embed_in_private_messages() ) {
-			add_filter( 'bp_get_the_thread_message_content', array( &$this, 'autoembed' ), 8 );
-			add_filter( 'bp_get_the_thread_message_content', array( &$this, 'run_shortcode' ), 7 );
-		}
-
-		do_action_ref_array( 'bp_core_setup_oembed', array( &$this ) );
-	}
-
-	/**
-	 * The {@link do_shortcode()} callback function.
-	 *
-	 * Attempts to convert a URL into embed HTML. Starts by checking the
-	 * URL against the regex of the registered embed handlers. Next, checks
-	 * the URL against the regex of registered {@link WP_oEmbed} providers
-	 * if oEmbed discovery is false. If none of the regex matches and it's
-	 * enabled, then the URL will be passed to {@link BP_Embed::parse_oembed()}
-	 * for oEmbed parsing.
-	 *
-	 * @uses wp_parse_args()
-	 * @uses wp_embed_defaults()
-	 * @uses current_user_can()
-	 * @uses _wp_oembed_get_object()
-	 * @uses WP_Embed::maybe_make_link()
-	 *
-	 * @param array $attr Shortcode attributes.
-	 * @param string $url The URL attempting to be embeded.
-	 * @return string The embed HTML on success, otherwise the original URL.
-	 */
-	public function shortcode( $attr, $url = '' ) {
-		if ( empty( $url ) )
-			return '';
-
-		$rawattr = $attr;
-		$attr = wp_parse_args( $attr, wp_embed_defaults() );
-
-		// kses converts & into &amp; and we need to undo this
-		// See http://core.trac.wordpress.org/ticket/11311
-		$url = str_replace( '&amp;', '&', $url );
-
-		// Look for known internal handlers
-		ksort( $this->handlers );
-		foreach ( $this->handlers as $priority => $handlers ) {
-			foreach ( $handlers as $hid => $handler ) {
-				if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
-					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) {
-						return apply_filters( 'embed_handler_html', $return, $url, $attr );
-					}
-				}
-			}
-		}
-
-		// Get object ID
-		$id = apply_filters( 'embed_post_id', 0 );
-
-		// Is oEmbed discovery on?
-		$attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) );
-
-		// Set up a new WP oEmbed object to check URL with registered oEmbed providers
-		require_once( ABSPATH . WPINC . '/class-oembed.php' );
-		$oembed_obj = _wp_oembed_get_object();
-
-		// If oEmbed discovery is true, skip oEmbed provider check
-		$is_oembed_link = false;
-		if ( !$attr['discover'] ) {
-			foreach ( (array) $oembed_obj->providers as $provider_matchmask => $provider ) {
-				$regex = ( $is_regex = $provider[1] ) ? $provider_matchmask : '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $provider_matchmask ), '#' ) ) . '#i';
-
-				if ( preg_match( $regex, $url ) )
-					$is_oembed_link = true;
-			}
-
-			// If url doesn't match a WP oEmbed provider, stop parsing
-			if ( !$is_oembed_link )
-				return $this->maybe_make_link( $url );
-		}
-
-		return $this->parse_oembed( $id, $url, $attr, $rawattr );
-	}
-
-	/**
-	 * Base function so BP components/plugins can parse links to be embedded.
-	 *
-	 * View an example to add support in {@link bp_activity_embed()}.
-	 *
-	 * @uses apply_filters() Filters cache.
-	 * @uses do_action() To save cache.
-	 * @uses wp_oembed_get() Connects to oEmbed provider and returns HTML
-	 *       on success.
-	 * @uses WP_Embed::maybe_make_link() Process URL for hyperlinking on
-	 *       oEmbed failure.
-	 *
-	 * @param int $id ID to do the caching for.
-	 * @param string $url The URL attempting to be embedded.
-	 * @param array $attr Shortcode attributes from {@link WP_Embed::shortcode()}.
-	 * @param array $rawattr Untouched shortcode attributes from
-	 *        {@link WP_Embed::shortcode()}.
-	 * @return string The embed HTML on success, otherwise the original URL.
-	 */
-	public function parse_oembed( $id, $url, $attr, $rawattr ) {
-		$id = intval( $id );
-
-		if ( $id ) {
-			// Setup the cachekey
-			$cachekey = '_oembed_' . md5( $url . serialize( $attr ) );
-
-			// Let components / plugins grab their cache
-			$cache = '';
-			$cache = apply_filters( 'bp_embed_get_cache', $cache, $id, $cachekey, $url, $attr, $rawattr );
-
-			// Grab cache and return it if available
-			if ( !empty( $cache ) ) {
-				return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr );
-
-			// If no cache, ping the oEmbed provider and cache the result
-			} else {
-				$html = wp_oembed_get( $url, $attr );
-				$cache = ( $html ) ? $html : $url;
-
-				// Let components / plugins save their cache
-				do_action( 'bp_embed_update_cache', $cache, $cachekey, $id );
-
-				// If there was a result, return it
-				if ( $html )
-					return apply_filters( 'bp_embed_oembed_html', $html, $url, $attr, $rawattr );
-			}
-		}
-
-		// Still unknown
-		return $this->maybe_make_link( $url );
-	}
-}
-
-/**
- * Create HTML list of BP nav items.
- *
- * @since BuddyPress (1.7.0)
- */
-class BP_Walker_Nav_Menu extends Walker_Nav_Menu {
-
-	/**
-	 * Description of fields indexes for building markup.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 * @var array
-	 */
-	var $db_fields = array( 'id' => 'css_id', 'parent' => 'parent' );
-
-	/**
-	 * Tree type.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 * @var string
-	 */
-	var $tree_type = array();
-
-	/**
-	 * Display array of elements hierarchically.
-	 *
-	 * This method is almost identical to the version in {@link Walker::walk()}.
-	 * The only change is on one line which has been commented. An IF was
-	 * comparing 0 to a non-empty string which was preventing child elements
-	 * being grouped under their parent menu element.
-	 *
-	 * This caused a problem for BuddyPress because our primary/secondary
-	 * navigations don't have a unique numerical ID that describes a
-	 * hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and
-	 * those have ID/post_parent.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 *
-	 * @see Walker::walk()
-	 *
-	 * @param array $elements See {@link Walker::walk()}.
-	 * @param int $max_depth See {@link Walker::walk()}.
-	 * @return string See {@link Walker::walk()}.
-	 */
-	public function walk( $elements, $max_depth ) {
-		$func_args = func_get_args();
-
-		$args   = array_slice( $func_args, 2 );
-		$output = '';
-
-		if ( $max_depth < -1 ) // invalid parameter
-			return $output;
-
-		if ( empty( $elements ) ) // nothing to walk
-			return $output;
-
-		$id_field     = $this->db_fields['id'];
-		$parent_field = $this->db_fields['parent'];
-
-		// flat display
-		if ( -1 == $max_depth ) {
-
-			$empty_array = array();
-			foreach ( $elements as $e )
-				$this->display_element( $e, $empty_array, 1, 0, $args, $output );
-
-			return $output;
-		}
-
-		/*
-		 * need to display in hierarchical order
-		 * separate elements into two buckets: top level and children elements
-		 * children_elements is two dimensional array, eg.
-		 * children_elements[10][] contains all sub-elements whose parent is 10.
-		 */
-		$top_level_elements = array();
-		$children_elements  = array();
-
-		foreach ( $elements as $e ) {
-			// BuddyPress: changed '==' to '==='. This is the only change from version in Walker::walk().
-			if ( 0 === $e->$parent_field )
-				$top_level_elements[] = $e;
-			else
-				$children_elements[$e->$parent_field][] = $e;
-		}
-
-		/*
-		 * when none of the elements is top level
-		 * assume the first one must be root of the sub elements
-		 */
-		if ( empty( $top_level_elements ) ) {
-
-			$first              = array_slice( $elements, 0, 1 );
-			$root               = $first[0];
-			$top_level_elements = array();
-			$children_elements  = array();
-
-			foreach ( $elements as $e ) {
-				if ( $root->$parent_field == $e->$parent_field )
-					$top_level_elements[] = $e;
-				else
-					$children_elements[$e->$parent_field][] = $e;
-			}
-		}
-
-		foreach ( $top_level_elements as $e )
-			$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
-
-		/*
-		 * if we are displaying all levels, and remaining children_elements is not empty,
-		 * then we got orphans, which should be displayed regardless
-		 */
-		if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
-			$empty_array = array();
-
-			foreach ( $children_elements as $orphans )
-				foreach ( $orphans as $op )
-					$this->display_element( $op, $empty_array, 1, 0, $args, $output );
-		 }
-
-		 return $output;
-	}
-
-	/**
-	 * Display the current <li> that we are on.
-	 *
-	 * @see Walker::start_el() for complete description of parameters .
-	 *
-	 * @since BuddyPress (1.7.0)
-	 *
-	 * @param string $output Passed by reference. Used to append
-	 *        additional content.
-	 * @param object $item Menu item data object.
-	 * @param int $depth Depth of menu item. Used for padding. Optional,
-	 *        defaults to 0.
-	 * @param array $args Optional. See {@link Walker::start_el()}.
-	 * @param int $current_page Menu item ID. Optional.
-	 */
-	public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
-		// If we're someway down the tree, indent the HTML with the appropriate number of tabs
-		$indent = $depth ? str_repeat( "\t", $depth ) : '';
-
-		// Add HTML classes
-		$class_names = join( ' ', apply_filters( 'bp_nav_menu_css_class', array_filter( $item->class ), $item, $args ) );
-		$class_names = ! empty( $class_names ) ? ' class="' . esc_attr( $class_names ) . '"' : '';
-
-		// Add HTML ID
-		$id = sanitize_html_class( $item->css_id . '-personal-li' );  // Backpat with BP pre-1.7
-		$id = apply_filters( 'bp_nav_menu_item_id', $id, $item, $args );
-		$id = ! empty( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
-
-		// Opening tag; closing tag is handled in Walker_Nav_Menu::end_el().
-		$output .= $indent . '<li' . $id . $class_names . '>';
-
-		// Add href attribute
-		$attributes = ! empty( $item->link ) ? ' href="' . esc_attr( esc_url( $item->link ) ) . '"' : '';
-
-		// Construct the link
-		$item_output = $args->before;
-		$item_output .= '<a' . $attributes . '>';
-		$item_output .= $args->link_before . apply_filters( 'the_title', $item->name, 0 ) . $args->link_after;
-		$item_output .= '</a>';
-		$item_output .= $args->after;
-
-		// $output is byref
-		$output .= apply_filters( 'bp_walker_nav_menu_start_el', $item_output, $item, $depth, $args );
-	}
-}
-
-/**
- * Create a set of BuddyPress-specific links for use in the Menus admin UI.
- *
- * Borrowed heavily from {@link Walker_Nav_Menu_Checklist}, but modified so as not
- * to require an actual post type or taxonomy, and to force certain CSS classes
- *
- * @since BuddyPress (1.9.0)
- */
-class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
-
-	/**
-	 * Constructor.
-	 *
-	 * @see Walker_Nav_Menu::__construct() for a description of parameters.
-	 *
-	 * @param array $fields See {@link Walker_Nav_Menu::__construct()}.
-	 */
-	public function __construct( $fields = false ) {
-		if ( $fields ) {
-			$this->db_fields = $fields;
-		}
-	}
-
-	/**
-	 * Create the markup to start a tree level.
-	 *
-	 * @see Walker_Nav_Menu::start_lvl() for description of parameters.
-	 *
-	 * @param string $output See {@Walker_Nav_Menu::start_lvl()}.
-	 * @param int $depth See {@Walker_Nav_Menu::start_lvl()}.
-	 * @param array $args See {@Walker_Nav_Menu::start_lvl()}.
-	 */
-	public function start_lvl( &$output, $depth = 0, $args = array() ) {
-		$indent = str_repeat( "\t", $depth );
-		$output .= "\n$indent<ul class='children'>\n";
-	}
-
-	/**
-	 * Create the markup to end a tree level.
-	 *
-	 * @see Walker_Nav_Menu::end_lvl() for description of parameters.
-	 *
-	 * @param string $output See {@Walker_Nav_Menu::end_lvl()}.
-	 * @param int $depth See {@Walker_Nav_Menu::end_lvl()}.
-	 * @param array $args See {@Walker_Nav_Menu::end_lvl()}.
-	 */
-	public function end_lvl( &$output, $depth = 0, $args = array() ) {
-		$indent = str_repeat( "\t", $depth );
-		$output .= "\n$indent</ul>";
-	}
-
-	/**
-	 * Create the markup to start an element.
-	 *
-	 * @see Walker::start_el() for description of parameters.
-	 *
-	 * @param string $output Passed by reference. Used to append additional
-	 *        content.
-	 * @param object $item Menu item data object.
-	 * @param int $depth Depth of menu item. Used for padding.
-	 * @param object $args See {@Walker::start_el()}.
-	 * @param int $id See {@Walker::start_el()}.
-	 */
-	function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
-		global $_nav_menu_placeholder;
-
-		$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
-		$possible_object_id = isset( $item->post_type ) && 'nav_menu_item' == $item->post_type ? $item->object_id : $_nav_menu_placeholder;
-		$possible_db_id = ( ! empty( $item->ID ) ) && ( 0 < $possible_object_id ) ? (int) $item->ID : 0;
-
-		$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
-
-		$output .= $indent . '<li>';
-		$output .= '<label class="menu-item-title">';
-		$output .= '<input type="checkbox" class="menu-item-checkbox';
-
-		if ( property_exists( $item, 'label' ) ) {
-			$title = $item->label;
-		}
-
-		$output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="'. esc_attr( $item->object_id ) .'" /> ';
-		$output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
-		$output .= '</label>';
-
-		if ( empty( $item->url ) ) {
-			$item->url = $item->guid;
-		}
-
-		if ( ! in_array( array( 'bp-menu', 'bp-'. $item->post_excerpt .'-nav' ), $item->classes ) ) {
-			$item->classes[] = 'bp-menu';
-			$item->classes[] = 'bp-'. $item->post_excerpt .'-nav';
-		}
-
-		// Menu item hidden fields
-		$output .= '<input type="hidden" class="menu-item-db-id" name="menu-item[' . $possible_object_id . '][menu-item-db-id]" value="' . $possible_db_id . '" />';
-		$output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="'. esc_attr( $item->object ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="'. esc_attr( $item->menu_item_parent ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="custom" />';
-		$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="'. esc_attr( $item->title ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="'. esc_attr( $item->url ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="'. esc_attr( $item->target ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="'. esc_attr( $item->attr_title ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="'. esc_attr( implode( ' ', $item->classes ) ) .'" />';
-		$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="'. esc_attr( $item->xfn ) .'" />';
-	}
-}
-
-/**
- * Base class for the BuddyPress Suggestions API.
- *
- * Originally built to power BuddyPress' at-mentions suggestions, it's flexible enough to be used
- * for similar kinds of future core requirements, or those desired by third-party developers.
- *
- * To implement a new suggestions service, create a new class that extends this one, and update
- * the list of default services in {@link bp_core_get_suggestions()}. If you're building a plugin,
- * it's recommend that you use the `bp_suggestions_services` filter to do this. :)
- *
- * While the implementation of the query logic is left to you, it should be as quick and efficient
- * as possible. When implementing the abstract methods in this class, pay close attention to the
- * recommendations provided in the phpDoc blocks, particularly the expected return types.
- *
- * @since BuddyPress (2.1.0)
- */
-abstract class BP_Suggestions {
-
-	/**
-	 * Default arguments common to all suggestions services.
-	 *
-	 * If your custom service requires further defaults, add them here.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @var array
-	 */
-	protected $default_args = array(
-		'limit' => 16,
-		'term'  => '',
-		'type'  => '',
-	);
-
-	/**
-	 * Holds the arguments for the query (about to made to the suggestions service).
-	 *
-	 * This includes `$default_args`, as well as the user-supplied values.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @var array
-	 */
-	protected $args = array(
-	);
-
-
-	/**
-	 * Constructor.
-	 *
-	 * @param array $args Optional. If set, used as the parameters for the suggestions service query.
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function __construct( array $args = array() ) {
-		if ( ! empty( $args ) ) {
-			$this->set_query( $args );
-		}
-	}
-
-	/**
-	 * Set the parameters for the suggestions service query.
-	 *
-	 * @param array $args {
-	 *     @type int $limit Maximum number of results to display. Optional, default: 16.
-	 *     @type string $type The name of the suggestion service to use for the request. Mandatory.
-	 *     @type string $term The suggestion service will try to find results that contain this string.
-	 *           Mandatory.
-	 * }
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function set_query( array $args = array() ) {
-		$this->args = wp_parse_args( $args, $this->default_args );
-	}
-
-	/**
-	 * Validate and sanitise the parameters for the suggestion service query.
-	 *
-	 * Be sure to call this class' version of this method when implementing it in your own service.
-	 * If validation fails, you must return a WP_Error object.
-	 *
-	 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function validate() {
-		$this->args['limit'] = absint( $this->args['limit'] );
-		$this->args['term']  = trim( sanitize_text_field( $this->args['term'] ) );
-		$this->args          = apply_filters( 'bp_suggestions_args', $this->args, $this );
-
-
-		// Check for invalid or missing mandatory parameters.
-		if ( ! $this->args['limit'] || ! $this->args['term'] ) {
-			return new WP_Error( 'missing_parameter' );
-		}
-
-		// Check for blocked users (e.g. deleted accounts, or spammers).
-		if ( is_user_logged_in() && ! bp_is_user_active( get_current_user_id() ) ) {
-			return new WP_Error( 'invalid_user' );
-		}
-
-		return apply_filters( 'bp_suggestions_validate_args', true, $this );
-	}
-
-	/**
-	 * Find and return a list of suggestions that match the query.
-	 *
-	 * The return type is important. If no matches are found, an empty array must be returned.
-	 * Matches must be returned as objects in an array.
-	 *
-	 * The object format for each match must be: { 'ID': string, 'image': string, 'name': string }
-	 * For example: { 'ID': 'admin', 'image': 'http://example.com/logo.png', 'name': 'Name Surname' }
-	 *
-	 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
-	 * @since BuddyPress (2.1.0)
-	 */
-	abstract public function get_suggestions();
-}
-
-/**
- * Adds support for user at-mentions to the Suggestions API.
- *
- * This class is in the Core component because it's required by a class in the Groups component,
- * and Groups is loaded before Members (alphabetical order).
- *
- * @since BuddyPress (2.1.0)
- */
-class BP_Members_Suggestions extends BP_Suggestions {
-
-	/**
-	 * Default arguments for this suggestions service.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @var array $args {
-	 *     @type int $limit Maximum number of results to display. Default: 16.
-	 *     @type bool $only_friends If true, only match the current user's friends. Default: false.
-	 *     @type string $term The suggestion service will try to find results that contain this string.
-	 *           Mandatory.
-	 * }
-	 */
-	protected $default_args = array(
-		'limit'        => 10,
-		'only_friends' => false,
-		'term'         => '',
-		'type'         => '',
-	);
-
-
-	/**
-	 * Validate and sanitise the parameters for the suggestion service query.
-	 *
-	 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function validate() {
-		$this->args['only_friends'] = (bool) $this->args['only_friends'];
-		$this->args                 = apply_filters( 'bp_members_suggestions_args', $this->args, $this );
-
-		// Check for invalid or missing mandatory parameters.
-		if ( $this->args['only_friends'] && ( ! bp_is_active( 'friends' ) || ! is_user_logged_in() ) ) {
-			return new WP_Error( 'missing_requirement' );
-		}
-
-		return apply_filters( 'bp_members_suggestions_validate_args', parent::validate(), $this );
-	}
-
-	/**
-	 * Find and return a list of username suggestions that match the query.
-	 *
-	 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function get_suggestions() {
-		$user_query = array(
-			'count_total'     => '',  // Prevents total count
-			'populate_extras' => false,
-			'type'            => 'alphabetical',
-
-			'page'            => 1,
-			'per_page'        => $this->args['limit'],
-			'search_terms'    => $this->args['term'],
-			'search_wildcard' => 'right',
-		);
-
-		// Only return matches of friends of this user.
-		if ( $this->args['only_friends'] && is_user_logged_in() ) {
-			$user_query['user_id'] = get_current_user_id();
-		}
-
-		$user_query = apply_filters( 'bp_members_suggestions_query_args', $user_query, $this );
-		if ( is_wp_error( $user_query ) ) {
-			return $user_query;
-		}
-
-
-		$user_query = new BP_User_Query( $user_query );
-		$results    = array();
-
-		foreach ( $user_query->results as $user ) {
-			$result        = new stdClass();
-			$result->ID    = $user->user_nicename;
-			$result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
-			$result->name  = bp_core_get_user_displayname( $user->ID );
-
-			$results[] = $result;
-		}
-
-		return apply_filters( 'bp_members_suggestions_get_suggestions', $results, $this );
-	}
-}
+defined( 'ABSPATH' ) || exit;
+
+require dirname( __FILE__ ) . '/classes/class-bp-user-query.php';
+require dirname( __FILE__ ) . '/classes/class-bp-core-user.php';
+require dirname( __FILE__ ) . '/classes/class-bp-date-query.php';
+require dirname( __FILE__ ) . '/classes/class-bp-core-notification.php';
+require dirname( __FILE__ ) . '/classes/class-bp-button.php';
+require dirname( __FILE__ ) . '/classes/class-bp-embed.php';
+require dirname( __FILE__ ) . '/classes/class-bp-walker-nav-menu.php';
+require dirname( __FILE__ ) . '/classes/class-bp-walker-nav-menu-checklist.php';
+require dirname( __FILE__ ) . '/classes/class-bp-suggestions.php';
+require dirname( __FILE__ ) . '/classes/class-bp-members-suggestions.php';
+require dirname( __FILE__ ) . '/classes/class-bp-recursive-query.php';
+require dirname( __FILE__ ) . '/classes/class-bp-media-extractor.php';
+require dirname( __FILE__ ) . '/classes/class-bp-attachment.php';
+require dirname( __FILE__ ) . '/classes/class-bp-attachment-avatar.php';
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-component.php b/wp-content/plugins/buddypress/bp-core/bp-core-component.php
index 539359fbd08f71e87cdd61489259ab80a735e919..a24de99b4a83856c46891ab5a874e4d36b6fa534 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-component.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-component.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 if ( !class_exists( 'BP_Component' ) ) :
 /**
@@ -131,19 +131,21 @@ class BP_Component {
 	 * Component loader.
 	 *
 	 * @since BuddyPress (1.5.0)
-	 *
-	 * @uses BP_Component::setup_actions() Set up the hooks and actions.
-	 *
-	 * @param string $id Unique ID (for internal identification). Letters,
-	 *        numbers, and underscores only.
-	 * @param string $name Unique name. This should be a translatable name,
-	 *        eg __( 'Groups', 'buddypress' ).
-	 * @param string $path The file path for the component's files. Used by
-	 *        {@link BP_Component::includes()}.
-	 * @param array $params Additional parameters used by the component.
-	 *        The config array supports the following values:
-	 *        - 'adminbar_myaccount_order' Sets the position for our
-	 *          component menu under the WP Toolbar's "My Account" menu.
+	 * @since BuddyPress (1.9.0) Added $params as a parameter.
+	 * @since BuddyPress (2.3.0) Added $params['features'] as a configurable value.
+	 *
+	 * @param string $id   Unique ID. Letters, numbers, and underscores only.
+	 * @param string $name Unique name. This should be a translatable name, eg.
+	 *                     __( 'Groups', 'buddypress' ).
+	 * @param string $path The file path for the component's files. Used by {@link BP_Component::includes()}.
+	 * @param array  $params {
+	 *     Additional parameters used by the component.
+	 *     @type int   $adminbar_myaccount_order Set the position for our menu under the WP Toolbar's "My Account menu"
+	 *     @type array $features                 An array of feature names. This is used to load additional files from your
+	 *                                           component directory and for feature active checks. eg. array( 'awesome' )
+	 *                                           would look for a file called "bp-{$this->id}-awesome.php" and you could use
+	 *                                           bp_is_active( $this->id, 'awesome' ) to determine if the feature is active.
+	 * }
 	 */
 	public function start( $id = '', $name = '', $path = '', $params = array() ) {
 
@@ -163,6 +165,11 @@ class BP_Component {
 				$this->adminbar_myaccount_order = (int) $params['adminbar_myaccount_order'];
 			}
 
+			// Register features
+			if ( ! empty( $params['features'] ) ) {
+				$this->features = array_map( 'sanitize_title', (array) $params['features'] );
+			}
+
 		// Set defaults if not passed
 		} else {
 			// new component menus are added before the settings menu if not set
@@ -183,24 +190,18 @@ class BP_Component {
 	 *
 	 * @param array $args {
 	 *     All values are optional.
-	 *     @type string $slug The component slug. Used to construct certain
-	 *           URLs, such as 'friends' in http://example.com/members/joe/friends/
-	 *           Default: the value of $this->id.
-	 *     @type string $root_slug The component root slug. Note that this
-	 *           value is generally unused if the component has a root
-	 *           directory (the slug will be overridden by the post_name of
-	 *           the directory page). Default: the slug of the directory
-	 *           page if one is found, otherwise an empty string.
-	 *     @type bool $has_directory Set to true if the component requires
-	 *           an associated WordPress page.
-	 *     @type callable $notification_callback Optional. The callable
-	 *           function that formats the component's notifications.
-	 *     @type string $search_term Optional. The placeholder text in the
-	 *           component directory search box. Eg, 'Search Groups...'.
-	 *     @type array $global_tables Optional. An array of database table
-	 *           names.
-	 *     @type array $meta_tables Optional. An array of metadata table
-	 *           names.
+	 *     @type string   $slug                  The component slug. Used to construct certain URLs, such as 'friends' in
+	 *                                           http://example.com/members/joe/friends/. Default: the value of $this->id.
+	 *     @type string   $root_slug             The component root slug. Note that this value is generally unused if the
+	 *                                           component has a root directory (the slug will be overridden by the
+	 *                                           post_name of the directory page). Default: the slug of the directory page
+	 *                                           if one is found, otherwise an empty string.
+	 *     @type bool     $has_directory         Set to true if the component requires an associated WordPress page.
+	 *     @type callable $notification_callback Optional. The callable function that formats the component's notifications.
+	 *     @type string   $search_term           Optional. The placeholder text in the component directory search box. Eg,
+	 *                                           'Search Groups...'.
+	 *     @type array    $global_tables         Optional. An array of database table names.
+	 *     @type array    $meta_tables           Optional. An array of metadata table names.
 	 * }
 	 */
 	public function setup_globals( $args = array() ) {
@@ -222,22 +223,58 @@ class BP_Component {
 			'meta_tables'           => '',
 		) );
 
-		// Slug used for permalink URI chunk after root
+		/**
+		 * Filters the slug to be used for the permalink URI chunk after root.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Slug to use in permalink URI chunk.
+		 */
 		$this->slug                  = apply_filters( 'bp_' . $this->id . '_slug',                  $r['slug']                  );
 
-		// Slug used for root directory
+		/**
+		 * Filters the slug used for root directory.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Root directory slug.
+		 */
 		$this->root_slug             = apply_filters( 'bp_' . $this->id . '_root_slug',             $r['root_slug']             );
 
-		// Does this component have a top-level directory?
+		/**
+		 * Filters the component's top-level directory if available.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param bool $value Whether or not there is a top-level directory.
+		 */
 		$this->has_directory         = apply_filters( 'bp_' . $this->id . '_has_directory',         $r['has_directory']         );
 
-		// Does this component have a top-level directory?
+		/**
+		 * Filters the component's directory title.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $value Title to use for the directory.
+		 */
 		$this->directory_title       = apply_filters( 'bp_' . $this->id . '_directory_title',       $r['directory_title']         );
 
-		// Search string
+		/**
+		 * Filters the placeholder text for search inputs for component.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Name to use in search input placeholders.
+		 */
 		$this->search_string         = apply_filters( 'bp_' . $this->id . '_search_string',         $r['search_string']         );
 
-		// Notifications callback
+		/**
+		 * Filters the callable function that formats the component's notifications.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Function callback.
+		 */
 		$this->notification_callback = apply_filters( 'bp_' . $this->id . '_notification_callback', $r['notification_callback'] );
 
 		// Set the global table names, if applicable
@@ -255,7 +292,13 @@ class BP_Component {
 		// Register this component in the loaded components array
 		buddypress()->loaded_components[$this->slug] = $this->id;
 
-		// Call action
+		/**
+		 * Fires at the end of the setup_globals method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_setup_globals' );
 	}
 
@@ -320,7 +363,13 @@ class BP_Component {
 			}
 		}
 
-		// Call action
+		/**
+		 * Fires at the end of the includes method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_includes' );
 	}
 
@@ -356,6 +405,9 @@ class BP_Component {
 		// Setup component title
 		add_action( 'bp_setup_title',            array( $this, 'setup_title'            ), 10 );
 
+		// Setup cache groups
+		add_action( 'bp_setup_cache_groups',     array( $this, 'setup_cache_groups'     ), 10 );
+
 		// Register post types
 		add_action( 'bp_register_post_types',    array( $this, 'register_post_types'    ), 10 );
 
@@ -377,7 +429,13 @@ class BP_Component {
 		// Generate rewrite rules
 		add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 );
 
-		// Additional actions can be attached here
+		/**
+		 * Fires at the end of the setup_actions method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_setup_actions' );
 	}
 
@@ -416,7 +474,13 @@ class BP_Component {
 			}
 		}
 
-		// Call action
+		/**
+		 * Fires at the end of the setup_nav method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_setup_nav' );
 	}
 
@@ -444,7 +508,15 @@ class BP_Component {
 			return;
 		}
 
-		// Filter the passed admin nav
+		/**
+		 * Filters the admin navigation passed into setup_admin_bar.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param array $wp_admin_nav Array of navigation items to add.
+		 */
 		$wp_admin_nav = apply_filters( 'bp_' . $this->id . '_admin_nav', $wp_admin_nav );
 
 		// Do we have Toolbar menus to add?
@@ -462,7 +534,13 @@ class BP_Component {
 			}
 		}
 
-		// Call action
+		/**
+		 * Fires at the end of the setup_admin_bar method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_setup_admin_bar' );
 	}
 
@@ -471,12 +549,39 @@ class BP_Component {
 	 *
 	 * @since BuddyPress (1.5.0)
 	 *
-	 * @uses do_action() Calls 'bp_{@link bp_Component::name}setup_title'.
+	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_setup_title'.
 	 */
 	public function setup_title() {
+
+		/**
+		 * Fires in the setup_title method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action(  'bp_' . $this->id . '_setup_title' );
 	}
 
+	/**
+	 * Setup component-specific cache groups.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @uses do_action() Calls 'bp_setup_{@link bp_Component::name}_cache_groups'.
+	 */
+	public function setup_cache_groups() {
+
+		/**
+		 * Fires in the setup_cache_groups method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 */
+		do_action( 'bp_' . $this->id . '_setup_cache_groups' );
+	}
+
 	/**
 	 * Register global tables for the component, so that it may use WordPress's database API.
 	 *
@@ -486,8 +591,15 @@ class BP_Component {
 	 */
 	public function register_global_tables( $tables = array() ) {
 
-		// This filter allows for component-specific filtering of table names
-		// To filter *all* tables, use the 'bp_core_get_table_prefix' filter instead
+		/**
+		 * Filters the global tables for the component, so that it may use WordPress' database API.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 * It allows for component-specific filtering of table names. To filter
+		 * *all* tables, use the 'bp_core_get_table_prefix' filter instead.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 */
 		$tables = apply_filters( 'bp_' . $this->id . '_global_tables', $tables );
 
 		// Add to the BuddyPress global object
@@ -500,6 +612,13 @@ class BP_Component {
 			$this->global_tables = $tables;
 		}
 
+		/**
+		 * Fires at the end of the register_global_tables method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 */
 		do_action( 'bp_' . $this->id . '_register_global_tables' );
 	}
 
@@ -516,8 +635,15 @@ class BP_Component {
 	public function register_meta_tables( $tables = array() ) {
 		global $wpdb;
 
-		// This filter allows for component-specific filtering of table names
-		// To filter *all* tables, use the 'bp_core_get_table_prefix' filter instead
+		/**
+		 * Filters the global meta_tables for the component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 * It allows for component-specific filtering of table names. To filter
+		 * *all* tables, use the 'bp_core_get_table_prefix' filter instead.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 */
 		$tables = apply_filters( 'bp_' . $this->id . '_meta_tables', $tables );
 
 		/**
@@ -533,6 +659,13 @@ class BP_Component {
 			$this->meta_tables = $tables;
 		}
 
+		/**
+		 * Fires at the end of the register_meta_tables method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 */
 		do_action( 'bp_' . $this->id . '_register_meta_tables' );
 	}
 
@@ -544,6 +677,14 @@ class BP_Component {
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_register_post_types'.
 	 */
 	public function register_post_types() {
+
+		/**
+		 * Fires in the register_post_types method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_register_post_types' );
 	}
 
@@ -555,6 +696,14 @@ class BP_Component {
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_register_taxonomies'.
 	 */
 	public function register_taxonomies() {
+
+		/**
+		 * Fires in the register_taxonomies method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_register_taxonomies' );
 	}
 
@@ -566,6 +715,14 @@ class BP_Component {
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_rewrite_tags'.
 	 */
 	public function add_rewrite_tags() {
+
+		/**
+		 * Fires in the add_rewrite_tags method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_add_rewrite_tags' );
 	}
 
@@ -577,6 +734,14 @@ class BP_Component {
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_rewrite_rules'.
 	 */
 	public function add_rewrite_rules() {
+
+		/**
+		 * Fires in the add_rewrite_rules method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 */
 		do_action( 'bp_' . $this->id . '_add_rewrite_rules' );
 	}
 
@@ -588,6 +753,14 @@ class BP_Component {
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_permastruct'
 	 */
 	public function add_permastructs() {
+
+		/**
+		 * Fires in the add_permastructs method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 */
 		do_action( 'bp_' . $this->id . '_add_permastructs' );
 	}
 
@@ -600,6 +773,16 @@ class BP_Component {
 	 * @param object The main WP_Query
 	 */
 	public function parse_query( $query ) {
+
+		/**
+		 * Fires in the parse_query method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param object $query Main WP_Query object. Passed by reference.
+		 */
 		do_action_ref_array( 'bp_' . $this->id . '_parse_query', array( &$query ) );
 	}
 
@@ -611,6 +794,14 @@ class BP_Component {
 	 * @uses do_action() Calls 'bp_{@link bp_Component::name}_generate_rewrite_rules'
 	 */
 	public function generate_rewrite_rules() {
+
+		/**
+		 * Fires in the generate_rewrite_rules method inside BP_Component.
+		 *
+		 * This is a dynamic hook that is based on the component string ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_' . $this->id . '_generate_rewrite_rules' );
 	}
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
index ce59ad2b89d381b36ffca36654cf7957d4e2a157..45466e445fc372bbcc678e13696517c327770af9 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register scripts commonly used by BuddyPress.
@@ -17,23 +17,37 @@ if ( !defined( 'ABSPATH' ) ) exit;
 function bp_core_register_common_scripts() {
 	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 	$url = buddypress()->plugin_url . 'bp-core/js/';
-	
+
+	/**
+	 * Filters the BuddyPress Core javascript files to register.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $value Array of javascript file information to register.
+	 */
 	$scripts = apply_filters( 'bp_core_register_common_scripts', array(
 
 		// Legacy
-		'bp-confirm'        => array( 'file' => "{$url}confirm{$min}.js",        'dependencies' => array( 'jquery' ) ),
-		'bp-widget-members' => array( 'file' => "{$url}widget-members{$min}.js", 'dependencies' => array( 'jquery' ) ),
-		'bp-jquery-query'   => array( 'file' => "{$url}jquery-query{$min}.js",   'dependencies' => array( 'jquery' ) ),
-		'bp-jquery-cookie'  => array( 'file' => "{$url}jquery-cookie{$min}.js",  'dependencies' => array( 'jquery' ) ),
+		'bp-confirm'        => array( 'file' => "{$url}confirm{$min}.js",        'dependencies' => array( 'jquery' ), 'footer' => false ),
+		'bp-widget-members' => array( 'file' => "{$url}widget-members{$min}.js", 'dependencies' => array( 'jquery' ), 'footer' => false ),
+		'bp-jquery-query'   => array( 'file' => "{$url}jquery-query{$min}.js",   'dependencies' => array( 'jquery' ), 'footer' => false ),
+		'bp-jquery-cookie'  => array( 'file' => "{$url}jquery-cookie{$min}.js",  'dependencies' => array( 'jquery' ), 'footer' => false ),
+		'bp-jquery-scroll-to' => array( 'file' => "{$url}jquery-scroll-to{$min}.js", 'dependencies' => array( 'jquery' ), 'footer' => false ),
 
 		// 2.1
-		'jquery-caret' => array( 'file' => "{$url}jquery.caret{$min}.js", 'dependencies' => array( 'jquery' ) ),
-		'jquery-atwho' => array( 'file' => "{$url}jquery.atwho{$min}.js", 'dependencies' => array( 'jquery', 'jquery-caret' ) ),
+		'jquery-caret' => array( 'file' => "{$url}jquery.caret{$min}.js", 'dependencies' => array( 'jquery' ), 'footer' => true ),
+		'jquery-atwho' => array( 'file' => "{$url}jquery.atwho{$min}.js", 'dependencies' => array( 'jquery', 'jquery-caret' ), 'footer' => true ),
+
+		// 2.3
+		'bp-plupload' => array( 'file' => "{$url}bp-plupload{$min}.js", 'dependencies' => array( 'plupload', 'jquery', 'json2', 'wp-backbone' ), 'footer' => true ),
+		'bp-avatar'   => array( 'file' => "{$url}avatar{$min}.js", 'dependencies' => array( 'jcrop' ), 'footer' => true ),
+		'bp-webcam'   => array( 'file' => "{$url}webcam{$min}.js", 'dependencies' => array( 'bp-avatar' ), 'footer' => true ),
+
 	) );
 
 	$version = bp_get_version();
 	foreach ( $scripts as $id => $script ) {
-		wp_register_script( $id, $script['file'], $script['dependencies'], $version );
+		wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] );
 	}
 }
 add_action( 'bp_enqueue_scripts',       'bp_core_register_common_scripts', 1 );
@@ -48,11 +62,31 @@ function bp_core_register_common_styles() {
 	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 	$url = buddypress()->plugin_url . 'bp-core/css/';
 
+	/**
+	 * Filters the URL for the Admin Bar stylesheet.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value URL for the Admin Bar stylesheet.
+	 */
+	$admin_bar_file = apply_filters( 'bp_core_admin_bar_css', "{$url}admin-bar{$min}.css" );
+
+	/**
+	 * Filters the BuddyPress Core stylesheet files to register.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $value Array of stylesheet file information to register.
+	 */
 	$styles = apply_filters( 'bp_core_register_common_styles', array(
 		'bp-admin-bar' => array(
-			'file'         => apply_filters( 'bp_core_admin_bar_css', "{$url}admin-bar{$min}.css" ),
+			'file'         => $admin_bar_file,
 			'dependencies' => array( 'admin-bar' )
-		)
+		),
+		'bp-avatar' => array(
+			'file'         => "{$url}avatar{$min}.css",
+			'dependencies' => array( 'jcrop' )
+		),
 	) );
 
 	foreach ( $styles as $id => $style ) {
@@ -82,8 +116,28 @@ function bp_core_confirmation_js() {
 	) );
 
 }
-add_action( 'bp_enqueue_scripts',    'bp_core_confirmation_js' );
-add_action( 'admin_enqueue_scripts', 'bp_core_confirmation_js' );
+add_action( 'bp_enqueue_scripts',       'bp_core_confirmation_js' );
+add_action( 'bp_admin_enqueue_scripts', 'bp_core_confirmation_js' );
+
+/**
+ * Enqueues the css and js required by the Avatar UI
+ *
+ * @since  BuddyPress (2.3.0)
+ */
+function bp_core_avatar_scripts() {
+	if ( ! bp_avatar_is_front_edit() ) {
+		return false;
+	}
+
+	// Enqueue the Attachments scripts for the Avatar UI
+	bp_attachments_enqueue_scripts( 'BP_Attachment_Avatar' );
+
+	// Add Some actions for Theme backcompat
+	add_action( 'bp_after_profile_avatar_upload_content', 'bp_avatar_template_check' );
+	add_action( 'bp_after_group_admin_content',           'bp_avatar_template_check' );
+	add_action( 'bp_after_group_avatar_creation_step',    'bp_avatar_template_check' );
+}
+add_action( 'bp_enqueue_scripts', 'bp_core_avatar_scripts' );
 
 /**
  * Enqueues jCrop library and hooks BP's custom cropper JS.
@@ -100,7 +154,13 @@ function bp_core_add_jquery_cropper() {
  */
 function bp_core_add_cropper_inline_js() {
 
-	// Bail if no image was uploaded
+	/**
+	 * Filters the return value of getimagesize to determine if an image was uploaded.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array $value Array of data found by getimagesize.
+	 */
 	$image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir ) );
 	if ( empty( $image ) ) {
 		return;
@@ -125,7 +185,7 @@ function bp_core_add_cropper_inline_js() {
 		$crop_right = $image[0];
 
 	// Less than 2x full-width: cropper defaults to full-width
-	} else if ( $image[0] < ( $full_width * 2 ) ) {
+	} elseif ( $image[0] < ( $full_width * 2 ) ) {
 		$padding_w  = round( ( $image[0] - $full_width ) / 2 );
 		$crop_left  = $padding_w;
 		$crop_right = $image[0] - $padding_w;
@@ -142,7 +202,7 @@ function bp_core_add_cropper_inline_js() {
 		$crop_bottom = $image[1];
 
 	// Less than double full-height: cropper defaults to full-height
-	} else if ( $image[1] < ( $full_height * 2 ) ) {
+	} elseif ( $image[1] < ( $full_height * 2 ) ) {
 		$padding_h   = round( ( $image[1] - $full_height ) / 2 );
 		$crop_top    = $padding_h;
 		$crop_bottom = $image[1] - $padding_h;
@@ -163,7 +223,6 @@ function bp_core_add_cropper_inline_js() {
 				aspectRatio: <?php echo (int) $aspect_ratio; ?>,
 				setSelect: [ <?php echo (int) $crop_left; ?>, <?php echo (int) $crop_top; ?>, <?php echo (int) $crop_right; ?>, <?php echo (int) $crop_bottom; ?> ]
 			});
-			updateCoords({x: <?php echo (int) $crop_left; ?>, y: <?php echo (int) $crop_top; ?>, w: <?php echo (int) $crop_right; ?>, h: <?php echo (int) $crop_bottom; ?>});
 		});
 
 		function updateCoords(c) {
@@ -240,19 +299,35 @@ add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
  * @return string AJAX endpoint URL.
  */
 function bp_core_ajax_url() {
+
+	/**
+	 * Filters the proper value for BuddyPress' ajaxurl.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $value Proper ajaxurl value for BuddyPress.
+	 */
 	return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );
 }
 
 /**
- * Get the javascript dependencies for buddypress.js.
+ * Get the JavaScript dependencies for buddypress.js.
  *
  * @since BuddyPress (2.0.0)
  *
  * @uses apply_filters() to allow other component to load extra dependencies
  *
- * @return array The javascript dependencies.
+ * @return array The JavaScript dependencies.
  */
 function bp_core_get_js_dependencies() {
+
+	/**
+	 * Filters the javascript dependencies for buddypress.js.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $value Array of javascript dependencies for buddypress.js.
+	 */
 	return apply_filters( 'bp_core_get_js_dependencies', array(
 		'jquery',
 		'bp-confirm',
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php b/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php
index 8ce93a7d9461907183477fecdf40f37c31729fb9..6534851cfa2d848561a095833e69bec2f6ec0118 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php
@@ -14,13 +14,19 @@
  * The following functions are wrappers for hooks, allowing them to be
  * manually called and/or piggy-backed on top of other hooks if needed.
  *
- * @todo use anonymous functions when PHP minimun requirement allows (5.3)
+ * @todo use anonymous functions when PHP minimum requirement allows (5.3)
  */
 
 /**
  * Fire the 'bp_include' action, where plugins should include files.
  */
 function bp_include() {
+
+	/**
+	 * Fires inside the 'bp_include' function, where plugins should include files.
+	 *
+	 * @since BuddyPress (1.2.5)
+	 */
 	do_action( 'bp_include' );
 }
 
@@ -28,6 +34,12 @@ function bp_include() {
  * Fire the 'bp_setup_components' action, where plugins should initialize components.
  */
 function bp_setup_components() {
+
+	/**
+	 * Fires inside the 'bp_setup_components' function, where plugins should initialize components.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_setup_components' );
 }
 
@@ -35,13 +47,40 @@ function bp_setup_components() {
  * Fire the 'bp_setup_canonical_stack' action, where plugins should set up their canonical URL.
  */
 function bp_setup_canonical_stack() {
+
+	/**
+	 * Fires inside the 'bp_setup_canonical_stack' function, where plugins should set up their canonical URL.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 */
 	do_action( 'bp_setup_canonical_stack' );
 }
 
+/**
+ * Fire the 'bp_register_taxonomies' action, where plugins should register taxonomies.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_register_taxonomies() {
+
+	/**
+	 * Fires inside the 'bp_register_taxonomies' function, where plugins should register taxonomies.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	do_action( 'bp_register_taxonomies' );
+}
+
 /**
  * Fire the 'bp_setup_globals' action, where plugins should initialize global settings.
  */
 function bp_setup_globals() {
+
+	/**
+	 * Fires inside the 'bp_setup_globals' function, where plugins should initialize global settings.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_setup_globals' );
 }
 
@@ -49,6 +88,12 @@ function bp_setup_globals() {
  * Fire the 'bp_setup_nav' action, where plugins should register their navigation items.
  */
 function bp_setup_nav() {
+
+	/**
+	 * Fires inside the 'bp_setup_nav' function, where plugins should register their navigation items.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_setup_nav' );
 }
 
@@ -56,14 +101,29 @@ function bp_setup_nav() {
  * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar.
  */
 function bp_setup_admin_bar() {
-	if ( bp_use_wp_admin_bar() )
+	if ( bp_use_wp_admin_bar() ) {
+
+		/**
+		 * Fires inside the 'bp_setup_admin_bar' function, where plugins should add items to the WP admin bar.
+		 *
+		 * This hook will only fire if bp_use_wp_admin_bar() returns true.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_setup_admin_bar' );
+	}
 }
 
 /**
  * Fire the 'bp_setup_title' action, where plugins should modify the page title.
  */
 function bp_setup_title() {
+
+	/**
+	 * Fires inside the 'bp_setup_title' function, where plugins should modify the page title.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_setup_title' );
 }
 
@@ -71,12 +131,53 @@ function bp_setup_title() {
  * Fire the 'bp_register_widgets' action, where plugins should register widgets.
  */
 function bp_setup_widgets() {
+
+	/**
+	 * Fires inside the 'bp_register_widgets' function, where plugins should register widgets.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_register_widgets' );
 }
 
+/**
+ * Fire the 'bp_register_member_types' action, where plugins should register member types.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_register_member_types() {
+
+	/**
+	 * Fires inside bp_register_member_types(), so plugins can register member types.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 */
+	do_action( 'bp_register_member_types' );
+}
+
+/**
+ * Fire the 'bp_setup_cache_groups' action, where cache groups are registered.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_setup_cache_groups() {
+
+	/**
+	 * Fires inside the 'bp_setup_cache_groups' function, where cache groups are registered.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	do_action( 'bp_setup_cache_groups' );
+}
+
 /**
  * Set up the currently logged-in user.
  *
+ * We white-list the WordPress customizer which purposely loads the user early.
+ *
+ * @link https://buddypress.trac.wordpress.org/ticket/6046
+ * @link https://core.trac.wordpress.org/ticket/24169
+ *
  * @uses did_action() To make sure the user isn't loaded out of order.
  * @uses do_action() Calls 'bp_setup_current_user'.
  */
@@ -84,10 +185,15 @@ function bp_setup_current_user() {
 
 	// If the current user is being setup before the "init" action has fired,
 	// strange (and difficult to debug) role/capability issues will occur.
-	if ( ! did_action( 'after_setup_theme' ) ) {
+	if ( ! isset( $GLOBALS['wp_customize'] ) && ! did_action( 'after_setup_theme' ) ) {
 		_doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'buddypress' ), '1.7' );
 	}
 
+	/**
+	 * Fires to set up the current user setup process.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
 	do_action( 'bp_setup_current_user' );
 }
 
@@ -95,6 +201,12 @@ function bp_setup_current_user() {
  * Fire the 'bp_init' action, BuddyPress's main initialization hook.
  */
 function bp_init() {
+
+	/**
+	 * Fires inside the 'bp_init' function, BuddyPress' main initialization hook.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
 	do_action( 'bp_init' );
 }
 
@@ -104,6 +216,12 @@ function bp_init() {
  * Attached to 'plugins_loaded'.
  */
 function bp_loaded() {
+
+	/**
+	 * Fires inside the 'bp_loaded' function, which fires after BP's core plugin files have been loaded.
+	 *
+	 * @since BuddyPress (1.2.5)
+	 */
 	do_action( 'bp_loaded' );
 }
 
@@ -113,6 +231,12 @@ function bp_loaded() {
  * Attached to 'wp'.
  */
 function bp_ready() {
+
+	/**
+	 * Fires inside the 'bp_ready' function, which runs after BP is set up and the page is about to render.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_ready' );
 }
 
@@ -123,6 +247,12 @@ function bp_ready() {
  * custom URLs.
  */
 function bp_actions() {
+
+	/**
+	 * Fires inside the 'bp_actions' function, which runs just before rendering.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_actions' );
 }
 
@@ -133,6 +263,14 @@ function bp_actions() {
  * loaders.
  */
 function bp_screens() {
+
+	/**
+	 * Fires inside the 'bp_screens' function, which runs just before rendering.
+	 *
+	 * Runs just after 'bp_actions'. Use this hook to attach your template loaders.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_screens' );
 }
 
@@ -142,6 +280,14 @@ function bp_screens() {
  * Hooked to 'widgets_init'.
  */
 function bp_widgets_init() {
+
+	/**
+	 * Fires inside the 'bp_widgets_init' function, which runs after widgets have been set up.
+	 *
+	 * Hooked to 'widgets_init'.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action ( 'bp_widgets_init' );
 }
 
@@ -168,6 +314,12 @@ function bp_head() {
  * @uses do_action()
  */
 function bp_template_redirect() {
+
+	/**
+	 * Fires inside the 'bp_template_redirect' function.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_template_redirect' );
 }
 
@@ -183,6 +335,14 @@ function bp_template_redirect() {
  * @uses do_action()
  */
 function bp_register_theme_directory() {
+
+	/**
+	 * Fires inside the 'bp_register_theme_directory' function.
+	 *
+	 * The main action used registering theme directories.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
 	do_action( 'bp_register_theme_directory' );
 }
 
@@ -196,6 +356,12 @@ function bp_register_theme_directory() {
  * @uses do_action()
  */
 function bp_register_theme_packages() {
+
+	/**
+	 * Fires inside the 'bp_register_theme_packages' function.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
 	do_action( 'bp_register_theme_packages' );
 }
 
@@ -207,6 +373,12 @@ function bp_register_theme_packages() {
  * @uses do_action() Calls 'bp_enqueue_scripts'.
  */
 function bp_enqueue_scripts() {
+
+	/**
+	 * Fires inside the 'bp_enqueue_scripts' function, where BP enqueues its CSS and JS.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action ( 'bp_enqueue_scripts' );
 }
 
@@ -218,6 +390,12 @@ function bp_enqueue_scripts() {
  * @uses do_action() Calls 'bp_add_rewrite_tags'.
  */
 function bp_add_rewrite_tags() {
+
+	/**
+	 * Fires inside the 'bp_add_rewrite_tags' function, where BP adds its custom rewrite tags.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
 	do_action( 'bp_add_rewrite_tags' );
 }
 
@@ -229,6 +407,12 @@ function bp_add_rewrite_tags() {
  * @uses do_action() Calls 'bp_add_rewrite_rules'.
  */
 function bp_add_rewrite_rules() {
+
+	/**
+	 * Fires inside the 'bp_add_rewrite_rules' function, where BP adds its custom rewrite rules.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 */
 	do_action( 'bp_add_rewrite_rules' );
 }
 
@@ -240,6 +424,12 @@ function bp_add_rewrite_rules() {
  * @uses do_action() Calls 'bp_add_permastructs'.
  */
 function bp_add_permastructs() {
+
+	/**
+	 * Fires inside the 'bp_add_permastructs' function, where BP adds its BP-specific permalink structure.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 */
 	do_action( 'bp_add_permastructs' );
 }
 
@@ -254,6 +444,12 @@ function bp_add_permastructs() {
  * @uses do_action() Calls 'bp_setup_theme'.
  */
 function bp_setup_theme() {
+
+	/**
+	 * Fires inside the 'bp_setup_theme' function.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action ( 'bp_setup_theme' );
 }
 
@@ -272,6 +468,12 @@ function bp_setup_theme() {
  * @uses do_action() Calls 'bp_after_setup_theme'.
  */
 function bp_after_setup_theme() {
+
+	/**
+	 * Fires inside the 'bp_after_setup_theme' function.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
 	do_action ( 'bp_after_setup_theme' );
 }
 
@@ -288,6 +490,14 @@ function bp_after_setup_theme() {
  * @return array $query_vars See {@link WP::parse_request()}.
  */
 function bp_request( $query_vars = array() ) {
+
+	/**
+	 * Filters the query_vars for the current request.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $query_vars Array of query variables.
+	 */
 	return apply_filters( 'bp_request', $query_vars );
 }
 
@@ -298,9 +508,21 @@ function bp_request( $query_vars = array() ) {
  *
  * @param string $redirect_to See 'login_redirect'.
  * @param string $redirect_to_raw See 'login_redirect'.
- * @param string $user See 'login_redirect'.
+ * @param bool   $user See 'login_redirect'.
+ *
+ * @return string
  */
 function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) {
+
+	/**
+	 * Filters the URL to redirect to after login.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string           $redirect_to     The redirect destination URL.
+	 * @param string           $redirect_to_raw The requested redirect destination URL passed as a parameter.
+	 * @param WP_User|WP_Error $user            WP_User object if login was successful, WP_Error object otherwise.
+	 */
 	return apply_filters( 'bp_login_redirect', $redirect_to, $redirect_to_raw, $user );
 }
 
@@ -317,11 +539,19 @@ function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = fa
  * @return string Template file to use.
  */
 function bp_template_include( $template = '' ) {
+
+	/**
+	 * Filters the template to use with template_include.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $template The path of the template to include.
+	 */
 	return apply_filters( 'bp_template_include', $template );
 }
 
 /**
- * Fire the 'bp_generate_rewrite_rules' filter, where BP generates its rewrite rules.
+ * Fire the 'bp_generate_rewrite_rules' action, where BP generates its rewrite rules.
  *
  * @since BuddyPress (1.7.0)
  *
@@ -330,6 +560,14 @@ function bp_template_include( $template = '' ) {
  * @param WP_Rewrite $wp_rewrite See 'generate_rewrite_rules'.
  */
 function bp_generate_rewrite_rules( $wp_rewrite ) {
+
+	/**
+	 * Fires inside the 'bp_generate_rewrite_rules' function.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param WP_Rewrite $wp_rewrite WP_Rewrite object. Passed by reference.
+	 */
 	do_action_ref_array( 'bp_generate_rewrite_rules', array( &$wp_rewrite ) );
 }
 
@@ -343,6 +581,14 @@ function bp_generate_rewrite_rules( $wp_rewrite ) {
  * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list.
  */
 function bp_allowed_themes( $themes ) {
+
+	/**
+	 * Filters the allowed themes list for BuddyPress-specific themes.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $template The path of the template to include.
+	 */
 	return apply_filters( 'bp_allowed_themes', $themes );
 }
 
@@ -357,19 +603,38 @@ function bp_allowed_themes( $themes ) {
 function bp_post_request() {
 
 	// Bail if not a POST action
-	if ( ! bp_is_post_request() )
+	if ( ! bp_is_post_request() ) {
 		return;
+	}
 
 	// Bail if no action
-	if ( empty( $_POST['action'] ) )
+	if ( empty( $_POST['action'] ) ) {
 		return;
+	}
+
+	// Sanitize the POST action
+	$action = sanitize_key( $_POST['action'] );
 
-	// This dynamic action is probably the one you want to use. It narrows down
-	// the scope of the 'action' without needing to check it in your function.
-	do_action( 'bp_post_request_' . $_POST['action'] );
+	/**
+	 * Fires at the end of the bp_post_request function.
+	 *
+	 * This dynamic action is probably the one you want to use. It narrows down
+	 * the scope of the 'action' without needing to check it in your function.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 */
+	do_action( 'bp_post_request_' . $action );
 
-	// Use this static action if you don't mind checking the 'action' yourself.
-	do_action( 'bp_post_request',   $_POST['action'] );
+	/**
+	 * Fires at the end of the bp_post_request function.
+	 *
+	 * Use this static action if you don't mind checking the 'action' yourself.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $action The action being run.
+	 */
+	do_action( 'bp_post_request',   $action );
 }
 
 /**
@@ -381,17 +646,36 @@ function bp_post_request() {
 function bp_get_request() {
 
 	// Bail if not a POST action
-	if ( ! bp_is_get_request() )
+	if ( ! bp_is_get_request() ) {
 		return;
+	}
 
 	// Bail if no action
-	if ( empty( $_GET['action'] ) )
+	if ( empty( $_GET['action'] ) ) {
 		return;
+	}
 
-	// This dynamic action is probably the one you want to use. It narrows down
-	// the scope of the 'action' without needing to check it in your function.
-	do_action( 'bp_get_request_' . $_GET['action'] );
-
-	// Use this static action if you don't mind checking the 'action' yourself.
-	do_action( 'bp_get_request',   $_GET['action'] );
+	// Sanitize the GET action
+	$action = sanitize_key( $_GET['action'] );
+
+	/**
+	 * Fires at the end of the bp_get_request function.
+	 *
+	 * This dynamic action is probably the one you want to use. It narrows down
+	 * the scope of the 'action' without needing to check it in your function.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 */
+	do_action( 'bp_get_request_' . $action );
+
+	/**
+	 * Fires at the end of the bp_get_request function.
+	 *
+	 * Use this static action if you don't mind checking the 'action' yourself.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $action The action being run.
+	 */
+	do_action( 'bp_get_request',   $action );
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
index 69f06856ea5ae14ddecf96aaf2bde2a63e14a593..b5e857ace50fb5f2218b6c98ce53e11e84526f4b 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php
@@ -21,7 +21,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Attach BuddyPress to WordPress.
@@ -63,7 +63,7 @@ add_filter( 'bp_template_include',   'bp_template_include_theme_supports', 2, 1
 add_filter( 'bp_template_include',   'bp_template_include_theme_compat',   4, 2 );
 
 // Filter BuddyPress template locations
-add_filter( 'bp_get_template_stack', 'bp_add_template_stack_locations'          );
+add_filter( 'bp_get_template_stack', 'bp_add_template_stack_locations' );
 
 // Turn comments off for BuddyPress pages
 add_filter( 'comments_open', 'bp_comments_open', 10, 2 );
@@ -94,6 +94,13 @@ function bp_core_exclude_pages( $pages = array() ) {
 	if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) )
 		$pages[] = $bp->pages->forums->id;
 
+	/**
+	 * Filters specific pages that shouldn't show up on page listings.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $pages Array of pages to exclude.
+	 */
 	return apply_filters( 'bp_core_exclude_pages', $pages );
 }
 add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' );
@@ -139,6 +146,93 @@ function bp_core_exclude_pages_from_nav_menu_admin( $object = null ) {
 }
 add_filter( 'nav_menu_meta_box_object', 'bp_core_exclude_pages_from_nav_menu_admin', 11, 1 );
 
+/**
+ * Adds current page CSS classes to the parent BP page in a WP Page Menu.
+ *
+ * Because BuddyPress primarily uses virtual pages, we need a way to highlight
+ * the BP parent page during WP menu generation.  This function checks the
+ * current BP component against the current page in the WP menu to see if we
+ * should highlight the WP page.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array   $retval CSS classes for the current menu page in the menu
+ * @param WP_Post $page   The page properties for the current menu item
+ * @return array
+ */
+function bp_core_menu_highlight_parent_page( $retval, $page ) {
+	if ( ! is_buddypress() ) {
+		return $retval;
+	}
+
+	$page_id = false;
+
+	// loop against all BP component pages
+	foreach ( (array) buddypress()->pages as $component => $bp_page ) {
+		// handles the majority of components
+		if ( bp_is_current_component( $component ) ) {
+	                $page_id = (int) $bp_page->id;
+		}
+
+		// stop if not on a user page
+		if ( ! bp_is_user() && ! empty( $page_id ) ) {
+			break;
+		}
+
+		// members component requires an explicit check due to overlapping components
+		if ( bp_is_user() && 'members' === $component ) {
+			$page_id = (int) $bp_page->id;
+			break;
+		}
+	}
+
+	// duplicate some logic from Walker_Page::start_el() to highlight menu items
+	if ( ! empty( $page_id ) ) {
+		$_bp_page = get_post( $page_id );
+		if ( in_array( $page->ID, $_bp_page->ancestors, true ) ) {
+			$retval[] = 'current_page_ancestor';
+		}
+		if ( $page->ID === $page_id ) {
+			$retval[] = 'current_page_item';
+		} elseif ( $_bp_page && $page->ID === $_bp_page->post_parent ) {
+			$retval[] = 'current_page_parent';
+		}
+	}
+
+	$retval = array_unique( $retval );
+
+	return $retval;
+}
+add_filter( 'page_css_class', 'bp_core_menu_highlight_parent_page', 10, 2 );
+
+/**
+ * Adds current page CSS classes to the parent BP page in a WP Nav Menu.
+ *
+ * When {@link wp_nav_menu()} is used, this function helps to highlight the
+ * current BP parent page during nav menu generation.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array   $retval CSS classes for the current nav menu item in the menu
+ * @param WP_Post $item   The properties for the current nav menu item
+ * @return array
+ */
+function bp_core_menu_highlight_nav_menu_item( $retval, $item ) {
+	// If we're not on a BP page or if the current nav item is not a page, stop!
+	if ( ! is_buddypress() || 'page' !== $item->object ) {
+		return $retval;
+	}
+
+	// get the WP page
+	$page   = get_post( $item->object_id );
+
+	// see if we should add our highlight CSS classes for the page
+	$retval = bp_core_menu_highlight_parent_page( $retval, $page );
+
+	return $retval;
+}
+add_filter( 'nav_menu_css_class', 'bp_core_menu_highlight_nav_menu_item', 10, 2 );
+
 /**
  * Set "From" name in outgoing email to the site name.
  *
@@ -147,6 +241,14 @@ add_filter( 'nav_menu_meta_box_object', 'bp_core_exclude_pages_from_nav_menu_adm
  * @return string The blog name for the root blog.
  */
 function bp_core_email_from_name_filter() {
+
+	/**
+	 * Filters the "From" name in outgoing email to the site name.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Value to set the "From" name to.
+	 */
  	return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) );
 }
 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
@@ -213,7 +315,19 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) {
 		return $redirect_to;
 	}
 
-	// Allow plugins to allow or disallow redirects, as desired
+	/**
+	 * Filters whether or not to redirect.
+	 *
+	 * Allows plugins to have finer grained control of redirect upon login.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+    * @param bool    $value           Whether or not to redirect.
+	 * @param string  $redirect_to     Sanitized URL to be redirected to.
+	 * @param string  $redirect_to_raw Unsanitized URL to be redirected to.
+	 * @param WP_User $user            The WP_User object corresponding to a
+	 *                                 successfully logged in user.
+	 */
 	$maybe_redirect = apply_filters( 'bp_core_login_redirect', false, $redirect_to, $redirect_to_raw, $user );
 	if ( false !== $maybe_redirect ) {
 		return $maybe_redirect;
@@ -230,6 +344,13 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) {
 		return wp_get_referer();
 	}
 
+	/**
+	 * Filters the URL to redirect users to upon successful login.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $value URL to redirect to.
+	 */
 	return apply_filters( 'bp_core_login_redirect_to', bp_get_root_domain() );
 }
 add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
@@ -327,9 +448,52 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u
 	$message = sprintf( __( "%1\$s,\n\n\n\nThanks for registering! To complete the activation of your account and blog, please click the following link:\n\n%2\$s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%3\$s", 'buddypress' ), $user, $activate_url, esc_url( "http://{$domain}{$path}" ) );
 	$subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Activate %s', 'buddypress' ), 'http://' . $domain . $path ) ) );
 
-	// Email filters
+	/**
+	 * Filters the email that the notification is going to upon successful registration with blog.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $user_email The user's email address.
+	 * @param string $domain     The new blog domain.
+	 * @param string $path       The new blog path.
+	 * @param string $title      The site title.
+	 * @param string $user       The user's login name.
+	 * @param string $user_email The user's email address.
+	 * @param string $key        The activation key created in wpmu_signup_blog().
+	 * @param array  $meta       Array of meta values for the created site.
+	 */
 	$to      = apply_filters( 'bp_core_activation_signup_blog_notification_to',   $user_email, $domain, $path, $title, $user, $user_email, $key, $meta );
+
+	/**
+	 * Filters the subject that the notification uses upon successful registration with blog.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $subject    The subject to use.
+	 * @param string $domain     The new blog domain.
+	 * @param string $path       The new blog path.
+	 * @param string $title      The site title.
+	 * @param string $user       The user's login name.
+	 * @param string $user_email The user's email address.
+	 * @param string $key        The activation key created in wpmu_signup_blog().
+	 * @param array  $meta       Array of meta values for the created site.
+	 */
 	$subject = apply_filters( 'bp_core_activation_signup_blog_notification_subject', $subject, $domain, $path, $title, $user, $user_email, $key, $meta );
+
+	/**
+	 * Filters the message that the notification uses upon successful registration with blog.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $message    The message to use.
+	 * @param string $domain     The new blog domain.
+	 * @param string $path       The new blog path.
+	 * @param string $title      The site title.
+	 * @param string $user       The user's login name.
+	 * @param string $user_email The user's email address.
+	 * @param string $key        The activation key created in wpmu_signup_blog().
+	 * @param array  $meta       Array of meta values for the created site.
+	 */
 	$message = apply_filters( 'bp_core_activation_signup_blog_notification_message', $message, $domain, $path, $title, $user, $user_email, $key, $meta );
 
 	// Send the email
@@ -338,6 +502,22 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u
 	// Set up the $admin_email to pass to the filter
 	$admin_email = bp_get_option( 'admin_email' );
 
+	/**
+	 * Fires after the sending of the notification to new users for successful registration with blog.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $admin_email Admin Email address for the site.
+	 * @param string $subject     Subject used in the notification email.
+	 * @param string $message     Message used in the notification email.
+	 * @param string domain       The new blog domain.
+	 * @param string $path        The new blog path.
+	 * @param string $title       The site title.
+	 * @param string $user        The user's login name.
+	 * @param string $user_email  The user's email address.
+	 * @param string $key         The activation key created in wpmu_signup_blog().
+	 * @param array  $meta        Array of meta values for the created site.
+	 */
 	do_action( 'bp_core_sent_blog_signup_email', $admin_email, $subject, $message, $domain, $path, $title, $user, $user_email, $key, $meta );
 
 	// Return false to stop the original WPMU function from continuing
@@ -375,7 +555,7 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key,
 		 * And the super admin goes in pending accounts to resend it. In this case, as the
 		 * meta['password'] is not set, the activation url must be WordPress one
 		 */
-		} else if ( buddypress()->members->admin->signups_page == get_current_screen()->id ) {
+		} elseif ( buddypress()->members->admin->signups_page == get_current_screen()->id ) {
 			$is_hashpass_in_meta = maybe_unserialize( $meta );
 
 			if ( empty( $is_hashpass_in_meta['password'] ) ) {
@@ -392,9 +572,43 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key,
 	$message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url );
 	$subject = bp_get_email_subject( array( 'text' => __( 'Activate Your Account', 'buddypress' ) ) );
 
-	// Email filters
+	/**
+	 * Filters the email that the notification is going to upon successful registration without blog.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $user_email The user's email address.
+	 * @param string $user       The user's login name.
+	 * @param string $user_email The user's email address.
+	 * @param string $key        The activation key created in wpmu_signup_blog().
+	 * @param array  $meta       Array of meta values for the created site.
+	 */
 	$to      = apply_filters( 'bp_core_activation_signup_user_notification_to',   $user_email, $user, $user_email, $key, $meta );
+
+	/**
+	 * Filters the subject that the notification uses upon successful registration without blog.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $subject    The subject to use.
+	 * @param string $user       The user's login name.
+	 * @param string $user_email The user's email address.
+	 * @param string $key        The activation key created in wpmu_signup_blog().
+	 * @param array  $meta       Array of meta values for the created site.
+	 */
 	$subject = apply_filters( 'bp_core_activation_signup_user_notification_subject', $subject, $user, $user_email, $key, $meta );
+
+	/**
+	 * Filters the message that the notification uses upon successful registration without blog.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $message    The message to use.
+	 * @param string $user       The user's login name.
+	 * @param string $user_email The user's email address.
+	 * @param string $key        The activation key created in wpmu_signup_blog().
+	 * @param array  $meta       Array of meta values for the created site.
+	 */
 	$message = apply_filters( 'bp_core_activation_signup_user_notification_message', $message, $user, $user_email, $key, $meta );
 
 	// Send the email
@@ -403,6 +617,19 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key,
 	// Set up the $admin_email to pass to the filter
 	$admin_email = bp_get_option( 'admin_email' );
 
+	/**
+	 * Fires after the sending of the notification to new users for successful registration without blog.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $admin_email Admin Email address for the site.
+	 * @param string $subject     Subject used in the notification email.
+	 * @param string $message     Message used in the notification email.
+	 * @param string $user        The user's login name.
+	 * @param string $user_email  The user's email address.
+	 * @param string $key         The activation key created in wpmu_signup_blog().
+	 * @param array  $meta        Array of meta values for the created site. Default empty array.
+	 */
 	do_action( 'bp_core_sent_user_signup_email', $admin_email, $subject, $message, $user, $user_email, $key, $meta );
 
 	// Return false to stop the original WPMU function from continuing
@@ -418,17 +645,19 @@ add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_not
  * @see wp_title()
  * @global object $bp BuddyPress global settings.
  *
- * @param string $title Original page title.
- * @param string $sep How to separate the various items within the page title.
- * @param string $seplocation Direction to display title.
- * @return string New page title.
+ * @param  string $title       Original page title.
+ * @param  string $sep         How to separate the various items within the page title.
+ * @param  string $seplocation Direction to display title.
+ *
+ * @return string              New page title.
  */
-function bp_modify_page_title( $title, $sep, $seplocation ) {
-	global $bp;
+function bp_modify_page_title( $title = '', $sep = '&raquo;', $seplocation = 'right' ) {
+	global $bp, $paged, $page, $_wp_theme_features;
 
 	// If this is not a BP page, just return the title produced by WP
-	if ( bp_is_blog_page() )
+	if ( bp_is_blog_page() ) {
 		return $title;
+	}
 
 	// If this is a 404, let WordPress handle it
 	if ( is_404() ) {
@@ -436,79 +665,176 @@ function bp_modify_page_title( $title, $sep, $seplocation ) {
 	}
 
 	// If this is the front page of the site, return WP's title
-	if ( is_front_page() || is_home() )
+	if ( is_front_page() || is_home() ) {
 		return $title;
+	}
+
+	// Return WP's title if not a BuddyPress page
+	if ( ! is_buddypress() ) {
+		return $title;
+	}
 
-	$title = '';
+	// Setup an empty title parts array
+	$title_parts = array();
+
+	// Is there a displayed user, and do they have a name?
+	$displayed_user_name = bp_get_displayed_user_fullname();
 
 	// Displayed user
-	if ( bp_get_displayed_user_fullname() && !is_404() ) {
+	if ( ! empty( $displayed_user_name ) && ! is_404() ) {
 
-		// Get the component's ID to try and get it's name
+		// Get the component's ID to try and get its name
 		$component_id = $component_name = bp_current_component();
 
-		// Use the actual component name
-		if ( !empty( $bp->{$component_id}->name ) ) {
-			$component_name = $bp->{$component_id}->name;
+		// Set empty subnav name
+		$component_subnav_name = '';
+
+		// Use the component nav name
+		if ( ! empty( $bp->bp_nav[$component_id] ) ) {
+			$component_name = _bp_strip_spans_from_title( $bp->bp_nav[ $component_id ]['name'] );
+
+		// Fall back on the component ID
+		} elseif ( ! empty( $bp->{$component_id}->id ) ) {
+			$component_name = ucwords( $bp->{$component_id}->id );
+		}
+
+		// Append action name if we're on a member component sub-page
+		if ( ! empty( $bp->bp_options_nav[ $component_id ] ) && ! empty( $bp->canonical_stack['action'] ) ) {
+			$component_subnav_name = wp_filter_object_list( $bp->bp_options_nav[ $component_id ], array( 'slug' => bp_current_action() ), 'and', 'name' );
 
-		// Fall back on the component ID (probably same as current_component)
-		} elseif ( !empty( $bp->{$component_id}->id ) ) {
-			$component_name = $bp->{$component_id}->id;
+			if ( ! empty( $component_subnav_name ) ) {
+				$component_subnav_name = array_shift( $component_subnav_name );
+			}
 		}
 
-		// Construct the page title. 1 = user name, 2 = seperator, 3 = component name
-		$title = strip_tags( sprintf( _x( '%1$s %3$s %2$s', 'Construct the page title. 1 = user name, 2 = component name, 3 = seperator', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep ) );
+		// If on the user profile's landing page, just use the fullname
+		if ( bp_is_current_component( $bp->default_component ) && ( bp_get_requested_url() === bp_displayed_user_domain() ) ) {
+			$title_parts[] = $displayed_user_name;
+
+		// Use component name on member pages
+		} else {
+			$title_parts = array_merge( $title_parts, array_map( 'strip_tags', array(
+				$displayed_user_name,
+				$component_name,
+			) ) );
+
+			// If we have a subnav name, add it separately for localization
+			if ( ! empty( $component_subnav_name ) ) {
+				$title_parts[] = strip_tags( $component_subnav_name );
+			}
+		}
 
 	// A single group
-	} elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
-		$subnav = isset( $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] ) ? $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] : '';
-		// translators: "group name | group nav section name"
-		$title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $subnav );
+	} elseif ( bp_is_active( 'groups' ) && ! empty( $bp->groups->current_group ) && ! empty( $bp->bp_options_nav[ $bp->groups->current_group->slug ] ) ) {
+		$subnav      = isset( $bp->bp_options_nav[ $bp->groups->current_group->slug ][ bp_current_action() ]['name'] ) ? $bp->bp_options_nav[ $bp->groups->current_group->slug ][ bp_current_action() ]['name'] : '';
+		$title_parts = array( $bp->bp_options_title, $subnav );
 
 	// A single item from a component other than groups
 	} elseif ( bp_is_single_item() ) {
-		// translators: "component item name | component nav section name | root component name"
-		$title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
+		$title_parts = array( $bp->bp_options_title, $bp->bp_options_nav[ bp_current_item() ][ bp_current_action() ]['name'] );
 
 	// An index or directory
 	} elseif ( bp_is_directory() ) {
-
 		$current_component = bp_current_component();
 
 		// No current component (when does this happen?)
-		if ( empty( $current_component ) ) {
-			$title = _x( 'Directory', 'component directory title', 'buddypress' );
-		} else {
-			$title = bp_get_directory_title( $current_component );
-		}
+		$title_parts = array( _x( 'Directory', 'component directory title', 'buddypress' ) );
+
+		if ( ! empty( $current_component ) ) {
+			$title_parts = array( bp_get_directory_title( $current_component ) );
+ 		}
 
 	// Sign up page
 	} elseif ( bp_is_register_page() ) {
-		$title = __( 'Create an Account', 'buddypress' );
+		$title_parts = array( __( 'Create an Account', 'buddypress' ) );
 
 	// Activation page
 	} elseif ( bp_is_activation_page() ) {
-		$title = __( 'Activate your Account', 'buddypress' );
+		$title_parts = array( __( 'Activate your Account', 'buddypress' ) );
 
 	// Group creation page
 	} elseif ( bp_is_group_create() ) {
-		$title = __( 'Create a Group', 'buddypress' );
+		$title_parts = array( __( 'Create a Group', 'buddypress' ) );
 
 	// Blog creation page
 	} elseif ( bp_is_create_blog() ) {
-		$title = __( 'Create a Site', 'buddypress' );
+		$title_parts = array( __( 'Create a Site', 'buddypress' ) );
+	}
+
+	// Strip spans
+	$title_parts = array_map( '_bp_strip_spans_from_title', $title_parts );
+
+	// sep on right, so reverse the order
+	if ( 'right' == $seplocation ) {
+		$title_parts = array_reverse( $title_parts );
+	}
+
+	// Get the blog name, so we can check if the original $title included it
+	$blogname = get_bloginfo( 'name', 'display' );
+
+	/**
+	 * Are we going to fake 'title-tag' theme functionality?
+	 *
+	 * @link https://buddypress.trac.wordpress.org/ticket/6107
+	 * @see wp_title()
+	 */
+	$title_tag_compatibility = (bool) ( ! empty( $_wp_theme_features['title-tag'] ) || strstr( $title, $blogname ) );
+
+	// Append the site title to title parts if theme supports title tag
+	if ( true === $title_tag_compatibility ) {
+		$title_parts[] = $blogname;
+
+		if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
+			$title_parts[] = sprintf( __( 'Page %s', 'buddypress' ), max( $paged, $page ) );
+		}
 	}
 
-	// Some BP nav items contain item counts. Remove them
-	$title = preg_replace( '|<span>[0-9]+</span>|', '', $title );
+	// Pad the separator with 1 space on each side
+	$prefix = str_pad( $sep, strlen( $sep ) + 2, ' ', STR_PAD_BOTH );
 
-	return apply_filters( 'bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation );
+	// Join the parts together
+	$new_title = join( $prefix, array_filter( $title_parts ) );
+
+	// Append the prefix for pre `title-tag` compatibility
+	if ( false === $title_tag_compatibility ) {
+		$new_title = $new_title . $prefix;
+	}
+
+	/**
+	 * Filters the page title for BuddyPress pages.
+	 *
+	 * @since  BuddyPress (1.5.0)
+	 *
+	 * @param  string $new_title   The BuddyPress page title.
+	 * @param  string $title       The original WordPress page title.
+	 * @param  string $sep         The title parts separator.
+	 * @param  string $seplocation Location of the separator (left or right).
+	 */
+	return apply_filters( 'bp_modify_page_title', $new_title, $title, $sep, $seplocation );
 }
-add_filter( 'wp_title', 'bp_modify_page_title', 10, 3 );
+add_filter( 'wp_title', 'bp_modify_page_title', 20, 3 );
 add_filter( 'bp_modify_page_title', 'wptexturize'     );
 add_filter( 'bp_modify_page_title', 'convert_chars'   );
 add_filter( 'bp_modify_page_title', 'esc_html'        );
 
+/**
+ * Strip span tags out of title part strings.
+ *
+ * This is a temporary function for compatibility with WordPress versions
+ * less than 4.0, and should be removed at a later date.
+ *
+ * @param  string $title_part
+ * @return string
+ */
+function _bp_strip_spans_from_title( $title_part = '' ) {
+	$title = $title_part;
+	$span = strpos( $title, '<span' );
+	if ( false !== $span ) {
+		$title = substr( $title, 0, $span - 1 );
+	}
+	return $title;
+}
+
 /**
  * Add BuddyPress-specific items to the wp_nav_menu.
  *
@@ -524,7 +850,7 @@ function bp_setup_nav_menu_item( $menu_item ) {
 
 	// We use information stored in the CSS class to determine what kind of
 	// menu item this is, and how it should be treated
-	$css_target = preg_match( '/\sbp-(.*)-nav/', implode( ' ', $menu_item->classes), $matches );
+	preg_match( '/\sbp-(.*)-nav/', implode( ' ', $menu_item->classes), $matches );
 
 	// If this isn't a BP menu item, we can stop here
 	if ( empty( $matches[1] ) ) {
@@ -603,7 +929,25 @@ add_filter( 'wp_setup_nav_menu_item', 'bp_setup_nav_menu_item', 10, 1 );
  * @return string
  */
 function bp_filter_metaid_column_name( $q ) {
-	return str_replace( 'meta_id', 'id', $q );
+	/*
+	 * Replace quoted content with __QUOTE__ to avoid false positives.
+	 * This regular expression will match nested quotes.
+	 */
+	$quoted_regex = "/'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'/s";
+	preg_match_all( $quoted_regex, $q, $quoted_matches );
+	$q = preg_replace( $quoted_regex, '__QUOTE__', $q );
+
+	$q = str_replace( 'meta_id', 'id', $q );
+
+	// Put quoted content back into the string.
+	if ( ! empty( $quoted_matches[0] ) ) {
+		for ( $i = 0; $i < count( $quoted_matches[0] ); $i++ ) {
+			$quote_pos = strpos( $q, '__QUOTE__' );
+			$q = substr_replace( $q, $quoted_matches[0][ $i ], $quote_pos, 9 );
+		}
+	}
+
+	return $q;
 }
 
 /**
@@ -611,8 +955,8 @@ function bp_filter_metaid_column_name( $q ) {
  *
  * @since BuddyPress (2.1.0)
  *
- * @param  string $link    The edit link.
- * @param  int    $post_id Post ID.
+ * @param  string $edit_link The edit link.
+ * @param  int    $post_id   Post ID.
  * @return mixed  Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link)
  *                otherwise
  */
@@ -623,3 +967,25 @@ function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) {
 
 	return $edit_link;
 }
+
+/**
+ * Should BuddyPress load the mentions scripts and related assets, including results to prime the
+ * mentions suggestions?
+ *
+ * @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.
+ * @since BuddyPress (2.2.0)
+ */
+function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled ) {
+	if ( ! $mentions_enabled ) {
+		return $load_mentions;
+	}
+
+	if ( $load_mentions || ( bp_is_blog_page() && is_singular() && comments_open() ) ) {
+		return true;
+	}
+
+	return $load_mentions;
+}
+add_filter( 'bp_activity_maybe_load_mentions_scripts', 'bp_maybe_load_mentions_scripts_for_blog_content', 10, 2 );
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
index 5b93f9c8d90930e9f4f9d46142996841dd86869e..55449bfe662d7133c268639558b6f899ddb52379 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Versions ******************************************************************/
 
@@ -71,7 +71,7 @@ function bp_db_version_raw() {
 	 * @return string The BuddyPress version direct from the database.
 	 */
 	function bp_get_db_version_raw() {
-		$bp     = buddypress();
+		$bp = buddypress();
 		return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
 	}
 
@@ -89,43 +89,53 @@ function bp_db_version_raw() {
 function bp_core_get_table_prefix() {
 	global $wpdb;
 
+	/**
+	 * Filters the $wpdb base prefix.
+	 *
+	 * Intended primarily for use in multinetwork installations.
+	 *
+	 * @since BuddyPress (1.2.6)
+	 *
+	 * @param string $base_prefix Base prefix to use.
+	 */
 	return apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix );
 }
 
 /**
- * Sort an array of objects or arrays by alphabetically sorting by a specific key/property.
- *
- * For instance, if you have an array of WordPress post objects, you can sort
- * them by post_name as follows:
- *     $sorted_posts = bp_alpha_sort_by_key( $posts, 'post_name' );
+ * Sort an array of objects or arrays by a specific key/property.
  *
  * The main purpose for this function is so that you can avoid having to create
  * your own awkward callback function for usort().
  *
- * @since BuddyPress (1.9.0)
+ * @since BuddyPress (2.2.0)
  *
- * @param array $items The array to be sorted. Its constituent items can be
- *        either associative arrays or objects.
- * @param string|int $key The array index or property name to sort by.
- * @return array $items The sorted array.
+ * @param  array      $items The items to be sorted. Its constituent items can be either associative arrays or objects.
+ * @param  string|int $key   The array index or property name to sort by.
+ * @param  string     $type  Sort type. 'alpha' for alphabetical, 'num' for numeric. Default: 'alpha'.
+ * @return array      $items The sorted array.
  */
-function bp_alpha_sort_by_key( $items, $key ) {
+function bp_sort_by_key( $items, $key, $type = 'alpha' ) {
 	usort( $items, create_function( '$a, $b', '
 		$values = array( 0 => false, 1 => false, );
 		$func_args = func_get_args();
 		foreach ( $func_args as $indexi => $index ) {
 			if ( isset( $index->' . $key . ' ) ) {
 				$values[ $indexi ] = $index->' . $key . ';
-			} else if ( isset( $index["' . $key . '"] ) ) {
+			} elseif ( isset( $index["' . $key . '"] ) ) {
 				$values[ $indexi ] = $index["' . $key . '"];
 			}
 		}
 
-		if ( $values[0] && $values[1] ) {
-			$cmp = strcmp( $values[0], $values[1] );
+		if ( isset( $values[0], $values[1] ) ) {
+			if ( "num" === "' . $type . '" ) {
+				$cmp = $values[0] - $values[1];
+			} else {
+				$cmp = strcmp( $values[0], $values[1] );
+			}
+
 			if ( 0 > $cmp ) {
 				$retval = -1;
-			} else if ( 0 < $cmp ) {
+			} elseif ( 0 < $cmp ) {
 				$retval = 1;
 			} else {
 				$retval = 0;
@@ -139,6 +149,23 @@ function bp_alpha_sort_by_key( $items, $key ) {
 	return $items;
 }
 
+/**
+ * Sort an array of objects or arrays by alphabetically sorting by a specific key/property.
+ *
+ * For instance, if you have an array of WordPress post objects, you can sort
+ * them by post_name as follows:
+ *     $sorted_posts = bp_alpha_sort_by_key( $posts, 'post_name' );
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @param  array      $items The items to be sorted. Its constituent items can be either associative arrays or objects.
+ * @param  string|int $key   The array index or property name to sort by.
+ * @return array      $items The sorted array.
+ */
+function bp_alpha_sort_by_key( $items, $key ) {
+	return bp_sort_by_key( $items, $key, 'alpha' );
+}
+
 /**
  * Format numbers the BuddyPress way.
  *
@@ -153,6 +180,15 @@ function bp_core_number_format( $number = 0, $decimals = false ) {
 		$number = 0;
 	}
 
+	/**
+	 * Filters the BuddyPress formatted number.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param string $value    BuddyPress formatted value.
+	 * @param int    $number   The number to be formatted.
+	 * @param bool   $decimals Whether or not to use decimals.
+	 */
 	return apply_filters( 'bp_core_number_format', number_format_i18n( $number, $decimals ), $number, $decimals );
 }
 
@@ -232,6 +268,16 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) {
 
 	// Passively filter the args before the parse
 	if ( !empty( $filter_key ) ) {
+
+		/**
+		 * Filters the arguments key before parsing if filter key provided.
+		 *
+		 * This is a dynamic filter dependent on the specified key.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $r Array of arguments to use.
+		 */
 		$r = apply_filters( 'bp_before_' . $filter_key . '_parse_args', $r );
 	}
 
@@ -242,6 +288,16 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) {
 
 	// Aggressively filter the args after the parse
 	if ( !empty( $filter_key ) ) {
+
+		/**
+		 * Filters the arguments key after parsing if filter key provided.
+		 *
+		 * This is a dynamic filter dependent on the specified key.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $r Array of parsed arguments.
+		 */
 		$r = apply_filters( 'bp_after_' . $filter_key . '_parse_args', $r );
 	}
 
@@ -249,6 +305,35 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) {
 	return $r;
 }
 
+/**
+ * Sanitizes a pagination argument based on both the request override and the
+ * original value submitted via a query argument, likely to a template class
+ * responsible for limiting the resultset of a template loop.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  string $page_arg The $_REQUEST argument to look for
+ * @param  int    $page     The original page value to fall back to
+ * @return int              A sanitized integer value, good for pagination
+ */
+function bp_sanitize_pagination_arg( $page_arg = '', $page = 1 ) {
+
+	// Check if request overrides exist
+	if ( isset( $_REQUEST[ $page_arg ] ) ) {
+
+		// Get the absolute integer value of the override
+		$int = absint( $_REQUEST[ $page_arg ] );
+
+		// If override is 0, do not use it. This prevents unlimited result sets.
+		// @see https://buddypress.trac.wordpress.org/ticket/5796
+		if ( $int ) {
+			$page = $int;
+		}
+	}
+
+	return intval( $page );
+}
+
 /**
  * Sanitize an 'order' parameter for use in building SQL queries.
  *
@@ -303,6 +388,14 @@ function bp_esc_like( $text ) {
  *         Default: false.
  */
 function bp_is_username_compatibility_mode() {
+
+	/**
+	 * Filters whether or not to use username compatibility mode.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not username compatibility mode should be used.
+	 */
 	return apply_filters( 'bp_is_username_compatibility_mode', defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) && BP_ENABLE_USERNAME_COMPATIBILITY_MODE );
 }
 
@@ -323,7 +416,7 @@ function bp_use_wp_admin_bar() {
 	// Default to true (to avoid loading deprecated BuddyBar code)
 	$use_admin_bar = true;
 
-	// Has the WP Toolbar constant been explicity opted into?
+	// Has the WP Toolbar constant been explicitly opted into?
 	if ( defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
 		$use_admin_bar = (bool) BP_USE_WP_ADMIN_BAR;
 
@@ -332,6 +425,13 @@ function bp_use_wp_admin_bar() {
 		$use_admin_bar = false;
 	}
 
+	/**
+	 * Filters whether or not to use the admin bar.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $use_admin_bar Whether or not to use the admin bar.
+	 */
 	return (bool) apply_filters( 'bp_use_wp_admin_bar', $use_admin_bar );
 }
 
@@ -371,21 +471,47 @@ function bp_core_get_packaged_component_ids() {
  *
  * @since BuddyPress (1.5.0)
  *
+ * @param string $status 'active' to return only pages associated with active components, 'all' to return all saved
+ *                       pages. When running save routines, use 'all' to avoid removing data related to inactive
+ *                       components. Default: 'active'.
  * @return array|string An array of page IDs, keyed by component names, or an
- *         empty string if the list is not found.
+ *                      empty string if the list is not found.
  */
-function bp_core_get_directory_page_ids() {
+function bp_core_get_directory_page_ids( $status = 'active' ) {
 	$page_ids = bp_get_option( 'bp-pages' );
 
 	// Ensure that empty indexes are unset. Should only matter in edge cases
 	if ( !empty( $page_ids ) && is_array( $page_ids ) ) {
 		foreach( (array) $page_ids as $component_name => $page_id ) {
 			if ( empty( $component_name ) || empty( $page_id ) ) {
-				unset( $page_ids[$component_name] );
+				unset( $page_ids[ $component_name ] );
+			}
+
+			// 'register' and 'activate' do not have components, but should be whitelisted.
+			if ( 'register' === $component_name || 'activate' === $component_name ) {
+				continue;
+			}
+
+			// Trashed pages should not appear in results.
+			if ( 'trash' == get_post_status( $page_id ) ) {
+				unset( $page_ids[ $component_name ] );
+
+			}
+
+			// Remove inactive component pages, if required.
+			if ( 'active' === $status && ! bp_is_active( $component_name ) ) {
+				unset( $page_ids[ $component_name ] );
 			}
 		}
 	}
 
+	/**
+	 * Filters the list of BP directory pages from the appropriate meta table.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $page_ids Array of directory pages.
+	 */
 	return apply_filters( 'bp_core_get_directory_page_ids', $page_ids );
 }
 
@@ -463,6 +589,13 @@ function bp_core_get_directory_pages() {
 		wp_cache_set( 'directory_pages', $pages, 'bp' );
 	}
 
+	/**
+	 * Filters the names and slugs for BuddyPress component directory pages.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param object $pages Object holding page names and slugs.
+	 */
 	return apply_filters( 'bp_core_get_directory_pages', $pages );
 }
 
@@ -492,7 +625,7 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
 		switch_to_blog( bp_get_root_blog_id() );
 	}
 
-	$pages = bp_core_get_directory_page_ids();
+	$pages = bp_core_get_directory_page_ids( 'all' );
 
 	// Delete any existing pages
 	if ( 'delete' === $existing ) {
@@ -566,6 +699,34 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
 	}
 }
 
+/**
+ * Remove the entry from bp_pages when the corresponding WP page is deleted.
+ *
+ * Bails early on multisite installations when not viewing the root site.
+ * @link https://buddypress.trac.wordpress.org/ticket/6226
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int $post_id Post ID.
+ */
+function bp_core_on_directory_page_delete( $post_id ) {
+
+	// Stop if we are not on the main BP root blog
+	if ( ! bp_is_root_blog() ) {
+		return;
+	}
+
+	$page_ids       = bp_core_get_directory_page_ids( 'all' );
+	$component_name = array_search( $post_id, $page_ids );
+
+	if ( ! empty( $component_name ) ) {
+		unset( $page_ids[ $component_name ] );
+	}
+
+	bp_core_update_directory_page_ids( $page_ids );
+}
+add_action( 'delete_post', 'bp_core_on_directory_page_delete' );
+
 /**
  * Create a default component slug from a WP page root_slug.
  *
@@ -593,6 +754,14 @@ function bp_core_component_slug_from_root_slug( $root_slug ) {
 	$slug_chunks = explode( '/', $root_slug );
  	$slug        = array_pop( $slug_chunks );
 
+	/**
+	 * Filters the default component slug from a WP page root_slug.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $slug      Short slug for use in the middle of URLs.
+	 * @param string $root_slug The root slug which comes from $bp->pages-[component]->slug.
+	 */
  	return apply_filters( 'bp_core_component_slug_from_root_slug', $slug, $root_slug );
 }
 
@@ -661,7 +830,7 @@ function bp_core_create_root_component_page() {
 		) );
 	}
 
-	$page_ids = array_merge( (array) $new_page_ids, (array) bp_core_get_directory_page_ids() );
+	$page_ids = array_merge( (array) $new_page_ids, (array) bp_core_get_directory_page_ids( 'all' ) );
 	bp_core_update_directory_page_ids( $page_ids );
 }
 
@@ -703,6 +872,13 @@ function bp_do_register_theme_directory() {
 		$register = true;
 	}
 
+	/**
+	 * Filters whether BuddyPress should register the bp-themes directory.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param bool $register If bp-themes should be registered.
+	 */
 	return apply_filters( 'bp_do_register_theme_directory', $register );
 }
 
@@ -711,7 +887,7 @@ function bp_do_register_theme_directory() {
 /**
  * Return the domain for the root blog.
  *
- * eg: http://domain.com OR https://domain.com
+ * eg: http://example.com OR https://example.com
  *
  * @uses get_blog_option() WordPress function to fetch blog meta.
  *
@@ -721,6 +897,13 @@ function bp_core_get_root_domain() {
 
 	$domain = get_home_url( bp_get_root_blog_id() );
 
+	/**
+	 * Filters the domain for the root blog.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string $domain The domain URL for the blog.
+	 */
 	return apply_filters( 'bp_core_get_root_domain', $domain );
 }
 
@@ -751,18 +934,31 @@ function bp_core_redirect( $location = '', $status = 302 ) {
 }
 
 /**
- * Return the referrer URL without the http(s)://
+ * Return the URL path of the referring page.
+ *
+ * This is a wrapper for `wp_get_referer()` that sanitizes the referer URL to
+ * a webroot-relative path. For example, 'http://example.com/foo/' will be
+ * reduced to '/foo/'.
  *
- * @return string The referrer URL.
+ * @since BuddyPress (2.3.0)
+ *
+ * @return bool|string Returns false on error, a URL path on success.
  */
-function bp_core_referrer() {
-	$referer = explode( '/', wp_get_referer() );
-	unset( $referer[0], $referer[1], $referer[2] );
-	return implode( '/', $referer );
+function bp_get_referer_path() {
+	$referer = wp_get_referer();
+
+	if ( false === $referer ) {
+		return false;
+	}
+
+	// Turn into an absolute path.
+	$referer = preg_replace( '|https?\://[^/]+/|', '/', $referer );
+
+	return $referer;
 }
 
 /**
- * Get the path of of the current site.
+ * Get the path of the current site.
  *
  * @global object $current_site
  *
@@ -779,7 +975,7 @@ function bp_core_get_site_path() {
 		if ( count( $site_path ) < 2 ) {
 			$site_path = '/';
 		} else {
-			// Unset the first three segments (http(s)://domain.com part)
+			// Unset the first three segments (http(s)://example.com part)
 			unset( $site_path[0] );
 			unset( $site_path[1] );
 			unset( $site_path[2] );
@@ -792,6 +988,13 @@ function bp_core_get_site_path() {
 		}
 	}
 
+	/**
+	 * Filters the path of the current site.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $site_path URL to the current site.
+	 */
 	return apply_filters( 'bp_core_get_site_path', $site_path );
 }
 
@@ -808,6 +1011,14 @@ function bp_core_get_site_path() {
  * @return string Current time in 'Y-m-d h:i:s' format.
  */
 function bp_core_current_time( $gmt = true, $type = 'mysql' ) {
+
+	/**
+	 * Filters the current GMT time to save into the DB.
+	 *
+	 * @since BuddyPress (1.2.6)
+	 *
+	 * @param string $value Current GMT time.
+	 */
 	return apply_filters( 'bp_core_current_time', current_time( $type, $gmt ) );
 }
 
@@ -839,15 +1050,45 @@ function bp_core_current_time( $gmt = true, $type = 'mysql' ) {
  */
 function bp_core_time_since( $older_date, $newer_date = false ) {
 
-	// Use this filter to bypass BuddyPress's time_since calculations
+	/**
+	 * Filters whether or not to bypass BuddyPress' time_since calculations.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param bool   $value      Whether or not to bypass.
+	 * @param string $older_date Earlier time from which we're calculating time elapsed.
+	 * @param string $newer_date Unix timestamp of date to compare older time to.
+	 */
 	$pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
 	if ( false !== $pre_value ) {
 		return $pre_value;
 	}
 
-	// Setup the strings
+	/**
+	 * Filters the value to use if the time since is unknown.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value String representing the time since the older date.
+	 */
 	$unknown_text   = apply_filters( 'bp_core_time_since_unknown_text',   __( 'sometime',  'buddypress' ) );
+
+	/**
+	 * Filters the value to use if the time since is right now.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value String representing the time since the older date.
+	 */
 	$right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) );
+
+	/**
+	 * Filters the value to use if the time since is some time ago.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value String representing the time since the older date.
+	 */
 	$ago_text       = apply_filters( 'bp_core_time_since_ago_text',       __( '%s ago',    'buddypress' ) );
 
 	// array of time period chunks
@@ -978,6 +1219,15 @@ function bp_core_time_since( $older_date, $newer_date = false ) {
 		$output = sprintf( $ago_text, $output );
 	}
 
+	/**
+	 * Filters the English-language representation of the time elapsed since a given date.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $output     Final 'time since' string.
+	 * @param string $older_date Earlier time from which we're calculating time elapsed.
+	 * @param string $newer_date Unix timestamp of date to compare older time to.
+	 */
 	return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date );
 }
 
@@ -1062,6 +1312,16 @@ function bp_core_render_message() {
 
 	if ( !empty( $bp->template_message ) ) :
 		$type    = ( 'success' === $bp->template_message_type ) ? 'updated' : 'error';
+
+		/**
+		 * Filters the 'template_notices' feedback message content.
+		 *
+		 * @since BuddyPress (1.5.5)
+		 *
+		 * @param string $template_message Feedback message content.
+		 * @param string $type             The type of message being displayed.
+		 *                                 Either 'updated' or 'error'.
+		 */
 		$content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?>
 
 		<div id="message" class="bp-template-notice <?php echo esc_attr( $type ); ?>">
@@ -1072,6 +1332,11 @@ function bp_core_render_message() {
 
 	<?php
 
+		/**
+		 * Fires after the display of any template_notices feedback messages.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'bp_core_render_message' );
 
 	endif;
@@ -1120,6 +1385,16 @@ function bp_core_record_activity() {
 
 	// Use this action to detect the very first activity for a given member
 	if ( empty( $activity ) ) {
+
+		/**
+		 * Fires inside the recording of an activity item.
+		 *
+		 * Use this action to detect the very first activity for a given member.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param int $user_id ID of the user whose activity is recorded.
+		 */
 		do_action( 'bp_first_activity_for_member', $user_id );
 	}
 
@@ -1152,7 +1427,15 @@ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) {
 		? __( 'Not recently active', 'buddypress' )
 		: sprintf( $string, bp_core_time_since( $last_activity_date ) );
 
-	// Filter and return
+	/**
+	 * Filters last activity string based on time since date given.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $last_active        Last activity string based on time since date given.
+	 * @param string $last_activity_date The date of last activity.
+	 * @param string $string             A sprintf()-able statement of the form 'active %s'.
+	 */
 	return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
 }
 
@@ -1182,6 +1465,14 @@ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) {
  * @return string $key The usermeta meta_key.
  */
 function bp_get_user_meta_key( $key = false ) {
+
+	/**
+	 * Filters the meta_key for a given piece of user metadata.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $key The usermeta meta key.
+	 */
 	return apply_filters( 'bp_get_user_meta_key', $key );
 }
 
@@ -1277,11 +1568,19 @@ add_action( 'bp_init', 'bp_embed_init', 9 );
  *         enabled. Default: true.
  */
 function bp_use_embed_in_activity() {
+
+	/**
+	 * Filters whether or not oEmbeds are allowed in activity items.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not oEmbeds are allowed.
+	 */
 	return apply_filters( 'bp_use_oembed_in_activity', !defined( 'BP_EMBED_DISABLE_ACTIVITY' ) || !BP_EMBED_DISABLE_ACTIVITY );
 }
 
 /**
- * Are oembeds allwoed in activity replies?
+ * Are oembeds allowed in activity replies?
  *
  * @since BuddyPress (1.5.0)
  *
@@ -1289,6 +1588,14 @@ function bp_use_embed_in_activity() {
  *         when enabled. Default: true.
  */
 function bp_use_embed_in_activity_replies() {
+
+	/**
+	 * Filters whether or not oEmbeds are allowed in activity replies.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not oEmbeds are allowed.
+	 */
 	return apply_filters( 'bp_use_embed_in_activity_replies', !defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) || !BP_EMBED_DISABLE_ACTIVITY_REPLIES );
 }
 
@@ -1301,6 +1608,14 @@ function bp_use_embed_in_activity_replies() {
  *         enabled. Default: true.
  */
 function bp_use_embed_in_forum_posts() {
+
+	/**
+	 * Filters whether or not oEmbeds are allowed in forum posts.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not oEmbeds are allowed.
+	 */
 	return apply_filters( 'bp_use_embed_in_forum_posts', !defined( 'BP_EMBED_DISABLE_FORUM_POSTS' ) || !BP_EMBED_DISABLE_FORUM_POSTS );
 }
 
@@ -1313,6 +1628,14 @@ function bp_use_embed_in_forum_posts() {
  *         enabled. Default: true.
  */
 function bp_use_embed_in_private_messages() {
+
+	/**
+	 * Filters whether or not oEmbeds are allowed in private messages.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not oEmbeds are allowed.
+	 */
 	return apply_filters( 'bp_use_embed_in_private_messages', !defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) || !BP_EMBED_DISABLE_PRIVATE_MESSAGES );
 }
 
@@ -1329,7 +1652,7 @@ function bp_use_embed_in_private_messages() {
  * @param string $scheme See {@link bp_get_admin_url()}.
  */
 function bp_admin_url( $path = '', $scheme = 'admin' ) {
-	echo bp_get_admin_url( $path, $scheme );
+	echo esc_url( bp_get_admin_url( $path, $scheme ) );
 }
 	/**
 	 * Return the correct admin URL based on BuddyPress and WordPress configuration.
@@ -1385,6 +1708,13 @@ function bp_core_do_network_admin() {
 		$retval = false;
 	}
 
+	/**
+	 * Filters whether or not BuddyPress should appear in network admin.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $retval Whether or not BuddyPress should be in the network admin.
+	 */
 	return (bool) apply_filters( 'bp_core_do_network_admin', $retval );
 }
 
@@ -1403,6 +1733,13 @@ function bp_core_do_network_admin() {
 function bp_core_admin_hook() {
 	$hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu';
 
+	/**
+	 * Filters the action name that BuddyPress nav setup callbacks should be hooked to.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $hook Action name to be attached to.
+	 */
 	return apply_filters( 'bp_core_admin_hook', $hook );
 }
 
@@ -1431,6 +1768,13 @@ function bp_is_root_blog( $blog_id = 0 ) {
 		$is_root_blog = true;
 	}
 
+	/**
+	 * Filters whether or not we're on the root blog.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $is_root_blog Whether or not we're on the root blog.
+	 */
 	return (bool) apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );
 }
 
@@ -1446,6 +1790,14 @@ function bp_is_root_blog( $blog_id = 0 ) {
  * @return int The root site ID.
  */
 function bp_get_root_blog_id() {
+
+	/**
+	 * Filters the ID for the root blog.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $root_blog_id ID for the root blog.
+	 */
 	return (int) apply_filters( 'bp_get_root_blog_id', (int) buddypress()->root_blog_id );
 }
 
@@ -1496,6 +1848,13 @@ function bp_is_multiblog_mode() {
 		$retval = true;
 	}
 
+	/**
+	 * Filters whether or not we're running in multiblog mode.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $retval Whether or not we're running multiblog mode.
+	 */
 	return apply_filters( 'bp_is_multiblog_mode', $retval );
 }
 
@@ -1525,6 +1884,13 @@ function bp_is_network_activated() {
 		$retval = false;
 	}
 
+	/**
+	 * Filters whether or not we're active at the network level.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param bool $retval Whether or not we're network activated.
+	 */
 	return (bool) apply_filters( 'bp_is_network_activated', $retval );
 }
 
@@ -1543,6 +1909,14 @@ function bp_update_is_directory( $is_directory = false, $component = '' ) {
 		$component = bp_current_component();
 	}
 
+	/**
+	 * Filters the "is_directory" global value.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $is_directory Whether or not we're "is_directory".
+	 * @param string $component    Component name. Default: the current component.
+	 */
 	buddypress()->is_directory = apply_filters( 'bp_update_is_directory', $is_directory, $component );
 }
 
@@ -1559,6 +1933,14 @@ function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) {
 		$component = bp_current_component();
 	}
 
+	/**
+	 * Filters the "is_item_admin" global value.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $is_item_admin Whether or not we're "is_item_admin".
+	 * @param string $component     Component name. Default: the current component.
+	 */
 	buddypress()->is_item_admin = apply_filters( 'bp_update_is_item_admin', $is_item_admin, $component );
 }
 
@@ -1575,6 +1957,14 @@ function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) {
 		$component = bp_current_component();
 	}
 
+	/**
+	 * Filters the "is_item_mod" global value.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $is_item_mod Whether or not we're "is_item_mod".
+	 * @param string $component   Component name. Default: the current component.
+	 */
 	buddypress()->is_item_mod = apply_filters( 'bp_update_is_item_mod', $is_item_mod, $component );
 }
 
@@ -1591,6 +1981,14 @@ function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) {
 function bp_do_404( $redirect = 'remove_canonical_direct' ) {
 	global $wp_query;
 
+	/**
+	 * Fires inside the triggering of a 404.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $redirect Redirect type used to determine if redirect_canonical
+	 *                         function should be be removed.
+	 */
 	do_action( 'bp_do_404', $redirect );
 
 	$wp_query->set_404();
@@ -1650,7 +2048,15 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
 
 	/** Look for match ********************************************************/
 
-	// Filter the requested URL, for configurations like reverse proxying
+	/**
+	 * Filters the requested URL being nonce-verified.
+	 *
+	 * Useful for configurations like reverse proxying.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $requested_url The requested URL.
+	 */
 	$matched_url = apply_filters( 'bp_verify_nonce_request_url', $requested_url );
 
 	// Check the nonce
@@ -1661,7 +2067,14 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) {
 		$result = false;
 	}
 
-	// Do extra things
+	/**
+	 * Fires at the end of the nonce verification check.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $action Action nonce.
+	 * @param bool   $result Boolean result of nonce verification.
+	 */
 	do_action( 'bp_verify_nonce_request', $action, $result );
 
 	return $result;
@@ -1700,22 +2113,43 @@ function bp_is_get_request() {
  * @return bool True on success, false on failure.
  */
 function bp_core_load_buddypress_textdomain() {
-	// Try to load via load_plugin_textdomain() first, for future
-	// wordpress.org translation downloads
-	if ( load_plugin_textdomain( 'buddypress', false, 'buddypress/bp-languages' ) ) {
-		return true;
-	}
+	$domain = 'buddypress';
+
+	/**
+	 * Filters the locale to be loaded for the language files.
+	 *
+	 * @since BuddyPress (1.0.2)
+	 *
+	 * @param string $value Current locale for the install.
+	 */
+	$mofile_custom = sprintf( '%s-%s.mo', $domain, apply_filters( 'buddypress_locale', get_locale() ) );
 
-	// Nothing found in bp-languages, so try to load from WP_LANG_DIR
-	$locale = apply_filters( 'buddypress_locale', get_locale() );
-	$mofile = WP_LANG_DIR . '/buddypress-' . $locale . '.mo';
+	/**
+	 * Filters the locations to load language files from.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $value Array of directories to check for language files in.
+	 */
+	$locations = apply_filters( 'buddypress_locale_locations', array(
+		trailingslashit( WP_LANG_DIR . '/' . $domain  ),
+		trailingslashit( WP_LANG_DIR ),
+	) );
+
+	// Try custom locations in WP_LANG_DIR
+	foreach ( $locations as $location ) {
+		if ( load_textdomain( 'buddypress', $location . $mofile_custom ) ) {
+			return true;
+		}
+ 	}
 
-	return load_textdomain( 'buddypress', $mofile );
+	// default to WP and glotpress
+	return load_plugin_textdomain( $domain );
 }
 add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
 
 /**
- * A javascript-free implementation of the search functions in BuddyPress.
+ * A JavaScript-free implementation of the search functions in BuddyPress.
  *
  * @param string $slug The slug to redirect to for searching.
  */
@@ -1776,6 +2210,14 @@ function bp_core_action_search_site( $slug = '' ) {
 		}
 	}
 
+	/**
+	 * Filters the constructed url for use with site searching.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value        URL for use with site searching.
+	 * @param array  $search_terms Array of search terms.
+	 */
 	bp_core_redirect( apply_filters( 'bp_core_search_site', home_url( $slug . $query_string . urlencode( $search_terms ) ), $search_terms ) );
 }
 add_action( 'bp_init', 'bp_core_action_search_site', 7 );
@@ -1860,7 +2302,6 @@ function bp_nav_menu_get_loggedin_pages() {
 	$page_args = array();
 
 	foreach ( $bp_menu_items as $bp_item ) {
-		$item_name = '';
 
 		// Remove <span>number</span>
 		$item_name = preg_replace( '/([.0-9]+)/', '', $bp_item['name'] );
@@ -1999,7 +2440,7 @@ function bp_nav_menu_get_item_url( $slug ) {
  * @since BuddyPress (2.1.0)
  */
 function bp_core_get_suggestions( $args ) {
-	$args = wp_parse_args( $args );
+	$args = bp_parse_args( $args, array(), 'get_suggestions' );
 
 	if ( ! $args['type'] ) {
 		return new WP_Error( 'missing_parameter' );
@@ -2015,7 +2456,18 @@ function bp_core_get_suggestions( $args ) {
 		}
 
 	} else {
-		// If you've built a custom suggestions service, use this to tell BP the name of your class.
+
+		/**
+		 * Filters the default suggestions service to use.
+		 *
+		 * Use this hook to tell BP the name of your class
+		 * if you've built a custom suggestions service.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $value Custom class to use. Default: none.
+		 * @param array  $args  Array of arguments for sugggestions.
+		 */
 		$class = apply_filters( 'bp_suggestions_services', '', $args );
 	}
 
@@ -2033,5 +2485,60 @@ function bp_core_get_suggestions( $args ) {
 		$retval = $suggestions->get_suggestions();
 	}
 
+	/**
+	 * Filters the available type of at-mentions.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array|WP_Error $retval Array of results or WP_Error object.
+	 * @param array          $args   Array of arguments for suggestions.
+	 */
 	return apply_filters( 'bp_core_get_suggestions', $retval, $args );
-}
\ No newline at end of file
+}
+
+/**
+ * Set data from the BP root blog's upload directory.
+ *
+ * Handy for multisite instances because all uploads are made on the BP root
+ * blog and we need to query the BP root blog for the upload directory data.
+ *
+ * This function ensures that we only need to use {@link switch_to_blog()}
+ * once to get what we need.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @uses  is_multisite()
+ * @uses  bp_is_root_blog()
+ * @uses  switch_to_blog()
+ * @uses  wp_upload_dir()
+ * @uses  restore_current_blog()
+ */
+function bp_upload_dir() {
+	$bp = buddypress();
+
+	if ( empty( $bp->upload_dir ) ) {
+		$need_switch = (bool) ( is_multisite() && ! bp_is_root_blog() );
+
+		// Maybe juggle to root blog
+		if ( true === $need_switch ) {
+			switch_to_blog( bp_get_root_blog_id() );
+		}
+
+		// Get the upload directory (maybe for root blog)
+		$wp_upload_dir = wp_upload_dir();
+
+		// Maybe juggle back to current blog
+		if ( true === $need_switch ) {
+			restore_current_blog();
+		}
+
+		// Bail if an error occurred
+		if ( ! empty( $wp_upload_dir['error'] ) ) {
+			return false;
+		}
+
+		$bp->upload_dir = $wp_upload_dir;
+	}
+
+	return $bp->upload_dir;
+}
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
index 6b0d5566906d98e9fe6d7312122a4676aaaa5129..03455a43f9ee62d93484ffbc81fd16a9ef7df8ff 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Core extends BP_Component {
 
@@ -34,7 +34,7 @@ class BP_Core extends BP_Component {
 	/**
 	 * Populate the global data needed before BuddyPress can continue.
 	 *
-	 * This involves figuring out the currently required, active, deactive,
+	 * This involves figuring out the currently required, activated, deactivated,
 	 * and optional components.
 	 *
 	 * @since BuddyPress (1.5.0)
@@ -43,25 +43,47 @@ class BP_Core extends BP_Component {
 		$bp = buddypress();
 
 		/**
-		 * At this point in the stack, BuddyPress core has been loaded but
-		 * individual components (friends/activity/groups/etc...) have not.
+		 * Fires before the loading of individual components and after BuddyPress Core.
 		 *
-		 * The 'bp_core_loaded' action lets you execute code ahead of the
-		 * other components.
+		 * Allows plugins to run code ahead of the other components.
+		 *
+		 * @since BuddyPress (1.2.0)
 		 */
 		do_action( 'bp_core_loaded' );
 
 		/** Components ********************************************************/
 
-		// Set the included and optional components.
+		/**
+		 * Filters the included and optional components.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param array $value Array of included and optional components.
+		 */
 		$bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'notifications', 'settings', 'xprofile' ) );
 
-		// Set the required components
+		/**
+		 * Filters the required components.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param array $value Array of required components.
+		 */
 		$bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) );
 
 		// Get a list of activated components
 		if ( $active_components = bp_get_option( 'bp-active-components' ) ) {
+
+			/** This filter is documented in bp-core/admin/bp-core-admin-components.php */
 			$bp->active_components      = apply_filters( 'bp_active_components', $active_components );
+
+			/**
+			 * Filters the deactivated components.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param array $value Array of deactivated components.
+			 */
 			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) );
 
 		// Pre 1.5 Backwards compatibility
@@ -72,13 +94,13 @@ class BP_Core extends BP_Component {
 				$trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
 			}
 
-			// Set globals
+			/** This filter is documented in bp-core/bp-core-loader.php */
 			$bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed );
 
 			// Setup the active components
 			$active_components     = array_fill_keys( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ), '1' );
 
-			// Set the active component global
+			/** This filter is documented in bp-core/admin/bp-core-admin-components.php */
 			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
 
 		// Default to all components active
@@ -90,7 +112,7 @@ class BP_Core extends BP_Component {
 			// Setup the active components
 			$active_components     = array_fill_keys( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), '1' );
 
-			// Set the active component global
+			/** This filter is documented in bp-core/admin/bp-core-admin-components.php */
 			$bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
 		}
 
@@ -111,6 +133,11 @@ class BP_Core extends BP_Component {
 		// Add Core to required components
 		$bp->required_components[] = 'core';
 
+		/**
+		 * Fires after the loading of individual components.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 */
 		do_action( 'bp_core_components_included' );
 	}
 
@@ -179,8 +206,32 @@ class BP_Core extends BP_Component {
 
 		// Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
 		$bp->grav_default        = new stdClass;
+
+		/**
+		 * Filters the default user Gravatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Default user Gravatar.
+		 */
 		$bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default',  $bp->site_options['avatar_default'] );
+
+		/**
+		 * Filters the default group Gravatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Default group Gravatar.
+		 */
 		$bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', $bp->grav_default->user );
+
+		/**
+		 * Filters the default blog Gravatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Default blog Gravatar.
+		 */
 		$bp->grav_default->blog  = apply_filters( 'bp_blog_gravatar_default',  $bp->grav_default->user );
 
 		// Notifications table. Included here for legacy purposes. Use
@@ -200,6 +251,11 @@ class BP_Core extends BP_Component {
 		// Is the logged in user is a mod for the current item?
 		bp_update_is_item_mod( false,                  'core' );
 
+		/**
+		 * Fires at the end of the setup of bp-core globals setting.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'bp_core_setup_globals' );
 	}
 
@@ -251,6 +307,21 @@ class BP_Core extends BP_Component {
 			parent::setup_nav( $main_nav, $sub_nav );
 		}
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php
index a1f2da1413424d1b7e44573066730d678992045e..c2cf37714be67c3721ccd969c69bde67006cc484 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Moderation ****************************************************************/
 
@@ -31,16 +31,19 @@ if ( !defined( 'ABSPATH' ) ) exit;
 function bp_core_check_for_flood( $user_id = 0 ) {
 
 	// Option disabled. No flood checks.
-	if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) )
+	if ( !$throttle_time = bp_get_option( '_bp_throttle_time' ) ) {
 		return true;
+	}
 
 	// Bail if no user ID passed
-	if ( empty( $user_id ) )
+	if ( empty( $user_id ) ) {
 		return false;
+	}
 
 	$last_posted = get_user_meta( $user_id, '_bp_last_posted', true );
-	if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && !current_user_can( 'throttle' ) )
+	if ( isset( $last_posted ) && ( time() < ( $last_posted + $throttle_time ) ) && !current_user_can( 'throttle' ) ) {
 		return false;
+	}
 
 	return true;
 }
@@ -61,56 +64,73 @@ function bp_core_check_for_flood( $user_id = 0 ) {
  */
 function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' ) {
 
+	/**
+	 * Filters whether or not to bypass checking for moderation keys and too many links.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param bool   $value   Whether or not to bypass checking. Default false.
+	 * @param int    $user_id Topic of reply author ID.
+	 * @param string $title   The title of the content.
+	 * @param string $content $the content being posted.
+	 */
+	if ( apply_filters( 'bp_bypass_check_for_moderation', false, $user_id, $title, $content ) ) {
+		return true;
+	}
+
 	// Bail if super admin is author
-	if ( is_super_admin( $user_id ) )
+	if ( is_super_admin( $user_id ) ) {
 		return true;
+	}
 
 	// Define local variable(s)
-	$post      = array();
+	$_post     = array();
 	$match_out = '';
 
-	/** Blacklist *************************************************************/
-
-	// Get the moderation keys
-	$blacklist = trim( get_option( 'moderation_keys' ) );
-
-	// Bail if blacklist is empty
-	if ( empty( $blacklist ) )
-		return true;
-
 	/** User Data *************************************************************/
 
-	if ( !empty( $user_id ) ) {
+	if ( ! empty( $user_id ) ) {
 
 		// Get author data
 		$user = get_userdata( $user_id );
 
 		// If data exists, map it
-		if ( !empty( $user ) ) {
-			$post['author'] = $user->display_name;
-			$post['email']  = $user->user_email;
-			$post['url']    = $user->user_url;
+		if ( ! empty( $user ) ) {
+			$_post['author'] = $user->display_name;
+			$_post['email']  = $user->user_email;
+			$_post['url']    = $user->user_url;
 		}
 	}
 
 	// Current user IP and user agent
-	$post['user_ip'] = bp_core_current_user_ip();
-	$post['user_ua'] = bp_core_current_user_ua();
+	$_post['user_ip'] = bp_core_current_user_ip();
+	$_post['user_ua'] = bp_core_current_user_ua();
 
 	// Post title and content
-	$post['title']   = $title;
-	$post['content'] = $content;
+	$_post['title']   = $title;
+	$_post['content'] = $content;
 
 	/** Max Links *************************************************************/
 
 	$max_links = get_option( 'comment_max_links' );
-	if ( !empty( $max_links ) ) {
+	if ( ! empty( $max_links ) ) {
 
 		// How many links?
-		$num_links = preg_match_all( '/<a [^>]*href/i', $content, $match_out );
+		$num_links = preg_match_all( '/(http|ftp|https):\/\//i', $content, $match_out );
 
 		// Allow for bumping the max to include the user's URL
-		$num_links = apply_filters( 'comment_max_links_url', $num_links, $post['url'] );
+		if ( ! empty( $_post['url'] ) ) {
+
+			/**
+			 * Filters the maximum amount of links allowed to include the user's URL.
+			 *
+			 * @since BuddyPress (1.6.0)
+			 *
+			 * @param string $num_links How many links found.
+			 * @param string $value     User's url.
+			 */
+			$num_links = apply_filters( 'comment_max_links_url', $num_links, $_post['url'] );
+		}
 
 		// Das ist zu viele links!
 		if ( $num_links >= $max_links ) {
@@ -118,33 +138,42 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = ''
 		}
 	}
 
-	/** Words *****************************************************************/
+	/** Blacklist *************************************************************/
 
-	// Get words separated by new lines
-	$words = explode( "\n", $blacklist );
+	// Get the moderation keys
+	$blacklist = trim( get_option( 'moderation_keys' ) );
 
-	// Loop through words
-	foreach ( (array) $words as $word ) {
+	// Bail if blacklist is empty
+	if ( ! empty( $blacklist ) ) {
 
-		// Trim the whitespace from the word
-		$word = trim( $word );
+		// Get words separated by new lines
+		$words = explode( "\n", $blacklist );
 
-		// Skip empty lines
-		if ( empty( $word ) ) { continue; }
+		// Loop through words
+		foreach ( (array) $words as $word ) {
 
-		// Do some escaping magic so that '#' chars in the
-		// spam words don't break things:
-		$word    = preg_quote( $word, '#' );
-		$pattern = "#$word#i";
+			// Trim the whitespace from the word
+			$word = trim( $word );
 
-		// Loop through post data
-		foreach( $post as $post_data ) {
+			// Skip empty lines
+			if ( empty( $word ) ) {
+				continue;
+			}
 
-			// Check each user data for current word
-			if ( preg_match( $pattern, $post_data ) ) {
+			// Do some escaping magic so that '#' chars in the
+			// spam words don't break things:
+			$word    = preg_quote( $word, '#' );
+			$pattern = "#$word#i";
 
-				// Post does not pass
-				return false;
+			// Loop through post data
+			foreach ( $_post as $post_data ) {
+
+				// Check each user data for current word
+				if ( preg_match( $pattern, $post_data ) ) {
+
+					// Post does not pass
+					return false;
+				}
 			}
 		}
 	}
@@ -169,12 +198,27 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = ''
  */
 function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) {
 
+	/**
+	 * Filters whether or not to bypass checking for blocked keys.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param bool   $value   Whether or not to bypass checking. Default false.
+	 * @param int    $user_id Topic of reply author ID.
+	 * @param string $title   The title of the content.
+	 * @param string $content $the content being posted.
+	 */
+	if ( apply_filters( 'bp_bypass_check_for_blacklist', false, $user_id, $title, $content ) ) {
+		return true;
+	}
+
 	// Bail if super admin is author
-	if ( is_super_admin( $user_id ) )
+	if ( is_super_admin( $user_id ) ) {
 		return true;
+	}
 
 	// Define local variable
-	$post = array();
+	$_post = array();
 
 	/** Blacklist *************************************************************/
 
@@ -182,32 +226,33 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' )
 	$blacklist = trim( get_option( 'blacklist_keys' ) );
 
 	// Bail if blacklist is empty
-	if ( empty( $blacklist ) )
+	if ( empty( $blacklist ) ) {
 		return true;
+	}
 
 	/** User Data *************************************************************/
 
 	// Map current user data
-	if ( !empty( $user_id ) ) {
+	if ( ! empty( $user_id ) ) {
 
 		// Get author data
 		$user = get_userdata( $user_id );
 
 		// If data exists, map it
-		if ( !empty( $user ) ) {
-			$post['author'] = $user->display_name;
-			$post['email']  = $user->user_email;
-			$post['url']    = $user->user_url;
+		if ( ! empty( $user ) ) {
+			$_post['author'] = $user->display_name;
+			$_post['email']  = $user->user_email;
+			$_post['url']    = $user->user_url;
 		}
 	}
 
 	// Current user IP and user agent
-	$post['user_ip'] = bp_core_current_user_ip();
-	$post['user_ua'] = bp_core_current_user_ua();
+	$_post['user_ip'] = bp_core_current_user_ip();
+	$_post['user_ua'] = bp_core_current_user_ua();
 
 	// Post title and content
-	$post['title']   = $title;
-	$post['content'] = $content;
+	$_post['title']   = $title;
+	$_post['content'] = $content;
 
 	/** Words *****************************************************************/
 
@@ -223,12 +268,13 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' )
 		// Skip empty lines
 		if ( empty( $word ) ) { continue; }
 
-		// Do some escaping magic so that '#' chars in the spam words don't break things:
+		// Do some escaping magic so that '#' chars in the
+		// spam words don't break things:
 		$word    = preg_quote( $word, '#' );
 		$pattern = "#$word#i";
 
 		// Loop through post data
-		foreach( $post as $post_data ) {
+		foreach( $_post as $post_data ) {
 
 			// Check each user data for current word
 			if ( preg_match( $pattern, $post_data ) ) {
@@ -253,6 +299,13 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' )
 function bp_core_current_user_ip() {
 	$retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );
 
+	/**
+	 * Filters the current user's IP address.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $retval Current user's IP Address.
+	 */
 	return apply_filters( 'bp_core_current_user_ip', $retval );
 }
 
@@ -266,10 +319,18 @@ function bp_core_current_user_ip() {
 function bp_core_current_user_ua() {
 
 	// Sanity check the user agent
-	if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) )
+	if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
 		$retval = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 );
-	else
+	} else {
 		$retval = '';
+	}
 
+	/**
+	 * Filters the current user's user-agent.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $retval Current user's user-agent
+	 */
 	return apply_filters( 'bp_core_current_user_ua', $retval );
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-options.php b/wp-content/plugins/buddypress/bp-core/bp-core-options.php
index f927069009dd881c167c90b9cee39fd2be21663d..1ca2ee6d4b8e411a78efe89aacd909fae5df9e47 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-options.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-options.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Get the default site options and their values.
@@ -55,6 +55,9 @@ function bp_get_default_options() {
 		// Avatar uploads
 		'bp-disable-avatar-uploads'       => false,
 
+		// Group Profile Photos
+		'bp-disable-group-avatar-uploads' => false,
+
 		// Allow users to delete their own accounts
 		'bp-disable-account-deletion'     => false,
 
@@ -100,6 +103,13 @@ function bp_get_default_options() {
 		'widget_bp_messages_sitewide_notices_widget' => false,
 	);
 
+	/**
+	 * Filters the default options to be set upon activation.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $options Array of default options to set.
+	 */
 	return apply_filters( 'bp_get_default_options', $options );
 }
 
@@ -125,7 +135,13 @@ function bp_add_options() {
 		bp_add_option( $key, $value );
 	}
 
-	// Allow previously activated plugins to append their own options.
+	/**
+	 * Fires after the addition of default options when BuddyPress is first activated.
+	 *
+	 * Allows previously activated plugins to append their own options.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_add_options' );
 }
 
@@ -153,7 +169,13 @@ function bp_delete_options() {
 		delete_option( $key );
 	}
 
-	// Allow previously activated plugins to append their own options.
+	/**
+	 * Fires after the deletion of default options when BuddyPress is first deactivated.
+	 *
+	 * Allows previously activated plugins to append their own options.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_delete_options' );
 }
 
@@ -178,7 +200,13 @@ function bp_setup_option_filters() {
 		add_filter( 'pre_option_' . $key, 'bp_pre_get_option' );
 	}
 
-	// Allow previously activated plugins to append their own options.
+	/**
+	 * Fires after the addition of filters to each BuddyPress option.
+	 *
+	 * Allows previously activated plugins to append their own options.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_setup_option_filters' );
 }
 
@@ -187,7 +215,7 @@ function bp_setup_option_filters() {
  *
  * Currently unused.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
  * @param bool $value Optional. Default value false
  * @return mixed false if not overloaded, mixed if set
@@ -218,7 +246,7 @@ function bp_pre_get_option( $value = false ) {
  *
  * The 'bp_get_option' filter is primarily for backward-compatibility.
  *
- * @since BuddyPress (1.5.0)
+ * @since BuddyPress (1.2.0)
  *
  * @uses bp_get_root_blog_id()
  *
@@ -229,6 +257,14 @@ function bp_pre_get_option( $value = false ) {
  */
 function bp_get_option( $option_name, $default = '' ) {
 	$value = get_blog_option( bp_get_root_blog_id(), $option_name, $default );
+
+	/**
+	 * Filters the option value for the requested option.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param mixed $value The value for the option.
+	 */
 	return apply_filters( 'bp_get_option', $value );
 }
 
@@ -296,9 +332,10 @@ function bp_delete_option( $option_name ) {
  * @deprecated 1.6.0
  */
 function bp_core_activate_site_options( $keys = array() ) {
-	global $bp;
 
 	if ( !empty( $keys ) && is_array( $keys ) ) {
+		$bp = buddypress();
+
 		$errors = false;
 
 		foreach ( $keys as $key => $default ) {
@@ -353,6 +390,14 @@ function bp_core_get_root_options() {
 
 		// On Multisite installations, some options must always be fetched from sitemeta
 		if ( is_multisite() ) {
+
+			/**
+			 * Filters multisite options retrieved from sitemeta.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param array $value Array of multisite options from sitemeta table.
+			 */
 			$network_options = apply_filters( 'bp_core_network_options', array(
 				'tags_blog_id'       => '0',
 				'sitewide_tags_blog' => '',
@@ -429,13 +474,47 @@ function bp_core_get_root_options() {
 		wp_cache_set( 'root_blog_options', $root_blog_options_meta, 'bp' );
 	}
 
+	/**
+	 * Filters the global BP options.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $root_blog_options_meta Array of global BP options.
+	 */
 	return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta );
 }
 
+/**
+ * Get a root option.
+ *
+ * "Root options" are those that apply across an entire installation, and are fetched only a single
+ * time during a pageload and stored in `buddypress()->site_options` to prevent future lookups.
+ * See {@see bp_core_get_root_options()}.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  string $option Name of the option key.
+ * @return mixed Value, if found.
+ */
+function bp_core_get_root_option( $option ) {
+	$bp = buddypress();
+
+	if ( ! isset( $bp->site_options ) ) {
+		$bp->site_options = bp_core_get_root_options();
+	}
+
+	$value = '';
+	if ( isset( $bp->site_options[ $option ] ) ) {
+		$value = $bp->site_options[ $option ];
+	}
+
+	return $value;
+}
+
 /** Active? *******************************************************************/
 
 /**
- * Is profile sycing disabled?
+ * Is profile syncing disabled?
  *
  * @since BuddyPress (1.6.0)
  *
@@ -446,6 +525,14 @@ function bp_core_get_root_options() {
  * @return bool True if profile sync is enabled, otherwise false.
  */
 function bp_disable_profile_sync( $default = false ) {
+
+	/**
+	 * Filters whether or not profile syncing is disabled.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not syncing is disabled.
+	 */
 	return (bool) apply_filters( 'bp_disable_profile_sync', (bool) bp_get_option( 'bp-disable-profile-sync', $default ) );
 }
 
@@ -462,6 +549,14 @@ function bp_disable_profile_sync( $default = false ) {
  *         otherwise false.
  */
 function bp_hide_loggedout_adminbar( $default = true ) {
+
+	/**
+	 * Filters whether or not the toolbar is hidden for logged out users.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not the toolbar is hidden.
+	 */
 	return (bool) apply_filters( 'bp_hide_loggedout_adminbar', (bool) bp_get_option( 'hide-loggedout-adminbar', $default ) );
 }
 
@@ -477,9 +572,51 @@ function bp_hide_loggedout_adminbar( $default = true ) {
  * @return bool True if avatar uploads are disabled, otherwise false.
  */
 function bp_disable_avatar_uploads( $default = true ) {
+
+	/**
+	 * Filters whether or not members are able to upload their own avatars.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not members are able to upload their own avatars.
+	 */
 	return (bool) apply_filters( 'bp_disable_avatar_uploads', (bool) bp_get_option( 'bp-disable-avatar-uploads', $default ) );
 }
 
+/**
+ * Are group avatars disabled?
+ *
+ * For backward compatibility, this option falls back on the value of 'bp-disable-avatar-uploads' when no value is
+ * found in the database.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param bool $default Optional. Fallback value if not found in the database.
+ *                      Defaults to the value of `bp_disable_avatar_uploads()`.
+ * @return bool True if group avatar uploads are disabled, otherwise false.
+ */
+function bp_disable_group_avatar_uploads( $default = null ) {
+	$disabled = bp_get_option( 'bp-disable-group-avatar-uploads', '' );
+
+	if ( '' === $disabled ) {
+		if ( is_null( $default ) ) {
+			$disabled = bp_disable_avatar_uploads();
+		} else {
+			$disabled = $default;
+		}
+	}
+
+	/**
+	 * Filters whether or not members are able to upload group avatars.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param bool $disabled Whether or not members are able to upload their groups avatars.
+	 * @param bool $default  Default value passed to the function.
+	 */
+	return (bool) apply_filters( 'bp_disable_group_avatar_uploads', $disabled, $default );
+}
+
 /**
  * Are members able to delete their own accounts?
  *
@@ -493,6 +630,14 @@ function bp_disable_avatar_uploads( $default = true ) {
  *         false.
  */
 function bp_disable_account_deletion( $default = false ) {
+
+	/**
+	 * Filters whether or not members are able to delete their own accounts.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not members are able to delete their own accounts.
+	 */
 	return apply_filters( 'bp_disable_account_deletion', (bool) bp_get_option( 'bp-disable-account-deletion', $default ) );
 }
 
@@ -510,6 +655,14 @@ function bp_disable_account_deletion( $default = false ) {
  *         items, otherwise false.
  */
 function bp_disable_blogforum_comments( $default = false ) {
+
+	/**
+	 * Filters whether or not blog and forum activity stream comments are disabled.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not blog and forum activity stream comments are disabled.
+	 */
 	return (bool) apply_filters( 'bp_disable_blogforum_comments', (bool) bp_get_option( 'bp-disable-blogforum-comments', $default ) );
 }
 
@@ -526,6 +679,14 @@ function bp_disable_blogforum_comments( $default = false ) {
  * @return bool True if group creation is restricted, otherwise false.
  */
 function bp_restrict_group_creation( $default = true ) {
+
+	/**
+	 * Filters whether or not group creation is turned off.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not group creation is turned off.
+	 */
 	return (bool) apply_filters( 'bp_restrict_group_creation', (bool) bp_get_option( 'bp_restrict_group_creation', $default ) );
 }
 
@@ -541,6 +702,14 @@ function bp_restrict_group_creation( $default = true ) {
  * @return bool True if the BuddyBar should be forced on, otherwise false.
  */
 function bp_force_buddybar( $default = true ) {
+
+	/**
+	 * Filters whether or not BuddyBar should be forced in place of WP Admin Bar.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar.
+	 */
 	return (bool) apply_filters( 'bp_force_buddybar', (bool) bp_get_option( '_bp_force_buddybar', $default ) );
 }
 
@@ -565,6 +734,14 @@ function bp_group_forums_root_id( $default = '0' ) {
 	 * @return int The ID of the group forums root forum.
 	 */
 	function bp_get_group_forums_root_id( $default = '0' ) {
+
+		/**
+		 * Filters the group forums root parent forum id.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param int $value The group forums root parent forum id.
+		 */
 		return (int) apply_filters( 'bp_get_group_forums_root_id', (int) bp_get_option( '_bp_group_forums_root_id', $default ) );
 	}
 
@@ -580,6 +757,14 @@ function bp_group_forums_root_id( $default = '0' ) {
  * @return bool True if group forums are active, otherwise false.
  */
 function bp_is_group_forums_active( $default = true ) {
+
+	/**
+	 * Filters whether or not BuddyPress Group Forums are enabled.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not BuddyPress Group Forums are enabled.
+	 */
 	return (bool) apply_filters( 'bp_is_group_forums_active', (bool) bp_get_option( '_bp_enable_group_forums', $default ) );
 }
 
@@ -595,6 +780,14 @@ function bp_is_group_forums_active( $default = true ) {
  * @return bool True if Akismet is enabled, otherwise false.
  */
 function bp_is_akismet_active( $default = true ) {
+
+	/**
+	 * Filters whether or not Akismet is enabled.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $value Whether or not Akismet is enabled.
+	 */
 	return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
 }
 
@@ -610,6 +803,14 @@ function bp_is_akismet_active( $default = true ) {
  * @return bool True if Heartbeat refresh is enabled, otherwise false.
  */
 function bp_is_activity_heartbeat_active( $default = true ) {
+
+	/**
+	 * Filters whether or not Activity Heartbeat refresh is enabled.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param bool $value Whether or not Activity Heartbeat refresh is enabled.
+	 */
 	return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default ) );
 }
 
@@ -625,5 +826,13 @@ function bp_is_activity_heartbeat_active( $default = true ) {
  * @return string ID of the theme package.
  */
 function bp_get_theme_package_id( $default = 'legacy' ) {
+
+	/**
+	 * Filters the current theme package ID.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $value The current theme package ID.
+	 */
 	return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $default ) );
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php b/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php
new file mode 100644
index 0000000000000000000000000000000000000000..1573157dbd29686353af6464bd0e3e12bd2c0fc9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php
@@ -0,0 +1,109 @@
+<?php
+
+/**
+ * BuddyPress taxonomy functions.
+ *
+ * Most BuddyPress taxonomy functions are wrappers for their WordPress counterparts.
+ * Because BuddyPress can be activated in various ways in a network environment, we
+ * must switch to the root blog before using the WP functions.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+
+/**
+ * Register our default taxonomies.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_register_default_taxonomies() {
+	// Member Type.
+	register_taxonomy( 'bp_member_type', 'user', array(
+		'public' => false,
+	) );
+}
+add_action( 'bp_register_taxonomies', 'bp_register_default_taxonomies' );
+
+/**
+ * Set taxonomy terms on a BuddyPress object.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see wp_set_object_terms() for a full description of function and parameters.
+ *
+ * @param int          $object_id Object ID.
+ * @param string|array $terms     Term or terms to set.
+ * @param string       $taxonomy  Taxonomy name.
+ * @param bool         $append    Optional. True to append terms to existing terms. Default: false.
+ * @return array Array of term taxonomy IDs.
+ */
+function bp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
+	$is_root_blog = bp_is_root_blog();
+
+	if ( ! $is_root_blog ) {
+		switch_to_blog( bp_get_root_blog_id() );
+	}
+
+	$retval = wp_set_object_terms( $object_id, $terms, $taxonomy, $append );
+
+	if ( ! $is_root_blog ) {
+		restore_current_blog();
+	}
+
+	return $retval;
+}
+
+/**
+ * Get taxonomy terms for a BuddyPress object.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see wp_get_object_terms() for a full description of function and parameters.
+ *
+ * @param int|array    $object_ids ID or IDs of objects.
+ * @param string|array $taxonomies Name or names of taxonomies to match.
+ * @param array        $args       See {@see wp_get_object_terms()}.
+ * @return array
+ */
+function bp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
+	$is_root_blog = bp_is_root_blog();
+
+	if ( ! $is_root_blog ) {
+		switch_to_blog( bp_get_root_blog_id() );
+	}
+
+	$retval = wp_get_object_terms( $object_ids, $taxonomies, $args );
+
+	if ( ! $is_root_blog ) {
+		restore_current_blog();
+	}
+
+	return $retval;
+}
+
+/**
+ * Remove taxonomy terms on a BuddyPress object.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @see wp_remove_object_terms() for a full description of function and parameters.
+ *
+ * @param int          $object_id Object ID.
+ * @param string|array $terms     Term or terms to remove.
+ * @param string       $taxonomy  Taxonomy name.
+ * @return bool|WP_Error True on success, false or WP_Error on failure.
+ */
+function bp_remove_object_terms( $object_id, $terms, $taxonomy ) {
+	$is_root_blog = bp_is_root_blog();
+
+	if ( ! $is_root_blog ) {
+		switch_to_blog( bp_get_root_blog_id() );
+	}
+
+	$retval = wp_remove_object_terms( $object_id, $terms, $taxonomy );
+
+	if ( ! $is_root_blog ) {
+		restore_current_blog();
+	}
+
+	return $retval;
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php b/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php
index 89ee7b7aaa2fe25893477ea7f98fb0d299eba747..47d48fdf46601dfe49eb34c616901561c0afb659 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Get a BuddyPress template part for display in a theme.
@@ -32,15 +32,35 @@ if ( !defined( 'ABSPATH' ) ) exit;
 function bp_get_template_part( $slug, $name = null ) {
 
 	// Execute code for this part
+	/**
+	 * Fires at the start of bp_get_template_part().
+	 *
+	 * This is a variable hook that is dependent on the slug passed in.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $slug Template part slug requested.
+	 * @param string $name Template part name requested.
+	 */
 	do_action( 'get_template_part_' . $slug, $slug, $name );
 
 	// Setup possible parts
 	$templates = array();
-	if ( isset( $name ) )
+	if ( isset( $name ) ) {
 		$templates[] = $slug . '-' . $name . '.php';
+	}
 	$templates[] = $slug . '.php';
 
 	// Allow template parts to be filtered
+	/**
+	 * Filters the template parts to be loaded.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array  $templates Array of templates located.
+	 * @param string $slug      Template part slug requested.
+	 * @param string $name      Template part name requested.
+	 */
 	$templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name );
 
 	// Return the part that is found
@@ -73,8 +93,9 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru
 	foreach ( (array) $template_names as $template_name ) {
 
 		// Continue if template is empty
-		if ( empty( $template_name ) )
+		if ( empty( $template_name ) ) {
 			continue;
+		}
 
 		// Trim off any slashes from the template name
 		$template_name  = ltrim( $template_name, '/' );
@@ -83,8 +104,9 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru
 		foreach ( (array) $template_locations as $template_location ) {
 
 			// Continue if $template_location is empty
-			if ( empty( $template_location ) )
+			if ( empty( $template_location ) ) {
 				continue;
+			}
 
 			// Check child theme first
 			if ( file_exists( trailingslashit( $template_location ) . $template_name ) ) {
@@ -212,6 +234,13 @@ function bp_get_template_stack() {
 	// Remove empties and duplicates
 	$stack = array_unique( array_filter( $stack ) );
 
+	/**
+	 * Filters the "template stack" list of registered directories where templates can be found.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $stack Array of registered directories for template locations.
+	 */
 	return (array) apply_filters( 'bp_get_template_stack', $stack ) ;
 }
 
@@ -271,23 +300,45 @@ function bp_buffer_template_part( $slug, $name = null, $echo = true ) {
 function bp_get_query_template( $type, $templates = array() ) {
 	$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
 
-	if ( empty( $templates ) )
+	if ( empty( $templates ) ) {
 		$templates = array( "{$type}.php" );
+	}
+
+	/**
+	 * Filters possible file paths to check for for a template.
+	 *
+	 * This is a variable filter based on the type passed into
+	 * bp_get_query_template.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $templates Array of template files already prepared.
+	 */
+	$templates = apply_filters( "bp_get_{$type}_template", $templates );
 
 	// Filter possible templates, try to match one, and set any BuddyPress theme
 	// compat properties so they can be cross-checked later.
-	$templates = apply_filters( "bp_get_{$type}_template", $templates );
 	$templates = bp_set_theme_compat_templates( $templates );
 	$template  = bp_locate_template( $templates );
 	$template  = bp_set_theme_compat_template( $template );
 
+	/**
+	 * Filters the path to a template file.
+	 *
+	 * This is a variable filter based on the type passed into
+	 * bp_get_query_template.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $template Path to the most appropriate found template file.
+	 */
 	return apply_filters( "bp_{$type}_template", $template );
 }
 
 /**
  * Get the possible subdirectories to check for templates in
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  * @param array $templates Templates we are looking for
  * @return array Possible subfolders to look in
  */
@@ -297,6 +348,15 @@ function bp_get_template_locations( $templates = array() ) {
 		'community',
 		''
 	);
+
+	/**
+	 * Filters the possible subdirectories to check for templates in.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $locations Array of subfolders to look in.
+	 * @param array $templates Array of templates we are looking for.
+	 */
 	return apply_filters( 'bp_get_template_locations', $locations, $templates );
 }
 
@@ -315,10 +375,20 @@ function bp_add_template_stack_locations( $stacks = array() ) {
 	$locations = bp_get_template_locations();
 
 	// Loop through locations and stacks and combine
-	foreach ( (array) $stacks as $stack )
-		foreach ( (array) $locations as $custom_location )
+	foreach ( (array) $stacks as $stack ) {
+		foreach ( (array) $locations as $custom_location ) {
 			$retval[] = untrailingslashit( trailingslashit( $stack ) . $custom_location );
+		}
+	}
 
+	/**
+	 * Filters the template locations to template files being searched for.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $value  Array of all template locations registered so far.
+	 * @param array $stacks Array of template locations.
+	 */
 	return apply_filters( 'bp_add_template_stack_locations', array_unique( $retval ), $stacks );
 }
 
@@ -332,18 +402,29 @@ function bp_add_template_stack_locations( $stacks = array() ) {
 function bp_parse_query( $posts_query ) {
 
 	// Bail if $posts_query is not the main loop
-	if ( ! $posts_query->is_main_query() )
+	if ( ! $posts_query->is_main_query() ) {
 		return;
+	}
 
 	// Bail if filters are suppressed on this query
-	if ( true == $posts_query->get( 'suppress_filters' ) )
+	if ( true == $posts_query->get( 'suppress_filters' ) ) {
 		return;
+	}
 
 	// Bail if in admin
-	if ( is_admin() )
+	if ( is_admin() ) {
 		return;
+	}
 
-	// Allow BuddyPress components to parse the main query
+	/**
+	 * Fires at the end of the bp_parse_query function.
+	 *
+	 * Allow BuddyPress components to parse the main query.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param WP_Query $posts_query WP_Query instance. Passed by reference.
+	 */
 	do_action_ref_array( 'bp_parse_query', array( &$posts_query ) );
 }
 
@@ -364,15 +445,29 @@ function bp_parse_query( $posts_query ) {
  */
 function bp_template_include_theme_supports( $template = '' ) {
 
-	// Look for root BuddyPress template files in parent/child themes
+	/**
+	 * Filters whether or not to override the template being loaded in parent/child themes.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param bool   $value    Whether or not there is a file override. Default false.
+	 * @param string $template The path to the template file that is being used.
+	 */
 	$new_template = apply_filters( 'bp_get_root_template', false, $template );
 
 	// A BuddyPress template file was located, so override the WordPress
 	// template and use it to switch off BuddyPress's theme compatibility.
-	if ( !empty( $new_template ) ) {
+	if ( ! empty( $new_template ) ) {
 		$template = bp_set_template_included( $new_template );
 	}
 
+	/**
+	 * Filters the final template being loaded in parent/child themes.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $template The path to the template file that is being used.
+	 */
 	return apply_filters( 'bp_template_include_theme_supports', $template );
 }
 
@@ -417,8 +512,9 @@ function bp_load_theme_functions() {
 	}
 
 	// Do not include on BuddyPress deactivation
-	if ( bp_is_deactivation() )
+	if ( bp_is_deactivation() ) {
 		return;
+	}
 
 	// If the $wp_query global is empty (the main query has not been run,
 	// or has been reset), load_template() will fail at setting certain
@@ -442,7 +538,7 @@ function bp_load_theme_functions() {
  * @return array Array of possible root level wrapper template files.
  */
 function bp_get_theme_compat_templates() {
-	$templates = array(
+	return bp_get_query_template( 'buddypress', array(
 		'plugin-buddypress.php',
 		'buddypress.php',
 		'community.php',
@@ -450,6 +546,5 @@ function bp_get_theme_compat_templates() {
 		'page.php',
 		'single.php',
 		'index.php'
-	);
-	return bp_get_query_template( 'buddypress', $templates );
+	) );
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-template.php b/wp-content/plugins/buddypress/bp-core/bp-core-template.php
index c86efdb7ef713e44dc671374d3ca9739740ede26..f6c88ed0e9f384e449553aef616d3d8e297ddcf6 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-template.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-template.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the "options nav", the secondary-level single item navigation menu.
@@ -26,12 +26,13 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @uses bp_get_user_nav() Renders the navigation for a profile of a currently
  *       viewed user.
  */
-function bp_get_options_nav() {
+function bp_get_options_nav( $parent_slug = '' ) {
 	$bp = buddypress();
 
 	// If we are looking at a member profile, then the we can use the current
 	// component as an index. Otherwise we need to use the component's root_slug
 	$component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() );
+	$selected_item   = bp_current_action();
 
 	if ( ! bp_is_single_item() ) {
 		if ( !isset( $bp->bp_options_nav[$component_index] ) || count( $bp->bp_options_nav[$component_index] ) < 1 ) {
@@ -40,10 +41,17 @@ function bp_get_options_nav() {
 			$the_index = $component_index;
 		}
 	} else {
-		if ( !isset( $bp->bp_options_nav[bp_current_item()] ) || count( $bp->bp_options_nav[bp_current_item()] ) < 1 ) {
+		$current_item = bp_current_item();
+
+		if ( ! empty( $parent_slug ) ) {
+			$current_item  = $parent_slug;
+			$selected_item = bp_action_variable( 0 );
+		}
+
+		if ( !isset( $bp->bp_options_nav[$current_item] ) || count( $bp->bp_options_nav[$current_item] ) < 1 ) {
 			return false;
 		} else {
-			$the_index = bp_current_item();
+			$the_index = $current_item;
 		}
 	}
 
@@ -54,7 +62,7 @@ function bp_get_options_nav() {
 		}
 
 		// If the current action or an action variable matches the nav item id, then add a highlight CSS class.
-		if ( $subnav_item['slug'] == bp_current_action() ) {
+		if ( $subnav_item['slug'] == $selected_item ) {
 			$selected = ' class="current selected"';
 		} else {
 			$selected = '';
@@ -63,8 +71,18 @@ function bp_get_options_nav() {
 		// List type depends on our current component
 		$list_type = bp_is_group() ? 'groups' : 'personal';
 
-		// echo out the final list item
-		echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item );
+		/**
+		 * Filters the "options nav", the secondary-level single item navigation menu.
+		 *
+		 * This is a dynamic filter that is dependent on the provided css_id value.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value         HTML list item for the submenu item.
+		 * @param array  $subnav_item   Submenu array item being displayed.
+		 * @param string $selected_item Current action.
+		 */
+		echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . esc_attr( $subnav_item['css_id'] . '-' . $list_type . '-li' ) . '" ' . $selected . '><a id="' . esc_attr( $subnav_item['css_id'] ) . '" href="' . esc_url( $subnav_item['link'] ) . '">' . $subnav_item['name'] . '</a></li>', $subnav_item, $selected_item );
 	}
 }
 
@@ -106,6 +124,14 @@ function bp_get_directory_title( $component = '' ) {
 		$title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name );
 	}
 
+	/**
+	 * Filters the directory title for a component.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $title     Text to be used in <title> tag.
+	 * @param string $component Current componet being displayed.
+	 */
 	return apply_filters( 'bp_get_directory_title', $title, $component );
 }
 
@@ -192,6 +218,13 @@ function bp_avatar_admin_step() {
 			? $step = $bp->avatar_admin->step
 			: 'upload-image';
 
+		/**
+		 * Filters the current avatar upload step.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $step The current avatar upload step.
+		 */
 		return apply_filters( 'bp_get_avatar_admin_step', $step );
 	}
 
@@ -212,6 +245,13 @@ function bp_avatar_to_crop() {
 			? $bp->avatar_admin->image->url
 			: '';
 
+		/**
+		 * Filters the URL of the avatar to crop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $url URL for the avatar.
+		 */
 		return apply_filters( 'bp_get_avatar_to_crop', $url );
 	}
 
@@ -232,6 +272,13 @@ function bp_avatar_to_crop_src() {
 			? str_replace( WP_CONTENT_DIR, '', $bp->avatar_admin->image->dir )
 			: '';
 
+		/**
+		 * Filters the relative file path to the avatar to crop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $src Relative file path for the avatar.
+		 */
 		return apply_filters( 'bp_get_avatar_to_crop_src', $src );
 	}
 
@@ -260,49 +307,96 @@ function bp_site_name() {
 	 * @since BuddyPress (1.6.0)
 	 */
 	function bp_get_site_name() {
+
+		/**
+		 * Filters the name of the BP site. Used in RSS headers.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Current BP site name.
+		 */
 		return apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) );
 	}
 
 /**
- * Format a date.
+ * Format a date based on a UNIX timestamp
  *
- * @param int $time The UNIX timestamp to be formatted.
- * @param bool $just_date Optional. True to return only the month + day, false
- *        to return month, day, and time. Default: false.
- * @param bool $localize_time Optional. True to display in local time, false to
- *        leave in GMT. Default: true.
- * @return string|bool $localize_time Optional. A string representation of
- *         $time, in the format "January 1, 2010 at 9:50pm" (or whatever your
- *         'date_format' and 'time_format' settings are). False on failure.
+ * This function can be used to turn a UNIX timestamp into a properly formatted
+ * (and possibly localized) string, userful for ouputting the date & time an
+ * action took place.
+ *
+ * Not to be confused with `bp_core_time_since()`, this function is best used
+ * for displaying a more exact date and time vs. a human-readable time.
+ *
+ * Note: This function may be improved or removed at a later date, as it is
+ * hardly used and adds an additional layer of complexity to calculating dates
+ * and times together with timezone offsets and i18n.
+ *
+ * @since BuddyPress (1.1.0)
+ *
+ * @param int  $time         The UNIX timestamp to be formatted.
+ * @param bool $exclude_time Optional. True to return only the month + day, false
+ *                           to return month, day, and time. Default: false.
+ * @param bool $gmt          Optional. True to display in local time, false to
+ *                           leave in GMT. Default: true.
+ *
+ * @return mixed             A string representation of $time, in the format
+ *                           "March 18, 2014 at 2:00 pm" (or whatever your
+ *                           'date_format' and 'time_format' settings are
+ *                           on your root blog). False on failure.
  */
-function bp_format_time( $time, $just_date = false, $localize_time = true ) {
+function bp_format_time( $time = '', $exclude_time = false, $gmt = true ) {
 
-	if ( ! isset( $time ) || ! is_numeric( $time ) ) {
+	// Bail if time is empty or not numeric
+	// @todo We should output something smarter here
+	if ( empty( $time ) || ! is_numeric( $time ) ) {
 		return false;
 	}
 
 	// Get GMT offset from root blog
-	$root_blog_offset = false;
-	if ( ! empty( $localize_time ) ) {
-		$root_blog_offset = get_blog_option( bp_get_root_blog_id(), 'gmt_offset' );
-	}
+	if ( true === $gmt ) {
+
+		// Use Timezone string if set
+		$timezone_string = bp_get_option( 'timezone_string' );
+		if ( ! empty( $timezone_string ) ) {
+			$timezone_object = timezone_open( $timezone_string );
+			$datetime_object = date_create( "@{$time}" );
+			$timezone_offset = timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS;
 
-	// Calculate offset time
-	$time_offset = $time + ( $root_blog_offset * 3600 );
+		// Fall back on less reliable gmt_offset
+		} else {
+			$timezone_offset = bp_get_option( 'gmt_offset' );
+		}
+
+		// Calculate time based on the offset
+		$calculated_time = $time + ( $timezone_offset * HOUR_IN_SECONDS );
+
+	// No localizing, so just use the time that was submitted
+	} else {
+		$calculated_time = $time;
+	}
 
-	// Current date (January 1, 2010)
-	$date = date_i18n( get_option( 'date_format' ), $time_offset );
+	// Formatted date: "March 18, 2014"
+	$formatted_date = date_i18n( bp_get_option( 'date_format' ), $calculated_time, $gmt );
 
 	// Should we show the time also?
-	if ( empty( $just_date ) ) {
-		// Current time (9:50pm)
-		$time = date_i18n( get_option( 'time_format' ), $time_offset );
+	if ( true !== $exclude_time ) {
+
+		// Formatted time: "2:00 pm"
+		$formatted_time = date_i18n( bp_get_option( 'time_format' ), $calculated_time, $gmt );
 
 		// Return string formatted with date and time
-		$date = sprintf( __( '%1$s at %2$s', 'buddypress' ), $date, $time );
+		$formatted_date = sprintf( esc_html__( '%1$s at %2$s', 'buddypress' ), $formatted_date, $formatted_time );
 	}
 
-	return apply_filters( 'bp_format_time', $date );
+	/**
+	 * Filters the date based on a UNIX timestamp.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $formatted_date Formatted date from the timestamp.
+	 */
+	return apply_filters( 'bp_format_time', $formatted_date );
 }
 
 /**
@@ -331,8 +425,18 @@ function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true
 
 	if ( bp_displayed_user_id() == bp_loggedin_user_id() ) {
 		if ( true == $echo ) {
+
+			/**
+			 * Filters the text used based on context of own profile or someone else's profile.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param string $youtext Context-determined string to display.
+			 */
 			echo apply_filters( 'bp_word_or_name', $youtext );
 		} else {
+
+			/** This filter is documented in bp-core/bp-core-template.php */
 			return apply_filters( 'bp_word_or_name', $youtext );
 		}
 	} else {
@@ -340,8 +444,12 @@ function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true
 		$fullname = (array) explode( ' ', $fullname );
 		$nametext = sprintf( $nametext, $fullname[0] );
 		if ( true == $echo ) {
+
+			/** This filter is documented in bp-core/bp-core-template.php */
 			echo apply_filters( 'bp_word_or_name', $nametext );
 		} else {
+
+			/** This filter is documented in bp-core/bp-core-template.php */
 			return apply_filters( 'bp_word_or_name', $nametext );
 		}
 	}
@@ -367,6 +475,14 @@ function bp_styles() {
  * @return string URL action attribute for search forms, eg example.com/search/.
  */
 function bp_search_form_action() {
+
+	/**
+	 * Filters the "action" attribute for search forms.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Search form action url.
+	 */
 	return apply_filters( 'bp_search_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_search_slug() ) );
 }
 
@@ -403,6 +519,13 @@ function bp_search_form_type_select() {
 	$selection_box  = '<label for="search-which" class="accessibly-hidden">' . _x( 'Search these:', 'search form', 'buddypress' ) . '</label>';
 	$selection_box .= '<select name="search-which" id="search-which" style="width: auto">';
 
+	/**
+	 * Filters all of the component options available for search scope.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $options Array of options to add to select field.
+	 */
 	$options = apply_filters( 'bp_search_form_type_select_options', $options );
 	foreach( (array) $options as $option_value => $option_title ) {
 		$selection_box .= sprintf( '<option value="%s">%s</option>', $option_value, $option_title );
@@ -410,6 +533,13 @@ function bp_search_form_type_select() {
 
 	$selection_box .= '</select>';
 
+	/**
+	 * Filters the complete <select> input used for search scope.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $selection_box <select> input for selecting search scope.
+	 */
 	return apply_filters( 'bp_search_form_type_select', $selection_box );
 }
 
@@ -434,7 +564,8 @@ function bp_search_default_text( $component = '' ) {
 	 * @return string Placeholder text for search field.
 	 */
 	function bp_get_search_default_text( $component = '' ) {
-		global $bp;
+
+		$bp = buddypress();
 
 		if ( empty( $component ) ) {
 			$component = bp_current_component();
@@ -458,6 +589,14 @@ function bp_search_default_text( $component = '' ) {
 			}
 		}
 
+		/**
+		 * Filters the default text for the search box for a given component.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $default_text Default text for search box.
+		 * @param string $component    Current component displayed.
+		 */
 		return apply_filters( 'bp_get_search_default_text', $default_text, $component );
 	}
 
@@ -483,6 +622,80 @@ function bp_custom_profile_sidebar_boxes() {
 	do_action( 'bp_custom_profile_sidebar_boxes' );
 }
 
+/**
+ * Output the attributes for a form field.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $name       The field name to output attributes for.
+ * @param array  $attributes Array of existing attributes to add.
+ */
+function bp_form_field_attributes( $name = '', $attributes = array() ) {
+	echo bp_get_form_field_attributes( $name, $attributes );
+}
+	/**
+	 * Get the attributes for a form field.
+	 *
+	 * Primarily to add better support for touchscreen devices, but plugin devs
+	 * can use the 'bp_get_form_field_extra_attributes' filter for further
+	 * manipulation.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string $name       The field name to get attributes for.
+	 * @param array  $attributes Array of existing attributes to add.
+	 * @return string
+	 */
+	function bp_get_form_field_attributes( $name = '', $attributes = array() ) {
+		$retval = '';
+
+		if ( empty( $attributes ) ) {
+			$attributes = array();
+		}
+
+		$name = strtolower( $name );
+
+		switch ( $name ) {
+			case 'username' :
+			case 'blogname' :
+				$attributes['autocomplete']   = 'off';
+				$attributes['autocapitalize'] = 'none';
+				break;
+
+			case 'email' :
+				if ( wp_is_mobile() ) {
+					$attributes['autocapitalize'] = 'none';
+				}
+				break;
+
+			case 'password' :
+				$attributes['spellcheck']   = 'false';
+				$attributes['autocomplete'] = 'off';
+
+				if ( wp_is_mobile() ) {
+					$attributes['autocorrect']    = 'false';
+					$attributes['autocapitalize'] = 'none';
+				}
+				break;
+		}
+
+		/**
+		 * Filter the attributes for a field before rendering output.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param array  $attributes The field attributes
+		 * @param string $name       The field name
+		 */
+		$attributes = (array) apply_filters( 'bp_get_form_field_attributes', $attributes, $name );
+
+		foreach( $attributes as $attr => $value ) {
+			$retval .= sprintf( ' %s="%s"', sanitize_key( $attr ), esc_attr( $value ) );
+		}
+
+		return $retval;
+	}
+
 /**
  * Create and output a button.
  *
@@ -503,6 +716,16 @@ function bp_button( $args = '' ) {
 	 */
 	function bp_get_button( $args = '' ) {
 		$button = new BP_Button( $args );
+
+		/**
+		 * Filters the requested button output.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string    $contents  Button context to be used.
+		 * @param array     $args      Array of args for the button.
+		 * @param BP_Button $button    BP_Button object.
+		 */
 		return apply_filters( 'bp_get_button', $button->contents, $args, $button );
 	}
 
@@ -553,8 +776,22 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 	// Save the original text, to be passed along to the filter
 	$original_text = $text;
 
-	// Allow plugins to modify these values globally
+	/**
+	 * Filters the excerpt length to trim text to.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $length Length of returned string, including ellipsis.
+	 */
 	$length = apply_filters( 'bp_excerpt_length',      $length      );
+
+	/**
+	 * Filters the excerpt appended text value.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value Text to append to the end of the excerpt.
+	 */
 	$ending = apply_filters( 'bp_excerpt_append_text', $r['ending'] );
 
 	// Remove shortcodes if necessary
@@ -575,10 +812,10 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 		$openTags    = array();
 		$truncate    = '';
 
-		// Find all the tags and put them in a stack for later use
-		preg_match_all( '/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
-		foreach ( $tags as $tag ) {
+		// Find all the tags and HTML comments and put them in a stack for later use
+		preg_match_all( '/(<\/?([\w!].+?)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
 
+		foreach ( $tags as $tag ) {
 			// Process tags that need to be closed
 			if ( !preg_match( '/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s',  $tag[2] ) ) {
 				if ( preg_match( '/<[\w]+[^>]*>/s', $tag[0] ) ) {
@@ -629,7 +866,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 	// If $exact is false, we can't break on words
 	if ( empty( $r['exact'] ) ) {
 		$spacepos = mb_strrpos( $truncate, ' ' );
-		if ( isset( $spacepos ) ) {
+		if ( false !== $spacepos ) {
 			if ( $r['html'] ) {
 				$bits = mb_substr( $truncate, $spacepos );
 				preg_match_all( '/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER );
@@ -652,6 +889,16 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
 		}
 	}
 
+	/**
+	 * Filters the final generated excerpt.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $truncate      Generated excerpt.
+	 * @param string $original_text Original text provided.
+	 * @param int    $length        Length of returned string, including ellipsis.
+	 * @param array  $options       Array of HTML attributes and options.
+	 */
 	return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options );
 }
 add_filter( 'bp_create_excerpt', 'stripslashes_deep'  );
@@ -678,6 +925,14 @@ function bp_total_member_count() {
 	 * @return int Member count.
 	 */
 	function bp_get_total_member_count() {
+
+		/**
+		 * Filters the total member count in your BP instance.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Member count.
+		 */
 		return apply_filters( 'bp_get_total_member_count', bp_core_get_active_member_count() );
 	}
 	add_filter( 'bp_get_total_member_count', 'bp_core_number_format' );
@@ -704,7 +959,7 @@ function bp_blog_signup_allowed() {
 			return false;
 		}
 
-		$status = buddypress()->site_options['registration'];
+		$status = bp_core_get_root_option( 'registration' );
 		if ( ( 'none' !== $status ) && ( 'user' !== $status ) ) {
 			return true;
 		}
@@ -737,6 +992,14 @@ function bp_account_was_activated() {
  * @return bool True by default.
  */
 function bp_registration_needs_activation() {
+
+	/**
+	 * Filters whether registrations require activation on this installation.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param bool $value Whether registrations require activation. Default true.
+	 */
 	return apply_filters( 'bp_registration_needs_activation', true );
 }
 
@@ -748,7 +1011,7 @@ function bp_registration_needs_activation() {
  *
  * @since BuddyPress (1.7.0)
  *
- * @see http://buddypress.trac.wordpress.org/ticket/4401
+ * @see https://buddypress.trac.wordpress.org/ticket/4401
  *
  * @param array $args {
  *     Array of optional parameters.
@@ -774,6 +1037,14 @@ function bp_get_email_subject( $args = array() ) {
 
 	$subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text'];
 
+	/**
+	 * Filters a client friendly version of the root blog name.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $subject Client friendy version of the root blog name.
+	 * @param array  $r       Array of arguments for the email subject.
+	 */
 	return apply_filters( 'bp_get_email_subject', $subject, $r );
 }
 
@@ -797,6 +1068,16 @@ function bp_ajax_querystring( $object = false ) {
 		$bp->ajax_querystring = '';
 	}
 
+	/**
+	 * Filters the template paramenters to be used in the query string.
+	 *
+	 * Allows templates to pass parameters into the template loops via AJAX.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $ajax_querystring Current query string.
+	 * @param string $object           Current template component.
+	 */
 	return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring, $object );
 }
 
@@ -813,6 +1094,13 @@ function bp_current_component() {
 		? $bp->current_component
 		: false;
 
+	/**
+	 * Filters the name of the current component.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string|bool $current_component Current component if available or false.
+	 */
 	return apply_filters( 'bp_current_component', $current_component );
 }
 
@@ -827,6 +1115,13 @@ function bp_current_action() {
 		? $bp->current_action
 		: '';
 
+	/**
+	 * Filters the name of the current action.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $current_action Current action.
+	 */
 	return apply_filters( 'bp_current_action', $current_action );
 }
 
@@ -841,6 +1136,13 @@ function bp_current_item() {
 		? $bp->current_item
 		: false;
 
+	/**
+	 * Filters the name of the current item.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string|bool $current_item Current item if available or false.
+	 */
 	return apply_filters( 'bp_current_item', $current_item );
 }
 
@@ -856,6 +1158,13 @@ function bp_action_variables() {
 		? $bp->action_variables
 		: false;
 
+	/**
+	 * Filters the value of $bp->action_variables.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array|bool $action_variables Available action variables.
+	 */
 	return apply_filters( 'bp_action_variables', $action_variables );
 }
 
@@ -874,6 +1183,14 @@ function bp_action_variable( $position = 0 ) {
 		? $action_variables[ $position ]
 		: false;
 
+	/**
+	 * Filters the value of a given action variable.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string|bool $action_variable Requested action variable based on position.
+	 * @param int         $position        The key of the action variable requested.
+	 */
 	return apply_filters( 'bp_action_variable', $action_variable, $position );
 }
 
@@ -898,6 +1215,13 @@ function bp_root_domain() {
 			$bp->root_domain = $domain;
 		}
 
+		/**
+		 * Filters the "root domain", the URL of the BP root blog.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param string $domain URL of the BP root blog.
+		 */
 		return apply_filters( 'bp_get_root_domain', $domain );
 	}
 
@@ -970,6 +1294,14 @@ function bp_root_slug( $component = '' ) {
 			$root_slug = $component;
 		}
 
+		/**
+		 * Filters the root slug for given component.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $root_slug Root slug for given component.
+		 * @param string $component Current component.
+		 */
 		return apply_filters( 'bp_get_root_slug', $root_slug, $component );
 	}
 
@@ -1009,6 +1341,13 @@ function bp_user_has_access() {
 		? true
 		: false;
 
+	/**
+	 * Filters whether or not a user has access.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param bool $has_access Whether or not user has access.
+	 */
 	return (bool) apply_filters( 'bp_user_has_access', $has_access );
 }
 
@@ -1030,6 +1369,14 @@ function bp_search_slug() {
 	 * @return string The search slug. Default: 'search'.
 	 */
 	function bp_get_search_slug() {
+
+		/**
+		 * Filters the search slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string BP_SEARCH_SLUG The search slug. Default "search".
+		 */
 		return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG );
 	}
 
@@ -1046,6 +1393,13 @@ function bp_displayed_user_id() {
 		? $bp->displayed_user->id
 		: 0;
 
+	/**
+	 * Filters the ID of the currently displayed user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the currently displayed user.
+	 */
 	return (int) apply_filters( 'bp_displayed_user_id', $id );
 }
 
@@ -1062,6 +1416,13 @@ function bp_loggedin_user_id() {
 		? $bp->loggedin_user->id
 		: 0;
 
+	/**
+	 * Filters the ID of the currently logged-in user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the currently logged-in user.
+	 */
 	return (int) apply_filters( 'bp_loggedin_user_id', $id );
 }
 
@@ -1081,9 +1442,9 @@ function bp_loggedin_user_id() {
  * @param string $component Name of the component being checked.
  * @return bool Returns true if the component matches, or else false.
  */
-function bp_is_current_component( $component ) {
-	global $wp_query;
+function bp_is_current_component( $component = '' ) {
 
+	// Default is no match. We'll check a few places for matches
 	$is_current_component = false;
 
 	// Always return false if a null value is passed to the function
@@ -1098,6 +1459,7 @@ function bp_is_current_component( $component ) {
 
 	$bp = buddypress();
 
+	// Only check if BuddyPress found a current_component
 	if ( ! empty( $bp->current_component ) ) {
 
 		// First, check to see whether $component_name and the current
@@ -1138,23 +1500,16 @@ function bp_is_current_component( $component ) {
 				}
 			}
 		}
-
-	// Page template fallback check if $bp->current_component is empty
-	} elseif ( !is_admin() && is_a( $wp_query, 'WP_Query' ) && is_page() ) {
-		global $wp_query;
-
-		$page = $wp_query->get_queried_object();
-		if ( isset( $page->ID ) ) {
-			$custom_fields = get_post_custom_values( '_wp_page_template', $page->ID );
-			$page_template = $custom_fields[0];
-
-			// Component name is in the page template name
-			if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
-				$is_current_component = true;
-			}
-		}
 	}
 
+	/**
+	 * Filters whether the current page belongs to the specified component.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $is_current_component Whether or not the current page belongs to specified component.
+	 * @param string $component            Name of the component being checked.
+	 */
  	return apply_filters( 'bp_is_current_component', $is_current_component, $component );
 }
 
@@ -1216,6 +1571,15 @@ function bp_is_action_variable( $action_variable = '', $position = false ) {
 		$is_action_variable = in_array( $action_variable, (array)bp_action_variables() );
 	}
 
+	/**
+	 * Filters whether the current page matches a given action_variable.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $is_action_variable Whether the current page matches a given action_variable.
+	 * @param string $action_variable    The action_variable being tested against.
+	 * @param int    $position           The array key tested against.
+	 */
 	return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position );
 }
 
@@ -1228,6 +1592,14 @@ function bp_is_action_variable( $action_variable = '', $position = false ) {
 function bp_is_current_item( $item = '' ) {
 	$retval = ( $item === bp_current_item() );
 
+	/**
+	 * Filters whether or not an item is the current item.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool   $retval Whether or not an item is the current item.
+	 * @param string $item   The item being checked.
+	 */
 	return (bool) apply_filters( 'bp_is_current_item', $retval, $item );
 }
 
@@ -1244,6 +1616,13 @@ function bp_is_single_item() {
 		$retval = $bp->is_single_item;
 	}
 
+	/**
+	 * Filters whether or not an item is the a single item. (group, user, etc)
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not an item is a single item.
+	 */
 	return (bool) apply_filters( 'bp_is_single_item', $retval );
 }
 
@@ -1261,6 +1640,13 @@ function bp_is_item_admin() {
 		$retval = $bp->is_item_admin;
 	}
 
+	/**
+	 * Filters whether or not the logged-in user is an admin for the current item.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not the logged-in user is an admin.
+	 */
 	return (bool) apply_filters( 'bp_is_item_admin', $retval );
 }
 
@@ -1278,6 +1664,13 @@ function bp_is_item_mod() {
 		$retval = $bp->is_item_mod;
 	}
 
+	/**
+	 * Filters whether or not the logged-in user is a mod for the current item.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not the logged-in user is a mod.
+	 */
 	return (bool) apply_filters( 'bp_is_item_mod', $retval );
 }
 
@@ -1295,14 +1688,21 @@ function bp_is_directory() {
 		$retval = $bp->is_directory;
 	}
 
+	/**
+	 * Filters whether or not user is on a component directory page.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not user is on a component directory page.
+	 */
 	return (bool) apply_filters( 'bp_is_directory', $retval );
 }
 
 /**
  * Check to see if a component's URL should be in the root, not under a member page.
  *
- * - Yes ('groups' is root)    : http://domain.com/groups/the-group
- * - No  ('groups' is not-root): http://domain.com/members/andy/groups/the-group
+ * - Yes ('groups' is root)    : http://example.com/groups/the-group
+ * - No  ('groups' is not-root): http://example.com/members/andy/groups/the-group
  *
  * This function is on the chopping block. It's currently only used by a few
  * already deprecated functions.
@@ -1328,6 +1728,13 @@ function bp_is_root_component( $component_name = '' ) {
 		}
 	}
 
+	/**
+	 * Filters whether or not a component's URL should be in the root, not under a member page.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not URL should be in the root.
+	 */
 	return (bool) apply_filters( 'bp_is_root_component', $retval );
 }
 
@@ -1368,6 +1775,14 @@ function bp_is_component_front_page( $component = '' ) {
 		return false;
 	}
 
+	/**
+	 * Filters whether or not the specified BuddyPress component directory is set to be the front page.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool   $value     Whether or not the specified component directory is set as front page.
+	 * @param string $component Current component being checked.
+	 */
 	return (bool) apply_filters( 'bp_is_component_front_page', ( $bp->pages->{$component}->id == $page_on_front ), $component );
 }
 
@@ -1390,6 +1805,13 @@ function bp_is_blog_page() {
 		$is_blog_page = true;
 	}
 
+	/**
+	 * Filters whether or not current page is a blog page or not.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $is_blog_page Whether or not current page is a blog page.
+	 */
 	return (bool) apply_filters( 'bp_is_blog_page', $is_blog_page );
 }
 
@@ -1410,18 +1832,29 @@ function bp_is_blog_page() {
 function is_buddypress() {
 	$retval = (bool) ( bp_current_component() || bp_is_user() );
 
+	/**
+	 * Filters whether or not this is a BuddyPress component.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param bool $retval Whether or not this is a BuddyPress component.
+	 */
 	return apply_filters( 'is_buddypress', $retval );
 }
 
 /** Components ****************************************************************/
 
 /**
- * Check whether a given component has been activated by the admin.
+ * Check whether a given component (or feature of a component) is active.
+ *
+ * @since BuddyPress (1.2.0) See r2539.
+ * @since BuddyPress (2.3.0) Added $feature as a parameter.
  *
  * @param string $component The component name.
- * @return bool True if the component is active, otherwise false.
+ * @param string $feature   The feature name.
+ * @return bool
  */
-function bp_is_active( $component = '' ) {
+function bp_is_active( $component = '', $feature = '' ) {
 	$retval = false;
 
 	// Default to the current component if none is passed
@@ -1432,8 +1865,32 @@ function bp_is_active( $component = '' ) {
 	// Is component in either the active or required components arrays
 	if ( isset( buddypress()->active_components[ $component ] ) || isset( buddypress()->required_components[ $component ] ) ) {
 		$retval = true;
+
+		// Is feature active?
+		if ( ! empty( $feature ) ) {
+			if ( empty( buddypress()->$component->features ) || false === in_array( $feature, buddypress()->$component->features, true ) ) {
+				$retval = false;
+			}
+
+			/**
+			 * Filters whether or not a given feature for a component is active.
+			 *
+			 * @since BuddyPress (2.3.0)
+			 *
+			 * @param bool $retval
+			 */
+			$retval = apply_filters( "bp_is_{$component}_{$feature}_active", $retval );
+		}
 	}
 
+	/**
+	 * Filters whether or not a given component has been activated by the admin.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool   $retval    Whether or not a given component has been activated by the admin.
+	 * @param string $component Current component being checked.
+	 */
 	return apply_filters( 'bp_is_active', $retval, $component );
 }
 
@@ -1612,6 +2069,13 @@ function bp_is_my_profile() {
 		$my_profile = false;
 	}
 
+	/**
+	 * Filters whether or not current page is part of the profile for the logged-in user.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param bool $my_profile Whether or not current page is part of the profile for the logged-in user.
+	 */
 	return apply_filters( 'bp_is_my_profile', $my_profile );
 }
 
@@ -1931,7 +2395,7 @@ function bp_is_group() {
 	if ( ! empty( $retval ) ) {
 		$retval = bp_is_groups_component() && groups_get_current_group();
 	}
-	
+
 	return (bool) $retval;
 }
 
@@ -2360,6 +2824,10 @@ function bp_the_body_class() {
 
 		/** Groups ************************************************************/
 
+		if ( bp_is_group() ) {
+			$bp_classes[] = 'group-' . groups_get_current_group()->slug;
+		}
+
 		if ( bp_is_group_leave() ) {
 			$bp_classes[] = 'leave-group';
 		}
@@ -2429,6 +2897,16 @@ function bp_the_body_class() {
 		// Merge WP classes with BuddyPress classes and remove any duplicates
 		$classes = array_unique( array_merge( (array) $bp_classes, (array) $wp_classes ) );
 
+		/**
+		 * Filters the BuddyPress classes to be added to body_class()
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param array $classes        Array of body classes to add.
+		 * @param array $bp_classes     Array of BuddyPress-based classes.
+		 * @param array $wp_classes     Array of WordPress-based classes.
+		 * @param array $custom_classes Array of classes that were passed to get_body_class().
+		 */
 		return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes );
 	}
 	add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 );
@@ -2578,7 +3056,7 @@ function bp_get_nav_menu_items() {
 			continue;
 		}
 
-		// Get the correct menu link. See http://buddypress.trac.wordpress.org/ticket/4624
+		// Get the correct menu link. See https://buddypress.trac.wordpress.org/ticket/4624
 		$link = bp_loggedin_user_domain() ? str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $nav['link'] ) : trailingslashit( bp_displayed_user_domain() . $nav['link'] );
 
 		// Add this menu
@@ -2597,6 +3075,13 @@ function bp_get_nav_menu_items() {
 		$menus[] = $menu;
 	}
 
+	/**
+	 * Filters the items registered in the primary and secondary BuddyPress navigation menus.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $menus Array of items registered in the primary and secondary BuddyPress navigation.
+	 */
 	return apply_filters( 'bp_get_nav_menu_items', $menus );
 }
 
@@ -2656,6 +3141,14 @@ function bp_nav_menu( $args = array() ) {
 		'walker'          => '',
 	);
 	$args = wp_parse_args( $args, $defaults );
+
+	/**
+	 * Filters the parsed bp_nav_menu arguments.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $args Array of parsed arguments.
+	 */
 	$args = apply_filters( 'bp_nav_menu_args', $args );
 	$args = (object) $args;
 
@@ -2673,6 +3166,14 @@ function bp_nav_menu( $args = array() ) {
 
 	// Whether to wrap the ul, and what to wrap it with
 	if ( $args->container ) {
+
+		/**
+		 * Filters the allowed tags for the wp_nav_menu_container.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array $value Array of allowed tags. Default 'div' and 'nav'.
+		 */
 		$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav', ) );
 
 		if ( in_array( $args->container, $allowed_tags ) ) {
@@ -2684,7 +3185,14 @@ function bp_nav_menu( $args = array() ) {
 		}
 	}
 
-	// Get the BuddyPress menu items
+	/**
+	 * Filters the BuddyPress menu objects.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $value Array of nav menu objects.
+	 * @param array $args  Array of arguments for the menu.
+	 */
 	$menu_items = apply_filters( 'bp_nav_menu_objects', bp_get_nav_menu_items(), $args );
 	$items      = walk_nav_menu_tree( $menu_items, $args->depth, $args );
 	unset( $menu_items );
@@ -2707,7 +3215,16 @@ function bp_nav_menu( $args = array() ) {
 	}
 	$menu_id_slugs[] = $wrap_id;
 
-	// Allow plugins to hook into the menu to add their own <li>'s
+	/**
+	 * Filters the BuddyPress menu items.
+	 *
+	 * Allow plugins to hook into the menu to add their own <li>'s
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $items Array of nav menu items.
+	 * @param array $args  Array of arguments for the menu.
+	 */
 	$items = apply_filters( 'bp_nav_menu_items', $items, $args );
 
 	// Build the output
@@ -2720,7 +3237,14 @@ function bp_nav_menu( $args = array() ) {
 		$nav_menu .= '</' . $args->container . '>';
 	}
 
-	// Final chance to modify output
+	/**
+	 * Filters the final BuddyPress menu output.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $nav_menu Final nav menu output.
+	 * @param array  $args     Array of arguments for the menu.
+	 */
 	$nav_menu = apply_filters( 'bp_nav_menu', $nav_menu, $args );
 
 	if ( ! empty( $args->echo ) ) {
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php b/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php
index c3a0013d5e51738fa13963bd2465cf9af09662ee..d88c27ac294f4cd11cdb6b14fdfafeac9ecd939a 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Theme Compat **************************************************************/
 
@@ -68,7 +68,7 @@ class BP_Theme_Compat {
 	/**
 	 * Set up the BuddyPress-specific theme compat methods.
 	 *
-	 * Themes shoud use this method in their constructor.
+	 * Themes should use this method in their constructor.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
@@ -155,7 +155,7 @@ function bp_setup_theme_compat( $theme = '' ) {
  * Get the ID of the theme package being used.
  *
  * This can be filtered or set manually. Tricky theme authors can override the
- * default and include their own BuddyPress compatability layers for their themes.
+ * default and include their own BuddyPress compatibility layers for their themes.
  *
  * @since BuddyPress (1.7.0)
  *
@@ -164,6 +164,14 @@ function bp_setup_theme_compat( $theme = '' ) {
  * @return string ID of the theme package in use.
  */
 function bp_get_theme_compat_id() {
+
+	/**
+	 * Filters the ID of the theme package being used.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $id ID of the theme package in use.
+	 */
 	return apply_filters( 'bp_get_theme_compat_id', buddypress()->theme_compat->theme->id );
 }
 
@@ -171,7 +179,7 @@ function bp_get_theme_compat_id() {
  * Get the name of the theme package being used.
  *
  * This can be filtered or set manually. Tricky theme authors can override the
- * default and include their own BuddyPress compatability layers for their themes.
+ * default and include their own BuddyPress compatibility layers for their themes.
  *
  * @since BuddyPress (1.7.0)
  *
@@ -180,6 +188,14 @@ function bp_get_theme_compat_id() {
  * @return string Name of the theme package currently in use.
  */
 function bp_get_theme_compat_name() {
+
+	/**
+	 * Filters the name of the theme package being used.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $name Name of the theme package in use.
+	 */
 	return apply_filters( 'bp_get_theme_compat_name', buddypress()->theme_compat->theme->name );
 }
 
@@ -187,7 +203,7 @@ function bp_get_theme_compat_name() {
  * Get the version of the theme package being used.
  *
  * This can be filtered or set manually. Tricky theme authors can override the
- * default and include their own BuddyPress compatability layers for their themes.
+ * default and include their own BuddyPress compatibility layers for their themes.
  *
  * @since BuddyPress (1.7.0)
  *
@@ -196,6 +212,14 @@ function bp_get_theme_compat_name() {
  * @return string The version string of the theme package currently in use.
  */
 function bp_get_theme_compat_version() {
+
+	/**
+	 * Filters the version of the theme package being used.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $version The version string of the theme package in use.
+	 */
 	return apply_filters( 'bp_get_theme_compat_version', buddypress()->theme_compat->theme->version );
 }
 
@@ -203,7 +227,7 @@ function bp_get_theme_compat_version() {
  * Get the absolute path of the theme package being used.
  *
  * or set manually. Tricky theme authors can override the default and include
- * their own BuddyPress compatability layers for their themes.
+ * their own BuddyPress compatibility layers for their themes.
  *
  * @since BuddyPress (1.7.0)
  *
@@ -212,6 +236,14 @@ function bp_get_theme_compat_version() {
  * @return string The absolute path of the theme package currently in use.
  */
 function bp_get_theme_compat_dir() {
+
+	/**
+	 * Filters the absolute path of the theme package being used.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $dir The absolute path of the theme package in use.
+	 */
 	return apply_filters( 'bp_get_theme_compat_dir', buddypress()->theme_compat->theme->dir );
 }
 
@@ -219,7 +251,7 @@ function bp_get_theme_compat_dir() {
  * Get the URL of the theme package being used.
  *
  * This can be filtered, or set manually. Tricky theme authors can override
- * the default and include their own BuddyPress compatability layers for their
+ * the default and include their own BuddyPress compatibility layers for their
  * themes.
  *
  * @since BuddyPress (1.7.0)
@@ -229,6 +261,14 @@ function bp_get_theme_compat_dir() {
  * @return string URL of the theme package currently in use.
  */
 function bp_get_theme_compat_url() {
+
+	/**
+	 * Filters the URL of the theme package being used.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $url URL of the theme package in use.
+	 */
 	return apply_filters( 'bp_get_theme_compat_url', buddypress()->theme_compat->theme->url );
 }
 
@@ -249,6 +289,13 @@ function bp_use_theme_compat_with_current_theme() {
 		bp_detect_theme_compat_with_current_theme();
 	}
 
+	/**
+	 * Filters whether or not to use theme compat for the active theme.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param bool $use_with_current_theme True if the current theme needs theme compatibility.
+	 */
 	return apply_filters( 'bp_use_theme_compat_with_current_theme', buddypress()->theme_compat->use_with_current_theme );
 }
 
@@ -286,9 +333,9 @@ function bp_detect_theme_compat_with_current_theme() {
 		if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) {
 			$theme_compat = false;
 
-		// Bruteforce check for a BP template
+		// Brute-force check for a BP template
 		// Examples are clones of bp-default
-		} else if ( locate_template( 'members/members-loop.php', false, false ) ) {
+		} elseif ( locate_template( 'members/members-loop.php', false, false ) ) {
 			$theme_compat = false;
 		}
 	}
@@ -309,8 +356,9 @@ function bp_detect_theme_compat_with_current_theme() {
 function bp_is_theme_compat_active() {
 	$bp = buddypress();
 
-	if ( empty( $bp->theme_compat->active ) )
+	if ( empty( $bp->theme_compat->active ) ) {
 		return false;
+	}
 
 	return $bp->theme_compat->active;
 }
@@ -392,8 +440,9 @@ function bp_set_theme_compat_original_template( $template = '' ) {
 function bp_is_theme_compat_original_template( $template = '' ) {
 	$bp = buddypress();
 
-	if ( empty( $bp->theme_compat->original_template ) )
+	if ( empty( $bp->theme_compat->original_template ) ) {
 		return false;
+	}
 
 	return (bool) ( $bp->theme_compat->original_template == $template );
 }
@@ -404,7 +453,7 @@ function bp_is_theme_compat_original_template( $template = '' ) {
  * For an example of how this function is used, see:
  * {@link BuddyPress::register_theme_packages()}.
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  *
  * @see BP_Theme_Compat for a description of the $theme parameter arguments.
  *
@@ -548,7 +597,7 @@ function bp_theme_compat_reset_post( $args = array() ) {
 	/**
 	 * Force the header back to 200 status if not a deliberate 404
 	 *
-	 * @see http://bbpress.trac.wordpress.org/ticket/1973
+	 * @see https://bbpress.trac.wordpress.org/ticket/1973
 	 */
 	if ( ! $wp_query->is_404() ) {
 		status_header( 200 );
@@ -595,15 +644,20 @@ function bp_template_include_theme_compat( $template = '' ) {
 	}
 
 	/**
+	 * Fires when resetting main query vars and filtering 'the_content' to output BuddyPress template parts.
+	 *
 	 * Use this action to execute code that will communicate to BuddyPress's
 	 * theme compatibility layer whether or not we're replacing the_content()
 	 * with some other template part.
+	 *
+	 * @since BuddyPress (1.7.0)
 	 */
 	do_action( 'bp_template_include_reset_dummy_post_data' );
 
 	// Bail if the template already matches a BuddyPress template
-	if ( !empty( buddypress()->theme_compat->found_template ) )
+	if ( ! empty( buddypress()->theme_compat->found_template ) ) {
 		return $template;
+	}
 
 	/**
 	 * If we are relying on BuddyPress's built in theme compatibility to load
@@ -633,6 +687,13 @@ function bp_template_include_theme_compat( $template = '' ) {
 		}
 	}
 
+	/**
+	 * Filters the template name to include.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $template Template name.
+	 */
 	return apply_filters( 'bp_template_include_theme_compat', $template );
 }
 
@@ -651,18 +712,25 @@ function bp_template_include_theme_compat( $template = '' ) {
 function bp_replace_the_content( $content = '' ) {
 
 	// Bail if not the main loop where theme compat is happening
-	if ( ! bp_do_theme_compat() )
+	if ( ! bp_do_theme_compat() ) {
 		return $content;
+	}
 
 	// Set theme compat to false early, to avoid recursion from nested calls to
 	// the_content() that execute before theme compat has unhooked itself.
 	bp_set_theme_compat_active( false );
 
-	// Do we have new content to replace the old content?
+	/**
+	 * Filters the content to replace in the post.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $content Original post content.
+	 */
 	$new_content = apply_filters( 'bp_replace_the_content', $content );
 
 	// Juggle the content around and try to prevent unsightly comments
-	if ( !empty( $new_content ) && ( $new_content !== $content ) ) {
+	if ( ! empty( $new_content ) && ( $new_content !== $content ) ) {
 
 		// Set the content to be the new content
 		$content = $new_content;
@@ -718,7 +786,7 @@ function bp_remove_all_filters( $tag, $priority = false ) {
 	if ( isset( $wp_filter[$tag] ) ) {
 
 		// Filters exist in this priority
-		if ( !empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) {
+		if ( ! empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) {
 
 			// Store filters in a backup
 			$bp->filters->wp_filter[$tag][$priority] = $wp_filter[$tag][$priority];
@@ -774,7 +842,7 @@ function bp_restore_all_filters( $tag, $priority = false ) {
 	if ( isset( $bp->filters->wp_filter[$tag] ) ) {
 
 		// Filters exist in this priority
-		if ( !empty( $priority ) && isset( $bp->filters->wp_filter[$tag][$priority] ) ) {
+		if ( ! empty( $priority ) && isset( $bp->filters->wp_filter[$tag][$priority] ) ) {
 
 			// Store filters in a backup
 			$wp_filter[$tag][$priority] = $bp->filters->wp_filter[$tag][$priority];
@@ -819,7 +887,15 @@ function bp_comments_open( $open, $post_id = 0 ) {
 
 	$retval = is_buddypress() ? false : $open;
 
-	// Allow override of the override
+	/**
+	 * Filters whether or not to force comments_status to closed for BuddyPress post types.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param bool $retval  Whether or not we are on a BuddyPress post type.
+	 * @param bool $open    True if comments open, false if closed.
+	 * @param int  $post_id Post ID for the checked post.
+	 */
 	return apply_filters( 'bp_force_comment_status', $retval, $open, $post_id );
 }
 
@@ -844,8 +920,7 @@ function bp_comments_open( $open, $post_id = 0 ) {
 function bp_theme_compat_toggle_is_page( $retval = '' ) {
 	global $wp_query;
 
-	$wp_query->is_single = false;
-	$wp_query->is_page   = false;
+	$wp_query->is_page = false;
 
 	// Set a switch so we know that we've toggled these WP_Query properties
 	buddypress()->theme_compat->is_page_toggled = true;
@@ -873,8 +948,7 @@ function bp_theme_compat_loop_end( $query ) {
 	}
 
 	// Revert our toggled WP_Query properties
-	$query->is_single = true;
-	$query->is_page   = true;
+	$query->is_page = true;
 
 	// Unset our switch
 	unset( $bp->theme_compat->is_page_toggled );
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-update.php b/wp-content/plugins/buddypress/bp-core/bp-core-update.php
index 6b271544cfb9da993d9a2ff62bf1137916e4ec59..fb8e468ab6160cc43cb9c9934a482686ddba3583 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-update.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-update.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Is this a fresh installation of BuddyPress?
@@ -187,6 +187,13 @@ function bp_version_updater() {
 	// Get the raw database version
 	$raw_db_version = (int) bp_get_db_version_raw();
 
+	/**
+	 * Filters the default components to activate for a new install.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $value Array of default components to activate.
+	 */
 	$default_components = apply_filters( 'bp_new_install_default_components', array(
 		'activity'      => 1,
 		'members'       => 1,
@@ -195,7 +202,7 @@ function bp_version_updater() {
 		'notifications' => 1,
 	) );
 
-	require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-schema.php' );
+	require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
 
 	// Install BP schema and activate only Activity and XProfile
 	if ( bp_is_install() ) {
@@ -211,18 +218,18 @@ function bp_version_updater() {
 		// Run the schema install to update tables
 		bp_core_install();
 
-		// 1.5
+		// 1.5.0
 		if ( $raw_db_version < 1801 ) {
 			bp_update_to_1_5();
 			bp_core_add_page_mappings( $default_components, 'delete' );
 		}
 
-		// 1.6
+		// 1.6.0
 		if ( $raw_db_version < 6067 ) {
 			bp_update_to_1_6();
 		}
 
-		// 1.9
+		// 1.9.0
 		if ( $raw_db_version < 7553 ) {
 			bp_update_to_1_9();
 		}
@@ -232,7 +239,7 @@ function bp_version_updater() {
 			bp_update_to_1_9_2();
 		}
 
-		// 2.0
+		// 2.0.0
 		if ( $raw_db_version < 7892 ) {
 			bp_update_to_2_0();
 		}
@@ -241,6 +248,16 @@ function bp_version_updater() {
 		if ( $raw_db_version < 8311 ) {
 			bp_update_to_2_0_1();
 		}
+
+		// 2.2.0
+		if ( $raw_db_version < 9181 ) {
+			bp_update_to_2_2();
+		}
+
+		// 2.3.0
+		if ( $raw_db_version < 9615 ) {
+			bp_update_to_2_3();
+		}
 	}
 
 	/** All done! *************************************************************/
@@ -249,6 +266,41 @@ function bp_version_updater() {
 	bp_version_bump();
 }
 
+/**
+ * Perform database operations that must take place before the general schema upgrades.
+ *
+ * `dbDelta()` cannot handle certain operations - like changing indexes - so we do it here instead.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_pre_schema_upgrade() {
+	global $wpdb;
+
+	$raw_db_version = (int) bp_get_db_version_raw();
+	$bp_prefix      = bp_core_get_table_prefix();
+
+	// 2.3.0: Change index lengths to account for utf8mb4.
+	if ( $raw_db_version < 9695 ) {
+		// table_name => columns.
+		$tables = array(
+			$bp_prefix . 'bp_activity_meta'       => array( 'meta_key' ),
+			$bp_prefix . 'bp_groups_groupmeta'    => array( 'meta_key' ),
+			$bp_prefix . 'bp_messages_meta'       => array( 'meta_key' ),
+			$bp_prefix . 'bp_notifications_meta'  => array( 'meta_key' ),
+			$bp_prefix . 'bp_user_blogs_blogmeta' => array( 'meta_key' ),
+			$bp_prefix . 'bp_xprofile_meta'       => array( 'meta_key' ),
+		);
+
+		foreach ( $tables as $table_name => $indexes ) {
+			foreach ( $indexes as $index ) {
+				if ( $wpdb->query( $wpdb->prepare( "SHOW TABLES LIKE %s", bp_esc_like( $table_name ) ) ) ) {
+					$wpdb->query( "ALTER TABLE {$table_name} DROP INDEX {$index}" );
+				}
+			}
+		}
+	}
+}
+
 /** Upgrade Routines **********************************************************/
 
 /**
@@ -389,6 +441,97 @@ function bp_update_to_2_0_1() {
 	bp_core_maybe_install_signups();
 }
 
+/**
+ * 2.2.0 update routine.
+ *
+ * - Add messages meta table
+ * - Update the component field of the 'new members' activity type
+ * - Clean up hidden friendship activities
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_update_to_2_2() {
+
+	// Also handled by `bp_core_install()`
+	if ( bp_is_active( 'messages' ) ) {
+		bp_core_install_private_messaging();
+	}
+
+	if ( bp_is_active( 'activity' ) ) {
+		bp_migrate_new_member_activity_component();
+
+		if ( bp_is_active( 'friends' ) ) {
+			bp_cleanup_friendship_activities();
+		}
+	}
+}
+
+/**
+ * 2.3.0 update routine.
+ *
+ * - Add notifications meta table
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_update_to_2_3() {
+
+	// Also handled by `bp_core_install()`
+	if ( bp_is_active( 'notifications' ) ) {
+		bp_core_install_notifications();
+	}
+}
+
+/**
+ * Updates the component field for new_members type.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @global $wpdb
+ * @uses   buddypress()
+ *
+ */
+function bp_migrate_new_member_activity_component() {
+	global $wpdb;
+	$bp = buddypress();
+
+	// Update the component for the new_member type
+	$wpdb->update(
+		// Activity table
+		$bp->members->table_name_last_activity,
+		array(
+			'component' => $bp->members->id,
+		),
+		array(
+			'component' => 'xprofile',
+			'type'      => 'new_member',
+		),
+		// Data sanitization format
+		array(
+			'%s',
+		),
+		// WHERE sanitization format
+		array(
+			'%s',
+			'%s'
+		)
+	);
+}
+
+/**
+ * Remove all hidden friendship activities
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @uses bp_activity_delete() to delete the corresponding friendship activities
+ */
+function bp_cleanup_friendship_activities() {
+	bp_activity_delete( array(
+		'component'     => buddypress()->friends->id,
+		'type'          => 'friendship_created',
+		'hide_sitewide' => true,
+	) );
+ }
+
 /**
  * Redirect user to BP's What's New page on first page load after activation.
  *
@@ -478,7 +621,13 @@ function bp_activation() {
 	// Add options
 	bp_add_options();
 
-	// Use as of (1.6)
+	/**
+	 * Fires during the activation of BuddyPress.
+	 *
+	 * Use as of (1.6.0)
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_activation' );
 
 	// @deprecated as of (1.6)
@@ -507,7 +656,13 @@ function bp_deactivation() {
 		update_option( 'stylesheet_root', get_raw_theme_root( WP_DEFAULT_THEME, true ) );
 	}
 
-	// Use as of (1.6)
+	/**
+	 * Fires during the deactivation of BuddyPress.
+	 *
+	 * Use as of (1.6.0)
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_deactivation' );
 
 	// @deprecated as of (1.6)
@@ -524,5 +679,11 @@ function bp_deactivation() {
  * @uses do_action() Calls 'bp_uninstall' hook.
  */
 function bp_uninstall() {
+
+	/**
+	 * Fires during the uninstallation of BuddyPress.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_uninstall' );
 }
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
index 2cd01c0c6ab369de50e9a3e2a868031255a33cff..48a29e217411364dd2e88e11bfcc49028482a124 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php
@@ -7,16 +7,15 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register bp-core widgets.
+ *
+ * @since BuddyPress (1.0.0)
  */
 function bp_core_register_widgets() {
 	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Login_Widget");') );
-	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Members_Widget");') );
-	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Whos_Online_Widget");') );
-	add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Recently_Active_Widget");') );
 }
 add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
 
@@ -51,7 +50,18 @@ class BP_Core_Login_Widget extends WP_Widget {
 	 */
 	public function widget( $args, $instance ) {
 		$title = isset( $instance['title'] ) ? $instance['title'] : '';
-		$title = apply_filters( 'widget_title', $title );
+
+		/**
+		 * Filters the title of the Login widget.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $instance The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
 
 		echo $args['before_widget'];
 
@@ -59,7 +69,14 @@ class BP_Core_Login_Widget extends WP_Widget {
 
 		<?php if ( is_user_logged_in() ) : ?>
 
-			<?php do_action( 'bp_before_login_widget_loggedin' ); ?>
+			<?php
+
+ 		 	/**
+		 	 * Fires before the display of widget content if logged in.
+		 	 *
+		 	 * @since BuddyPress (1.9.0)
+		 	 */
+			do_action( 'bp_before_login_widget_loggedin' ); ?>
 
 			<div class="bp-login-widget-user-avatar">
 				<a href="<?php echo bp_loggedin_user_domain(); ?>">
@@ -72,18 +89,32 @@ class BP_Core_Login_Widget extends WP_Widget {
 				<div class="bp-login-widget-user-logout"><a class="logout" href="<?php echo wp_logout_url( bp_get_requested_url() ); ?>"><?php _e( 'Log Out', 'buddypress' ); ?></a></div>
 			</div>
 
-			<?php do_action( 'bp_after_login_widget_loggedin' ); ?>
+			<?php
+
+			/**
+		 	 * Fires after the display of widget content if logged in.
+		 	 *
+		 	 * @since BuddyPress (1.9.0)
+		 	 */
+			do_action( 'bp_after_login_widget_loggedin' ); ?>
 
 		<?php else : ?>
 
-			<?php do_action( 'bp_before_login_widget_loggedout' ); ?>
+			<?php
+
+			/**
+		 	 * Fires before the display of widget content if logged out.
+		 	 *
+		 	 * @since BuddyPress (1.9.0)
+		 	 */
+			do_action( 'bp_before_login_widget_loggedout' ); ?>
 
 			<form name="bp-login-form" id="bp-login-widget-form" class="standard-form" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
 				<label for="bp-login-widget-user-login"><?php _e( 'Username', 'buddypress' ); ?></label>
 				<input type="text" name="log" id="bp-login-widget-user-login" class="input" value="" />
 
 				<label for="bp-login-widget-user-pass"><?php _e( 'Password', 'buddypress' ); ?></label>
-				<input type="password" name="pwd" id="bp-login-widget-user-pass" class="input" value=""  />
+				<input type="password" name="pwd" id="bp-login-widget-user-pass" class="input" value="" <?php bp_form_field_attributes( 'password' ) ?> />
 
 				<div class="forgetmenot"><label><input name="rememberme" type="checkbox" id="bp-login-widget-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ); ?></label></div>
 
@@ -97,7 +128,14 @@ class BP_Core_Login_Widget extends WP_Widget {
 
 			</form>
 
-			<?php do_action( 'bp_after_login_widget_loggedout' ); ?>
+			<?php
+
+			/**
+		 	 * Fires after the display of widget content if logged out.
+		 	 *
+		 	 * @since BuddyPress (1.9.0)
+		 	 */
+			do_action( 'bp_after_login_widget_loggedout' ); ?>
 
 		<?php endif;
 
@@ -137,440 +175,3 @@ class BP_Core_Login_Widget extends WP_Widget {
 		<?php
 	}
 }
-
-/**
- * Members Widget.
- */
-class BP_Core_Members_Widget extends WP_Widget {
-
-	/**
-	 * Constructor method.
-	 */
-	function __construct() {
-		$widget_ops = array(
-			'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ),
-			'classname' => 'widget_bp_core_members_widget buddypress widget',
-		);
-		parent::__construct( false, $name = _x( '(BuddyPress) Members', 'widget name', 'buddypress' ), $widget_ops );
-
-		if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
-			wp_enqueue_script( 'bp-widget-members' );
-		}
-	}
-
-	/**
-	 * Display the Members widget.
-	 *
-	 * @see WP_Widget::widget() for description of parameters.
-	 *
-	 * @param array $args Widget arguments.
-	 * @param array $instance Widget settings, as saved by the user.
-	 */
-	function widget( $args, $instance ) {
-
-		extract( $args );
-
-		if ( !$instance['member_default'] )
-			$instance['member_default'] = 'active';
-
-		$title = apply_filters( 'widget_title', $instance['title'] );
-
-		echo $before_widget;
-
-		$title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $title . '</a>' : $title;
-
-		echo $before_title
-		   . $title
-		   . $after_title;
-
-		$members_args = array(
-			'user_id'         => 0,
-			'type'            => $instance['member_default'],
-			'per_page'        => $instance['max_members'],
-			'max'             => $instance['max_members'],
-			'populate_extras' => true,
-			'search_terms'    => false,
-		);
-
-		?>
-
-		<?php if ( bp_has_members( $members_args ) ) : ?>
-			<div class="item-options" id="members-list-options">
-				<a href="<?php bp_members_directory_permalink(); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a>
-				|  <a href="<?php bp_members_directory_permalink(); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a>
-
-				<?php if ( bp_is_active( 'friends' ) ) : ?>
-
-					| <a href="<?php bp_members_directory_permalink(); ?>" id="popular-members" <?php if ( $instance['member_default'] == 'popular' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></a>
-
-				<?php endif; ?>
-			</div>
-
-			<ul id="members-list" class="item-list">
-				<?php while ( bp_members() ) : bp_the_member(); ?>
-					<li class="vcard">
-						<div class="item-avatar">
-							<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar() ?></a>
-						</div>
-
-						<div class="item">
-							<div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
-							<div class="item-meta">
-								<span class="activity">
-								<?php
-									if ( 'newest' == $instance['member_default'] )
-										bp_member_registered();
-									if ( 'active' == $instance['member_default'] )
-										bp_member_last_active();
-									if ( 'popular' == $instance['member_default'] )
-										bp_member_total_friend_count();
-								?>
-								</span>
-							</div>
-						</div>
-					</li>
-
-				<?php endwhile; ?>
-			</ul>
-			<?php wp_nonce_field( 'bp_core_widget_members', '_wpnonce-members' ); ?>
-			<input type="hidden" name="members_widget_max" id="members_widget_max" value="<?php echo esc_attr( $instance['max_members'] ); ?>" />
-
-		<?php else: ?>
-
-			<div class="widget-error">
-				<?php _e('No one has signed up yet!', 'buddypress') ?>
-			</div>
-
-		<?php endif; ?>
-
-		<?php echo $after_widget; ?>
-	<?php
-	}
-
-	/**
-	 * Update the Members widget options.
-	 *
-	 * @param array $new_instance The new instance options.
-	 * @param array $old_instance The old instance options.
-	 * @return array $instance The parsed options to be saved.
-	 */
-	function update( $new_instance, $old_instance ) {
-		$instance = $old_instance;
-
-		$instance['title'] 	    = strip_tags( $new_instance['title'] );
-		$instance['max_members']    = strip_tags( $new_instance['max_members'] );
-		$instance['member_default'] = strip_tags( $new_instance['member_default'] );
-		$instance['link_title']	    = (bool)$new_instance['link_title'];
-
-		return $instance;
-	}
-
-	/**
-	 * Output the Members widget options form.
-	 *
-	 * @param $instance Settings for this widget.
-	 */
-	function form( $instance ) {
-		$defaults = array(
-			'title' 	 => __( 'Members', 'buddypress' ),
-			'max_members' 	 => 5,
-			'member_default' => 'active',
-			'link_title' 	 => false
-		);
-		$instance = wp_parse_args( (array) $instance, $defaults );
-
-		$title 		= strip_tags( $instance['title'] );
-		$max_members 	= strip_tags( $instance['max_members'] );
-		$member_default = strip_tags( $instance['member_default'] );
-		$link_title	= (bool)$instance['link_title'];
-		?>
-
-		<p><label for="bp-core-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
-
-		<p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Members directory', 'buddypress' ) ?></label></p>
-
-		<p><label for="bp-core-widget-members-max"><?php _e('Max members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p>
-
-		<p>
-			<label for="bp-core-widget-groups-default"><?php _e('Default members to show:', 'buddypress'); ?>
-			<select name="<?php echo $this->get_field_name( 'member_default' ) ?>">
-				<option value="newest" <?php if ( $member_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
-				<option value="active" <?php if ( $member_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
-				<option value="popular"  <?php if ( $member_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
-			</select>
-			</label>
-		</p>
-
-	<?php
-	}
-}
-
-/*** WHO'S ONLINE WIDGET *****************/
-
-class BP_Core_Whos_Online_Widget extends WP_Widget {
-
-	/**
-	 * Constructor method.
-	 */
-	function __construct() {
-		$widget_ops = array(
-			'description' => __( 'Profile photos of online users', 'buddypress' ),
-			'classname' => 'widget_bp_core_whos_online_widget buddypress widget',
-		);
-		parent::__construct( false, $name = _x( "(BuddyPress) Who's Online", 'widget name', 'buddypress' ), $widget_ops );
-	}
-
-	/**
-	 * Display the Who's Online widget.
-	 *
-	 * @see WP_Widget::widget() for description of parameters.
-	 *
-	 * @param array $args Widget arguments.
-	 * @param array $instance Widget settings, as saved by the user.
-	 */
-	function widget($args, $instance) {
-
-		extract( $args );
-
-		$title = apply_filters( 'widget_title', $instance['title'] );
-
-		echo $before_widget;
-		echo $before_title
-		   . $title
-		   . $after_title;
-
-		$members_args = array(
-			'user_id'         => 0,
-			'type'            => 'online',
-			'per_page'        => $instance['max_members'],
-			'max'             => $instance['max_members'],
-			'populate_extras' => true,
-			'search_terms'    => false,
-		);
-
-		?>
-
-		<?php if ( bp_has_members( $members_args ) ) : ?>
-			<div class="avatar-block">
-				<?php while ( bp_members() ) : bp_the_member(); ?>
-					<div class="item-avatar">
-						<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar() ?></a>
-					</div>
-				<?php endwhile; ?>
-			</div>
-		<?php else: ?>
-
-			<div class="widget-error">
-				<?php _e( 'There are no users currently online', 'buddypress' ) ?>
-			</div>
-
-		<?php endif; ?>
-
-		<?php echo $after_widget; ?>
-	<?php
-	}
-
-	/**
-	 * Update the Who's Online widget options.
-	 *
-	 * @param array $new_instance The new instance options.
-	 * @param array $old_instance The old instance options.
-	 * @return array $instance The parsed options to be saved.
-	 */
-	function update( $new_instance, $old_instance ) {
-		$instance = $old_instance;
-		$instance['title'] = strip_tags( $new_instance['title'] );
-		$instance['max_members'] = strip_tags( $new_instance['max_members'] );
-
-		return $instance;
-	}
-
-	/**
-	 * Output the Who's Online widget options form.
-	 *
-	 * @param $instance Settings for this widget.
-	 */
-	function form( $instance ) {
-		$defaults = array(
-			'title' => __( "Who's Online", 'buddypress' ),
-			'max_members' => 15
-		);
-		$instance = wp_parse_args( (array) $instance, $defaults );
-
-		$title = strip_tags( $instance['title'] );
-		$max_members = strip_tags( $instance['max_members'] );
-		?>
-
-		<p><label for="bp-core-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
-
-		<p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p>
-	<?php
-	}
-}
-
-/*** RECENTLY ACTIVE WIDGET *****************/
-
-class BP_Core_Recently_Active_Widget extends WP_Widget {
-
-	/**
-	 * Constructor method.
-	 */
-	function __construct() {
-		$widget_ops = array(
-			'description' => __( 'Profile photos of recently active members', 'buddypress' ),
-			'classname' => 'widget_bp_core_recently_active_widget buddypress widget',
-		);
-		parent::__construct( false, $name = _x( '(BuddyPress) Recently Active Members', 'widget name', 'buddypress' ), $widget_ops );
-	}
-
-	/**
-	 * Display the Recently Active widget.
-	 *
-	 * @see WP_Widget::widget() for description of parameters.
-	 *
-	 * @param array $args Widget arguments.
-	 * @param array $instance Widget settings, as saved by the user.
-	 */
-	function widget( $args, $instance ) {
-
-		extract( $args );
-
-		$title = apply_filters( 'widget_title', $instance['title'] );
-
-		echo $before_widget;
-		echo $before_title
-		   . $title
-		   . $after_title;
-
-		$members_args = array(
-			'user_id'         => 0,
-			'type'            => 'active',
-			'per_page'        => $instance['max_members'],
-			'max'             => $instance['max_members'],
-			'populate_extras' => true,
-			'search_terms'    => false,
-		);
-
-		?>
-
-		<?php if ( bp_has_members( $members_args ) ) : ?>
-			<div class="avatar-block">
-				<?php while ( bp_members() ) : bp_the_member(); ?>
-					<div class="item-avatar">
-						<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_avatar() ?></a>
-					</div>
-				<?php endwhile; ?>
-			</div>
-		<?php else: ?>
-
-			<div class="widget-error">
-				<?php _e( 'There are no recently active members', 'buddypress' ) ?>
-			</div>
-
-		<?php endif; ?>
-
-		<?php echo $after_widget; ?>
-	<?php
-	}
-
-	/**
-	 * Update the Recently Active widget options.
-	 *
-	 * @param array $new_instance The new instance options.
-	 * @param array $old_instance The old instance options.
-	 * @return array $instance The parsed options to be saved.
-	 */
-	function update( $new_instance, $old_instance ) {
-		$instance = $old_instance;
-		$instance['title'] = strip_tags( $new_instance['title'] );
-		$instance['max_members'] = strip_tags( $new_instance['max_members'] );
-
-		return $instance;
-	}
-
-	/**
-	 * Output the Recently Active widget options form.
-	 *
-	 * @param $instance Settings for this widget.
-	 */
-	function form( $instance ) {
-		$defaults = array(
-			'title' => __( 'Recently Active Members', 'buddypress' ),
-			'max_members' => 15
-		);
-		$instance = wp_parse_args( (array) $instance, $defaults );
-
-		$title = strip_tags( $instance['title'] );
-		$max_members = strip_tags( $instance['max_members'] );
-		?>
-
-		<p><label for="bp-core-widget-members-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
-
-		<p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" /></label></p>
-	<?php
-	}
-}
-
-/**
- * AJAX request handler for Members widgets.
- */
-function bp_core_ajax_widget_members() {
-
-	check_ajax_referer( 'bp_core_widget_members' );
-
-	switch ( $_POST['filter'] ) {
-		case 'newest-members':
-			$type = 'newest';
-			break;
-
-		case 'recently-active-members':
-			$type = 'active';
-			break;
-
-		case 'popular-members':
-			if ( bp_is_active( 'friends' ) )
-				$type = 'popular';
-			else
-				$type = 'active';
-
-			break;
-	}
-
-	$members_args = array(
-		'user_id'         => 0,
-		'type'            => $type,
-		'per_page'        => $_POST['max-members'],
-		'max'             => $_POST['max-members'],
-		'populate_extras' => 1,
-		'search_terms'    => false,
-	);
-
-	if ( bp_has_members( $members_args ) ) : ?>
-		<?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?>
-		<?php while ( bp_members() ) : bp_the_member(); ?>
-			<li class="vcard">
-				<div class="item-avatar">
-					<a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
-				</div>
-
-				<div class="item">
-					<div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
-					<?php if ( 'active' == $type ) : ?>
-						<div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
-					<?php elseif ( 'newest' == $type ) : ?>
-						<div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div>
-					<?php elseif ( bp_is_active( 'friends' ) ) : ?>
-						<div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div>
-					<?php endif; ?>
-				</div>
-			</li>
-		<?php endwhile; ?>
-
-	<?php else: ?>
-		<?php echo "-1[[SPLIT]]<li>"; ?>
-		<?php _e( 'There were no members found, please try another filter.', 'buddypress' ) ?>
-		<?php echo "</li>"; ?>
-	<?php endif;
-}
-add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
-add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' );
diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
index 18a3c23be5047c3976a712b0b41f9e71f63a727b..7344245f580c0d25a96d4868aaeeb9cd64caf8fe 100644
--- a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
+++ b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Parse the WordPress core version number into the major release.
@@ -75,7 +75,7 @@ if ( !is_multisite() ) {
 		/**
 		 * @see switch_to_blog()
 		 */
-		function switch_to_blog() {
+		function switch_to_blog( $new_blog, $deprecated = null ) {
 			return bp_get_root_blog_id();
 		}
 	}
@@ -93,7 +93,7 @@ if ( !is_multisite() ) {
 		/**
 		 * @see get_blogs_of_user()
 		 */
-		function get_blogs_of_user() {
+		function get_blogs_of_user( $user_id, $all = false ) {
 			return false;
 		}
 	}
@@ -102,7 +102,7 @@ if ( !is_multisite() ) {
 		/**
 		 * @see update_blog_status()
 		 */
-		function update_blog_status() {
+		function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
 			return true;
 		}
 	}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment-avatar.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment-avatar.php
new file mode 100644
index 0000000000000000000000000000000000000000..5ea1bd154463788e56aed2a4bff6ea5d1e5680c3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment-avatar.php
@@ -0,0 +1,409 @@
+<?php
+/**
+ * Core Avatars attachment class
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BP Attachment Avatar class
+ *
+ * Extends BP Attachment to manage the avatar uploads
+ *
+ * @since BuddyPress (2.3.0)
+ */
+class BP_Attachment_Avatar extends BP_Attachment {
+
+	/**
+	 * Construct Upload parameters
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @see  BP_Attachment::__construct() for list of parameters
+	 * @uses bp_core_avatar_original_max_filesize()
+	 * @uses BP_Attachment::__construct()
+	 */
+	public function __construct() {
+		// Allowed avatar types
+		$allowed_types = bp_core_get_allowed_avatar_types();
+
+		parent::__construct( array(
+			'action'                => 'bp_avatar_upload',
+			'file_input'            => 'file',
+			'original_max_filesize' => bp_core_avatar_original_max_filesize(),
+
+			// Specific errors for avatars
+			'upload_error_strings'  => array(
+				9  => sprintf( __( 'That photo is too big. Please upload one smaller than %s', 'buddypress' ), size_format( bp_core_avatar_original_max_filesize() ) ),
+				10 => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddypress' ), self::get_avatar_types( $allowed_types ) ),
+			),
+		) );
+	}
+
+	/**
+	 * Gets the available avatar types
+	 *
+	 * @since BuddyPress (2.3.0)
+	 * @return string comma separated list of allowed avatar types
+	 */
+	public static function get_avatar_types( $allowed_types = array() ) {
+		$types = array_map( 'strtoupper', $allowed_types );
+		$comma = _x( ',', 'avatar types separator', 'buddypress' );
+		return join( $comma . ' ', $types );
+	}
+
+	/**
+	 * Set Upload Dir data for avatars
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @uses bp_core_avatar_upload_path()
+	 * @uses bp_core_avatar_url()
+	 * @uses bp_upload_dir()
+	 * @uses BP_Attachment::set_upload_dir()
+	 */
+	public function set_upload_dir() {
+		if ( bp_core_avatar_upload_path() && bp_core_avatar_url() ) {
+			$this->upload_path = bp_core_avatar_upload_path();
+			$this->url         = bp_core_avatar_url();
+			$this->upload_dir  = bp_upload_dir();
+		} else {
+			parent::set_upload_dir();
+		}
+	}
+
+	/**
+	 * Avatar specific rules
+	 *
+	 * Adds an error if the avatar size or type don't match BuddyPress needs
+	 * The error code is the index of $upload_error_strings
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  array $file the temporary file attributes (before it has been moved)
+	 * @uses   bp_core_check_avatar_size()
+	 * @uses   bp_core_check_avatar_type()
+	 * @return array the file with extra errors if needed
+	 */
+	public function validate_upload( $file = array() ) {
+		// Bail if already an error
+		if ( ! empty( $file['error'] ) ) {
+			return $file;
+		}
+
+		// File size is too big
+		if ( ! bp_core_check_avatar_size( array( 'file' => $file ) ) ) {
+			$file['error'] = 9;
+
+		// File is of invalid type
+		} elseif ( ! bp_core_check_avatar_type( array( 'file' => $file ) ) ) {
+			$file['error'] = 10;
+		}
+
+		// Return with error code attached
+		return $file;
+	}
+
+	/**
+	 * Maybe shrink the attachment to fit maximum allowed width
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param string $file the absolute path to the file
+	 * @uses  bp_core_avatar_original_max_width()
+	 * @uses  wp_get_image_editor()
+	 * @return mixed
+	 */
+	public static function shrink( $file = '' ) {
+		// Get image size
+		$size   = @getimagesize( $file );
+		$retval = false;
+
+		// Check image size and shrink if too large
+		if ( $size[0] > bp_core_avatar_original_max_width() ) {
+			$editor = wp_get_image_editor( $file );
+
+			if ( ! is_wp_error( $editor ) ) {
+				$editor->set_quality( 100 );
+
+				$resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
+				if ( ! is_wp_error( $resized ) ) {
+					$thumb = $editor->save( $editor->generate_filename() );
+				} else {
+					$retval = $resized;
+				}
+
+				// Check for thumbnail creation errors
+				if ( ( false === $retval ) && is_wp_error( $thumb ) ) {
+					$retval = $thumb;
+				}
+
+				// Thumbnail is good so proceed
+				if ( false === $retval ) {
+					$retval = $thumb;
+				}
+
+			} else {
+				$retval = $editor;
+			}
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Check if the image dimensions are smaller than full avatar dimensions
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param string $file the absolute path to the file
+	 * @uses  bp_core_avatar_full_width()
+	 * @uses  bp_core_avatar_full_height()
+	 * @return boolean
+	 */
+	public static function is_too_small( $file = '' ) {
+		$uploaded_image = @getimagesize( $file );
+		$full_width     = bp_core_avatar_full_width();
+		$full_height    = bp_core_avatar_full_height();
+
+		if ( isset( $uploaded_image[0] ) && $uploaded_image[0] < $full_width || $uploaded_image[1] < $full_height ) {
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Crop the avatar
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @see  BP_Attachment::crop for the list of parameters
+	 * @param array $args
+	 * @uses bp_core_fetch_avatar()
+	 * @uses bp_core_delete_existing_avatar()
+	 * @uses bp_core_avatar_full_width()
+	 * @uses bp_core_avatar_full_height()
+	 * @uses bp_core_avatar_dimension()
+	 * @uses BP_Attachment::crop
+	 * @return array the cropped avatars (full and thumb)
+	 */
+	public function crop( $args = array() ) {
+		// Bail if the original file is missing
+		if ( empty( $args['original_file'] ) ) {
+			return false;
+		}
+
+		/**
+		 * Original file is a relative path to the image
+		 * eg: /avatars/1/avatar.jpg
+		 */
+		$relative_path = $args['original_file'];
+		$absolute_path = $this->upload_path . $relative_path;
+
+		// Bail if the avatar is not available
+		if ( ! file_exists( $absolute_path ) )  {
+			return false;
+		}
+
+		if ( empty( $args['item_id'] ) ) {
+
+			/** This filter is documented in bp-core/bp-core-avatars.php */
+			$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $absolute_path ), $args['item_id'], $args['object'], $args['avatar_dir'] );
+		} else {
+
+			/** This filter is documented in bp-core/bp-core-avatars.php */
+			$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $this->upload_path . '/' . $args['avatar_dir'] . '/' . $args['item_id'], $args['item_id'], $args['object'], $args['avatar_dir'] );
+		}
+
+		// Bail if the avatar folder is missing for this item_id
+		if ( ! file_exists( $avatar_folder_dir ) ) {
+			return false;
+		}
+
+		// Delete the existing avatar files for the object
+		$existing_avatar = bp_core_fetch_avatar( array(
+			'object'  => $args['object'],
+			'item_id' => $args['item_id'],
+			'html' => false,
+		) );
+
+		/**
+		 * Check that the new avatar doesn't have the same name as the
+		 * old one before deleting
+		 */
+		if ( ! empty( $existing_avatar ) && $existing_avatar !== $this->url . $relative_path ) {
+			bp_core_delete_existing_avatar( array( 'object' => $args['object'], 'item_id' => $args['item_id'], 'avatar_path' => $avatar_folder_dir ) );
+		}
+
+		// Make sure we at least have minimal data for cropping
+		if ( empty( $args['crop_w'] ) ) {
+			$args['crop_w'] = bp_core_avatar_full_width();
+		}
+
+		if ( empty( $args['crop_h'] ) ) {
+			$args['crop_h'] = bp_core_avatar_full_height();
+		}
+
+		// Get the file extension
+		$data = @getimagesize( $absolute_path );
+		$ext  = $data['mime'] == 'image/png' ? 'png' : 'jpg';
+
+		$args['original_file'] = $absolute_path;
+		$args['src_abs']       = false;
+		$avatar_types = array( 'full' => '', 'thumb' => '' );
+
+		foreach ( $avatar_types as $key_type => $type ) {
+			$args['dst_w']    = bp_core_avatar_full_width();
+			$args['dst_h']    = bp_core_avatar_full_height();
+			$args['dst_file'] = $avatar_folder_dir . '/' . wp_hash( $absolute_path . time() ) . '-bp' . $key_type . '.' . $ext;
+
+			$avatar_types[ $key_type ] = parent::crop( $args );
+		}
+
+		// Remove the original
+		@unlink( $absolute_path );
+
+		// Return the full and thumb cropped avatars
+		return $avatar_types;
+	}
+
+	/**
+	 * Get the user id to set its avatar
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return integer the user ID
+	 */
+	private function get_user_id() {
+		$bp = buddypress();
+		$user_id = 0;
+
+		if ( bp_is_user() ) {
+			$user_id = bp_displayed_user_id();
+		}
+
+		if ( ! empty( $bp->members->admin->user_id ) ) {
+			$user_id = $bp->members->admin->user_id;
+		}
+
+		return $user_id;
+	}
+
+	/**
+	 * Get the group id to set its avatar
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return integer the group id
+	 */
+	private function get_group_id() {
+		$group_id = 0;
+
+		if ( bp_is_group() ) {
+			$group_id = bp_get_current_group_id();
+		}
+
+		return $group_id;
+	}
+
+	/**
+	 * Build script datas for the Uploader UI
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return array the javascript localization data
+	 */
+	public function script_data() {
+		// Get default script data
+		$script_data = parent::script_data();
+
+		// Defaults to Avatar Backbone script
+		$js_scripts = array( 'bp-avatar' );
+
+		// Default object
+		$object = '';
+
+		// Get the possible item ids
+		$user_id  = $this->get_user_id();
+		$group_id = $this->get_group_id();
+
+		if ( ! empty( $user_id ) ) {
+			// Should we load the the Webcam Avatar javascript file
+			if ( bp_avatar_use_webcam() ) {
+				$js_scripts = array( 'bp-webcam' );
+			}
+
+			$script_data['bp_params'] = array(
+				'object'     => 'user',
+				'item_id'    => $user_id,
+				'has_avatar' => bp_get_user_has_avatar( $user_id ),
+				'nonces'  => array(
+					'set'    => wp_create_nonce( 'bp_avatar_cropstore' ),
+					'remove' => wp_create_nonce( 'bp_delete_avatar_link' ),
+				),
+			);
+
+			// Set feedback messages
+			$script_data['feedback_messages'] = array(
+				1 => __( 'There was a problem cropping your profile photo.', 'buddypress' ),
+				2 => __( 'Your new profile photo was uploaded successfully.', 'buddypress' ),
+				3 => __( 'There was a problem deleting your profile photo. Please try again.', 'buddypress' ),
+				4 => __( 'Your profile photo was deleted successfully!', 'buddypress' ),
+			);
+		} elseif ( ! empty( $group_id ) ) {
+			$script_data['bp_params'] = array(
+				'object'     => 'group',
+				'item_id'    => $group_id,
+				'has_avatar' => bp_get_group_has_avatar( $group_id ),
+				'nonces'     => array(
+					'set'    => wp_create_nonce( 'bp_avatar_cropstore' ),
+					'remove' => wp_create_nonce( 'bp_group_avatar_delete' ),
+				),
+			);
+
+			// Set feedback messages
+			$script_data['feedback_messages'] = array(
+				1 => __( 'There was a problem cropping the group profile photo.', 'buddypress' ),
+				2 => __( 'The group profile photo was uploaded successfully.', 'buddypress' ),
+				3 => __( 'There was a problem deleting the group profile photo. Please try again.', 'buddypress' ),
+				4 => __( 'The group profile photo was deleted successfully!', 'buddypress' ),
+			);
+		} else {
+			/**
+			 * Use this filter to include specific BuddyPress params for your object
+			 * e.g. Blavatar
+			 *
+			 * @since BuddyPress (2.3.0)
+			 *
+			 * @param array the avatar specific BuddyPress parameters
+			 */
+			$script_data['bp_params'] = apply_filters( 'bp_attachment_avatar_params', array() );
+		}
+
+		// Include the specific css
+		$script_data['extra_css'] = array( 'bp-avatar' );
+
+		// Include the specific css
+		$script_data['extra_js']  = $js_scripts;
+
+		// Set the object to contextualize the filter
+		if ( isset( $script_data['bp_params']['object'] ) ) {
+			$object = $script_data['bp_params']['object'];
+		}
+
+		/**
+		 * Use this filter to override/extend the avatar script data
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array  $script_data the avatar script data
+		 * @param string $object      the object the avatar belongs to (eg: user or group)
+		 */
+		return apply_filters( 'bp_attachment_avatar_script_data', $script_data, $object );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php
new file mode 100644
index 0000000000000000000000000000000000000000..3e62182bd13d1b0ada15462c1bfce7ff7cfe58cb
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php
@@ -0,0 +1,518 @@
+<?php
+/**
+ * Core attachment class.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BP Attachment class
+ *
+ * Extend it to manage your component's uploads.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+abstract class BP_Attachment {
+
+	/** Upload properties *****************************************************/
+
+	/**
+	 * The file being uploaded
+	 *
+	 * @var array
+	 */
+	public $attachment = array();
+
+	/**
+	 * The default args to be merged with the
+	 * ones passed by the child class
+	 *
+	 * @var array
+	 */
+	protected $default_args = array(
+		'original_max_filesize' => 0,
+		'allowed_mime_types'    => array(),
+		'base_dir'              => '',
+		'action'                => '',
+		'file_input'            => '',
+		'upload_error_strings'  => array(),
+		'required_wp_files'     => array( 'file' ),
+	);
+
+	/**
+	 * Construct Upload parameters
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $args {
+	 *     @type int    $original_max_filesize Maximum file size in kilobytes. Defaults to php.ini settings.
+	 *     @type array  $allowed_mime_types    List of allowed file extensions (eg: array( 'jpg', 'gif', 'png' ) ).
+	 *                                         Defaults to WordPress allowed mime types
+	 *     @type string $base_dir              Component's upload base directory. Defaults to WordPress 'uploads'
+	 *     @type string $action                The upload action used when uploading a file, $_POST['action'] must be set
+	 *                                         and its value must equal $action {@link wp_handle_upload()} (required)
+	 *     @type string $file_input            The name attribute used in the file input. (required)
+	 *     @type array  $upload_error_strings  A list of specific error messages (optional).
+	 *     @type array  $required_wp_files     The list of required WordPress core files. Default: array( 'file' );
+	 * }
+	 * @uses  sanitize_key()
+	 * @uses  wp_max_upload_size()
+	 * @uses  bp_parse_args()
+	 * @uses  BP_Attachment->set_upload_error_strings()
+	 * @uses  BP_Attachment->set_upload_dir()
+	 */
+	public function __construct( $args = '' ) {
+		// Upload action and the file input name are required parameters
+		if ( empty( $args['action'] ) || empty( $args['file_input'] ) ) {
+			return false;
+		}
+
+		// Sanitize the action ID and the file input name
+		$this->action     = sanitize_key( $args['action'] );
+		$this->file_input = sanitize_key( $args['file_input'] );
+
+		/**
+		 * Max file size defaults to php ini settings or, in the case of
+		 * a multisite config, the root site fileupload_maxk option
+		 */
+		$this->default_args['original_max_filesize'] = (int) wp_max_upload_size();
+
+		$params = bp_parse_args( $args, $this->default_args, $this->action . '_upload_params' );
+
+		foreach ( $params as $key => $param ) {
+			if ( 'upload_error_strings' === $key ) {
+				$this->{$key} = $this->set_upload_error_strings( $param );
+
+			// Sanitize the base dir
+			} elseif ( 'base_dir' === $key ) {
+				$this->{$key} = sanitize_title( $param );
+
+			// Action & File input are already set and sanitized
+			} elseif ( 'action' !== $key && 'file_input' !== $key ) {
+				$this->{$key} = $param;
+			}
+		}
+
+		// Set the path/url and base dir for uploads
+		$this->set_upload_dir();
+	}
+
+	/**
+	 * Set upload path and url for the component.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @uses  bp_upload_dir()
+	 */
+	public function set_upload_dir() {
+		// Set the directory, path, & url variables
+		$this->upload_dir  = bp_upload_dir();
+
+		if ( empty( $this->upload_dir ) ) {
+			return false;
+		}
+
+		$this->upload_path = $this->upload_dir['basedir'];
+		$this->url         = $this->upload_dir['baseurl'];
+
+		// Ensure URL is https if SSL is set/forced
+		if ( is_ssl() ) {
+			$this->url = str_replace( 'http://', 'https://', $this->url );
+		}
+
+		/**
+		 * Custom base dir.
+		 *
+		 * If the component set this property, set the specific path, url and create the dir
+		 */
+		if ( ! empty( $this->base_dir ) ) {
+			$this->upload_path = trailingslashit( $this->upload_path ) . $this->base_dir;
+			$this->url         = trailingslashit( $this->url  ) . $this->base_dir;
+
+			// Finally create the base dir
+			$this->create_dir();
+		}
+	}
+
+	/**
+	 * Set Upload error messages
+	 *
+	 * Used into the $overrides argument of BP_Attachment->upload()
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $param a list of error messages to add to BuddyPress core ones
+	 * @return array the list of upload errors
+	 */
+	public function set_upload_error_strings( $param = array() ) {
+		/**
+		 * Index of the array is the error code
+		 * Custom errors will start at 9 code
+		 */
+		$upload_errors = array(
+			0 => __( 'The file was uploaded successfully', 'buddypress' ),
+			1 => __( 'The uploaded file exceeds the maximum allowed file size for this site', 'buddypress' ),
+			2 => sprintf( __( 'The uploaded file exceeds the maximum allowed file size of: %s', 'buddypress' ), size_format( $this->original_max_filesize ) ),
+			3 => __( 'The uploaded file was only partially uploaded.', 'buddypress' ),
+			4 => __( 'No file was uploaded.', 'buddypress' ),
+			5 => '',
+			6 => __( 'Missing a temporary folder.', 'buddypress' ),
+			7 => __( 'Failed to write file to disk.', 'buddypress' ),
+			8 => __( 'File upload stopped by extension.', 'buddypress' ),
+		);
+
+		if ( ! array_intersect_key( $upload_errors, (array) $param ) ) {
+			foreach ( $param as $key_error => $error_message ) {
+				$upload_errors[ $key_error ] = $error_message;
+			}
+		}
+
+		return $upload_errors;
+	}
+
+	/**
+	 * Include the WordPress core needed files
+	 *
+	 * @since BuddyPress (2.3.0)
+	 */
+	public function includes() {
+		foreach ( array_unique( $this->required_wp_files ) as $wp_file ) {
+			if ( ! file_exists( ABSPATH . "/wp-admin/includes/{$wp_file}.php" ) ) {
+				continue;
+			}
+
+			require_once( ABSPATH . "/wp-admin/includes/{$wp_file}.php" );
+		}
+	}
+
+	/**
+	 * Upload the attachment
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  array $file               The appropriate entry the from $_FILES superglobal.
+	 * @param  string $upload_dir_filter A specific filter to be applied to 'upload_dir' (optional).
+	 * @param  string $time              Optional. Time formatted in 'yyyy/mm'. Default null.
+	 * @uses   wp_handle_upload()        To upload the file
+	 * @uses   add_filter()              To temporarly overrides WordPress uploads data
+	 * @uses   remove_filter()           To stop overriding WordPress uploads data
+	 * @uses   apply_filters()           Call 'bp_attachment_upload_overrides' to include specific upload overrides
+	 *
+	 * @return array                     On success, returns an associative array of file attributes.
+	 *                                   On failure, returns an array containing the error message
+	 *                                   (eg: array( 'error' => $message ) )
+	 */
+	public function upload( $file, $upload_dir_filter = '', $time = null ) {
+		/**
+		 * Upload action and the file input name are required parameters
+		 * @see BP_Attachment:__construct()
+		 */
+		if ( empty( $this->action ) || empty( $this->file_input ) ) {
+			return false;
+		}
+
+		/**
+		 * Add custom rules before enabling the file upload
+		 */
+		add_filter( "{$this->action}_prefilter", array( $this, 'validate_upload' ), 10, 1 );
+
+		/**
+		 * The above dynamic filter was introduced in WordPress 4.0, as we support WordPress
+		 * back to 3.6, we need to also use the pre 4.0 static filter and remove it after
+		 * the upload was processed.
+		 */
+		add_filter( 'wp_handle_upload_prefilter', array( $this, 'validate_upload' ), 10, 1 );
+
+		// Set Default overrides
+		$overrides = array(
+			'action'               => $this->action,
+			'upload_error_strings' => $this->upload_error_strings,
+		);
+
+		/**
+		 * Add a mime override if needed
+		 * Used to restrict uploads by extensions
+		 */
+		if ( ! empty( $this->allowed_mime_types ) ) {
+			$mime_types = $this->validate_mime_types();
+
+			if ( ! empty( $mime_types ) ) {
+				$overrides['mimes'] = $mime_types;
+			}
+		}
+
+		/**
+		 * If you need to add some overrides we haven't thought of
+		 *
+		 * @var  array $overrides the wp_handle_upload overrides
+		 */
+		$overrides = apply_filters( 'bp_attachment_upload_overrides', $overrides );
+
+		$this->includes();
+
+		/**
+		 * If the $base_dir was set when constructing the class,
+		 * and no specific filter has been requested, use a default
+		 * filter to create the specific $base dir
+		 * @see  BP_Attachment->upload_dir_filter()
+		 */
+		if ( empty( $upload_dir_filter ) && ! empty( $this->base_dir ) ) {
+			$upload_dir_filter = array( $this, 'upload_dir_filter' );
+		}
+
+		// Make sure the file will be uploaded in the attachment directory
+		if ( ! empty( $upload_dir_filter ) ) {
+			add_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
+		}
+
+		// Upload the attachment
+		$this->attachment = wp_handle_upload( $file[ $this->file_input ], $overrides, $time );
+
+		// Restore WordPress Uploads data
+		if ( ! empty( $upload_dir_filter ) ) {
+			remove_filter( 'upload_dir', $upload_dir_filter, 10, 0 );
+		}
+
+		// Remove the pre WordPress 4.0 static filter
+		remove_filter( 'wp_handle_upload_prefilter', array( $this, 'validate_upload' ), 10, 1 );
+
+		// Finally return the uploaded file or the error
+		return $this->attachment;
+	}
+
+	/**
+	 * Validate the allowed mime types using WordPress allowed mime types
+	 *
+	 * In case of a multisite, the mime types are already restricted by
+	 * the 'upload_filetypes' setting. BuddyPress will respect this setting.
+	 * @see check_upload_mimes()
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @uses get_allowed_mime_types()
+	 */
+	protected function validate_mime_types() {
+		$wp_mimes = get_allowed_mime_types();
+		$valid_mimes = array();
+
+		// Set the allowed mimes for the upload
+		foreach ( (array) $this->allowed_mime_types as $ext ) {
+			foreach ( $wp_mimes as $ext_pattern => $mime ) {
+				if ( $ext !== '' && strpos( $ext_pattern, $ext ) !== false ) {
+					$valid_mimes[$ext_pattern] = $mime;
+				}
+			}
+		}
+		return $valid_mimes;
+	}
+
+	/**
+	 * Specific upload rules
+	 *
+	 * Override this function from your child class to build your specific rules
+	 * By default, if an original_max_filesize is provided, a check will be done
+	 * on the file size.
+	 *
+	 * @see BP_Attachment_Avatar->validate_upload() for an example of use
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  array $file the temporary file attributes (before it has been moved)
+	 * @return array the file
+	 */
+	public function validate_upload( $file = array() ) {
+		// Bail if already an error
+		if ( ! empty( $file['error'] ) ) {
+			return $file;
+		}
+
+		if ( ! empty( $this->original_max_filesize ) && $file['size'] > $this->original_max_filesize ) {
+			$file['error'] = 2;
+		}
+
+		// Return the file
+		return $file;
+	}
+
+	/**
+	 * Default filter to save the attachments
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @uses   apply_filters() call 'bp_attachment_upload_dir' to eventually override the upload location
+	 *                         regarding to context
+	 * @return array the upload directory data
+	 */
+	public function upload_dir_filter() {
+		/**
+		 * Filters the component's upload directory.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array $value Array containing the path, URL, and other helpful settings.
+		 */
+		return apply_filters( 'bp_attachment_upload_dir', array(
+			'path'    => $this->upload_path,
+			'url'     => $this->url,
+			'subdir'  => false,
+			'basedir' => $this->upload_path,
+			'baseurl' => $this->url,
+			'error'   => false
+		) );
+	}
+
+	/**
+	 * Create the custom base directory for the component uploads
+	 *
+	 * Override this function in your child class to run specific actions
+	 * (eg: add an .htaccess file)
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @uses   wp_mkdir_p()
+	 */
+	public function create_dir() {
+		// Bail if no specific base dir is set
+		if ( empty( $this->base_dir ) ) {
+			return false;
+		}
+
+		// Check if upload path already exists
+		if ( ! is_dir( $this->upload_path ) ) {
+
+			// If path does not exist, attempt to create it
+			if ( ! wp_mkdir_p( $this->upload_path ) ) {
+				return false;
+			}
+		}
+
+		// Directory exists
+		return true;
+	}
+
+	/**
+	 * Crop an image file
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $args {
+	 *     @type string $original_file The source file (absolute path) for the Attachment.
+	 *     @type int    $crop_x The start x position to crop from.
+	 *     @type int    $crop_y The start y position to crop from.
+	 *     @type int    $crop_w The width to crop.
+	 *     @type int    $crop_h The height to crop.
+	 *     @type int    $dst_w The destination width.
+	 *     @type int    $dst_h The destination height.
+	 *     @type int    $src_abs Optional. If the source crop points are absolute.
+	 *     @type string $dst_file Optional. The destination file to write to.
+	 * }
+	 * @uses wp_crop_image()
+	 * @return string|WP_Error New filepath on success, WP_Error on failure.
+	 */
+	public function crop( $args = array() ) {
+		$wp_error = new WP_Error();
+
+		$r = bp_parse_args( $args, array(
+			'original_file' => '',
+			'crop_x'        => 0,
+			'crop_y'        => 0,
+			'crop_w'        => 0,
+			'crop_h'        => 0,
+			'dst_w'         => 0,
+			'dst_h'         => 0,
+			'src_abs'       => false,
+			'dst_file'      => false,
+		), 'bp_attachment_crop_args' );
+
+		if ( empty( $r['original_file'] ) || ! file_exists( $r['original_file'] ) ) {
+			$wp_error->add( 'crop_error', __( 'Cropping the file failed: missing source file.', 'buddypress' ) );
+			return $wp_error;
+		}
+
+		// Check image file pathes
+		$path_error = __( 'Cropping the file failed: the file path is not allowed.', 'buddypress' );
+
+		// Make sure it's coming from an uploaded file
+		if ( false === strpos( $r['original_file'], $this->upload_path ) ) {
+			$wp_error->add( 'crop_error', $path_error );
+			return $wp_error;
+		}
+
+		/**
+		 * If no destination file is provided, WordPress will use a default name
+		 * and will write the file in the source file's folder.
+		 * If a destination file is provided, we need to make sure it's going into uploads
+		 */
+		if ( ! empty( $r['dst_file'] ) && false === strpos( $r['dst_file'], $this->upload_path ) ) {
+			$wp_error->add( 'crop_error', $path_error );
+			return $wp_error;
+		}
+
+		// Check image file types
+		$check_types = array( 'src_file' => array( 'file' => $r['original_file'], 'error' => _x( 'source file', 'Attachment source file', 'buddypress' ) ) );
+		if ( ! empty( $r['dst_file'] ) ) {
+			$check_types['dst_file'] = array( 'file' => $r['dst_file'], 'error' => _x( 'destination file', 'Attachment destination file', 'buddypress' ) );
+		}
+
+		/**
+		 * WordPress image supported types
+		 * @see wp_attachment_is()
+		 */
+		$supported_image_types = array(
+			'jpg'  => 1,
+			'jpeg' => 1,
+			'jpe'  => 1,
+			'gif'  => 1,
+			'png'  => 1,
+		);
+
+		foreach ( $check_types as $file ) {
+			$is_image      = wp_check_filetype( $file['file'] );
+			$ext           = $is_image['ext'];
+
+			if ( empty( $ext ) || empty( $supported_image_types[ $ext ] ) ) {
+				$wp_error->add( 'crop_error', sprintf( __( 'Cropping the file failed: %s is not a supported image file.', 'buddypress' ), $file['error'] ) );
+				return $wp_error;
+			}
+		}
+
+		// Add the image.php to the required WordPress files, if it's not already the case
+		$required_files = array_flip( $this->required_wp_files );
+		if ( ! isset( $required_files['image'] ) ) {
+			$this->required_wp_files[] = 'image';
+		}
+
+		// Load the files
+		$this->includes();
+
+		// Finally crop the image
+		return wp_crop_image( $r['original_file'], (int) $r['crop_x'], (int) $r['crop_y'], (int) $r['crop_w'], (int) $r['crop_h'], (int) $r['dst_w'], (int) $r['dst_h'], $r['src_abs'], $r['dst_file'] );
+	}
+
+	/**
+	 * Build script datas for the Uploader UI
+	 *
+	 * Override this method from your child class to build the script datas
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return array the javascript localization data
+	 */
+	public function script_data() {
+		$script_data = array(
+			'action'            => $this->action,
+			'file_data_name'    => $this->file_input,
+			'max_file_size'     => $this->original_max_filesize,
+			'feedback_messages' => array(
+				1 => __( 'Sorry, uploading the file failed.', 'buddypress' ),
+				2 => __( 'File successfully uploaded.', 'buddypress' ),
+			),
+		);
+
+		return $script_data;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-button.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-button.php
new file mode 100644
index 0000000000000000000000000000000000000000..4be4b7646a5d5084cccb7023dd1ac03d1ebbe7c5
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-button.php
@@ -0,0 +1,270 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * API to create BuddyPress buttons.
+ *
+ * @since BuddyPress (1.2.6)
+ *
+ * @param array $args {
+ *     Array of arguments.
+ *     @type string $id String describing the button type.
+ *     @type string $component The name of the component the button belongs to.
+ *           Default: 'core'.
+ *     @type bool $must_be_logged_in Optional. Does the user need to be logged
+ *           in to see this button? Default: true.
+ *     @type bool $block_self Optional. True if the button should be hidden
+ *           when a user is viewing his own profile. Default: true.
+ *     @type string|bool $wrapper Optional. HTML element type that should wrap
+ *           the button: 'div', 'span', 'p', or 'li'. False for no wrapper at
+ *           all. Default: 'div'.
+ *     @type string $wrapper_id Optional. DOM ID of the button wrapper element.
+ *           Default: ''.
+ *     @type string $wrapper_class Optional. DOM class of the button wrapper
+ *           element. Default: ''.
+ *     @type string $link_href Optional. Destination link of the button.
+ *           Default: ''.
+ *     @type string $link_class Optional. DOM class of the button. Default: ''.
+ *     @type string $link_id Optional. DOM ID of the button. Default: ''.
+ *     @type string $link_rel Optional. DOM 'rel' attribute of the button.
+ *           Default: ''.
+ *     @type string $link_title Optional. Title attribute of the button.
+ *           Default: ''.
+ *     @type string $link_text Optional. Text to appear on the button.
+ *           Default: ''.
+ * }
+ */
+class BP_Button {
+
+	/** Button properties *****************************************************/
+
+	/**
+	 * The button ID.
+	 *
+	 * @var string
+	 */
+	public $id = '';
+
+	/**
+	 * The name of the component that the button belongs to.
+	 *
+	 * @var string
+	 */
+	public $component = 'core';
+
+	/**
+	 * Does the user need to be logged in to see this button?
+	 *
+	 * @var bool
+	 */
+	public $must_be_logged_in = true;
+
+	/**
+	 * Whether the button should be hidden when viewing your own profile.
+	 *
+	 * @var bool
+	 */
+	public $block_self = true;
+
+	/** Wrapper ***************************************************************/
+
+	/**
+	 * The type of DOM element to use for a wrapper.
+	 *
+	 * @var string|bool 'div', 'span', 'p', 'li', or false for no wrapper.
+	 */
+	public $wrapper = 'div';
+
+	/**
+	 * The DOM class of the button wrapper.
+	 *
+	 * @var string
+	 */
+	public $wrapper_class = '';
+
+	/**
+	 * The DOM ID of the button wrapper.
+	 *
+	 * @var string
+	 */
+	public $wrapper_id = '';
+
+	/** Button ****************************************************************/
+
+	/**
+	 * The destination link of the button.
+	 *
+	 * @var string
+	 */
+	public $link_href = '';
+
+	/**
+	 * The DOM class of the button link.
+	 *
+	 * @var string
+	 */
+	public $link_class = '';
+
+	/**
+	 * The DOM ID of the button link.
+	 *
+	 * @var string
+	 */
+	public $link_id = '';
+
+	/**
+	 * The DOM rel value of the button link.
+	 *
+	 * @var string
+	 */
+	public $link_rel = '';
+
+	/**
+	 * Title of the button link.
+	 *
+	 * @var string
+	 */
+	public $link_title = '';
+
+	/**
+	 * The contents of the button link.
+	 *
+	 * @var string
+	 */
+	public $link_text = '';
+
+	/** HTML result ***********************************************************/
+
+	public $contents = '';
+
+	/** Methods ***************************************************************/
+
+	/**
+	 * Builds the button based on class parameters.
+	 *
+	 * @since BuddyPress (1.2.6)
+	 *
+	 * @param array $args See {@BP_Button}.
+	 * @return bool|null Returns false when the button is not allowed for
+	 *         the current context.
+	 */
+	public function __construct( $args = '' ) {
+
+		$r = wp_parse_args( $args, get_class_vars( __CLASS__ ) );
+
+		// Required button properties
+		$this->id                = $r['id'];
+		$this->component         = $r['component'];
+		$this->must_be_logged_in = (bool) $r['must_be_logged_in'];
+		$this->block_self        = (bool) $r['block_self'];
+		$this->wrapper           = $r['wrapper'];
+
+		// $id and $component are required
+		if ( empty( $r['id'] ) || empty( $r['component'] ) )
+			return false;
+
+		// No button if component is not active
+		if ( ! bp_is_active( $this->component ) )
+			return false;
+
+		// No button for guests if must be logged in
+		if ( true == $this->must_be_logged_in && ! is_user_logged_in() )
+			return false;
+
+		// block_self
+		if ( true == $this->block_self ) {
+			// No button if you are the current user in a members loop
+			// This condition takes precedence, because members loops
+			// can be found on user profiles
+			if ( bp_get_member_user_id() ) {
+				if ( is_user_logged_in() && bp_loggedin_user_id() == bp_get_member_user_id() ) {
+					return false;
+				}
+
+			// No button if viewing your own profile (and not in
+			// a members loop)
+			} elseif ( bp_is_my_profile() ) {
+				return false;
+			}
+		}
+
+		// Wrapper properties
+		if ( false !== $this->wrapper ) {
+
+			// Wrapper ID
+			if ( !empty( $r['wrapper_id'] ) ) {
+				$this->wrapper_id    = ' id="' . $r['wrapper_id'] . '"';
+			}
+
+			// Wrapper class
+			if ( !empty( $r['wrapper_class'] ) ) {
+				$this->wrapper_class = ' class="generic-button ' . $r['wrapper_class'] . '"';
+			} else {
+				$this->wrapper_class = ' class="generic-button"';
+			}
+
+			// Set before and after
+			$before = '<' . $r['wrapper'] . $this->wrapper_class . $this->wrapper_id . '>';
+			$after  = '</' . $r['wrapper'] . '>';
+
+		// No wrapper
+		} else {
+			$before = $after = '';
+		}
+
+		// Link properties
+		if ( !empty( $r['link_id']    ) ) $this->link_id    = ' id="' .    $r['link_id']    . '"';
+		if ( !empty( $r['link_href']  ) ) $this->link_href  = ' href="' .  $r['link_href']  . '"';
+		if ( !empty( $r['link_title'] ) ) $this->link_title = ' title="' . $r['link_title'] . '"';
+		if ( !empty( $r['link_rel']   ) ) $this->link_rel   = ' rel="' .   $r['link_rel']   . '"';
+		if ( !empty( $r['link_class'] ) ) $this->link_class = ' class="' . $r['link_class'] . '"';
+		if ( !empty( $r['link_text']  ) ) $this->link_text  =              $r['link_text'];
+
+		// Build the button
+		$this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after;
+
+		/**
+		 * Filters the button based on class parameters.
+		 *
+		 * This filter is a dynamic filter based on component and component ID and
+		 * allows button to be manipulated externally.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string    $contents HTML being used for the button.
+		 * @param BP_Button $this     Current BP_Button instance.
+		 * @param string    $before   HTML appended before the actual button.
+		 * @param string    $after    HTML appended after the actual button.
+		 */
+		$this->contents = apply_filters( 'bp_button_' . $this->component . '_' . $this->id, $this->contents, $this, $before, $after );
+	}
+
+	/**
+	 * Return the markup for the generated button.
+	 *
+	 * @since BuddyPress (1.2.6)
+	 *
+	 * @return string Button markup.
+	 */
+	public function contents() {
+		return $this->contents;
+	}
+
+	/**
+	 * Output the markup of button.
+	 *
+	 * @since BuddyPress (1.2.6)
+	 */
+	public function display() {
+		if ( !empty( $this->contents ) )
+			echo $this->contents;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-notification.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-notification.php
new file mode 100644
index 0000000000000000000000000000000000000000..19ab42de761ac74dfa9ccb65af922192b1e4ae14
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-notification.php
@@ -0,0 +1,258 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BP_Core_Notification is deprecated.
+ *
+ * Use BP_Notifications_Notification instead.
+ *
+ * @package BuddyPress Core
+ * @deprecated since BuddyPress (1.9.0)
+ */
+class BP_Core_Notification {
+
+	/**
+	 * The notification id
+	 *
+	 * @var integer
+	 */
+	public $id;
+
+	/**
+	 * The ID to which the notification relates to within the component.
+	 *
+	 * @var integer
+	 */
+	public $item_id;
+
+	/**
+	 * The secondary ID to which the notification relates to within the component.
+	 *
+	 * @var integer
+	 */
+	public $secondary_item_id = null;
+
+	/**
+	 * The user ID for who the notification is for.
+	 *
+	 * @var integer
+	 */
+	public $user_id;
+
+	/**
+	 * The name of the component that the notification is for.
+	 *
+	 * @var string
+	 */
+	public $component_name;
+
+	/**
+	 * The action within the component which the notification is related to.
+	 *
+	 * @var string
+	 */
+	public $component_action;
+
+	/**
+	 * The date the notification was created.
+	 *
+	 * @var string
+	 */
+	public $date_notified;
+
+	/**
+	 * Is the notification new or has it already been read.
+	 *
+	 * @var boolean
+	 */
+	public $is_new;
+
+	/** Public Methods ********************************************************/
+
+	/**
+	 * Constructor
+	 *
+	 * @param integer $id
+	 */
+	public function __construct( $id = 0 ) {
+		if ( !empty( $id ) ) {
+			$this->id = $id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Update or insert notification details into the database.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @return bool Success or failure
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// Update
+		if ( !empty( $this->id ) ) {
+			$sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = %s, is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
+
+		// Save
+		} else {
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
+		}
+
+		if ( !$result = $wpdb->query( $sql ) )
+			return false;
+
+		$this->id = $wpdb->insert_id;
+
+		return true;
+	}
+
+	/** Private Methods *******************************************************/
+
+	/**
+	 * Fetches the notification data from the database.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
+			$this->item_id = $notification->item_id;
+			$this->secondary_item_id = $notification->secondary_item_id;
+			$this->user_id           = $notification->user_id;
+			$this->component_name    = $notification->component_name;
+			$this->component_action  = $notification->component_action;
+			$this->date_notified     = $notification->date_notified;
+			$this->is_new            = $notification->is_new;
+		}
+	}
+
+	/** Static Methods ********************************************************/
+
+	public static function check_access( $user_id, $notification_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
+	}
+
+	/**
+	 * Fetches all the notifications in the database for a specific user.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id User ID
+	 * @param string $status 'is_new' or 'all'
+	 * @return array Associative array
+	 * @static
+	 */
+	public static function get_all_for_user( $user_id, $status = 'is_new' ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$is_new = ( 'is_new' === $status )
+			? ' AND is_new = 1 '
+			: '';
+
+ 		return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) );
+	}
+
+	/**
+	 * Delete all the notifications for a user based on the component name and action.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id
+	 * @param string $component_name
+	 * @param string $component_action
+	 * @static
+	 */
+	public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
+	}
+
+	/**
+	 * Delete all the notifications that have a specific item id, component name and action.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id The ID of the user who the notifications are for.
+	 * @param integer $item_id The item ID of the notifications we wish to delete.
+	 * @param string $component_name The name of the component that the notifications we wish to delete.
+	 * @param string $component_action The action of the component that the notifications we wish to delete.
+	 * @param integer $secondary_item_id (optional) The secondary item id of the notifications that we wish to use to delete.
+	 * @static
+	 */
+	public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$secondary_item_sql = !empty( $secondary_item_id )
+			? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id )
+			: '';
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND item_id = %d AND component_name = %s AND component_action = %s{$secondary_item_sql}", $user_id, $item_id, $component_name, $component_action ) );
+	}
+
+	/**
+	 * Deletes all the notifications sent by a specific user, by component and action.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param integer $user_id The ID of the user whose sent notifications we wish to delete.
+	 * @param string $component_name The name of the component the notification was sent from.
+	 * @param string $component_action The action of the component the notification was sent from.
+	 * @static
+	 */
+	public static function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
+	}
+
+	/**
+	 * Deletes all the notifications for all users by item id, and optional secondary item id, and component name and action.
+	 *
+	 * @global wpdb $wpdb WordPress database object
+	 * @param string $item_id The item id that they notifications are to be for.
+	 * @param string $component_name The component that the notifications are to be from.
+	 * @param string $component_action The action that the notifications are to be from.
+	 * @param string $secondary_item_id Optional secondary item id that the notifications are to have.
+	 * @static
+	 */
+	public static function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
+		global $wpdb;
+
+		if ( $component_action )
+			$component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action );
+		else
+			$component_action_sql = '';
+
+		if ( $secondary_item_id )
+			$secondary_item_sql = $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id );
+		else
+			$secondary_item_sql = '';
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s {$component_action_sql} {$secondary_item_sql}", $item_id, $component_name ) );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-user.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-user.php
new file mode 100644
index 0000000000000000000000000000000000000000..fb25b9686adf15d6165df12b933ac2037b044045
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-user.php
@@ -0,0 +1,958 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Fetch data about a BuddyPress user.
+ *
+ * BP_Core_User class can be used by any component. It will fetch useful
+ * details for any user when provided with a user_id.
+ *
+ * Example:
+ *    $user = new BP_Core_User( $user_id );
+ *    $user_avatar = $user->avatar;
+ *	  $user_email = $user->email;
+ *    $user_status = $user->status;
+ *    etc.
+ */
+class BP_Core_User {
+
+	/**
+	 * ID of the user which the object relates to.
+	 *
+	 * @var integer
+	 */
+	public $id;
+
+	/**
+	 * The URL to the full size of the avatar for the user.
+	 *
+	 * @var string
+	 */
+	public $avatar;
+
+	/**
+	 * The URL to the thumb size of the avatar for the user.
+	 *
+	 * @var string
+	 */
+	public $avatar_thumb;
+
+	/**
+	 * The URL to the mini size of the avatar for the user.
+	 *
+	 * @var string
+	 */
+	public $avatar_mini;
+
+	/**
+	 * The full name of the user
+	 *
+	 * @var string
+	 */
+	public $fullname;
+
+	/**
+	 * The email for the user.
+	 *
+	 * @var string
+	 */
+	public $email;
+
+	/**
+	 * The absolute url for the user's profile.
+	 *
+	 * @var string
+	 */
+	public $user_url;
+
+	/**
+	 * The HTML for the user link, with the link text being the user's full name.
+	 *
+	 * @var string
+	 */
+	public $user_link;
+
+	/**
+	 * Contains a formatted string when the last time the user was active.
+	 *
+	 * Example: "active 2 hours and 50 minutes ago"
+	 *
+	 * @var string
+	 */
+	public $last_active;
+
+	/* Extras */
+
+	/**
+	 * The total number of "Friends" the user has on site.
+	 *
+	 * @var integer
+	 */
+	public $total_friends;
+
+	/**
+	 * The total number of blog posts posted by the user
+	 *
+	 * @var integer
+	 * @deprecated No longer used
+	 */
+	public $total_blogs;
+
+	/**
+	 * The total number of groups the user is a part of.
+	 *
+	 * Example: "1 group", "2 groups"
+	 *
+	 * @var string
+	 */
+	public $total_groups;
+
+	/**
+	 * Profile information for the specific user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var array
+	 */
+	public $profile_data;
+
+	/** Public Methods *******************************************************/
+
+	/**
+	 * Class constructor.
+	 *
+	 * @param integer $user_id The ID for the user being queried.
+	 * @param bool $populate_extras Whether to fetch extra information
+	 *        such as group/friendship counts or not. Default: false.
+	 */
+	public function __construct( $user_id, $populate_extras = false ) {
+		if ( !empty( $user_id ) ) {
+			$this->id = $user_id;
+			$this->populate();
+
+			if ( !empty( $populate_extras ) ) {
+				$this->populate_extras();
+			}
+		}
+	}
+
+	/**
+	 * Populate the instantiated class with data based on the User ID provided.
+	 *
+	 * @uses bp_core_get_userurl() Returns the URL with no HTML markup for
+	 *       a user based on their user id.
+	 * @uses bp_core_get_userlink() Returns a HTML formatted link for a
+	 *       user with the user's full name as the link text.
+	 * @uses bp_core_get_user_email() Returns the email address for the
+	 *       user based on user ID.
+	 * @uses bp_get_user_meta() BP function returns the value of passed
+	 *       usermeta name from usermeta table.
+	 * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user
+	 * @uses bp_profile_last_updated_date() Returns the last updated date
+	 *       for a user.
+	 */
+	public function populate() {
+
+		if ( bp_is_active( 'xprofile' ) )
+			$this->profile_data = $this->get_profile_data();
+
+		if ( !empty( $this->profile_data ) ) {
+			$full_name_field_name = bp_xprofile_fullname_field_name();
+
+			$this->user_url  = bp_core_get_user_domain( $this->id, $this->profile_data['user_nicename'], $this->profile_data['user_login'] );
+			$this->fullname  = esc_attr( $this->profile_data[$full_name_field_name]['field_data'] );
+			$this->user_link = "<a href='{$this->user_url}' title='{$this->fullname}'>{$this->fullname}</a>";
+			$this->email     = esc_attr( $this->profile_data['user_email'] );
+		} else {
+			$this->user_url  = bp_core_get_user_domain( $this->id );
+			$this->user_link = bp_core_get_userlink( $this->id );
+			$this->fullname  = esc_attr( bp_core_get_user_displayname( $this->id ) );
+			$this->email     = esc_attr( bp_core_get_user_email( $this->id ) );
+		}
+
+		// Cache a few things that are fetched often
+		wp_cache_set( 'bp_user_fullname_' . $this->id, $this->fullname, 'bp' );
+		wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
+		wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
+
+		$this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
+		$this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ) ) );
+		$this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) );
+		$this->last_active  = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), __( 'active %s', 'buddypress' ) );
+	}
+
+	/**
+	 * Populates extra fields such as group and friendship counts.
+	 */
+	public function populate_extras() {
+
+		if ( bp_is_active( 'friends' ) ) {
+			$this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id );
+		}
+
+		if ( bp_is_active( 'groups' ) ) {
+			$this->total_groups = BP_Groups_Member::total_group_count( $this->id );
+			$this->total_groups = sprintf( _n( '%d group', '%d groups', $this->total_groups, 'buddypress' ), $this->total_groups );
+		}
+	}
+
+	/**
+	 * Fetch xprofile data for the current user.
+	 *
+	 * @see BP_XProfile_ProfileData::get_all_for_user() for description of
+	 *      return value.
+	 *
+	 * @return array See {@link BP_XProfile_Profile_Data::get_all_for_user()}.
+	 */
+	public function get_profile_data() {
+		return BP_XProfile_ProfileData::get_all_for_user( $this->id );
+	}
+
+	/** Static Methods ********************************************************/
+
+	/**
+	 * Get a list of users that match the query parameters.
+	 *
+	 * Since BuddyPress 1.7, use {@link BP_User_Query} instead.
+	 *
+	 * @deprecated 1.7.0 Use {@link BP_User_Query}.
+	 *
+	 * @see BP_User_Query for a description of parameters, most of which
+	 *      are used there in the same way.
+	 *
+	 * @param string $type See {@link BP_User_Query}.
+	 * @param int $limit See {@link BP_User_Query}. Default: 0.
+	 * @param int $page See {@link BP_User_Query}. Default: 1.
+	 * @param int $user_id See {@link BP_User_Query}. Default: 0.
+	 * @param mixed $include See {@link BP_User_Query}. Default: false.
+	 * @param string|bool $search_terms See {@link BP_User_Query}.
+	 *        Default: false.
+	 * @param bool $populate_extras See {@link BP_User_Query}.
+	 *        Default: true.
+	 * @param mixed $exclude See {@link BP_User_Query}. Default: false.
+	 * @param string|bool $meta_key See {@link BP_User_Query}.
+	 *        Default: false.
+	 * @param string|bool $meta_value See {@link BP_User_Query}.
+	 *        Default: false.
+	 * @return array {
+	 *     @type int $total_users Total number of users matched by query
+	 *           params.
+	 *     @type array $paged_users The current page of users matched by
+	 *           query params.
+	 * }
+	 */
+	public static function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) {
+		global $wpdb;
+
+		_deprecated_function( __METHOD__, '1.7', 'BP_User_Query' );
+
+		$bp = buddypress();
+
+		$sql = array();
+
+		$sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
+
+		if ( 'active' == $type || 'online' == $type || 'newest' == $type  ) {
+			$sql['select_active'] = ", um.meta_value as last_activity";
+		}
+
+		if ( 'popular' == $type ) {
+			$sql['select_popular'] = ", um.meta_value as total_friend_count";
+		}
+
+		if ( 'alphabetical' == $type ) {
+			$sql['select_alpha'] = ", pd.value as fullname";
+		}
+
+		if ( $meta_key ) {
+			$sql['select_meta'] = ", umm.meta_key";
+
+			if ( $meta_value ) {
+				$sql['select_meta'] .= ", umm.meta_value";
+			}
+		}
+
+		$sql['from'] = "FROM {$wpdb->users} u LEFT JOIN {$wpdb->usermeta} um ON um.user_id = u.ID";
+
+		// We search against xprofile fields, so we must join the table
+		if ( $search_terms && bp_is_active( 'xprofile' ) ) {
+			$sql['join_profiledata_search'] = "LEFT JOIN {$bp->profile->table_name_data} spd ON u.ID = spd.user_id";
+		}
+
+		// Alphabetical sorting is done by the xprofile Full Name field
+		if ( 'alphabetical' == $type ) {
+			$sql['join_profiledata_alpha'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
+		}
+
+		if ( $meta_key ) {
+			$sql['join_meta'] = "LEFT JOIN {$wpdb->usermeta} umm ON umm.user_id = u.ID";
+		}
+
+		$sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );
+
+		if ( 'active' == $type || 'online' == $type || 'newest' == $type ) {
+			$sql['where_active'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) );
+		}
+
+		if ( 'popular' == $type ) {
+			$sql['where_popular'] = $wpdb->prepare( "AND um.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
+		}
+
+		if ( 'online' == $type ) {
+			$sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()";
+		}
+
+		if ( 'alphabetical' == $type ) {
+			$sql['where_alpha'] = "AND pd.field_id = 1";
+		}
+
+		if ( !empty( $exclude ) ) {
+			$exclude              = implode( ',', wp_parse_id_list( $exclude ) );
+			$sql['where_exclude'] = "AND u.ID NOT IN ({$exclude})";
+		}
+
+		// Passing an $include value of 0 or '0' will necessarily result in an empty set
+		// returned. The default value of false will hit the 'else' clause.
+		if ( 0 === $include || '0' === $include ) {
+			$sql['where_users'] = "AND 0 = 1";
+		} else {
+			if ( !empty( $include ) ) {
+				$include = implode( ',',  wp_parse_id_list( $include ) );
+				$sql['where_users'] = "AND u.ID IN ({$include})";
+			} elseif ( !empty( $user_id ) && bp_is_active( 'friends' ) ) {
+				$friend_ids = friends_get_friend_user_ids( $user_id );
+
+				if ( !empty( $friend_ids ) ) {
+					$friend_ids = implode( ',', wp_parse_id_list( $friend_ids ) );
+					$sql['where_friends'] = "AND u.ID IN ({$friend_ids})";
+
+				// User has no friends, return false since there will be no users to fetch.
+				} else {
+					return false;
+				}
+			}
+		}
+
+		if ( !empty( $search_terms ) && bp_is_active( 'xprofile' ) ) {
+			$search_terms_like        = '%' . bp_esc_like( $search_terms ) . '%';
+			$sql['where_searchterms'] = $wpdb->prepare( "AND spd.value LIKE %s", $search_terms_like );
+		}
+
+		if ( !empty( $meta_key ) ) {
+			$sql['where_meta'] = $wpdb->prepare( " AND umm.meta_key = %s", $meta_key );
+
+			// If a meta value is provided, match it
+			if ( $meta_value ) {
+				$sql['where_meta'] .= $wpdb->prepare( " AND umm.meta_value = %s", $meta_value );
+			}
+		}
+
+		switch ( $type ) {
+			case 'active': case 'online': default:
+				$sql[] = "ORDER BY um.meta_value DESC";
+				break;
+			case 'newest':
+				$sql[] = "ORDER BY u.ID DESC";
+				break;
+			case 'alphabetical':
+				$sql[] = "ORDER BY pd.value ASC";
+				break;
+			case 'random':
+				$sql[] = "ORDER BY rand()";
+				break;
+			case 'popular':
+				$sql[] = "ORDER BY CONVERT(um.meta_value, SIGNED) DESC";
+				break;
+		}
+
+		if ( !empty( $limit ) && !empty( $page ) ) {
+			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		/**
+		 * Filters the SQL used to query for paged users.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value Concatenated SQL statement for the query.
+		 * @param array  $sql   Array of SQL statement parts for the query.
+		 */
+		$paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array) $sql ), $sql );
+		$paged_users     = $wpdb->get_results( $paged_users_sql );
+
+		// Re-jig the SQL so we can get the total user count
+		unset( $sql['select_main'] );
+
+		if ( !empty( $sql['select_active'] ) ) {
+			unset( $sql['select_active'] );
+		}
+
+		if ( !empty( $sql['select_popular'] ) ) {
+			unset( $sql['select_popular'] );
+		}
+
+		if ( !empty( $sql['select_alpha'] ) ) {
+			unset( $sql['select_alpha'] );
+		}
+
+		if ( !empty( $sql['pagination'] ) ) {
+			unset( $sql['pagination'] );
+		}
+
+		array_unshift( $sql, "SELECT COUNT(u.ID)" );
+
+		/**
+		 * Filters the SQL used to query for total users.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value Concatenated SQL statement for the query.
+		 * @param array  $sql   Array of SQL statement parts for the query.
+		 */
+		$total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array) $sql ), $sql );
+		$total_users     = $wpdb->get_var( $total_users_sql );
+
+		/***
+		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
+		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
+		 */
+		if ( !empty( $populate_extras ) ) {
+			$user_ids = array();
+
+			foreach ( (array) $paged_users as $user ) {
+				$user_ids[] = $user->id;
+			}
+
+			// Add additional data to the returned results
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids, $type );
+		}
+
+		return array( 'users' => $paged_users, 'total' => $total_users );
+	}
+
+
+	/**
+	 * Fetch the details for all users whose usernames start with the given letter.
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param string $letter The letter the users names are to start with.
+	 * @param int $limit The number of users we wish to retrive.
+	 * @param int $page The page number we are currently on, used in
+	 *        conjunction with $limit to get the start position for the
+	 *        limit.
+	 * @param bool $populate_extras Populate extra user fields?
+	 * @param string $exclude Comma-separated IDs of users whose results
+	 *        aren't to be fetched.
+	 * @return mixed False on error, otherwise associative array of results.
+	 */
+	public static function get_users_by_letter( $letter, $limit = null, $page = 1, $populate_extras = true, $exclude = '' ) {
+		global $wpdb;
+
+		$pag_sql = '';
+		if ( $limit && $page ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		// Multibyte compliance
+		if ( function_exists( 'mb_strlen' ) ) {
+			if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) {
+				return false;
+			}
+		} else {
+			if ( strlen( $letter ) > 1 || is_numeric( $letter ) || !$letter ) {
+				return false;
+			}
+		}
+
+		$bp = buddypress();
+
+		$letter_like = bp_esc_like( $letter ) . '%';
+		$status_sql  = bp_core_get_status_sql( 'u.' );
+
+		if ( !empty( $exclude ) ) {
+			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
+			$exclude_sql = " AND u.id NOT IN ({$exclude})";
+		} else {
+			$exclude_sql = '';
+		}
+
+		/**
+		 * Filters the SQL used to query for total user count by first letter.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value SQL prepared statement for the user count query.
+		 */
+		$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", bp_xprofile_fullname_field_name(), $letter_like ) );
+
+		/**
+		 * Filters the SQL used to query for users by first letter.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value SQL prepared statement for the user query.
+		 */
+		$paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name(), $letter_like ) );
+
+		$total_users = $wpdb->get_var( $total_users_sql );
+		$paged_users = $wpdb->get_results( $paged_users_sql );
+
+		/***
+		 * Lets fetch some other useful data in a separate queries, this will be
+		 * faster than querying the data for every user in a list. We can't add
+		 * these to the main query above since only users who have this
+		 * information will be returned (since the much of the data is in
+		 * usermeta and won't support any type of directional join)
+		 */
+		$user_ids = array();
+		foreach ( (array) $paged_users as $user )
+			$user_ids[] = (int) $user->id;
+
+		// Add additional data to the returned results
+		if ( $populate_extras ) {
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
+		}
+
+		return array( 'users' => $paged_users, 'total' => $total_users );
+	}
+
+	/**
+	 * Get details of specific users from the database.
+	 *
+	 * Use {@link BP_User_Query} with the 'user_ids' param instead.
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 * @param array $user_ids The user IDs of the users who we wish to
+	 *        fetch information on.
+	 * @param int $limit The limit of results we want.
+	 * @param int $page The page we are on for pagination.
+	 * @param bool $populate_extras Populate extra user fields?
+	 * @return array Associative array.
+	 */
+	public static function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
+		global $wpdb;
+
+		$pag_sql = '';
+		if ( $limit && $page )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		$user_ids   = implode( ',', wp_parse_id_list( $user_ids ) );
+		$status_sql = bp_core_get_status_sql();
+
+		/**
+		 * Filter the SQL string used for querying specific user count.
+		 *
+		 * This same filter name is used for the paged user SQL, and so should be avoided.
+		 * Use 'bp_core_user_get_specific_users_count_sql' instead.
+		 *
+		 * @deprecated BuddyPress (2.3.0)
+		 *
+		 * @param string $sql SQL string.
+		 */
+		$total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ({$user_ids})" );
+
+		/**
+		 * Filter the SQL string used for querying specific user count results.
+		 *
+		 * Use this instead of the deprecated 'bp_core_get_specific_users_count_sql'.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param string   $sql             SQL string.
+		 * @param array    $user_ids        Array of IDs of specific users to fetch.
+		 * @param int|null $limit           Max number of records to return. Null for no limit.
+		 * @param int      $page            The page we're on for pagination.
+		 * @param bool     $populate_extras Whether to populate extra user fields.
+		 */
+		$total_users_sql = apply_filters( 'bp_core_user_get_specific_users_count_sql', $total_users_sql, $user_ids, $limit, $page, $populate_extras );
+
+		/**
+		 * Filter the SQL string used for querying specific user paged results.
+		 *
+		 * This same filter name is used for the user count SQL, and so should be avoided.
+		 * Use 'bp_core_user_get_specific_users_paged_sql' instead.
+		 *
+		 * @deprecated BuddyPress (2.3.0)
+		 *
+		 * @param string $sql SQL string.
+		 */
+		$paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ({$user_ids}) {$pag_sql}" );
+
+		/**
+		 * Filter the SQL string used for querying specific user paged results.
+		 *
+		 * Use this instead of the deprecated 'bp_core_get_specific_users_count_sql'.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param string   $sql             SQL string.
+		 * @param array    $user_ids        Array of IDs of specific users to fetch.
+		 * @param int|null $limit           Max number of records to return. Null for no limit.
+		 * @param int      $page            The page we're on for pagination.
+		 * @param bool     $populate_extras Whether to populate extra user fields.
+		 */
+		$paged_users_sql = apply_filters( 'bp_core_user_get_specific_users_paged_sql', $paged_users_sql, $user_ids, $limit, $page, $populate_extras );
+
+		$total_users = $wpdb->get_var( $total_users_sql );
+		$paged_users = $wpdb->get_results( $paged_users_sql );
+
+		/***
+		 * Lets fetch some other useful data in a separate queries, this will be
+		 * faster than querying the data for every user in a list. We can't add
+		 * these to the main query above since only users who have this
+		 * information will be returned (since the much of the data is in
+		 * usermeta and won't support any type of directional join)
+		 */
+
+		// Add additional data to the returned results
+		if ( !empty( $populate_extras ) ) {
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
+		}
+
+		return array( 'users' => $paged_users, 'total' => $total_users );
+	}
+
+	/**
+	 * Find users who match on the value of an xprofile data.
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param string $search_terms The terms to search the profile table
+	 *        value column for.
+	 * @param integer $limit The limit of results we want.
+	 * @param integer $page The page we are on for pagination.
+	 * @param boolean $populate_extras Populate extra user fields?
+	 * @return array Associative array.
+	 */
+	public static function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$user_ids = array();
+		$pag_sql  = $limit && $page ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) ) : '';
+
+		$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
+		$status_sql        = bp_core_get_status_sql( 'u.' );
+
+		/**
+		 * Filters the SQL used to query for searched users count.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value SQL statement for the searched users count query.
+		 */
+		$total_users_sql = apply_filters( 'bp_core_search_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", $search_terms_like ), $search_terms );
+
+		/**
+		 * Filters the SQL used to query for searched users.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value SQL statement for the searched users query.
+		 */
+		$paged_users_sql = apply_filters( 'bp_core_search_users_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", $search_terms_like ), $search_terms, $pag_sql );
+
+		$total_users = $wpdb->get_var( $total_users_sql );
+		$paged_users = $wpdb->get_results( $paged_users_sql );
+
+		/***
+		 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
+		 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
+		 */
+		foreach ( (array) $paged_users as $user )
+			$user_ids[] = $user->id;
+
+		// Add additional data to the returned results
+		if ( $populate_extras )
+			$paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids );
+
+		return array( 'users' => $paged_users, 'total' => $total_users );
+	}
+
+	/**
+	 * Fetch extra user information, such as friend count and last profile update message.
+	 *
+	 * Accepts multiple user IDs to fetch data for.
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param array $paged_users An array of stdClass containing the users.
+	 * @param string $user_ids The user ids to select information about.
+	 * @param string $type The type of fields we wish to get.
+	 * @return mixed False on error, otherwise associative array of results.
+	 */
+	public static function get_user_extras( &$paged_users, &$user_ids, $type = false ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( empty( $user_ids ) )
+			return $paged_users;
+
+		// Sanitize user IDs
+		$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
+
+		// Fetch the user's full name
+		if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) {
+			$names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", bp_xprofile_fullname_field_name() ) );
+			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
+				foreach ( (array) $names as $name ) {
+					if ( $name->id == $paged_users[$i]->id )
+						$paged_users[$i]->fullname = $name->fullname;
+				}
+			}
+		}
+
+		// Fetch the user's total friend count
+		if ( 'popular' != $type ) {
+			$friend_count = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as total_friend_count FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'total_friend_count' ) ) );
+			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
+				foreach ( (array) $friend_count as $fcount ) {
+					if ( $fcount->id == $paged_users[$i]->id )
+						$paged_users[$i]->total_friend_count = (int) $fcount->total_friend_count;
+				}
+			}
+		}
+
+		// Fetch whether or not the user is a friend
+		if ( bp_is_active( 'friends' ) ) {
+			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
+			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
+				foreach ( (array) $friend_status as $status ) {
+					if ( $status->initiator_user_id == $paged_users[$i]->id || $status->friend_user_id == $paged_users[$i]->id )
+						$paged_users[$i]->is_friend = $status->is_confirmed;
+				}
+			}
+		}
+
+		if ( 'active' != $type ) {
+			$user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
+			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
+				foreach ( (array) $user_activity as $activity ) {
+					if ( $activity->id == $paged_users[$i]->id )
+						$paged_users[$i]->last_activity = $activity->last_activity;
+				}
+			}
+		}
+
+		// Fetch the user's last_activity
+		if ( 'active' != $type ) {
+			$user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) );
+			for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
+				foreach ( (array) $user_activity as $activity ) {
+					if ( $activity->id == $paged_users[$i]->id )
+						$paged_users[$i]->last_activity = $activity->last_activity;
+				}
+			}
+		}
+
+		// Fetch the user's latest update
+		$user_update = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as latest_update FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'bp_latest_update' ) ) );
+		for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
+			foreach ( (array) $user_update as $update ) {
+				if ( $update->id == $paged_users[$i]->id )
+					$paged_users[$i]->latest_update = $update->latest_update;
+			}
+		}
+
+		return $paged_users;
+	}
+
+	/**
+	 * Get WordPress user details for a specified user.
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @param integer $user_id User ID.
+	 * @return array Associative array.
+	 */
+	public static function get_core_userdata( $user_id ) {
+		global $wpdb;
+
+		if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE ID = %d LIMIT 1", $user_id ) ) )
+			return false;
+
+		return $user;
+	}
+
+	/**
+	 * Get last activity data for a user or set of users.
+	 *
+	 * @param int|array User IDs or multiple user IDs.
+	 * @return array
+	 */
+	public static function get_last_activity( $user_id ) {
+		global $wpdb;
+
+		// Sanitize and remove empty values
+		$user_ids = array_filter( wp_parse_id_list( $user_id ) );
+
+		if ( empty( $user_ids ) ) {
+			return false;
+		}
+
+		$uncached_user_ids = bp_get_non_cached_ids( $user_ids, 'bp_last_activity' );
+		if ( ! empty( $uncached_user_ids ) ) {
+			$bp = buddypress();
+
+			$user_ids_sql = implode( ',', $uncached_user_ids );
+			$user_count   = count( $uncached_user_ids );
+
+			$last_activities = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_recorded FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity' AND user_id IN ({$user_ids_sql}) LIMIT {$user_count}", $bp->members->id ) );
+
+			foreach ( $last_activities as $last_activity ) {
+				wp_cache_set( $last_activity->user_id, array(
+					'user_id'       => $last_activity->user_id,
+					'date_recorded' => $last_activity->date_recorded,
+					'activity_id'   => $last_activity->id,
+				), 'bp_last_activity' );
+			}
+		}
+
+		// Fetch all user data from the cache
+		$retval = array();
+		foreach ( $user_ids as $user_id ) {
+			$retval[ $user_id ] = wp_cache_get( $user_id, 'bp_last_activity' );
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Set a user's last_activity value.
+	 *
+	 * Will create a new entry if it does not exist. Otherwise updates the
+	 * existing entry.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param int $user_id ID of the user whose last_activity you are updating.
+	 * @param string $time MySQL-formatted time string.
+	 * @return bool True on success, false on failure.
+	 */
+	public static function update_last_activity( $user_id, $time ) {
+		global $wpdb;
+
+		$table_name = buddypress()->members->table_name_last_activity;
+
+		$activity = self::get_last_activity( $user_id );
+
+		if ( ! empty( $activity[ $user_id ] ) ) {
+			$updated = $wpdb->update(
+				$table_name,
+
+				// Data to update
+				array(
+					'date_recorded' => $time,
+				),
+
+				// WHERE
+				array(
+					'id' => $activity[ $user_id ]['activity_id'],
+				),
+
+				// Data sanitization format
+				array(
+					'%s',
+				),
+
+				// WHERE sanitization format
+				array(
+					'%d',
+				)
+			);
+
+			// add new date to existing activity entry for caching
+			$activity[ $user_id ]['date_recorded'] = $time;
+
+		} else {
+			$updated = $wpdb->insert(
+				$table_name,
+
+				// Data
+				array(
+					'user_id'       => $user_id,
+					'component'     => buddypress()->members->id,
+					'type'          => 'last_activity',
+					'action'        => '',
+					'content'       => '',
+					'primary_link'  => '',
+					'item_id'       => 0,
+					'date_recorded' => $time,
+				),
+
+				// Data sanitization format
+				array(
+					'%d',
+					'%s',
+					'%s',
+					'%s',
+					'%s',
+					'%s',
+					'%d',
+					'%s',
+				)
+			);
+
+			// set up activity array for caching
+			// view the foreach loop in the get_last_activity() method for format
+			$activity = array();
+			$activity[ $user_id ] = array(
+				'user_id'       => $user_id,
+				'date_recorded' => $time,
+				'activity_id'   => $wpdb->insert_id,
+			);
+		}
+
+		// set cache
+		wp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' );
+
+		return $updated;
+	}
+
+	/**
+	 * Delete a user's last_activity value.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param int $user_id
+	 * @return bool True on success, false on failure or if no last_activity
+	 *         is found for the user.
+	 */
+	public static function delete_last_activity( $user_id ) {
+		global $wpdb;
+
+		$existing = self::get_last_activity( $user_id );
+
+		if ( empty( $existing ) ) {
+			return false;
+		}
+
+		$deleted = $wpdb->delete(
+			buddypress()->members->table_name_last_activity,
+
+			// WHERE
+			array(
+				'id' => $existing[ $user_id ]['activity_id'],
+			),
+
+			// WHERE sanitization format
+			array(
+				'%s',
+			)
+		);
+
+		wp_cache_delete( $user_id, 'bp_last_activity' );
+
+		return $deleted;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-date-query.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-date-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..8ad883864127d00f5abbbc629de2fab77ab6138d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-date-query.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+if ( class_exists( 'WP_Date_Query' ) ) :
+/**
+ * BuddyPress date query class.
+ *
+ * Extends the {@link WP_Date_Query} class for use with BuddyPress.
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @param array $date_query {
+ *     Date query arguments.  See first parameter of {@link WP_Date_Query::__construct()}.
+ * }
+ * @param string $column The DB column to query against.
+ */
+class BP_Date_Query extends WP_Date_Query {
+	/**
+	 * The column to query against. Can be changed via the query arguments.
+	 *
+	 * @var string
+	 */
+	public $column;
+
+	/**
+	 * Constructor.
+	 *
+	 * @see WP_Date_Query::__construct()
+	 */
+	public function __construct( $date_query, $column = '' ) {
+		if ( ! empty( $column ) ) {
+			$this->column = $column;
+			add_filter( 'date_query_valid_columns', array( $this, 'register_date_column' ) );
+		}
+
+		parent::__construct( $date_query, $column );
+	}
+
+	/**
+	 * Destructor.
+	 */
+	public function __destruct() {
+		remove_filter( 'date_query_valid_columns', array( $this, 'register_date_column' ) );
+	}
+
+	/**
+	 * Registers our date column with WP Date Query to pass validation.
+	 *
+	 * @param array $retval Current DB columns
+	 * @return array
+	 */
+	public function register_date_column( $retval = array() ) {
+		$retval[] = $this->column;
+		return $retval;
+	}
+}
+endif;
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-embed.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-embed.php
new file mode 100644
index 0000000000000000000000000000000000000000..5f51125236278666e4548ff7c15eed2a497d8a8a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-embed.php
@@ -0,0 +1,248 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Enable oEmbeds in BuddyPress contexts.
+ *
+ * Extends WP_Embed class for use with BuddyPress.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @see WP_Embed
+ */
+class BP_Embed extends WP_Embed {
+
+	/**
+	 * Constructor
+	 *
+	 * @global WP_Embed $wp_embed
+	 */
+	public function __construct() {
+		global $wp_embed;
+
+		// Make sure we populate the WP_Embed handlers array.
+		// These are providers that use a regex callback on the URL in question.
+		// Do not confuse with oEmbed providers, which require an external ping.
+		// Used in WP_Embed::shortcode()
+		$this->handlers = $wp_embed->handlers;
+
+		if ( bp_use_embed_in_activity() ) {
+			add_filter( 'bp_get_activity_content_body', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_activity_content_body', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		if ( bp_use_embed_in_activity_replies() ) {
+			add_filter( 'bp_get_activity_content', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_activity_content', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		if ( bp_use_embed_in_forum_posts() ) {
+			add_filter( 'bp_get_the_topic_post_content', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_the_topic_post_content', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		if ( bp_use_embed_in_private_messages() ) {
+			add_filter( 'bp_get_the_thread_message_content', array( &$this, 'autoembed' ), 8 );
+			add_filter( 'bp_get_the_thread_message_content', array( &$this, 'run_shortcode' ), 7 );
+		}
+
+		/**
+		 * Filters the BuddyPress Core oEmbed setup.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param BP_Embed $this Current instance of the BP_Embed. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_core_setup_oembed', array( &$this ) );
+	}
+
+	/**
+	 * The {@link do_shortcode()} callback function.
+	 *
+	 * Attempts to convert a URL into embed HTML. Starts by checking the
+	 * URL against the regex of the registered embed handlers. Next, checks
+	 * the URL against the regex of registered {@link WP_oEmbed} providers
+	 * if oEmbed discovery is false. If none of the regex matches and it's
+	 * enabled, then the URL will be passed to {@link BP_Embed::parse_oembed()}
+	 * for oEmbed parsing.
+	 *
+	 * @uses wp_parse_args()
+	 * @uses wp_embed_defaults()
+	 * @uses current_user_can()
+	 * @uses _wp_oembed_get_object()
+	 * @uses WP_Embed::maybe_make_link()
+	 *
+	 * @param array $attr Shortcode attributes.
+	 * @param string $url The URL attempting to be embeded.
+	 * @return string The embed HTML on success, otherwise the original URL.
+	 */
+	public function shortcode( $attr, $url = '' ) {
+		if ( empty( $url ) )
+			return '';
+
+		$rawattr = $attr;
+		$attr = wp_parse_args( $attr, wp_embed_defaults() );
+
+		// kses converts & into &amp; and we need to undo this
+		// See https://core.trac.wordpress.org/ticket/11311
+		$url = str_replace( '&amp;', '&', $url );
+
+		// Look for known internal handlers
+		ksort( $this->handlers );
+		foreach ( $this->handlers as $priority => $handlers ) {
+			foreach ( $handlers as $hid => $handler ) {
+				if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
+					if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) {
+
+						/**
+						 * Filters the oEmbed handler result for the provided URL.
+						 *
+						 * @since BuddyPress (1.5.0)
+						 *
+						 * @param string $return Handler callback for the oEmbed.
+						 * @param string $url    URL attempting to be embedded.
+						 * @param array  $attr   Shortcode attributes.
+						 */
+						return apply_filters( 'embed_handler_html', $return, $url, $attr );
+					}
+				}
+			}
+		}
+
+		/**
+		 * Filters the embed object ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $value Value of zero.
+		 */
+		$id = apply_filters( 'embed_post_id', 0 );
+
+		/**
+		 * Filters whether or not oEmbed discovery is on.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param bool $value Current status of oEmbed discovery.
+		 */
+		$attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) );
+
+		// Set up a new WP oEmbed object to check URL with registered oEmbed providers
+		require_once( ABSPATH . WPINC . '/class-oembed.php' );
+		$oembed_obj = _wp_oembed_get_object();
+
+		// If oEmbed discovery is true, skip oEmbed provider check
+		$is_oembed_link = false;
+		if ( !$attr['discover'] ) {
+			foreach ( (array) $oembed_obj->providers as $provider_matchmask => $provider ) {
+				$regex = ( $is_regex = $provider[1] ) ? $provider_matchmask : '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $provider_matchmask ), '#' ) ) . '#i';
+
+				if ( preg_match( $regex, $url ) )
+					$is_oembed_link = true;
+			}
+
+			// If url doesn't match a WP oEmbed provider, stop parsing
+			if ( !$is_oembed_link )
+				return $this->maybe_make_link( $url );
+		}
+
+		return $this->parse_oembed( $id, $url, $attr, $rawattr );
+	}
+
+	/**
+	 * Base function so BP components/plugins can parse links to be embedded.
+	 *
+	 * View an example to add support in {@link bp_activity_embed()}.
+	 *
+	 * @uses apply_filters() Filters cache.
+	 * @uses do_action() To save cache.
+	 * @uses wp_oembed_get() Connects to oEmbed provider and returns HTML
+	 *       on success.
+	 * @uses WP_Embed::maybe_make_link() Process URL for hyperlinking on
+	 *       oEmbed failure.
+	 *
+	 * @param int $id ID to do the caching for.
+	 * @param string $url The URL attempting to be embedded.
+	 * @param array $attr Shortcode attributes from {@link WP_Embed::shortcode()}.
+	 * @param array $rawattr Untouched shortcode attributes from
+	 *        {@link WP_Embed::shortcode()}.
+	 * @return string The embed HTML on success, otherwise the original URL.
+	 */
+	public function parse_oembed( $id, $url, $attr, $rawattr ) {
+		$id = intval( $id );
+
+		if ( $id ) {
+			// Setup the cachekey
+			$cachekey = '_oembed_' . md5( $url . serialize( $attr ) );
+
+			// Let components / plugins grab their cache
+			$cache = '';
+
+			/**
+			 * Filters the cache value to be used in the oEmbed, if exists.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $cache    Empty initial cache value.
+			 * @param int    $id       ID that the caching is for.
+			 * @param string $cachekey Key to use for the caching in the database.
+			 * @param string $url      The URL attempting to be embedded.
+			 * @param array  $attr     Parsed shortcode attributes.
+			 * @param array  $rawattr  Unparsed shortcode attributes.
+			 */
+			$cache = apply_filters( 'bp_embed_get_cache', $cache, $id, $cachekey, $url, $attr, $rawattr );
+
+			// Grab cache and return it if available
+			if ( !empty( $cache ) ) {
+
+				/**
+				 * Filters the found cache for the provided URL.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string $cache   Cached HTML markup for embed.
+				 * @param string $url     The URL being embedded.
+				 * @param array  $attr    Parsed shortcode attributes.
+				 * @param array  $rawattr Unparased shortcode attributes.
+				 */
+				return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr );
+
+			// If no cache, ping the oEmbed provider and cache the result
+			} else {
+				$html = wp_oembed_get( $url, $attr );
+				$cache = ( $html ) ? $html : $url;
+
+				/**
+				 * Fires if there is no existing cache and triggers cache setting.
+				 *
+				 * Lets components / plugins save their cache.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string $cache    Newly cached HTML markup for embed.
+				 * @param string $cachekey Key to use for the caching in the database.
+				 * @param int    $id       ID to do the caching for.
+				 */
+				do_action( 'bp_embed_update_cache', $cache, $cachekey, $id );
+
+				// If there was a result, return it
+				if ( $html ) {
+
+					/** This filter is documented in bp-core/classes/class-bp-embed.php */
+					return apply_filters( 'bp_embed_oembed_html', $html, $url, $attr, $rawattr );
+				}
+			}
+		}
+
+		// Still unknown
+		return $this->maybe_make_link( $url );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-media-extractor.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-media-extractor.php
new file mode 100644
index 0000000000000000000000000000000000000000..ab40585bccfbb022c07d0a8ab6b7b22eb83073d2
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-media-extractor.php
@@ -0,0 +1,901 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Extracts media from text. Use {@link extract()}.
+ *
+ * The supported types are links, mentions, images, shortcodes, embeds, audio, video, and "all".
+ * This is what each type extracts:
+ *
+ * Links:      <a href="http://example.com">
+ * Mentions:   @name
+ *             If the Activity component is enabled, we use it to parse out any @names. A consequence
+ *             to note is that the "name" mentioned must match a real user account. If it's a made-up
+ *             @name, then it isn't extracted.
+ *             If the Activity component is disabled, any @name is extracted (both those matching
+ *             real accounts, and those made-up).
+ * Images:     <img src="image.gif">, [gallery], [gallery ids="2,3"], featured images (Post thumbnails).
+ *             If an extracted image is in the Media Library, then its resolution will be included.
+ * Shortcodes: Extract information about any (registered) shortcodes.
+ *             This includes any shortcodes indirectly covered by any of the other media extraction types.
+ *             For example, [gallery].
+ * Embeds:     Extract any URL matching a registered oEmbed handler.
+ * Audio:      <a href="*.mp3"">, [audio]
+ *             See wp_get_audio_extensions() for supported audio formats.
+ * Video:      [video]
+ *             See wp_get_video_extensions() for supported video formats.
+ *
+ * @see BP_Media_Extractor::extract() Use this to extract media.
+ * @since BuddyPress (2.3.0)
+ */
+class BP_Media_Extractor {
+	/**
+	 * Media type.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 * @var int
+	 */
+	const ALL        = 255;
+	const LINKS      = 1;
+	const MENTIONS   = 2;
+	const IMAGES     = 4;
+	const SHORTCODES = 8;
+	const EMBEDS     = 16;
+	const AUDIO      = 32;
+	const VIDEOS     = 64;
+
+
+	/**
+	 * Extract media from text.
+	 *
+	 * @param string|WP_Post $richtext Content to parse.
+	 * @param int $what_to_extract Media type to extract (optional).
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $audio
+	 *         @type int $embeds
+	 *         @type int $images
+	 *         @type int $links
+	 *         @type int $mentions
+	 *         @type int $shortcodes
+	 *         @type int $video
+	 *     }
+	 *     @type array $audio Extracted audio. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $source Media source. Either "html" or "shortcodes".
+	 *         @type string $url Link to audio.
+	 *     }
+	 *     @type array $embeds Extracted oEmbeds. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $url oEmbed link.
+	 *     }
+	 *     @type array $images Extracted images. {
+	 *         Array of extracted media.
+	 *
+	 *         @type int $gallery_id Gallery ID. Optional, not always set.
+	 *         @type int $height Width of image. If unknown, set to 0.
+	 *         @type string $source Media source. Either "html" or "galleries".
+	 *         @type string $url Link to image.
+	 *         @type int $width Width of image. If unknown, set to 0.
+	 *     }
+	 *     @type array $links Extracted URLs. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $url Link.
+	 *     }
+	 *     @type array $mentions Extracted mentions. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $name @mention.
+	 *         @type string $user_id User ID. Optional, only set if Activity component enabled.
+	 *     }
+	 *     @type array $shortcodes Extracted shortcodes. {
+	 *         Array of extracted media.
+	 *
+	 *         @type array $attributes Key/value pairs of the shortcodes attributes (if any).
+	 *         @type string $content Text wrapped by the shortcode.
+	 *         @type string $type Shortcode type.
+	 *         @type string $original The entire shortcode.
+	 *     }
+	 *     @type array $videos Extracted video. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $source Media source. Currently only "shortcodes".
+	 *         @type string $url Link to audio.
+	 *     }
+	 * }
+	 * @since BuddyPress (2.3.0)
+	 */
+	public function extract( $richtext, $what_to_extract = self::ALL, $extra_args = array() ) {
+		$media = array();
+
+		// Support passing a WordPress Post for the $richtext parameter.
+		if ( is_a( $richtext, 'WP_Post' ) ) {
+			$extra_args['post'] = $richtext;
+			$richtext           = $extra_args['post']->post_content;
+		}
+
+		$plaintext = $this->strip_markup( $richtext );
+
+
+		// Extract links.
+		if ( self::LINKS & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_links( $richtext, $plaintext, $extra_args ) );
+		}
+
+		// Extract mentions.
+		if ( self::MENTIONS & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_mentions( $richtext, $plaintext, $extra_args ) );
+		}
+
+		// Extract images.
+		if ( self::IMAGES & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_images( $richtext, $plaintext, $extra_args ) );
+		}
+
+		// Extract shortcodes.
+		if ( self::SHORTCODES & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_shortcodes( $richtext, $plaintext, $extra_args ) );
+		}
+
+		// Extract oEmbeds.
+		if ( self::EMBEDS & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_embeds( $richtext, $plaintext, $extra_args ) );
+		}
+
+		// Extract audio.
+		if ( self::AUDIO & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_audio( $richtext, $plaintext, $extra_args ) );
+		}
+
+		// Extract video.
+		if ( self::VIDEOS & $what_to_extract ) {
+			$media = array_merge_recursive( $media, $this->extract_video( $richtext, $plaintext, $extra_args ) );
+		}
+
+		/**
+		 * Filters media extracted from text.
+		 *
+		 * @param array $media Extracted media. See {@link BP_Media_Extractor::extract()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param int $what_to_extract Media type to extract.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_extract', $media, $richtext, $what_to_extract, $extra_args, $plaintext );
+	}
+
+
+	/**
+	 * Content type specific extraction methods.
+	 *
+	 * You shouldn't need to use these directly; just use {@link BP_Media_Extractor::extract()}.
+	 */
+
+	/**
+	 * Extract `<a href>` tags from text.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $links
+	 *     }
+	 *     @type array $links Extracted URLs. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $url Link.
+	 *     }
+	 * }
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_links( $richtext, $plaintext, $extra_args = array() ) {
+		$data = array( 'has' => array( 'links' => 0 ), 'links' => array() );
+
+		// Matches: href="text" and href='text'
+		if ( stripos( $richtext, 'href=' ) !== false ) {
+			preg_match_all( '#href=(["\'])([^"\']+)\1#i', $richtext, $matches );
+
+			if ( ! empty( $matches[2] ) ) {
+				$matches[2] = array_unique( $matches[2] );
+
+				foreach ( $matches[2] as $link_src ) {
+					$link_src = esc_url_raw( $link_src );
+
+					if ( $link_src ) {
+						$data['links'][] = array( 'url' => $link_src );
+					}
+				}
+			}
+		}
+
+		$data['has']['links'] = count( $data['links'] );
+
+		/**
+		 * Filters links extracted from text.
+		 *
+		 * @param array $data Extracted links. See {@link BP_Media_Extractor::extract_links()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_links', $data, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract @mentions tags from text.
+	 *
+	 * If the Activity component is enabled, it is used to parse @mentions.
+	 * The mentioned "name" must match a user account, otherwise it is discarded.
+	 *
+	 * If the Activity component is disabled, any @mentions are extracted.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor.
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $mentions
+	 *     }
+	 *     @type array $mentions Extracted mentions. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $name @mention.
+	 *         @type string $user_id User ID. Optional, only set if Activity component enabled.
+	 *     }
+	 * }
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_mentions( $richtext, $plaintext, $extra_args = array() ) {
+		$data     = array( 'has' => array( 'mentions' => 0 ), 'mentions' => array() );
+		$mentions = array();
+
+		// If the Activity component is active, use it to parse @mentions.
+		if ( bp_is_active( 'activity' ) ) {
+			$mentions = bp_activity_find_mentions( $plaintext );
+			if ( ! $mentions ) {
+				$mentions = array();
+			}
+
+		// If the Activity component is disabled, instead do a basic parse.
+		} else {
+			if ( strpos( $plaintext, '@' ) !== false ) {
+				preg_match_all( '/[@]+([A-Za-z0-9-_\.@]+)\b/', $plaintext, $matches );
+
+				if ( ! empty( $matches[1] ) ) {
+					$mentions = array_unique( array_map( 'strtolower', $matches[1] ) );
+				}
+			}
+		}
+
+		// Build results
+		foreach ( $mentions as $user_id => $mention_name ) {
+			$mention = array( 'name' => strtolower( $mention_name ) );
+
+			// If the Activity component is active, store the User ID, too.
+			if ( bp_is_active( 'activity' ) ) {
+				$mention['user_id'] = (int) $user_id;
+			}
+
+			$data['mentions'][] = $mention;
+		}
+
+		$data['has']['mentions'] = count( $data['mentions'] );
+
+		/**
+		 * Filters @mentions extracted from text.
+		 *
+		 * @param array $data Extracted @mentions. See {@link BP_Media_Extractor::extract_mentions()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor (optional).
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_mentions', $data, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract images from `<img src>` tags, [galleries], and featured images from a Post.
+	 *
+	 * If an image is in the Media Library, then its resolution is included in the results.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $images
+	 *     }
+	 *     @type array $images Extracted images. {
+	 *         Array of extracted media.
+	 *
+	 *         @type int $gallery_id Gallery ID. Optional, not always set.
+	 *         @type int $height Width of image. If unknown, set to 0.
+	 *         @type string $source Media source. Either "html" or "galleries".
+	 *         @type string $url Link to image.
+	 *         @type int $width Width of image. If unknown, set to 0.
+	 *     }
+	 * }
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_images( $richtext, $plaintext, $extra_args = array() ) {
+		$media = array( 'has' => array( 'images' => 0 ), 'images' => array() );
+
+		$featured_image = $this->extract_images_from_featured_images( $richtext, $plaintext, $extra_args );
+		$galleries      = $this->extract_images_from_galleries( $richtext, $plaintext, $extra_args );
+
+
+		// `<img src>` tags.
+		if ( stripos( $richtext, 'src=' ) !== false ) {
+			preg_match_all( '#src=(["\'])([^"\']+)\1#i', $richtext, $img_srcs );  // matches src="text" and src='text'
+
+			// <img>.
+			if ( ! empty( $img_srcs[2] ) ) {
+				$img_srcs[2] = array_unique( $img_srcs[2] );
+
+				foreach ( $img_srcs[2] as $image_src ) {
+					// Skip data URIs.
+					if ( strtolower( substr( $image_src, 0, 5 ) ) === 'data:' ) {
+						continue;
+					}
+
+					$image_src = esc_url_raw( $image_src );
+					if ( ! $image_src ) {
+						continue;
+					}
+
+					$media['images'][] = array(
+						'source' => 'html',
+						'url'    => $image_src,
+
+						// The image resolution isn't available, but we need to set the keys anyway.
+						'height' => 0,
+						'width'  => 0,
+					);
+				}
+			}
+		}
+
+		// Galleries.
+		if ( ! empty( $galleries ) ) {
+			foreach ( $galleries as $gallery ) {
+				foreach ( $gallery as $image ) {
+					$image_url = esc_url_raw( $image['url'] );
+					if ( ! $image_url ) {
+						continue;
+					}
+
+					$media['images'][] = array(
+						'gallery_id' => $image['gallery_id'],
+						'source'     => 'galleries',
+						'url'        => $image_url,
+						'width'      => $image['width'],
+						'height'     => $image['height'],
+					);
+				}
+			}
+
+			$media['has']['galleries'] = count( $galleries );
+		}
+
+		// Featured images (aka thumbnails).
+		if ( ! empty( $featured_image ) ) {
+			$image_url = esc_url_raw( $featured_image[0] );
+
+			if ( $image_url ) {
+				$media['images'][] = array(
+					'source' => 'featured_images',
+					'url'    => $image_url,
+					'width'  => $featured_image[1],
+					'height' => $featured_image[2],
+				);
+
+				$media['has']['featured_images'] = 1;
+			}
+		}
+
+		// Update image count.
+		$media['has']['images'] = count( $media['images'] );
+
+
+		/**
+		 * Filters images extracted from text.
+		 *
+		 * @param array $media Extracted images. See {@link BP_Media_Extractor::extract_images()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_images', $media, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract shortcodes from text.
+	 *
+	 * This includes any shortcodes indirectly used by other media extraction types.
+	 * For example, [gallery] and [audio].
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $shortcodes
+	 *     }
+	 *     @type array $shortcodes Extracted shortcodes. {
+	 *         Array of extracted media.
+	 *
+	 *         @type array $attributes Key/value pairs of the shortcodes attributes (if any).
+	 *         @type string $content Text wrapped by the shortcode.
+	 *         @type string $type Shortcode type.
+	 *         @type string $original The entire shortcode.
+	 *     }
+	 * }
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_shortcodes( $richtext, $plaintext, $extra_args = array() ) {
+		$data = array( 'has' => array( 'shortcodes' => 0 ), 'shortcodes' => array() );
+
+		// Match any registered WordPress shortcodes.
+		if ( strpos( $richtext, '[' ) !== false ) {
+	 		preg_match_all( '/' . get_shortcode_regex() . '/s', $richtext, $matches );
+
+			if ( ! empty( $matches[2] ) ) {
+				foreach ( $matches[2] as $i => $shortcode_name ) {
+					$attrs = shortcode_parse_atts( $matches[3][ $i ] );
+					$attrs = ( ! $attrs ) ? array() : $attrs;
+
+					$shortcode               = array();
+					$shortcode['attributes'] = $attrs;             // Attributes
+					$shortcode['content']    = $matches[5][ $i ];  // Content
+					$shortcode['type']       = $shortcode_name;    // Shortcode
+					$shortcode['original']   = $matches[0][ $i ];  // Entire shortcode
+
+					$data['shortcodes'][] = $shortcode;
+				}
+			}
+		}
+
+		$data['has']['shortcodes'] = count( $data['shortcodes'] );
+
+		/**
+		 * Filters shortcodes extracted from text.
+		 *
+		 * @param array $data Extracted shortcodes. See {@link BP_Media_Extractor::extract_shortcodes()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_shortcodes', $data, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract any URL, matching a registered oEmbed endpoint, from text.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $embeds
+	 *     }
+	 *     @type array $embeds Extracted oEmbeds. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $url oEmbed link.
+	 *     }
+	 * }
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_embeds( $richtext, $plaintext, $extra_args = array() ) {
+		$data   = array( 'has' => array( 'embeds' => 0 ), 'embeds' => array() );
+		$embeds = array();
+
+		if ( ! function_exists( '_wp_oembed_get_object' ) ) {
+			require( ABSPATH . WPINC . '/class-oembed.php' );
+		}
+
+
+		// Matches any links on their own lines. They may be oEmbeds.
+		if ( stripos( $richtext, 'http' ) !== false ) {
+			preg_match_all( '#^\s*(https?://[^\s"]+)\s*$#im', $richtext, $matches );
+
+			if ( ! empty( $matches[1] ) ) {
+				$matches[1] = array_unique( $matches[1] );
+				$oembed     = _wp_oembed_get_object();
+
+				foreach ( $matches[1] as $link ) {
+					// Skip data URIs.
+					if ( strtolower( substr( $link, 0, 5 ) ) === 'data:' ) {
+						continue;
+					}
+
+					foreach ( $oembed->providers as $matchmask => $oembed_data ) {
+						list( , $is_regex ) = $oembed_data;
+
+						// Turn asterisk-type provider URLs into regexs.
+						if ( ! $is_regex ) {
+							$matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
+							$matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
+						}
+
+						// Check whether this "link" is really an oEmbed.
+						if ( preg_match( $matchmask, $link ) ) {
+							$data['embeds'][] = array( 'url' => $link );
+
+							break;
+						}
+					}
+				}
+			}
+		}
+
+		$data['has']['embeds'] = count( $data['embeds'] );
+
+		/**
+		 * Filters embeds extracted from text.
+		 *
+		 * @param array $data Extracted embeds. See {@link BP_Media_Extractor::extract_embeds()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_embeds', $data, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract [audio] shortcodes and `<a href="*.mp3">` tags, from text.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $audio
+	 *     }
+	 *     @type array $audio Extracted audio. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $original The entire shortcode.
+	 *         @type string $source Media source. Either "html" or "shortcodes".
+	 *         @type string $url Link to audio.
+	 *     }
+	 * }
+	 * @see wp_get_audio_extensions() for supported audio formats.
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_audio( $richtext, $plaintext, $extra_args = array() ) {
+		$data   = array( 'has' => array( 'audio' => 0 ), 'audio' => array() );
+		$audios = $this->extract_shortcodes( $richtext, $plaintext, $extra_args );
+		$links  = $this->extract_links( $richtext, $plaintext, $extra_args );
+
+		$audio_types = wp_get_audio_extensions();
+
+
+		// [audio]
+		$audios = wp_list_filter( $audios['shortcodes'], array( 'type' => 'audio' ) );
+		foreach ( $audios as $audio ) {
+
+			// Media URL can appear as the first parameter inside the shortcode brackets.
+			if ( isset( $audio['attributes']['src'] ) ) {
+				$src_param = 'src';
+			} elseif ( isset( $audio['attributes'][0] ) ) {
+				$src_param = 0;
+			} else {
+				continue;
+			}
+
+			$path = untrailingslashit( parse_url( $audio['attributes'][ $src_param ], PHP_URL_PATH ) );
+
+			foreach ( $audio_types as $extension ) {
+				$extension = '.' . $extension;
+
+				// Check this URL's file extension matches that of an accepted audio format.
+				if ( ! $path || substr( $path, -4 ) !== $extension ) {
+					continue;
+				}
+
+				$data['audio'][] = array(
+					'original' => '[audio src="' . esc_url_raw( $audio['attributes'][ $src_param ] ) . '"]',
+					'source'   => 'shortcodes',
+					'url'      => esc_url_raw( $audio['attributes'][ $src_param ] ),
+				);
+			}
+		}
+
+		// <a href="*.mp3"> tags
+		foreach ( $audio_types as $extension ) {
+			$extension = '.' . $extension;
+
+			foreach ( $links['links'] as $link ) {
+				$path = untrailingslashit( parse_url( $link['url'], PHP_URL_PATH ) );
+
+				// Check this URL's file extension matches that of an accepted audio format.
+				if ( ! $path || substr( $path, -4 ) !== $extension ) {
+					continue;
+				}
+
+				$data['audio'][] = array(
+					'original' => '[audio src="' . esc_url_raw( $link['url'] ) . '"]',  // Build an audio shortcode.
+					'source'   => 'html',
+					'url'      => esc_url_raw( $link['url'] ),
+				);
+			}
+		}
+
+		$data['has']['audio'] = count( $data['audio'] );
+
+		/**
+		 * Filters audio extracted from text.
+		 *
+		 * @param array $data Extracted audio. See {@link BP_Media_Extractor::extract_audio()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_audio', $data, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract [video] shortcodes from text.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array {
+	 *     @type array $has Extracted media counts. {
+	 *         @type int $video
+	 *     }
+	 *     @type array $videos Extracted video. {
+	 *         Array of extracted media.
+	 *
+	 *         @type string $source Media source. Currently only "shortcodes".
+	 *         @type string $url Link to audio.
+	 *     }
+	 * }
+	 * @see wp_get_video_extensions() for supported video formats.
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_video( $richtext, $plaintext, $extra_args = array() ) {
+		$data   = array( 'has' => array( 'videos' => 0 ), 'videos' => array() );
+		$videos = $this->extract_shortcodes( $richtext, $plaintext, $extra_args );
+
+		$video_types = wp_get_video_extensions();
+
+
+		// [video]
+		$videos = wp_list_filter( $videos['shortcodes'], array( 'type' => 'video' ) );
+		foreach ( $videos as $video ) {
+
+			// Media URL can appear as the first parameter inside the shortcode brackets.
+			if ( isset( $video['attributes']['src'] ) ) {
+				$src_param = 'src';
+			} elseif ( isset( $video['attributes'][0] ) ) {
+				$src_param = 0;
+			} else {
+				continue;
+			}
+
+			$path = untrailingslashit( parse_url( $video['attributes'][ $src_param ], PHP_URL_PATH ) );
+
+			foreach ( $video_types as $extension ) {
+				$extension = '.' . $extension;
+
+				// Check this URL's file extension matches that of an accepted video format (-5 for webm).
+				if ( ! $path || ( substr( $path, -4 ) !== $extension && substr( $path, -5 ) !== $extension ) ) {
+					continue;
+				}
+
+				$data['videos'][] = array(
+					'original' => $video['original'],  // Entire shortcode.
+					'source'   => 'shortcodes',
+					'url'      => esc_url_raw( $video['attributes'][ $src_param ] ),
+				);
+			}
+		}
+
+		$data['has']['videos'] = count( $data['videos'] );
+
+		/**
+		 * Filters videos extracted from text.
+		 *
+		 * @param array $data Extracted videos. See {@link BP_Media_Extractor::extract_videos()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_videos', $data, $richtext, $plaintext, $extra_args );
+	}
+
+
+	/**
+	 * Helpers and utility methods.
+	 */
+
+	/**
+	 * Extract images in [galleries] shortcodes from text.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Bespoke data for a particular extractor (optional).
+	 * @return array
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_images_from_galleries( $richtext, $plaintext, $extra_args = array() ) {
+		if ( ! isset( $extra_args['post'] ) || ! is_a( $extra_args['post'], 'WP_Post' ) ) {
+			$post = new WP_Post( (object) array( 'post_content' => $richtext ) );
+		} else {
+			$post = $extra_args['post'];
+		}
+
+		// We're not using get_post_galleries_images() because it returns thumbnails; we want the original image.
+		$galleries      = get_post_galleries( $post, false );
+		$galleries_data = array();
+	
+		if ( ! empty( $galleries ) ) {
+			// Validate the size of the images requested.
+			if ( isset( $extra_args['width'] ) ) {
+
+				// A width was specified but not a height, so calculate it assuming a 4:3 ratio.
+				if ( ! isset( $extra_args['height'] ) && ctype_digit( $extra_args['width'] ) ) {
+					$extra_args['height'] = round( ( $extra_args['width'] / 4 ) * 3 );
+				}
+
+				if ( ctype_digit( $extra_args['width'] ) ) {
+					$image_size = array( $extra_args['width'], $extra_args['height'] );
+				} else {
+					$image_size = $extra_args['width'];  // e.g. "thumb", "medium".
+				}
+
+			} else {
+				$image_size = 'full';
+			}
+
+			/**
+			 * There are two variants of gallery shortcode.
+			 *
+			 * One kind specifies the image (post) IDs via an `ids` parameter.
+			 * The other gets the image IDs from post_type=attachment and post_parent=get_the_ID().
+			 */
+
+			foreach ( $galleries as $gallery_id => $gallery ) {
+				$data   = array();
+				$images = array();
+
+				// Gallery ids= variant.
+				if ( isset( $gallery['ids'] ) ) {
+					$images = wp_parse_id_list( $gallery['ids'] );
+
+				// Gallery post_parent variant.
+				} elseif ( isset( $extra_args['post'] ) ) {
+					$images = wp_parse_id_list(
+						get_children( array(
+							'fields'         => 'ids',
+							'order'          => 'ASC',
+							'orderby'        => 'menu_order ID',
+							'post_mime_type' => 'image',
+							'post_parent'    => $extra_args['post']->ID,
+							'post_status'    => 'inherit',
+							'post_type'      => 'attachment',
+						) )
+					);
+				}
+
+				// Extract the data we need from each image in this gallery.
+				foreach ( $images as $image_id ) {
+					$image  = wp_get_attachment_image_src( $image_id, $image_size );
+					$data[] = array(
+						'url'    => $image[0],
+						'width'  => $image[1],
+						'height' => $image[2],
+
+						'gallery_id' => 1 + $gallery_id,
+					);
+				}
+
+				$galleries_data[] = $data;
+			}
+		}
+
+		/**
+		 * Filters image galleries extracted from text.
+		 *
+		 * @param array $galleries_data Galleries. See {@link BP_Media_Extractor::extract_images_from_galleries()}.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_galleries', $galleries_data, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Extract the featured image from a Post.
+	 *
+	 * @param string $richtext Content to parse.
+	 * @param string $plaintext Sanitized version of the content.
+	 * @param array $extra_args Contains data that an implementation might need beyond the defaults.
+	 * @return array
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function extract_images_from_featured_images( $richtext, $plaintext, $extra_args ) {
+		$image = array();
+		$thumb = 0;
+
+		if ( isset( $extra_args['post'] ) ) {
+			$thumb = (int) get_post_thumbnail_id( $extra_args['post']->ID );
+		}
+
+		if ( $thumb ) {
+			// Validate the size of the images requested.
+			if ( isset( $extra_args['width'] ) ) {
+				if ( ! isset( $extra_args['height'] ) && ctype_digit( $extra_args['width'] ) ) {
+					// A width was specified but not a height, so calculate it assuming a 4:3 ratio.
+					$extra_args['height'] = round( ( $extra_args['width'] / 4 ) * 3 );
+				}
+
+				if ( ctype_digit( $extra_args['width'] ) ) {
+					$image_size = array( $extra_args['width'], $extra_args['height'] );
+				} else {
+					$image_size = $extra_args['width'];  // e.g. "thumb", "medium".
+				}
+			} else {
+				$image_size = 'full';
+			}
+
+			$image = wp_get_attachment_image_src( $thumb, $image_size );
+		}
+
+		/**
+		 * Filters featured images extracted from a WordPress Post.
+		 *
+		 * @param array $image Extracted images. See {@link BP_Media_Extractor_Post::extract_images()} for format.
+		 * @param string $richtext Content to parse.
+		 * @param string $plaintext Copy of $richtext without any markup.
+		 * @param array $extra_args Bespoke data for a particular extractor.
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_featured_images', $image, $richtext, $plaintext, $extra_args );
+	}
+
+	/**
+	 * Sanitize and format raw content to prepare for content extraction.
+	 *
+	 * HTML tags and shortcodes are removed, and HTML entities are decoded.
+	 *
+	 * @param string $richtext
+	 * @return string
+	 * @since BuddyPress (2.3.0)
+	 */
+	protected function strip_markup( $richtext ) {
+		$plaintext = strip_shortcodes( html_entity_decode( strip_tags( $richtext ) ) );
+
+		/**
+		 * Filters the generated plain text version of the content passed to the extractor.
+		 *
+		 * @param array $plaintext Generated plain text.
+		 * @param string $richtext Original content
+		 * @since BuddyPress (2.3.0)
+		 */
+		return apply_filters( 'bp_media_extractor_strip_markup', $plaintext, $richtext );
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-members-suggestions.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-members-suggestions.php
new file mode 100644
index 0000000000000000000000000000000000000000..8972ab3bf28d798cd871875efc6c5f2ea9c8e057
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-members-suggestions.php
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Adds support for user at-mentions to the Suggestions API.
+ *
+ * This class is in the Core component because it's required by a class in the Groups component,
+ * and Groups is loaded before Members (alphabetical order).
+ *
+ * @since BuddyPress (2.1.0)
+ */
+class BP_Members_Suggestions extends BP_Suggestions {
+
+	/**
+	 * Default arguments for this suggestions service.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @var array $args {
+	 *     @type int $limit Maximum number of results to display. Default: 16.
+	 *     @type bool $only_friends If true, only match the current user's friends. Default: false.
+	 *     @type string $term The suggestion service will try to find results that contain this string.
+	 *           Mandatory.
+	 * }
+	 */
+	protected $default_args = array(
+		'limit'        => 10,
+		'only_friends' => false,
+		'term'         => '',
+		'type'         => '',
+	);
+
+
+	/**
+	 * Validate and sanitise the parameters for the suggestion service query.
+	 *
+	 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function validate() {
+		$this->args['only_friends'] = (bool) $this->args['only_friends'];
+
+		/**
+		 * Filters the members suggestions args for the current user.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array                  $args Array of arguments for the member suggestions.
+		 * @param BP_Members_Suggestions $this Current BP_Members_Suggestions instance.
+		 */
+		$this->args                 = apply_filters( 'bp_members_suggestions_args', $this->args, $this );
+
+		// Check for invalid or missing mandatory parameters.
+		if ( $this->args['only_friends'] && ( ! bp_is_active( 'friends' ) || ! is_user_logged_in() ) ) {
+			return new WP_Error( 'missing_requirement' );
+		}
+
+		/**
+		 * Filters the validation status for the suggestion service query.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param bool|WP_Error          $value Results of validation check.
+		 * @param BP_Members_Suggestions $this  Current BP_Members_Suggestions instance.
+		 */
+		return apply_filters( 'bp_members_suggestions_validate_args', parent::validate(), $this );
+	}
+
+	/**
+	 * Find and return a list of username suggestions that match the query.
+	 *
+	 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function get_suggestions() {
+		$user_query = array(
+			'count_total'     => '',  // Prevents total count
+			'populate_extras' => false,
+			'type'            => 'alphabetical',
+
+			'page'            => 1,
+			'per_page'        => $this->args['limit'],
+			'search_terms'    => $this->args['term'],
+			'search_wildcard' => 'right',
+		);
+
+		// Only return matches of friends of this user.
+		if ( $this->args['only_friends'] && is_user_logged_in() ) {
+			$user_query['user_id'] = get_current_user_id();
+		}
+
+		/**
+		 * Filters the members suggestions query args.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array                  $user_query Array of query arguments.
+		 * @param BP_Members_Suggestions $this       Current BP_Members_Suggestions instance.
+		 */
+		$user_query = apply_filters( 'bp_members_suggestions_query_args', $user_query, $this );
+		if ( is_wp_error( $user_query ) ) {
+			return $user_query;
+		}
+
+
+		$user_query = new BP_User_Query( $user_query );
+		$results    = array();
+
+		foreach ( $user_query->results as $user ) {
+			$result        = new stdClass();
+			$result->ID    = $user->user_nicename;
+			$result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
+			$result->name  = bp_core_get_user_displayname( $user->ID );
+
+			$results[] = $result;
+		}
+
+		/**
+		 * Filters the members suggestions results.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array                  $results Array of users to suggest.
+		 * @param BP_Members_Suggestions $this    Current BP_Members_Suggestions instance.
+		 */
+		return apply_filters( 'bp_members_suggestions_get_suggestions', $results, $this );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-recursive-query.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-recursive-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..7e45284f4f4f449f72fc022ca9e1ac3ba0c21d29
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-recursive-query.php
@@ -0,0 +1,234 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Base class for creating query classes that generate SQL fragments for filtering results based on recursive query params.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+abstract class BP_Recursive_Query {
+
+	/**
+	 * Query arguments passed to the constructor.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 * @var array
+	 */
+	public $queries = array();
+
+	/**
+	 * Generate SQL clauses to be appended to a main query.
+	 *
+	 * Extending classes should call this method from within a publicly
+	 * accessible get_sql() method, and manipulate the SQL as necessary.
+	 * For example, {@link BP_XProfile_Query::get_sql()} is merely a wrapper for
+	 * get_sql_clauses(), while {@link BP_Activity_Query::get_sql()} discards
+	 * the empty 'join' clause, and only passes the 'where' clause.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  string $primary_table
+	 * @param  string $primary_id_column
+	 * @return array
+	 */
+	protected function get_sql_clauses() {
+		$sql = $this->get_sql_for_query( $this->queries );
+
+		if ( ! empty( $sql['where'] ) ) {
+			$sql['where'] = ' AND ' . "\n" . $sql['where'] . "\n";
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Generate SQL clauses for a single query array.
+	 *
+	 * If nested subqueries are found, this method recurses the tree to
+	 * produce the properly nested SQL.
+	 *
+	 * Subclasses generally do not need to call this method. It is invoked
+	 * automatically from get_sql_clauses().
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array $query Query to parse.
+	 * @param  int   $depth Optional. Number of tree levels deep we
+	 *                      currently are. Used to calculate indentation.
+	 * @return array
+	 */
+	protected function get_sql_for_query( $query, $depth = 0 ) {
+		$sql_chunks = array(
+			'join'  => array(),
+			'where' => array(),
+		);
+
+		$sql = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		$indent = '';
+		for ( $i = 0; $i < $depth; $i++ ) {
+			$indent .= "\t";
+		}
+
+		foreach ( $query as $key => $clause ) {
+			if ( 'relation' === $key ) {
+				$relation = $query['relation'];
+			} elseif ( is_array( $clause ) ) {
+				// This is a first-order clause
+				if ( $this->is_first_order_clause( $clause ) ) {
+					$clause_sql = $this->get_sql_for_clause( $clause, $query );
+
+					$where_count = count( $clause_sql['where'] );
+					if ( ! $where_count ) {
+						$sql_chunks['where'][] = '';
+					} elseif ( 1 === $where_count ) {
+						$sql_chunks['where'][] = $clause_sql['where'][0];
+					} else {
+						$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
+					}
+
+					$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
+				// This is a subquery
+				} else {
+					$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
+
+					$sql_chunks['where'][] = $clause_sql['where'];
+					$sql_chunks['join'][]  = $clause_sql['join'];
+				}
+			}
+		}
+
+		// Filter empties
+		$sql_chunks['join']  = array_filter( $sql_chunks['join'] );
+		$sql_chunks['where'] = array_filter( $sql_chunks['where'] );
+
+		if ( empty( $relation ) ) {
+			$relation = 'AND';
+		}
+
+		if ( ! empty( $sql_chunks['join'] ) ) {
+			$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );
+		}
+
+		if ( ! empty( $sql_chunks['where'] ) ) {
+			$sql['where'] = '( ' . "\n\t" . $indent . implode( ' ' . "\n\t" . $indent . $relation . ' ' . "\n\t" . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')' . "\n";
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Recursive-friendly query sanitizer.
+	 *
+	 * Ensures that each query-level clause has a 'relation' key, and that
+	 * each first-order clause contains all the necessary keys from
+	 * $defaults.
+	 *
+	 * Extend this method if your class uses different sanitizing logic.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param  array $queries Array of query clauses.
+	 * @return array Sanitized array of query clauses.
+	 */
+	protected function sanitize_query( $queries ) {
+		$clean_queries = array();
+
+		if ( ! is_array( $queries ) ) {
+			return $clean_queries;
+		}
+
+		foreach ( $queries as $key => $query ) {
+			if ( 'relation' === $key ) {
+				$relation = $query;
+
+			} elseif ( ! is_array( $query ) ) {
+				continue;
+
+			// First-order clause.
+			} elseif ( $this->is_first_order_clause( $query ) ) {
+				if ( isset( $query['value'] ) && array() === $query['value'] ) {
+					unset( $query['value'] );
+				}
+
+				$clean_queries[] = $query;
+
+			// Otherwise, it's a nested query, so we recurse.
+			} else {
+				$cleaned_query = $this->sanitize_query( $query );
+
+				if ( ! empty( $cleaned_query ) ) {
+					$clean_queries[] = $cleaned_query;
+				}
+			}
+		}
+
+		if ( empty( $clean_queries ) ) {
+			return $clean_queries;
+		}
+
+		// Sanitize the 'relation' key provided in the query.
+		if ( isset( $relation ) && 'OR' === strtoupper( $relation ) ) {
+			$clean_queries['relation'] = 'OR';
+
+		/*
+		 * If there is only a single clause, call the relation 'OR'.
+		 * This value will not actually be used to join clauses, but it
+		 * simplifies the logic around combining key-only queries.
+		 */
+		} elseif ( 1 === count( $clean_queries ) ) {
+			$clean_queries['relation'] = 'OR';
+
+		// Default to AND.
+		} else {
+			$clean_queries['relation'] = 'AND';
+		}
+
+		return $clean_queries;
+	}
+
+	/**
+	 * Generate JOIN and WHERE clauses for a first-order clause.
+	 *
+	 * Must be overridden in a subclass.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array $clause       Array of arguments belonging to the clause.
+	 * @param  array $parent_query Parent query to which the clause belongs.
+	 * @return array {
+	 *     @type array $join  Array of subclauses for the JOIN statement.
+	 *     @type array $where Array of subclauses for the WHERE statement.
+	 * }
+	 */
+	abstract protected function get_sql_for_clause( $clause, $parent_query );
+
+	/**
+	 * Determine whether a clause is first-order.
+	 *
+	 * Must be overridden in a subclass.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array $q Clause to check.
+	 * @return bool
+	 */
+	abstract protected function is_first_order_clause( $query );
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-suggestions.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-suggestions.php
new file mode 100644
index 0000000000000000000000000000000000000000..5c92b1abf101f365a88e247b2e9e90995f656112
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-suggestions.php
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Base class for the BuddyPress Suggestions API.
+ *
+ * Originally built to power BuddyPress' at-mentions suggestions, it's flexible enough to be used
+ * for similar kinds of future core requirements, or those desired by third-party developers.
+ *
+ * To implement a new suggestions service, create a new class that extends this one, and update
+ * the list of default services in {@link bp_core_get_suggestions()}. If you're building a plugin,
+ * it's recommend that you use the `bp_suggestions_services` filter to do this. :)
+ *
+ * While the implementation of the query logic is left to you, it should be as quick and efficient
+ * as possible. When implementing the abstract methods in this class, pay close attention to the
+ * recommendations provided in the phpDoc blocks, particularly the expected return types.
+ *
+ * @since BuddyPress (2.1.0)
+ */
+abstract class BP_Suggestions {
+
+	/**
+	 * Default arguments common to all suggestions services.
+	 *
+	 * If your custom service requires further defaults, add them here.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @var array
+	 */
+	protected $default_args = array(
+		'limit' => 16,
+		'term'  => '',
+		'type'  => '',
+	);
+
+	/**
+	 * Holds the arguments for the query (about to made to the suggestions service).
+	 *
+	 * This includes `$default_args`, as well as the user-supplied values.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @var array
+	 */
+	protected $args = array(
+	);
+
+
+	/**
+	 * Constructor.
+	 *
+	 * @param array $args Optional. If set, used as the parameters for the suggestions service query.
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function __construct( array $args = array() ) {
+		if ( ! empty( $args ) ) {
+			$this->set_query( $args );
+		}
+	}
+
+	/**
+	 * Set the parameters for the suggestions service query.
+	 *
+	 * @param array $args {
+	 *     @type int $limit Maximum number of results to display. Optional, default: 16.
+	 *     @type string $type The name of the suggestion service to use for the request. Mandatory.
+	 *     @type string $term The suggestion service will try to find results that contain this string.
+	 *           Mandatory.
+	 * }
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function set_query( array $args = array() ) {
+		$this->args = wp_parse_args( $args, $this->default_args );
+	}
+
+	/**
+	 * Validate and sanitise the parameters for the suggestion service query.
+	 *
+	 * Be sure to call this class' version of this method when implementing it in your own service.
+	 * If validation fails, you must return a WP_Error object.
+	 *
+	 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function validate() {
+		$this->args['limit'] = absint( $this->args['limit'] );
+		$this->args['term']  = trim( sanitize_text_field( $this->args['term'] ) );
+
+		/**
+		 * Filters the arguments to be validated for the BP_Suggestions query.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param BP_Suggestions $value Arguments to be validated.
+		 * @param BP_Suggestions $this  Current BP_Suggestions instance.
+		 */
+		$this->args          = apply_filters( 'bp_suggestions_args', $this->args, $this );
+
+		// Check for invalid or missing mandatory parameters.
+		if ( ! $this->args['limit'] || ! $this->args['term'] ) {
+			return new WP_Error( 'missing_parameter' );
+		}
+
+		// Check for blocked users (e.g. deleted accounts, or spammers).
+		if ( is_user_logged_in() && ! bp_is_user_active( get_current_user_id() ) ) {
+			return new WP_Error( 'invalid_user' );
+		}
+
+		/**
+		 * Filters the status of validation for the BP_Suggestions query.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param bool           $value Whether or not the values are valid.
+		 * @param BP_Suggestions $this  Current BP_Suggestions instance.
+		 */
+		return apply_filters( 'bp_suggestions_validate_args', true, $this );
+	}
+
+	/**
+	 * Find and return a list of suggestions that match the query.
+	 *
+	 * The return type is important. If no matches are found, an empty array must be returned.
+	 * Matches must be returned as objects in an array.
+	 *
+	 * The object format for each match must be: { 'ID': string, 'image': string, 'name': string }
+	 * For example: { 'ID': 'admin', 'image': 'http://example.com/logo.png', 'name': 'Name Surname' }
+	 *
+	 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
+	 * @since BuddyPress (2.1.0)
+	 */
+	abstract public function get_suggestions();
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-user-query.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-user-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..87392666d31587d007fef686f984b9f6893941c1
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-user-query.php
@@ -0,0 +1,777 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress User Query class.
+ *
+ * Used for querying users in a BuddyPress context, in situations where WP_User_Query won't do the trick:
+ * Member directories, the Friends component, etc.
+ *
+ * @since BuddyPress (1.7.0)
+ *
+ * @param array $query {
+ *     Query arguments. All items are optional.
+ *     @type string            $type            Determines sort order. Select from 'newest', 'active', 'online',
+ *                                              'random', 'popular', 'alphabetical'. Default: 'newest'.
+ *     @type int               $per_page Number of results to return. Default: 0 (no limit).
+ *     @type int               $page            Page offset (together with $per_page). Default: 1.
+ *     @type int               $user_id         ID of a user. If present, and if the friends component is activated,
+ *                                              results will be limited to the friends of that user. Default: 0.
+ *     @type string|bool       $search_terms    Terms to search by. Search happens across xprofile fields. Requires
+ *                                              XProfile component. Default: false.
+ *     @type string            $search_wildcard When searching with $search_terms, set where wildcards around the term
+ *                                              should be positioned. Accepts 'both', 'left', 'right'. Default: 'both'.
+ *     @type array|string|bool $include         An array or comma-separated list of user IDs to which query should
+ *                                              be limited. Default: false.
+ *     @type array|string|bool $exclude         An array or comma-separated list of user IDs that will be excluded from
+ *                                              query results. Default: false.
+ *     @type array|string|bool $user_ids        An array or comma-separated list of IDs corresponding to the users
+ *                                              that should be returned. When this parameter is passed, it will
+ *                                              override all others; BP User objects will be constructed using these
+ *                                              IDs only. Default: false.
+ *     @type array|string      $member_type     Array or comma-separated list of member types to limit results to.
+ *     @type string|bool       $meta_key        Limit results to users that have usermeta associated with this meta_key.
+ *                                              Usually used with $meta_value. Default: false.
+ *     @type string|bool       $meta_value      When used with $meta_key, limits results to users whose usermeta value
+ *                                              associated with $meta_key matches $meta_value. Default: false.
+ *     @type array             $xprofile_query  Filter results by xprofile data. Requires the xprofile component. See
+ *                                              {@see BP_XProfile_Query} for details.
+ *     @type bool              $populate_extras True if you want to fetch extra metadata
+ *                                              about returned users, such as total group and friend counts.
+ *     @type string            $count_total     Determines how BP_User_Query will do a count of total users matching
+ *                                              the other filter criteria. Default value is 'count_query', which does
+ *                                              a separate SELECT COUNT query to determine the total.
+ *                                              'sql_count_found_rows' uses SQL_COUNT_FOUND_ROWS and
+ *                                              SELECT FOUND_ROWS(). Pass an empty string to skip the total user
+ *                                              count query.
+ * }
+ */
+class BP_User_Query {
+
+	/** Variables *************************************************************/
+
+	/**
+	 * Unaltered params as passed to the constructor.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @var array
+	 */
+	public $query_vars_raw = array();
+
+	/**
+	 * Array of variables to query with.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 * @var array
+	 */
+	public $query_vars = array();
+
+	/**
+	 * List of found users and their respective data.
+	 *
+	 * @access public To allow components to manipulate them.
+	 * @since BuddyPress (1.7.0)
+	 * @var array
+	 */
+	public $results = array();
+
+	/**
+	 * Total number of found users for the current query.
+	 *
+	 * @access public To allow components to manipulate it.
+	 * @since BuddyPress (1.7.0)
+	 * @var int
+	 */
+	public $total_users = 0;
+
+	/**
+	 * List of found user IDs.
+	 *
+	 * @access public To allow components to manipulate it.
+	 * @since BuddyPress (1.7.0)
+	 * @var array
+	 */
+	public $user_ids = array();
+
+	/**
+	 * SQL clauses for the user ID query.
+	 *
+	 * @access public To allow components to manipulate it.
+	 * @since BuddyPress (1.7.0)
+	 * @var array
+	 */
+	public $uid_clauses = array();
+
+	/**
+	 * SQL table where the user ID is being fetched from.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 * @var string
+	 */
+	public $uid_table = '';
+
+	/**
+	 * SQL database column name to order by.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 * @var string
+	 */
+	public $uid_name = '';
+
+	/**
+	 * Standard response when the query should not return any rows.
+	 *
+	 * @access protected
+	 * @since BuddyPress (1.7.0)
+	 * @var string
+	 */
+	protected $no_results = array( 'join' => '', 'where' => '0 = 1' );
+
+
+	/** Methods ***************************************************************/
+
+	/**
+	 * Constructor.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string|array $query See {@link BP_User_Query}.
+	 */
+	public function __construct( $query = null ) {
+
+		// Store the raw query vars for later access
+		$this->query_vars_raw = $query;
+
+		// Allow extending classes to register action/filter hooks
+		$this->setup_hooks();
+
+		if ( ! empty( $this->query_vars_raw ) ) {
+			$this->query_vars = wp_parse_args( $this->query_vars_raw, array(
+				'type'            => 'newest',
+				'per_page'        => 0,
+				'page'            => 1,
+				'user_id'         => 0,
+				'search_terms'    => false,
+				'search_wildcard' => 'both',
+				'include'         => false,
+				'exclude'         => false,
+				'user_ids'        => false,
+				'member_type'     => '',
+				'meta_key'        => false,
+				'meta_value'      => false,
+				'xprofile_query'  => false,
+				'populate_extras' => true,
+				'count_total'     => 'count_query'
+			) );
+
+			/**
+			 * Fires before the construction of the BP_User_Query query.
+			 *
+			 * @since BuddyPress (1.7.0)
+			 *
+			 * @param BP_User_Query $this Current instance of the BP_User_Query. Passed by reference.
+			 */
+			do_action_ref_array( 'bp_pre_user_query_construct', array( &$this ) );
+
+			// Get user ids
+			// If the user_ids param is present, we skip the query
+			if ( false !== $this->query_vars['user_ids'] ) {
+				$this->user_ids = wp_parse_id_list( $this->query_vars['user_ids'] );
+			} else {
+				$this->prepare_user_ids_query();
+				$this->do_user_ids_query();
+			}
+		}
+
+		// Bail if no user IDs were found
+		if ( empty( $this->user_ids ) ) {
+			return;
+		}
+
+		// Fetch additional data. First, using WP_User_Query
+		$this->do_wp_user_query();
+
+		// Get BuddyPress specific user data
+		$this->populate_extras();
+	}
+
+	/**
+	 * Allow extending classes to set up action/filter hooks.
+	 *
+	 * When extending BP_User_Query, you may need to use some of its
+	 * internal hooks to modify the output. It's not convenient to call
+	 * add_action() or add_filter() in your class constructor, because
+	 * BP_User_Query::__construct() contains a fair amount of logic that
+	 * you may not want to override in your class. Define this method in
+	 * your own class if you need a place where your extending class can
+	 * add its hooks early in the query-building process. See
+	 * {@link BP_Group_Member_Query::setup_hooks()} for an example.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function setup_hooks() {}
+
+	/**
+	 * Prepare the query for user_ids.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	public function prepare_user_ids_query() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// Default query variables used here
+		$type         = '';
+		$per_page     = 0;
+		$page         = 1;
+		$user_id      = 0;
+		$include      = false;
+		$search_terms = false;
+		$exclude      = false;
+		$meta_key     = false;
+		$meta_value   = false;
+
+		extract( $this->query_vars );
+
+		// Setup the main SQL query container
+		$sql = array(
+			'select'  => '',
+			'where'   => array(),
+			'orderby' => '',
+			'order'   => '',
+			'limit'   => ''
+		);
+
+		/** TYPE **************************************************************/
+
+		// Determines the sort order, which means it also determines where the
+		// user IDs are drawn from (the SELECT and WHERE statements)
+		switch ( $type ) {
+
+			// 'online' query happens against the last_activity usermeta key
+			// Filter 'bp_user_query_online_interval' to modify the
+			// number of minutes used as an interval
+			case 'online' :
+				$this->uid_name = 'user_id';
+				$this->uid_table = $bp->members->table_name_last_activity;
+				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$this->uid_table} u";
+				$sql['where'][] = $wpdb->prepare( "u.component = %s AND u.type = 'last_activity'", buddypress()->members->id );
+
+				/**
+				 * Filters the threshold for activity timestamp minutes since to indicate online status.
+				 *
+				 * @since BuddyPress (1.8.0)
+				 *
+				 * @param int $value Amount of minutes for threshold. Default 15.
+				 */
+				$sql['where'][] = $wpdb->prepare( "u.date_recorded >= DATE_SUB( UTC_TIMESTAMP(), INTERVAL %d MINUTE )", apply_filters( 'bp_user_query_online_interval', 15 ) );
+				$sql['orderby'] = "ORDER BY u.date_recorded";
+				$sql['order']   = "DESC";
+
+				break;
+
+			// 'active', 'newest', and 'random' queries
+			// all happen against the last_activity usermeta key
+			case 'active' :
+			case 'newest' :
+			case 'random' :
+				$this->uid_name = 'user_id';
+				$this->uid_table = $bp->members->table_name_last_activity;
+				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$this->uid_table} u";
+				$sql['where'][] = $wpdb->prepare( "u.component = %s AND u.type = 'last_activity'", buddypress()->members->id );
+
+				if ( 'newest' == $type ) {
+					$sql['orderby'] = "ORDER BY u.user_id";
+					$sql['order'] = "DESC";
+				} elseif ( 'random' == $type ) {
+					$sql['orderby'] = "ORDER BY rand()";
+				} else {
+					$sql['orderby'] = "ORDER BY u.date_recorded";
+					$sql['order'] = "DESC";
+				}
+
+				break;
+
+			// 'popular' sorts by the 'total_friend_count' usermeta
+			case 'popular' :
+				$this->uid_name = 'user_id';
+				$this->uid_table = $wpdb->usermeta;
+				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$this->uid_table} u";
+				$sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) );
+				$sql['orderby'] = "ORDER BY CONVERT(u.meta_value, SIGNED)";
+				$sql['order']   = "DESC";
+
+				break;
+
+			// 'alphabetical' sorts depend on the xprofile setup
+			case 'alphabetical' :
+
+				// We prefer to do alphabetical sorts against the display_name field
+				// of wp_users, because the table is smaller and better indexed. We
+				// can do so if xprofile sync is enabled, or if xprofile is inactive.
+				//
+				// @todo remove need for bp_is_active() check
+				if ( ! bp_disable_profile_sync() || ! bp_is_active( 'xprofile' ) ) {
+					$this->uid_name = 'ID';
+					$this->uid_table = $wpdb->users;
+					$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$this->uid_table} u";
+					$sql['orderby'] = "ORDER BY u.display_name";
+					$sql['order']   = "ASC";
+
+				// When profile sync is disabled, alphabetical sorts must happen against
+				// the xprofile table
+				} else {
+					$this->uid_name = 'user_id';
+					$this->uid_table = $bp->profile->table_name_data;
+					$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$this->uid_table} u";
+					$sql['where'][] = $wpdb->prepare( "u.field_id = %d", bp_xprofile_fullname_field_id() );
+					$sql['orderby'] = "ORDER BY u.value";
+					$sql['order']   = "ASC";
+				}
+
+				// Alphabetical queries ignore last_activity, while BP uses last_activity
+				// to infer spam/deleted/non-activated users. To ensure that these users
+				// are filtered out, we add an appropriate sub-query.
+				$sql['where'][] = "u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE " . bp_core_get_status_sql( '' ) . " )";
+
+				break;
+
+			// Any other 'type' falls through
+			default :
+				$this->uid_name = 'ID';
+				$this->uid_table = $wpdb->users;
+				$sql['select']  = "SELECT u.{$this->uid_name} as id FROM {$this->uid_table} u";
+
+				// In this case, we assume that a plugin is
+				// handling order, so we leave those clauses
+				// blank
+
+				break;
+		}
+
+		/** WHERE *************************************************************/
+
+		// 'include' - User ids to include in the results
+		$include     = false !== $include ? wp_parse_id_list( $include ) : array();
+		$include_ids = $this->get_include_ids( $include );
+		if ( ! empty( $include_ids ) ) {
+			$include_ids    = implode( ',', wp_parse_id_list( $include_ids ) );
+			$sql['where'][] = "u.{$this->uid_name} IN ({$include_ids})";
+		}
+
+		// 'exclude' - User ids to exclude from the results
+		if ( false !== $exclude ) {
+			$exclude_ids    = implode( ',', wp_parse_id_list( $exclude ) );
+			$sql['where'][] = "u.{$this->uid_name} NOT IN ({$exclude_ids})";
+		}
+
+		// 'user_id' - When a user id is passed, limit to the friends of the user
+		// @todo remove need for bp_is_active() check
+		if ( ! empty( $user_id ) && bp_is_active( 'friends' ) ) {
+			$friend_ids = friends_get_friend_user_ids( $user_id );
+			$friend_ids = implode( ',', wp_parse_id_list( $friend_ids ) );
+
+			if ( ! empty( $friend_ids ) ) {
+				$sql['where'][] = "u.{$this->uid_name} IN ({$friend_ids})";
+
+			// If the user has no friends, the query should always
+			// return no users
+			} else {
+				$sql['where'][] = $this->no_results['where'];
+			}
+		}
+
+		/** Search Terms ******************************************************/
+
+		// 'search_terms' searches user_login and user_nicename
+		// xprofile field matches happen in bp_xprofile_bp_user_query_search()
+		if ( false !== $search_terms ) {
+			$search_terms = bp_esc_like( wp_kses_normalize_entities( $search_terms ) );
+
+			if ( $search_wildcard === 'left' ) {
+				$search_terms_nospace = '%' . $search_terms;
+				$search_terms_space   = '%' . $search_terms . ' %';
+			} elseif ( $search_wildcard === 'right' ) {
+				$search_terms_nospace =        $search_terms . '%';
+				$search_terms_space   = '% ' . $search_terms . '%';
+			} else {
+				$search_terms_nospace = '%' . $search_terms . '%';
+				$search_terms_space   = '%' . $search_terms . '%';
+			}
+
+			$sql['where']['search'] = $wpdb->prepare(
+				"u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE ( user_login LIKE %s OR user_login LIKE %s OR user_nicename LIKE %s OR user_nicename LIKE %s ) )",
+				$search_terms_nospace,
+				$search_terms_space,
+				$search_terms_nospace,
+				$search_terms_space
+			);
+		}
+
+		// Member type.
+		if ( ! empty( $member_type ) ) {
+			$member_types = array();
+
+			if ( ! is_array( $member_type ) ) {
+				$member_type = preg_split( '/[,\s+]/', $member_type );
+			}
+
+			foreach ( $member_type as $mt ) {
+				if ( ! bp_get_member_type_object( $mt ) ) {
+					continue;
+				}
+
+				$member_types[] = $mt;
+			}
+
+			if ( ! empty( $member_types ) ) {
+				$member_type_tq = new WP_Tax_Query( array(
+					array(
+						'taxonomy' => 'bp_member_type',
+						'field'    => 'name',
+						'operator' => 'IN',
+						'terms'    => $member_types,
+					),
+				) );
+
+				// Switch to the root blog, where member type taxonomies live.
+				$switched = false;
+				if ( ! bp_is_root_blog() ) {
+					switch_to_blog( bp_get_root_blog_id() );
+					$switched = true;
+				}
+
+				$member_type_sql_clauses = $member_type_tq->get_sql( 'u', $this->uid_name );
+
+				if ( $switched ) {
+					restore_current_blog();
+				}
+
+				// Grab the first term_relationships clause and convert to a subquery.
+				if ( preg_match( '/' . $wpdb->term_relationships . '\.term_taxonomy_id IN \([0-9, ]+\)/', $member_type_sql_clauses['where'], $matches ) ) {
+					$sql['where']['member_type'] = "u.{$this->uid_name} IN ( SELECT object_id FROM $wpdb->term_relationships WHERE {$matches[0]} )";
+				} elseif ( false !== strpos( $member_type_sql_clauses['where'], '0 = 1' ) ) {
+					$sql['where']['member_type'] = $this->no_results['where'];
+				}
+			}
+		}
+
+		// 'meta_key', 'meta_value' allow usermeta search
+		// To avoid global joins, do a separate query
+		if ( false !== $meta_key ) {
+			$meta_sql = $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = %s", $meta_key );
+
+			if ( false !== $meta_value ) {
+				$meta_sql .= $wpdb->prepare( " AND meta_value = %s", $meta_value );
+			}
+
+			$found_user_ids = $wpdb->get_col( $meta_sql );
+
+			if ( ! empty( $found_user_ids ) ) {
+				$sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")";
+			} else {
+				$sql['where'][] = '1 = 0';
+			}
+		}
+
+		// 'per_page', 'page' - handles LIMIT
+		if ( !empty( $per_page ) && !empty( $page ) ) {
+			$sql['limit'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
+		} else {
+			$sql['limit'] = '';
+		}
+
+		/**
+		 * Filters the clauses for the user query.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array         $sql  Array of SQL clauses to be used in the query.
+		 * @param BP_User_Query $this Current BP_User_Query instance.
+		 */
+		$sql = apply_filters_ref_array( 'bp_user_query_uid_clauses', array( $sql, &$this ) );
+
+		// Assemble the query chunks
+		$this->uid_clauses['select']  = $sql['select'];
+		$this->uid_clauses['where']   = ! empty( $sql['where'] ) ? 'WHERE ' . implode( ' AND ', $sql['where'] ) : '';
+		$this->uid_clauses['orderby'] = $sql['orderby'];
+		$this->uid_clauses['order']   = $sql['order'];
+		$this->uid_clauses['limit']   = $sql['limit'];
+
+		/**
+		 * Fires before the BP_User_Query query is made.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param BP_User_Query $this Current BP_User_Query instance. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_pre_user_query', array( &$this ) );
+	}
+
+	/**
+	 * Query for IDs of users that match the query parameters.
+	 *
+	 * Perform a database query to specifically get only user IDs, using
+	 * existing query variables set previously in the constructor.
+	 *
+	 * Also used to quickly perform user total counts.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	public function do_user_ids_query() {
+		global $wpdb;
+
+		// If counting using SQL_CALC_FOUND_ROWS, set it up here
+		if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) {
+			$this->uid_clauses['select'] = str_replace( 'SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $this->uid_clauses['select'] );
+		}
+
+		// Get the specific user ids
+		$this->user_ids = $wpdb->get_col( "{$this->uid_clauses['select']} {$this->uid_clauses['where']} {$this->uid_clauses['orderby']} {$this->uid_clauses['order']} {$this->uid_clauses['limit']}" );
+
+		// Get the total user count
+		if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) {
+
+			/**
+			 * Filters the found user SQL statements before query.
+			 *
+			 * If "sql_calc_found_rows" is the provided count_total query var
+			 * then the value will be "SELECT FOUND_ROWS()". Otherwise it will
+			 * use a "SELECT COUNT()" query statement.
+			 *
+			 * @since BuddyPress (1.7.0)
+			 *
+			 * @param string        $value SQL statement to select FOUND_ROWS().
+			 * @param BP_User_Query $this  Current BP_User_Query instance.
+			 */
+			$this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "SELECT FOUND_ROWS()", $this ) );
+		} elseif ( 'count_query' == $this->query_vars['count_total'] ) {
+			$count_select      = preg_replace( '/^SELECT.*?FROM (\S+) u/', "SELECT COUNT(u.{$this->uid_name}) FROM $1 u", $this->uid_clauses['select'] );
+
+			/** This filter is documented in bp-core/classes/class-bp-user-query.php */
+			$this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "{$count_select} {$this->uid_clauses['where']}", $this ) );
+		}
+	}
+
+	/**
+	 * Use WP_User_Query() to pull data for the user IDs retrieved in the main query.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	public function do_wp_user_query() {
+		$fields = array( 'ID', 'user_login', 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_activation_key', 'user_status', 'display_name' );
+
+		if ( is_multisite() ) {
+			$fields[] = 'spam';
+			$fields[] = 'deleted';
+		}
+
+		/**
+		 * Filters the WP User Query arguments before passing into the class.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array         $value Array of arguments for the user query.
+		 * @param BP_User_Query $this  Current BP_User_Query instance.
+		 */
+		$wp_user_query = new WP_User_Query( apply_filters( 'bp_wp_user_query_args', array(
+
+			// Relevant
+			'fields'      => $fields,
+			'include'     => $this->user_ids,
+
+			// Overrides
+			'blog_id'     => 0,    // BP does not require blog roles
+			'count_total' => false // We already have a count
+
+		), $this ) );
+
+		// WP_User_Query doesn't cache the data it pulls from wp_users,
+		// and it does not give us a way to save queries by fetching
+		// only uncached users. However, BP does cache this data, so
+		// we set it here.
+		foreach ( $wp_user_query->results as $u ) {
+			wp_cache_set( 'bp_core_userdata_' . $u->ID, $u, 'bp' );
+		}
+
+		// We calculate total_users using a standalone query, except
+		// when a whitelist of user_ids is passed to the constructor.
+		// This clause covers the latter situation, and ensures that
+		// pagination works when querying by $user_ids.
+		if ( empty( $this->total_users ) ) {
+			$this->total_users = count( $wp_user_query->results );
+		}
+
+		// Reindex for easier matching
+		$r = array();
+		foreach ( $wp_user_query->results as $u ) {
+			$r[ $u->ID ] = $u;
+		}
+
+		// Match up to the user ids from the main query
+		foreach ( $this->user_ids as $uid ) {
+			if ( isset( $r[ $uid ] ) ) {
+				$this->results[ $uid ] = $r[ $uid ];
+
+				// The BP template functions expect an 'id'
+				// (as opposed to 'ID') property
+				$this->results[ $uid ]->id = $uid;
+			}
+		}
+	}
+
+	/**
+	 * Fetch the IDs of users to put in the IN clause of the main query.
+	 *
+	 * By default, returns the value passed to it
+	 * ($this->query_vars['include']). Having this abstracted into a
+	 * standalone method means that extending classes can override the
+	 * logic, parsing together their own user_id limits with the 'include'
+	 * ids passed to the class constructor. See {@link BP_Group_Member_Query}
+	 * for an example.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param array Sanitized array of user IDs, as passed to the 'include'
+	 *        parameter of the class constructor.
+	 * @return array The list of users to which the main query should be
+	 *         limited.
+	 */
+	public function get_include_ids( $include = array() ) {
+		return $include;
+	}
+
+	/**
+	 * Perform a database query to populate any extra metadata we might need.
+	 *
+	 * Different components will hook into the 'bp_user_query_populate_extras'
+	 * action to loop in the things they want.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @global WPDB $wpdb Global WordPress database access object.
+	 */
+	public function populate_extras() {
+		global $wpdb;
+
+		// Bail if no users
+		if ( empty( $this->user_ids ) || empty( $this->results ) ) {
+			return;
+		}
+
+		// Bail if the populate_extras flag is set to false
+		// In the case of the 'popular' sort type, we force
+		// populate_extras to true, because we need the friend counts
+		if ( 'popular' == $this->query_vars['type'] ) {
+			$this->query_vars['populate_extras'] = 1;
+		}
+
+		if ( ! (bool) $this->query_vars['populate_extras'] ) {
+			return;
+		}
+
+		// Turn user ID's into a query-usable, comma separated value
+		$user_ids_sql = implode( ',', wp_parse_id_list( $this->user_ids ) );
+
+		/**
+		 * Allows users to independently populate custom extras.
+		 *
+		 * Note that anything you add here should query using $user_ids_sql, to
+		 * avoid running multiple queries per user in the loop.
+		 *
+		 * Two BuddyPress components currently do this:
+		 * - XProfile: To override display names.
+		 * - Friends:  To set whether or not a user is the current users friend.
+		 *
+		 * @see bp_xprofile_filter_user_query_populate_extras()
+		 * @see bp_friends_filter_user_query_populate_extras()
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param BP_User_Query $this         Current BP_User_Query instance.
+		 * @param string        $user_ids_sql Comma-separated string of user IDs.
+		 */
+		do_action_ref_array( 'bp_user_query_populate_extras', array( $this, $user_ids_sql ) );
+
+		// Fetch last_active data from the activity table
+		$last_activities = BP_Core_User::get_last_activity( $this->user_ids );
+
+		// Set a last_activity value for each user, even if it's empty
+		foreach ( $this->results as $user_id => $user ) {
+			$user_last_activity = isset( $last_activities[ $user_id ] ) ? $last_activities[ $user_id ]['date_recorded'] : '';
+			$this->results[ $user_id ]->last_activity = $user_last_activity;
+		}
+
+		// Fetch usermeta data
+		// We want the three following pieces of info from usermeta:
+		// - friend count
+		// - latest update
+		$total_friend_count_key = bp_get_user_meta_key( 'total_friend_count' );
+		$bp_latest_update_key   = bp_get_user_meta_key( 'bp_latest_update'   );
+
+		// total_friend_count must be set for each user, even if its
+		// value is 0
+		foreach ( $this->results as $uindex => $user ) {
+			$this->results[$uindex]->total_friend_count = 0;
+		}
+
+		// Create, prepare, and run the separate usermeta query
+		$user_metas = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, meta_key, meta_value FROM {$wpdb->usermeta} WHERE meta_key IN (%s,%s) AND user_id IN ({$user_ids_sql})", $total_friend_count_key, $bp_latest_update_key ) );
+
+		// The $members_template global expects the index key to be different
+		// from the meta_key in some cases, so we rejig things here.
+		foreach ( $user_metas as $user_meta ) {
+			switch ( $user_meta->meta_key ) {
+				case $total_friend_count_key :
+					$key = 'total_friend_count';
+					break;
+
+				case $bp_latest_update_key :
+					$key = 'latest_update';
+					break;
+			}
+
+			if ( isset( $this->results[ $user_meta->user_id ] ) ) {
+				$this->results[ $user_meta->user_id ]->{$key} = $user_meta->meta_value;
+			}
+		}
+
+		// When meta_key or meta_value have been passed to the query,
+		// fetch the resulting values for use in the template functions
+		if ( ! empty( $this->query_vars['meta_key'] ) ) {
+			$meta_sql = array(
+				'select' => "SELECT user_id, meta_key, meta_value",
+				'from'   => "FROM $wpdb->usermeta",
+				'where'  => $wpdb->prepare( "WHERE meta_key = %s", $this->query_vars['meta_key'] )
+			);
+
+			if ( false !== $this->query_vars['meta_value'] ) {
+				$meta_sql['where'] .= $wpdb->prepare( " AND meta_value = %s", $this->query_vars['meta_value'] );
+			}
+
+			$metas = $wpdb->get_results( "{$meta_sql['select']} {$meta_sql['from']} {$meta_sql['where']}" );
+
+			if ( ! empty( $metas ) ) {
+				foreach ( $metas as $meta ) {
+					if ( isset( $this->results[ $meta->user_id ] ) ) {
+						$this->results[ $meta->user_id ]->meta_key = $meta->meta_key;
+
+						if ( ! empty( $meta->meta_value ) ) {
+							$this->results[ $meta->user_id ]->meta_value = $meta->meta_value;
+						}
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-nav-menu-checklist.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-nav-menu-checklist.php
new file mode 100644
index 0000000000000000000000000000000000000000..9a6d96dd81d5f90ac99feff3e030f210e413a2ec
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-nav-menu-checklist.php
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Create a set of BuddyPress-specific links for use in the Menus admin UI.
+ *
+ * Borrowed heavily from {@link Walker_Nav_Menu_Checklist}, but modified so as not
+ * to require an actual post type or taxonomy, and to force certain CSS classes
+ *
+ * @since BuddyPress (1.9.0)
+ */
+class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
+
+	/**
+	 * Constructor.
+	 *
+	 * @see Walker_Nav_Menu::__construct() for a description of parameters.
+	 *
+	 * @param array $fields See {@link Walker_Nav_Menu::__construct()}.
+	 */
+	public function __construct( $fields = false ) {
+		if ( $fields ) {
+			$this->db_fields = $fields;
+		}
+	}
+
+	/**
+	 * Create the markup to start a tree level.
+	 *
+	 * @see Walker_Nav_Menu::start_lvl() for description of parameters.
+	 *
+	 * @param string $output See {@Walker_Nav_Menu::start_lvl()}.
+	 * @param int $depth See {@Walker_Nav_Menu::start_lvl()}.
+	 * @param array $args See {@Walker_Nav_Menu::start_lvl()}.
+	 */
+	public function start_lvl( &$output, $depth = 0, $args = array() ) {
+		$indent = str_repeat( "\t", $depth );
+		$output .= "\n$indent<ul class='children'>\n";
+	}
+
+	/**
+	 * Create the markup to end a tree level.
+	 *
+	 * @see Walker_Nav_Menu::end_lvl() for description of parameters.
+	 *
+	 * @param string $output See {@Walker_Nav_Menu::end_lvl()}.
+	 * @param int $depth See {@Walker_Nav_Menu::end_lvl()}.
+	 * @param array $args See {@Walker_Nav_Menu::end_lvl()}.
+	 */
+	public function end_lvl( &$output, $depth = 0, $args = array() ) {
+		$indent = str_repeat( "\t", $depth );
+		$output .= "\n$indent</ul>";
+	}
+
+	/**
+	 * Create the markup to start an element.
+	 *
+	 * @see Walker::start_el() for description of parameters.
+	 *
+	 * @param string $output Passed by reference. Used to append additional
+	 *        content.
+	 * @param object $item Menu item data object.
+	 * @param int $depth Depth of menu item. Used for padding.
+	 * @param object $args See {@Walker::start_el()}.
+	 * @param int $id See {@Walker::start_el()}.
+	 */
+	function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
+		global $_nav_menu_placeholder;
+
+		$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
+		$possible_object_id = isset( $item->post_type ) && 'nav_menu_item' == $item->post_type ? $item->object_id : $_nav_menu_placeholder;
+		$possible_db_id = ( ! empty( $item->ID ) ) && ( 0 < $possible_object_id ) ? (int) $item->ID : 0;
+
+		$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
+
+		$output .= $indent . '<li>';
+		$output .= '<label class="menu-item-title">';
+		$output .= '<input type="checkbox" class="menu-item-checkbox';
+
+		if ( property_exists( $item, 'label' ) ) {
+			$title = $item->label;
+		}
+
+		$output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="'. esc_attr( $item->object_id ) .'" /> ';
+		$output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
+		$output .= '</label>';
+
+		if ( empty( $item->url ) ) {
+			$item->url = $item->guid;
+		}
+
+		if ( ! in_array( array( 'bp-menu', 'bp-'. $item->post_excerpt .'-nav' ), $item->classes ) ) {
+			$item->classes[] = 'bp-menu';
+			$item->classes[] = 'bp-'. $item->post_excerpt .'-nav';
+		}
+
+		// Menu item hidden fields
+		$output .= '<input type="hidden" class="menu-item-db-id" name="menu-item[' . $possible_object_id . '][menu-item-db-id]" value="' . $possible_db_id . '" />';
+		$output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="'. esc_attr( $item->object ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="'. esc_attr( $item->menu_item_parent ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="custom" />';
+		$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="'. esc_attr( $item->title ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="'. esc_attr( $item->url ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="'. esc_attr( $item->target ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="'. esc_attr( $item->attr_title ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="'. esc_attr( implode( ' ', $item->classes ) ) .'" />';
+		$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="'. esc_attr( $item->xfn ) .'" />';
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-nav-menu.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-nav-menu.php
new file mode 100644
index 0000000000000000000000000000000000000000..77c0fab4eeeb3fab5695af71e9621faee3df2f3a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-nav-menu.php
@@ -0,0 +1,214 @@
+<?php
+/**
+ * Core component classes.
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Create HTML list of BP nav items.
+ *
+ * @since BuddyPress (1.7.0)
+ */
+class BP_Walker_Nav_Menu extends Walker_Nav_Menu {
+
+	/**
+	 * Description of fields indexes for building markup.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 * @var array
+	 */
+	var $db_fields = array( 'id' => 'css_id', 'parent' => 'parent' );
+
+	/**
+	 * Tree type.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 * @var string
+	 */
+	var $tree_type = array();
+
+	/**
+	 * Display array of elements hierarchically.
+	 *
+	 * This method is almost identical to the version in {@link Walker::walk()}.
+	 * The only change is on one line which has been commented. An IF was
+	 * comparing 0 to a non-empty string which was preventing child elements
+	 * being grouped under their parent menu element.
+	 *
+	 * This caused a problem for BuddyPress because our primary/secondary
+	 * navigations don't have a unique numerical ID that describes a
+	 * hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and
+	 * those have ID/post_parent.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @see Walker::walk()
+	 *
+	 * @param array $elements See {@link Walker::walk()}.
+	 * @param int $max_depth See {@link Walker::walk()}.
+	 * @return string See {@link Walker::walk()}.
+	 */
+	public function walk( $elements, $max_depth ) {
+		$func_args = func_get_args();
+
+		$args   = array_slice( $func_args, 2 );
+		$output = '';
+
+		if ( $max_depth < -1 ) // invalid parameter
+			return $output;
+
+		if ( empty( $elements ) ) // nothing to walk
+			return $output;
+
+		$parent_field = $this->db_fields['parent'];
+
+		// flat display
+		if ( -1 == $max_depth ) {
+
+			$empty_array = array();
+			foreach ( $elements as $e )
+				$this->display_element( $e, $empty_array, 1, 0, $args, $output );
+
+			return $output;
+		}
+
+		/*
+		 * need to display in hierarchical order
+		 * separate elements into two buckets: top level and children elements
+		 * children_elements is two dimensional array, eg.
+		 * children_elements[10][] contains all sub-elements whose parent is 10.
+		 */
+		$top_level_elements = array();
+		$children_elements  = array();
+
+		foreach ( $elements as $e ) {
+			// BuddyPress: changed '==' to '==='. This is the only change from version in Walker::walk().
+			if ( 0 === $e->$parent_field )
+				$top_level_elements[] = $e;
+			else
+				$children_elements[$e->$parent_field][] = $e;
+		}
+
+		/*
+		 * when none of the elements is top level
+		 * assume the first one must be root of the sub elements
+		 */
+		if ( empty( $top_level_elements ) ) {
+
+			$first              = array_slice( $elements, 0, 1 );
+			$root               = $first[0];
+			$top_level_elements = array();
+			$children_elements  = array();
+
+			foreach ( $elements as $e ) {
+				if ( $root->$parent_field == $e->$parent_field )
+					$top_level_elements[] = $e;
+				else
+					$children_elements[$e->$parent_field][] = $e;
+			}
+		}
+
+		foreach ( $top_level_elements as $e )
+			$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
+
+		/*
+		 * if we are displaying all levels, and remaining children_elements is not empty,
+		 * then we got orphans, which should be displayed regardless
+		 */
+		if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
+			$empty_array = array();
+
+			foreach ( $children_elements as $orphans )
+				foreach ( $orphans as $op )
+					$this->display_element( $op, $empty_array, 1, 0, $args, $output );
+		 }
+
+		 return $output;
+	}
+
+	/**
+	 * Display the current <li> that we are on.
+	 *
+	 * @see Walker::start_el() for complete description of parameters .
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $output Passed by reference. Used to append
+	 *        additional content.
+	 * @param object $item Menu item data object.
+	 * @param int $depth Depth of menu item. Used for padding. Optional,
+	 *        defaults to 0.
+	 * @param array $args Optional. See {@link Walker::start_el()}.
+	 * @param int $current_page Menu item ID. Optional.
+	 */
+	public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
+		// If we're someway down the tree, indent the HTML with the appropriate number of tabs
+		$indent = $depth ? str_repeat( "\t", $depth ) : '';
+
+		/**
+		 * Filters the classes to be added to the nav menu markup.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array  $value Array of classes to be added.
+		 * @param object $item  Menu item data object.
+		 * @param array  $args  Array of arguments for the item.
+		 */
+		$class_names = join( ' ', apply_filters( 'bp_nav_menu_css_class', array_filter( $item->class ), $item, $args ) );
+		$class_names = ! empty( $class_names ) ? ' class="' . esc_attr( $class_names ) . '"' : '';
+
+		// Add HTML ID
+		$id = sanitize_html_class( $item->css_id . '-personal-li' );  // Backpat with BP pre-1.7
+
+		/**
+		 * Filters the value to be used for the nav menu ID attribute.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $id   ID attribute to be added to the menu item.
+		 * @param object $item Menu item data object.
+		 * @param array  $args Array of arguments for the item.
+		 */
+		$id = apply_filters( 'bp_nav_menu_item_id', $id, $item, $args );
+		$id = ! empty( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
+
+		// Opening tag; closing tag is handled in Walker_Nav_Menu::end_el().
+		$output .= $indent . '<li' . $id . $class_names . '>';
+
+		// Add href attribute
+		$attributes = ! empty( $item->link ) ? ' href="' . esc_url( $item->link ) . '"' : '';
+
+		// Construct the link
+		$item_output = $args->before;
+		$item_output .= '<a' . $attributes . '>';
+
+		/**
+		 * Filters the link text to be added to the item output.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $name  Item text to be applied.
+		 * @param int    $value Post ID the title is for.
+		 */
+		$item_output .= $args->link_before . apply_filters( 'the_title', $item->name, 0 ) . $args->link_after;
+		$item_output .= '</a>';
+		$item_output .= $args->after;
+
+		/**
+		 * Filters the final result for the menu item.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $item_output Constructed output for the menu item to append to output.
+		 * @param object $item        Menu item data object.
+		 * @param int    $depth       Depth of menu item. Used for padding.
+		 * @param array  $args        Array of arguments for the item.
+		 */
+		$output .= apply_filters( 'bp_walker_nav_menu_start_el', $item_output, $item, $depth, $args );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css
index 2b1f9d96a9616e329efdcdfad74963075fd392b8..9122430e717e92371269b6984c7afa300a497972 100644
--- a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
 #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px -5px 0 10px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{right:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759B;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css
index 52901166ed33a8a90ff12b8b1868611d4a110132..a27c0e84536dc4f304e7556c508463d25f19e915 100644
--- a/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css
+++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
 #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications,#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count{background:#21759B;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:700;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..04a3223999f5a36516ba7e4e8b5b72cb62abdd3e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css
@@ -0,0 +1,389 @@
+div.bp-avatar-status {
+	clear: both;
+	margin: 1em 0;
+}
+
+div.bp-avatar-status p.updated {
+	display: block;
+	padding: 10px 15px;
+}
+
+div.bp-avatar-status p.success {
+	background-color: #efc;
+	border: 1px solid #591;
+	color: #250;
+}
+
+div.bp-avatar-status p.error {
+	background-color: #fdc;
+	border: 1px solid #a00;
+	color: #800;
+}
+
+div.bp-avatar-status .bp-progress {
+	background: none;
+	border: 1px solid #d1d1d1;
+	float: left;
+	height: 22px;
+	line-height: 2em;
+	margin: 6px 0 0 10px;
+	margin-bottom: 2px;
+	padding: 0;
+	overflow: hidden;
+	width: 200px;
+}
+
+div.bp-avatar-status .bp-bar {
+	background-color: #c3ff88;
+	width: 0;
+	height: 100%;
+	z-index: 9;
+}
+
+.bp-uploader-progress div.error {
+	background-color: #fdc;
+	border: 1px solid #a00;
+	color: #800;
+	display: block;
+	font-size: 90%;
+	padding: 10px 15px;
+}
+
+#bp-uploader-warning, #bp-webcam-message p.warning {
+	background-color: #ffd;
+	border: 1px solid #cb2;
+	color: #440;
+	display: block;
+	font-size: 90%;
+	margin: 1em 0;
+	padding: 10px 15px;
+}
+
+div.bp-avatar-nav {
+	background: transparent;
+	clear: both;
+	margin: 10px 0 10px;
+	overflow: hidden;
+}
+
+.avatar-nav-items {
+	margin: 0;
+	padding: 0;
+}
+
+.bp-avatar-nav .avatar-nav-items li.avatar-nav-item {
+	float: right !important;
+	margin: 0;
+	list-style: none;
+}
+
+.avatar-nav-items li a {
+	display: block;
+	padding: 5px 10px;
+	text-decoration: none;
+}
+
+.bp-avatar-nav	ul:before,
+.bp-avatar-nav	ul:after {
+	content: " ";
+	display: table;
+}
+
+.bp-avatar-nav	ul:after {
+	clear: both;
+}
+
+.bp-avatar-nav	ul {
+	border-bottom: 1px solid #ccc;
+	margin-bottom: 10px;
+}
+
+.bp-avatar-nav	ul.avatar-nav-items li.current {
+	border: 1px solid #ccc;
+	border-bottom-color: #fff;
+	border-top-right-radius: 4px;
+	border-top-left-radius: 4px;
+	margin-bottom: -1px;
+}
+
+.bp-avatar-nav	li.current a {
+	background: none;
+	color: inherit;
+	font-weight: bold;
+	opacity: 0.8;
+	outline: 0;
+}
+
+#drag-drop-area {
+	border: 4px dashed #bbb;
+	height: 200px;
+}
+
+.drag-drop.drag-over #drag-drop-area {
+	border-color: #83b4d8;
+}
+
+.drag-drop-inside p {
+	display: none;
+}
+
+.drag-drop-inside p.drag-drop-buttons {
+	margin-top: 80px;
+	text-align: center;
+}
+
+.drag-drop .drag-drop-inside p.drag-drop-buttons {
+	margin: auto;
+	text-align: auto;
+}
+
+.drag-drop #drag-drop-area {
+	display: table;
+	height: 100%;
+	width: 100%;
+}
+
+.drag-drop .drag-drop-inside {
+	display: table-cell;
+	padding: 40px 0;
+	text-align: center;
+	vertical-align: middle;
+}
+
+.drag-drop .drag-drop-inside p,
+.drag-drop-inside p.drag-drop-buttons {
+	display: block;
+}
+
+.drag-drop .drag-drop-inside p {
+	color: #aaa;
+	font-size: 110%;
+	margin: 5px 0;
+	text-align: center;
+}
+
+.drag-drop-inside p.drag-drop-info {margin-top: 0;}
+
+#avatar-to-crop {
+	margin: 0 auto 20px ;
+	text-align: right;
+}
+
+#bp-webcam-avatar #avatar-to-crop {
+	float: right;
+	margin: 0 0 20px;
+}
+
+#avatar-to-crop .jcrop-holder {
+	margin: 0 auto;
+}
+
+.avatar-crop-management {
+	clear: right;
+	overflow: hidden;
+	padding-top: 20px;
+	text-align: center;
+}
+
+#bp-webcam-avatar .avatar-crop-management {
+	clear: none;
+	float: none;
+	overflow: visible;
+	padding-top: 0;
+	width: auto;
+}
+
+#avatar-crop-pane {
+	margin: 0 auto;
+	overflow: hidden;
+}
+
+#bp-webcam-avatar #avatar-to-crop {
+	border: 1px solid #eee;
+	max-width: 100%;
+	width: 100%;
+}
+
+@media screen and (min-width: 801px) {
+	#bp-webcam-avatar #avatar-to-crop {
+		max-width: 64%;
+		width: 64%;
+	}
+}
+
+#avatar-crop-actions a {
+	display: block;
+}
+
+#bp-webcam-avatar #avatar-crop-actions {
+	float: right;
+	margin: 0 0 20px 0;
+	width: 50%;
+}
+
+#avatar-crop-actions a.button {
+	margin-top: 10px;
+}
+
+#bp-webcam-avatar #avatar-crop-actions a.button {
+	display: block;
+	margin: 0 0 5px;
+	padding: 4px 0;
+	width: 100%;
+}
+
+#avatar-to-crop img,
+#avatar-crop-pane img,
+#avatar-crop-pane canvas,
+#avatar-upload-form img,
+#create-group-form img,
+#group-settings-form img {
+	border: none !important;
+	max-width: none !important;
+}
+
+#bp-webcam-avatar video {
+	float: right;
+	margin-bottom: 0;
+	max-width: 100%;
+	width: 100%;
+	-webkit-transform: scaleX(-1);
+	transform: scaleX(-1);
+}
+
+#bp-webcam-avatar #avatar-crop-pane {
+	border: 2px dashed #bbb;
+	clear: right;
+	float: left;
+	margin: 0  0 10px 40px;
+	overflow: hidden;
+}
+
+/**
+*  Users can define avatar constants with new dimension values
+*  If they do, we'll ensure the layouts preserved by enforcing a max width
+*  that matches bp default settings.
+*/
+#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+	max-width: 150px;
+	max-height: 150px;
+}
+
+#avatar-crop-pane canvas {
+	height: auto;
+	width: 100%;
+	max-width: 100%;
+}
+
+.group-avatar .bp-avatar .avatar-crop-management {
+	margin-right: 0;
+	padding-top: 0;
+	width: auto;
+}
+
+.bp-avatar .item {
+	overflow:hidden;
+}
+
+.bp-avatar .avatar-crop-management.adjust {
+	float: right;
+	clear: none;
+	padding-top: 0;
+}
+
+.bp-avatar #avatar-to-crop.adjust {
+	float: right;
+	margin-left: 20px;
+}
+
+@media screen and (max-width: 480px) {
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions,
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+		float: none;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+		margin: 0 auto 10px;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions  {
+		width: auto;
+	}
+
+}
+
+@media screen and (min-width: 801px) {
+
+	#bp-webcam-avatar .avatar-crop-management {
+		clear: none;
+		float: left;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+		float: none;
+		margin: 0 auto 10px;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions {
+		float: right;
+		width: 100%;
+	}
+
+}
+
+/** Admin Profile **/
+body.users_page_bp-profile-edit.modal-open #TB_ajaxContent,
+body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent {
+	height: 95% !important;
+	width: 95% !important;
+}
+
+body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,
+body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning,
+body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,
+body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning {
+	display: block;
+	padding: 10px 15px;
+}
+
+.wp-admin #TB_window .bp-avatar #avatar-to-crop {
+	float: right;
+	margin: 0;
+}
+.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop {
+	margin-bottom: 20px;
+}
+@media screen and (min-width: 783px) {
+
+	.wp-admin #TB_window .bp-avatar .avatar-crop-management {
+		clear: none;
+		float: right;
+		margin-right: 20px;
+		padding-top: 0;
+		text-align: center;
+
+	}
+
+}
+
+.wp-admin #TB_window .bp-avatar #avatar-to-crop video {
+		width: 100%;
+	}
+
+.wp-admin #TB_window .bp-avatar .avatar-crop-management a.button {
+	height: auto;
+	line-height: inherit;
+}
+
+@media screen and (min-width: 810px) {
+	.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop {
+		max-width: none;
+		width: 76%;
+	}
+
+	.wp-admin #TB_window #bp-webcam-avatar .avatar-crop-management {
+		max-width: none;
+		width: auto;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.min.css b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.min.css
new file mode 100644
index 0000000000000000000000000000000000000000..fe6cd24b3ffb91ad85ff8ab8f88f394a0f0e269c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.min.css
@@ -0,0 +1 @@
+div.bp-avatar-status{clear:both;margin:1em 0}div.bp-avatar-status p.updated{display:block;padding:10px 15px}div.bp-avatar-status p.success{background-color:#efc;border:1px solid #591;color:#250}div.bp-avatar-status p.error{background-color:#fdc;border:1px solid #a00;color:#800}div.bp-avatar-status .bp-progress{background:0 0;border:1px solid #d1d1d1;float:left;height:22px;line-height:2em;margin:6px 0 2px 10px;padding:0;overflow:hidden;width:200px}div.bp-avatar-status .bp-bar{background-color:#c3ff88;width:0;height:100%;z-index:9}.bp-uploader-progress div.error{background-color:#fdc;border:1px solid #a00;color:#800;display:block;font-size:90%;padding:10px 15px}#bp-uploader-warning,#bp-webcam-message p.warning{background-color:#ffd;border:1px solid #cb2;color:#440;display:block;font-size:90%;margin:1em 0;padding:10px 15px}div.bp-avatar-nav{background:0 0;clear:both;margin:10px 0;overflow:hidden}.avatar-nav-items{margin:0;padding:0}.bp-avatar-nav .avatar-nav-items li.avatar-nav-item{float:right!important;margin:0;list-style:none}.avatar-nav-items li a{display:block;padding:5px 10px;text-decoration:none}.bp-avatar-nav ul:after,.bp-avatar-nav ul:before{content:" ";display:table}.bp-avatar-nav ul:after{clear:both}.bp-avatar-nav ul{border-bottom:1px solid #ccc;margin-bottom:10px}.bp-avatar-nav ul.avatar-nav-items li.current{border:1px solid #ccc;border-bottom-color:#fff;border-top-right-radius:4px;border-top-left-radius:4px;margin-bottom:-1px}.bp-avatar-nav li.current a{background:0 0;color:inherit;font-weight:700;opacity:.8;outline:0}#drag-drop-area{border:4px dashed #bbb;height:200px}.drag-drop.drag-over #drag-drop-area{border-color:#83b4d8}.drag-drop-inside p{display:none}.drag-drop-inside p.drag-drop-buttons{margin-top:80px;text-align:center}.drag-drop .drag-drop-inside p.drag-drop-buttons{margin:auto;text-align:auto}.drag-drop #drag-drop-area{display:table;height:100%;width:100%}.drag-drop .drag-drop-inside{display:table-cell;padding:40px 0;text-align:center;vertical-align:middle}.drag-drop .drag-drop-inside p,.drag-drop-inside p.drag-drop-buttons{display:block}.drag-drop .drag-drop-inside p{color:#aaa;font-size:110%;margin:5px 0;text-align:center}.drag-drop-inside p.drag-drop-info{margin-top:0}#avatar-to-crop{margin:0 auto 20px;text-align:right}#bp-webcam-avatar #avatar-to-crop{float:right;margin:0 0 20px}#avatar-to-crop .jcrop-holder{margin:0 auto}.avatar-crop-management{clear:right;overflow:hidden;padding-top:20px;text-align:center}#bp-webcam-avatar .avatar-crop-management{clear:none;float:none;overflow:visible;padding-top:0;width:auto}#avatar-crop-pane{margin:0 auto;overflow:hidden}#bp-webcam-avatar #avatar-to-crop{border:1px solid #eee;max-width:100%;width:100%}@media screen and (min-width:801px){#bp-webcam-avatar #avatar-to-crop{max-width:64%;width:64%}}#avatar-crop-actions a{display:block}#bp-webcam-avatar #avatar-crop-actions{float:right;margin:0 0 20px;width:50%}#avatar-crop-actions a.button{margin-top:10px}#bp-webcam-avatar #avatar-crop-actions a.button{display:block;margin:0 0 5px;padding:4px 0;width:100%}#avatar-crop-pane canvas,#avatar-crop-pane img,#avatar-to-crop img,#avatar-upload-form img,#create-group-form img,#group-settings-form img{border:none!important;max-width:none!important}#bp-webcam-avatar video{float:right;margin-bottom:0;max-width:100%;width:100%;-webkit-transform:scaleX(-1);transform:scaleX(-1)}#bp-webcam-avatar #avatar-crop-pane{border:2px dashed #bbb;clear:right;float:left;margin:0 0 10px 40px;overflow:hidden}#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{max-width:150px;max-height:150px}#avatar-crop-pane canvas{height:auto;width:100%;max-width:100%}.group-avatar .bp-avatar .avatar-crop-management{margin-right:0;padding-top:0;width:auto}.bp-avatar .item{overflow:hidden}.bp-avatar .avatar-crop-management.adjust{float:right;clear:none;padding-top:0}.bp-avatar #avatar-to-crop.adjust{float:right;margin-left:20px}@media screen and (max-width:480px){#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions,#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{float:none}#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{margin:0 auto 10px}#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions{width:auto}}@media screen and (min-width:801px){#bp-webcam-avatar .avatar-crop-management{clear:none;float:left}#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{float:none;margin:0 auto 10px}#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions{float:right;width:100%}}body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent{height:95%!important;width:95%!important}body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning{display:block;padding:10px 15px}.wp-admin #TB_window .bp-avatar #avatar-to-crop{float:right;margin:0}.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop{margin-bottom:20px}@media screen and (min-width:783px){.wp-admin #TB_window .bp-avatar .avatar-crop-management{clear:none;float:right;margin-right:20px;padding-top:0;text-align:center}}.wp-admin #TB_window .bp-avatar #avatar-to-crop video{width:100%}.wp-admin #TB_window .bp-avatar .avatar-crop-management a.button{height:auto;line-height:inherit}@media screen and (min-width:810px){.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop{max-width:none;width:76%}.wp-admin #TB_window #bp-webcam-avatar .avatar-crop-management{max-width:none;width:auto}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/avatar.css b/wp-content/plugins/buddypress/bp-core/css/avatar.css
new file mode 100644
index 0000000000000000000000000000000000000000..d3434e46e43dd5f7ecfd580e1bd6510b80f7d85f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/avatar.css
@@ -0,0 +1,389 @@
+div.bp-avatar-status {
+	clear: both;
+	margin: 1em 0;
+}
+
+div.bp-avatar-status p.updated {
+	display: block;
+	padding: 10px 15px;
+}
+
+div.bp-avatar-status p.success {
+	background-color: #efc;
+	border: 1px solid #591;
+	color: #250;
+}
+
+div.bp-avatar-status p.error {
+	background-color: #fdc;
+	border: 1px solid #a00;
+	color: #800;
+}
+
+div.bp-avatar-status .bp-progress {
+	background: none;
+	border: 1px solid #d1d1d1;
+	float: right;
+	height: 22px;
+	line-height: 2em;
+	margin: 6px 10px 0 0;
+	margin-bottom: 2px;
+	padding: 0;
+	overflow: hidden;
+	width: 200px;
+}
+
+div.bp-avatar-status .bp-bar {
+	background-color: #c3ff88;
+	width: 0;
+	height: 100%;
+	z-index: 9;
+}
+
+.bp-uploader-progress div.error {
+	background-color: #fdc;
+	border: 1px solid #a00;
+	color: #800;
+	display: block;
+	font-size: 90%;
+	padding: 10px 15px;
+}
+
+#bp-uploader-warning, #bp-webcam-message p.warning {
+	background-color: #ffd;
+	border: 1px solid #cb2;
+	color: #440;
+	display: block;
+	font-size: 90%;
+	margin: 1em 0;
+	padding: 10px 15px;
+}
+
+div.bp-avatar-nav {
+	background: transparent;
+	clear: both;
+	margin: 10px 0 10px;
+	overflow: hidden;
+}
+
+.avatar-nav-items {
+	margin: 0;
+	padding: 0;
+}
+
+.bp-avatar-nav .avatar-nav-items li.avatar-nav-item {
+	float: left !important;
+	margin: 0;
+	list-style: none;
+}
+
+.avatar-nav-items li a {
+	display: block;
+	padding: 5px 10px;
+	text-decoration: none;
+}
+
+.bp-avatar-nav	ul:before,
+.bp-avatar-nav	ul:after {
+	content: " ";
+	display: table;
+}
+
+.bp-avatar-nav	ul:after {
+	clear: both;
+}
+
+.bp-avatar-nav	ul {
+	border-bottom: 1px solid #ccc;
+	margin-bottom: 10px;
+}
+
+.bp-avatar-nav	ul.avatar-nav-items li.current {
+	border: 1px solid #ccc;
+	border-bottom-color: #fff;
+	border-top-left-radius: 4px;
+	border-top-right-radius: 4px;
+	margin-bottom: -1px;
+}
+
+.bp-avatar-nav	li.current a {
+	background: none;
+	color: inherit;
+	font-weight: bold;
+	opacity: 0.8;
+	outline: 0;
+}
+
+#drag-drop-area {
+	border: 4px dashed #bbb;
+	height: 200px;
+}
+
+.drag-drop.drag-over #drag-drop-area {
+	border-color: #83b4d8;
+}
+
+.drag-drop-inside p {
+	display: none;
+}
+
+.drag-drop-inside p.drag-drop-buttons {
+	margin-top: 80px;
+	text-align: center;
+}
+
+.drag-drop .drag-drop-inside p.drag-drop-buttons {
+	margin: auto;
+	text-align: auto;
+}
+
+.drag-drop #drag-drop-area {
+	display: table;
+	height: 100%;
+	width: 100%;
+}
+
+.drag-drop .drag-drop-inside {
+	display: table-cell;
+	padding: 40px 0;
+	text-align: center;
+	vertical-align: middle;
+}
+
+.drag-drop .drag-drop-inside p,
+.drag-drop-inside p.drag-drop-buttons {
+	display: block;
+}
+
+.drag-drop .drag-drop-inside p {
+	color: #aaa;
+	font-size: 110%;
+	margin: 5px 0;
+	text-align: center;
+}
+
+.drag-drop-inside p.drag-drop-info {margin-top: 0;}
+
+#avatar-to-crop {
+	margin: 0 auto 20px ;
+	text-align: left;
+}
+
+#bp-webcam-avatar #avatar-to-crop {
+	float: left;
+	margin: 0 0 20px;
+}
+
+#avatar-to-crop .jcrop-holder {
+	margin: 0 auto;
+}
+
+.avatar-crop-management {
+	clear: left;
+	overflow: hidden;
+	padding-top: 20px;
+	text-align: center;
+}
+
+#bp-webcam-avatar .avatar-crop-management {
+	clear: none;
+	float: none;
+	overflow: visible;
+	padding-top: 0;
+	width: auto;
+}
+
+#avatar-crop-pane {
+	margin: 0 auto;
+	overflow: hidden;
+}
+
+#bp-webcam-avatar #avatar-to-crop {
+	border: 1px solid #eee;
+	max-width: 100%;
+	width: 100%;
+}
+
+@media screen and (min-width: 801px) {
+	#bp-webcam-avatar #avatar-to-crop {
+		max-width: 64%;
+		width: 64%;
+	}
+}
+
+#avatar-crop-actions a {
+	display: block;
+}
+
+#bp-webcam-avatar #avatar-crop-actions {
+	float: left;
+	margin: 0 0 20px 0;
+	width: 50%;
+}
+
+#avatar-crop-actions a.button {
+	margin-top: 10px;
+}
+
+#bp-webcam-avatar #avatar-crop-actions a.button {
+	display: block;
+	margin: 0 0 5px;
+	padding: 4px 0;
+	width: 100%;
+}
+
+#avatar-to-crop img,
+#avatar-crop-pane img,
+#avatar-crop-pane canvas,
+#avatar-upload-form img,
+#create-group-form img,
+#group-settings-form img {
+	border: none !important;
+	max-width: none !important;
+}
+
+#bp-webcam-avatar video {
+	float: left;
+	margin-bottom: 0;
+	max-width: 100%;
+	width: 100%;
+	-webkit-transform: scaleX(-1);
+	transform: scaleX(-1);
+}
+
+#bp-webcam-avatar #avatar-crop-pane {
+	border: 2px dashed #bbb;
+	clear: left;
+	float: right;
+	margin: 0  40px 10px 0;
+	overflow: hidden;
+}
+
+/**
+*  Users can define avatar constants with new dimension values
+*  If they do, we'll ensure the layouts preserved by enforcing a max width
+*  that matches bp default settings.
+*/
+#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+	max-width: 150px;
+	max-height: 150px;
+}
+
+#avatar-crop-pane canvas {
+	height: auto;
+	width: 100%;
+	max-width: 100%;
+}
+
+.group-avatar .bp-avatar .avatar-crop-management {
+	margin-left: 0;
+	padding-top: 0;
+	width: auto;
+}
+
+.bp-avatar .item {
+	overflow:hidden;
+}
+
+.bp-avatar .avatar-crop-management.adjust {
+	float: left;
+	clear: none;
+	padding-top: 0;
+}
+
+.bp-avatar #avatar-to-crop.adjust {
+	float: left;
+	margin-right: 20px;
+}
+
+@media screen and (max-width: 480px) {
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions,
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+		float: none;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+		margin: 0 auto 10px;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions  {
+		width: auto;
+	}
+
+}
+
+@media screen and (min-width: 801px) {
+
+	#bp-webcam-avatar .avatar-crop-management {
+		clear: none;
+		float: right;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane {
+		float: none;
+		margin: 0 auto 10px;
+	}
+
+	#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions {
+		float: left;
+		width: 100%;
+	}
+
+}
+
+/** Admin Profile **/
+body.users_page_bp-profile-edit.modal-open #TB_ajaxContent,
+body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent {
+	height: 95% !important;
+	width: 95% !important;
+}
+
+body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,
+body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning,
+body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,
+body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning {
+	display: block;
+	padding: 10px 15px;
+}
+
+.wp-admin #TB_window .bp-avatar #avatar-to-crop {
+	float: left;
+	margin: 0;
+}
+.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop {
+	margin-bottom: 20px;
+}
+@media screen and (min-width: 783px) {
+
+	.wp-admin #TB_window .bp-avatar .avatar-crop-management {
+		clear: none;
+		float: left;
+		margin-left: 20px;
+		padding-top: 0;
+		text-align: center;
+
+	}
+
+}
+
+.wp-admin #TB_window .bp-avatar #avatar-to-crop video {
+		width: 100%;
+	}
+
+.wp-admin #TB_window .bp-avatar .avatar-crop-management a.button {
+	height: auto;
+	line-height: inherit;
+}
+
+@media screen and (min-width: 810px) {
+	.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop {
+		max-width: none;
+		width: 76%;
+	}
+
+	.wp-admin #TB_window #bp-webcam-avatar .avatar-crop-management {
+		max-width: none;
+		width: auto;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-core/css/avatar.min.css b/wp-content/plugins/buddypress/bp-core/css/avatar.min.css
new file mode 100644
index 0000000000000000000000000000000000000000..3ddbbd4568c5f9a158bc9830aac184d48722525e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/css/avatar.min.css
@@ -0,0 +1 @@
+div.bp-avatar-status{clear:both;margin:1em 0}div.bp-avatar-status p.updated{display:block;padding:10px 15px}div.bp-avatar-status p.success{background-color:#efc;border:1px solid #591;color:#250}div.bp-avatar-status p.error{background-color:#fdc;border:1px solid #a00;color:#800}div.bp-avatar-status .bp-progress{background:0 0;border:1px solid #d1d1d1;float:right;height:22px;line-height:2em;margin:6px 10px 2px 0;padding:0;overflow:hidden;width:200px}div.bp-avatar-status .bp-bar{background-color:#c3ff88;width:0;height:100%;z-index:9}.bp-uploader-progress div.error{background-color:#fdc;border:1px solid #a00;color:#800;display:block;font-size:90%;padding:10px 15px}#bp-uploader-warning,#bp-webcam-message p.warning{background-color:#ffd;border:1px solid #cb2;color:#440;display:block;font-size:90%;margin:1em 0;padding:10px 15px}div.bp-avatar-nav{background:0 0;clear:both;margin:10px 0;overflow:hidden}.avatar-nav-items{margin:0;padding:0}.bp-avatar-nav .avatar-nav-items li.avatar-nav-item{float:left!important;margin:0;list-style:none}.avatar-nav-items li a{display:block;padding:5px 10px;text-decoration:none}.bp-avatar-nav ul:after,.bp-avatar-nav ul:before{content:" ";display:table}.bp-avatar-nav ul:after{clear:both}.bp-avatar-nav ul{border-bottom:1px solid #ccc;margin-bottom:10px}.bp-avatar-nav ul.avatar-nav-items li.current{border:1px solid #ccc;border-bottom-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;margin-bottom:-1px}.bp-avatar-nav li.current a{background:0 0;color:inherit;font-weight:700;opacity:.8;outline:0}#drag-drop-area{border:4px dashed #bbb;height:200px}.drag-drop.drag-over #drag-drop-area{border-color:#83b4d8}.drag-drop-inside p{display:none}.drag-drop-inside p.drag-drop-buttons{margin-top:80px;text-align:center}.drag-drop .drag-drop-inside p.drag-drop-buttons{margin:auto;text-align:auto}.drag-drop #drag-drop-area{display:table;height:100%;width:100%}.drag-drop .drag-drop-inside{display:table-cell;padding:40px 0;text-align:center;vertical-align:middle}.drag-drop .drag-drop-inside p,.drag-drop-inside p.drag-drop-buttons{display:block}.drag-drop .drag-drop-inside p{color:#aaa;font-size:110%;margin:5px 0;text-align:center}.drag-drop-inside p.drag-drop-info{margin-top:0}#avatar-to-crop{margin:0 auto 20px;text-align:left}#bp-webcam-avatar #avatar-to-crop{float:left;margin:0 0 20px}#avatar-to-crop .jcrop-holder{margin:0 auto}.avatar-crop-management{clear:left;overflow:hidden;padding-top:20px;text-align:center}#bp-webcam-avatar .avatar-crop-management{clear:none;float:none;overflow:visible;padding-top:0;width:auto}#avatar-crop-pane{margin:0 auto;overflow:hidden}#bp-webcam-avatar #avatar-to-crop{border:1px solid #eee;max-width:100%;width:100%}@media screen and (min-width:801px){#bp-webcam-avatar #avatar-to-crop{max-width:64%;width:64%}}#avatar-crop-actions a{display:block}#bp-webcam-avatar #avatar-crop-actions{float:left;margin:0 0 20px;width:50%}#avatar-crop-actions a.button{margin-top:10px}#bp-webcam-avatar #avatar-crop-actions a.button{display:block;margin:0 0 5px;padding:4px 0;width:100%}#avatar-crop-pane canvas,#avatar-crop-pane img,#avatar-to-crop img,#avatar-upload-form img,#create-group-form img,#group-settings-form img{border:none!important;max-width:none!important}#bp-webcam-avatar video{float:left;margin-bottom:0;max-width:100%;width:100%;-webkit-transform:scaleX(-1);transform:scaleX(-1)}#bp-webcam-avatar #avatar-crop-pane{border:2px dashed #bbb;clear:left;float:right;margin:0 40px 10px 0;overflow:hidden}#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{max-width:150px;max-height:150px}#avatar-crop-pane canvas{height:auto;width:100%;max-width:100%}.group-avatar .bp-avatar .avatar-crop-management{margin-left:0;padding-top:0;width:auto}.bp-avatar .item{overflow:hidden}.bp-avatar .avatar-crop-management.adjust{float:left;clear:none;padding-top:0}.bp-avatar #avatar-to-crop.adjust{float:left;margin-right:20px}@media screen and (max-width:480px){#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions,#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{float:none}#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{margin:0 auto 10px}#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions{width:auto}}@media screen and (min-width:801px){#bp-webcam-avatar .avatar-crop-management{clear:none;float:right}#bp-webcam-avatar .avatar-crop-management #avatar-crop-pane{float:none;margin:0 auto 10px}#bp-webcam-avatar .avatar-crop-management #avatar-crop-actions{float:left;width:100%}}body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent{height:95%!important;width:95%!important}body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.updated,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning{display:block;padding:10px 15px}.wp-admin #TB_window .bp-avatar #avatar-to-crop{float:left;margin:0}.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop{margin-bottom:20px}@media screen and (min-width:783px){.wp-admin #TB_window .bp-avatar .avatar-crop-management{clear:none;float:left;margin-left:20px;padding-top:0;text-align:center}}.wp-admin #TB_window .bp-avatar #avatar-to-crop video{width:100%}.wp-admin #TB_window .bp-avatar .avatar-crop-management a.button{height:auto;line-height:inherit}@media screen and (min-width:810px){.wp-admin #TB_window .bp-avatar #bp-webcam-avatar #avatar-to-crop{max-width:none;width:76%}.wp-admin #TB_window #bp-webcam-avatar .avatar-crop-management{max-width:none;width:auto}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css
index 00b4c74f1aae32a28438058172a33a53c5026ce2..1d900bd50285493d4c1635eb915d9f692815a024 100644
--- a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;right:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;right:10px}#wp-admin-bar a img{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#wp-admin-bar li.no-arrow a{padding-left:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:right;font-weight:700;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 0 0 11px;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-left:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;left:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;right:-999em;margin-right:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:right;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{right:-999em}#wp-admin-bar img.avatar{float:right;margin-left:8px}#wp-admin-bar span.activity{display:block;margin-right:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-right:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
+#admin-bar-logo,#wp-admin-bar li a{font-size:11px;text-decoration:none}body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;right:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;right:10px}#wp-admin-bar a img,#wp-admin-bar li.alt{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:right}#wp-admin-bar li a{padding:7px 15px;color:#eee}#wp-admin-bar li.no-arrow a{padding-left:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:right;font-weight:700;padding:5px 8px;margin:0;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 0 0 11px;float:right;position:relative;background:url(../images/admin-menu-arrow.gif) 12% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-left:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;left:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;right:-999em;margin-right:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:right;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{right:-999em}#wp-admin-bar img.avatar{float:right;margin-left:8px}#wp-admin-bar span.activity{display:block;margin-right:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-right:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css b/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css
index dae88e048e1a7b590b53aaba988700d26e9bac29..da95dbbde0731e0518afbb5987bef4ede0fb28e2 100644
--- a/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css
+++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:none}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:left;font-weight:700;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 11px 0 0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
+#admin-bar-logo,#wp-admin-bar li a{font-size:11px;text-decoration:none}body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img,#wp-admin-bar li.alt{border:none}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px;color:#eee}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li.hover,#wp-admin-bar li:hover{position:static}#admin-bar-logo{float:left;font-weight:700;padding:5px 8px;margin:0;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0 11px 0 0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat}#wp-admin-bar ul li.no-arrow{background:0 0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li:hover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,.1);-moz-border-radius:3px;-webkit-border-radius:0 0 3px 3px;-moz-border-radius-topleft:0;-moz-border-radius-topright:0}#wp-admin-bar ul li>ul{border-top:none}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li:hover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li ul li.sfhover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li:hover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar li.sfhover ul li ul,#wp-admin-bar ul li:hover ul ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
index b1931b58cb0eb4ce6c889de8b6bdb2e529580793..5c2471f2df79f1fe51c596210b5ff99dd3218afc 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Loader ********************************************************************/
 
@@ -449,7 +449,7 @@ function bp_is_friend_requests() {
 
 /**
  * Checks to see if a component's URL should be in the root, not under a member page:
- * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group
+ * eg: http://example.com/groups/the-group NOT http://example.com/members/andy/groups/the-group
  * You should be using bp_is_root_component().
  *
  * @deprecated BuddyPress (1.5)
@@ -561,8 +561,8 @@ function bp_dtheme_deprecated() {
 
 	if ( !function_exists( 'bp_dtheme_add_blog_comments_js' ) ) :
 	/**
-	 * In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
-	 * As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
+	 * In BuddyPress 1.2.x, this added the JavaScript needed for blog comment replies.
+	 * As of 1.5.x, we recommend that you enqueue the comment-reply JavaScript in your theme's header.php.
 	 *
 	 * @deprecated BuddyPress (1.5)
 	 * @deprecated Enqueue the comment-reply script in your theme's header.php.
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php
index 4330b090c9db3dc3b99e0038603595a2a10181c1..8b5a5f04a3d3f98001196839a551bd6541f66920 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php
@@ -9,7 +9,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Toolbar functions *********************************************************/
 
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php
index 20f12d786fddf6037efbea69eb06812f8c8f37b6..34cac6b39137dac918fc96848503cc8b7a3eed0a 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the BuddyPress maintenance mode
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php
index 04a92af05b496b6e2cb1f3fb7ebb72528d8f4876..d2c0f42f8827b2b454b27bf1e41f9db6c2942f4a 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Add a notification for a specific user, from a specific component.
@@ -212,7 +212,7 @@ function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $c
 /**
  * Delete all notifications for a user.
  *
- * Used when clearing out all notifications for a user, whene deleted or spammed
+ * Used when clearing out all notifications for a user, when deleted or spammed
  *
  * @deprecated Deprecated since BuddyPress 1.9.0. Use
  *             bp_notifications_delete_notifications_from_user() instead.
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.0.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.0.php
index 18608d2fec92a642404ca197e3726e4dd7e57960..32cebede11b0d750c36cf6c2bb968ba2f3c5946b 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/2.0.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.0.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * @deprecated BuddyPress (2.0.0)
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.1.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.1.php
index 9ad16e9991d14007b119e58577fd69b555c96bb7..edc12d5efb1c6d4d2a96165eb2343c3385d77221 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/2.1.php
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.1.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( ! defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register (not enqueue) scripts that used to be used by BuddyPress.
@@ -21,12 +21,6 @@ function bp_core_register_deprecated_scripts() {
 
 	$scripts = apply_filters( 'bp_core_register_deprecated_scripts', array(
 
-		// Core
-		'bp-jquery-scroll-to' => array(
-			'file'         => "{$url}jquery-scroll-to{$min}.js",
-			'dependencies' => array( 'jquery' ),
-		),
-
 		// Messages
 		'bp-jquery-autocomplete'    => array(
 			'file'          => "{$url}autocomplete/jquery.autocomplete{$min}.js",
@@ -91,18 +85,17 @@ add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_styles', 1 );
  * @since BuddyPress (1.0.0)
  * @deprecated BuddyPress (2.1.0)
  *
- * @global object $bp The BuddyPress global settings object.
- *
  * @return bool|null Returns false on failure. Otherwise echoes the menu item.
  */
 function bp_adminbar_blogs_menu() {
-	global $bp;
 
-	if ( !is_user_logged_in() || !bp_is_active( 'blogs' ) )
+	if ( ! is_user_logged_in() || ! bp_is_active( 'blogs' ) ) {
 		return false;
+	}
 
-	if ( !is_multisite() )
+	if ( ! is_multisite() ) {
 		return false;
+	}
 
 	$blogs = wp_cache_get( 'bp_blogs_of_user_' . bp_loggedin_user_id() . '_inc_hidden', 'bp' );
 	if ( empty( $blogs ) ) {
@@ -143,7 +136,7 @@ function bp_adminbar_blogs_menu() {
 
 		if ( bp_blog_signup_enabled() ) {
 			echo '<li' . $alt . '>';
-			echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
+			echo '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
 			echo '</li>';
 		}
 
@@ -170,7 +163,7 @@ function bp_admin_setting_callback_force_buddybar() {
 
 
 /**
- * Sanitization for _bp_force_buddyvar
+ * Sanitization for _bp_force_buddybar
  *
  * If upgraded to 1.6 and you chose to keep the BuddyBar, a checkbox asks if you want to switch to
  * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function
@@ -191,13 +184,15 @@ function bp_admin_sanitize_callback_force_buddybar( $value = false ) {
  * @deprecated BuddyPress (2.1.0)
  */
 function bp_core_admin_bar() {
-	global $bp;
+	$bp = buddypress();
 
-	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR )
+	if ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) {
 		return false;
+	}
 
-	if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
+	if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) {
 		return false;
+	}
 
 	$bp->doing_admin_bar = true;
 
@@ -237,14 +232,16 @@ function bp_adminbar_logo() {
  */
 function bp_adminbar_login_menu() {
 
-	if ( is_user_logged_in() )
+	if ( is_user_logged_in() ) {
 		return false;
+	}
 
 	echo '<li class="bp-login no-arrow"><a href="' . wp_login_url() . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
 
 	// Show "Sign Up" link if user registrations are allowed
-	if ( bp_get_signup_allowed() )
+	if ( bp_get_signup_allowed() ) {
 		echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
+	}
 }
 
 /**
@@ -255,10 +252,11 @@ function bp_adminbar_login_menu() {
  * @return bool|null Returns false on failure.
  */
 function bp_adminbar_account_menu() {
-	global $bp;
+	$bp = buddypress();
 
-	if ( !$bp->bp_nav || !is_user_logged_in() )
+	if ( empty( $bp->bp_nav ) || ! is_user_logged_in() ) {
 		return false;
+	}
 
 	echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
 	echo __( 'My Account', 'buddypress' ) . '</a>';
@@ -269,8 +267,9 @@ function bp_adminbar_account_menu() {
 	foreach( (array) $bp->bp_nav as $nav_item ) {
 		$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
 
-		if ( -1 == $nav_item['position'] )
+		if ( -1 == $nav_item['position'] ) {
 			continue;
+		}
 
 		echo '<li' . $alt . '>';
 		echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
@@ -283,11 +282,13 @@ function bp_adminbar_account_menu() {
 				$link = $subnav_item['link'];
 				$name = $subnav_item['name'];
 
-				if ( bp_displayed_user_domain() )
+				if ( bp_displayed_user_domain() ) {
 					$link = str_replace( bp_displayed_user_domain(), bp_loggedin_user_domain(), $subnav_item['link'] );
+				}
 
-				if ( isset( $bp->displayed_user->userdata->user_login ) )
+				if ( isset( $bp->displayed_user->userdata->user_login ) ) {
 					$name = str_replace( $bp->displayed_user->userdata->user_login, $bp->loggedin_user->userdata->user_login, $subnav_item['name'] );
+				}
 
 				$alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
 				echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $link . '">' . $name . '</a></li>';
@@ -339,17 +340,17 @@ function bp_adminbar_random_menu() {
 	<li class="align-right" id="bp-adminbar-visitrandom-menu">
 		<a href="#"><?php _e( 'Visit', 'buddypress' ) ?></a>
 		<ul class="random-list">
-			<li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '?random-member' ?>" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
+			<li><a href="<?php bp_members_directory_permalink(); ?>?random-member" rel="nofollow"><?php _e( 'Random Member', 'buddypress' ) ?></a></li>
 
 			<?php if ( bp_is_active( 'groups' ) ) : ?>
 
-				<li class="alt"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '?random-group' ?>"  rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
+				<li class="alt"><a href="<?php bp_groups_directory_permalink(); ?>?random-group"  rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
 
 			<?php endif; ?>
 
 			<?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
 
-				<li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '?random-blog' ?>"  rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
+				<li><a href="<?php bp_blogs_directory_permalink(); ?>?random-blog"  rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
 
 			<?php endif; ?>
 
@@ -367,8 +368,10 @@ function bp_adminbar_random_menu() {
  * @deprecated BuddyPress (2.1.0)
  */
 function bp_core_load_buddybar_css() {
-	if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) )
+
+	if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) ) {
 		return;
+	}
 
 	$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 
@@ -393,18 +396,18 @@ add_action( 'bp_init', 'bp_core_load_buddybar_css' );
  * @since BuddyPress (1.0.0)
  *
  * @deprecated BuddyPress (2.1.0)
- *
- * @global BuddyPress $bp
  */
 function bp_groups_adminbar_admin_menu() {
-	global $bp;
+	$bp = buddypress();
 
-	if ( empty( $bp->groups->current_group ) )
+	if ( empty( $bp->groups->current_group ) ) {
 		return false;
+	}
 
 	// Only group admins and site admins can see this menu
-	if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() )
-		return false; ?>
+	if ( !current_user_can( 'edit_users' ) && !bp_current_user_can( 'bp_moderate' ) && !bp_is_item_admin() ) {
+		return false;
+	} ?>
 
 	<li id="bp-adminbar-adminoptions-menu">
 		<a href="<?php bp_groups_action_link( 'admin' ); ?>"><?php _e( 'Admin Options', 'buddypress' ); ?></a>
@@ -470,12 +473,14 @@ function bp_adminbar_authors_menu() {
 	global $wpdb;
 
 	// Only for multisite
-	if ( !is_multisite() )
+	if ( ! is_multisite() ) {
 		return false;
+	}
 
 	// Hide on root blog
-	if ( $wpdb->blogid == bp_get_root_blog_id() || !bp_is_active( 'blogs' ) )
+	if ( bp_is_root_blog( $wpdb->blogid ) || ! bp_is_active( 'blogs' ) ) {
 		return false;
+	}
 
 	$blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid );
 	$authors     = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" );
@@ -489,7 +494,9 @@ function bp_adminbar_authors_menu() {
 		echo '<ul class="author-list">';
 		foreach( (array) $authors as $author ) {
 			$caps = maybe_unserialize( $author->caps );
-			if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) continue;
+			if ( isset( $caps['subscriber'] ) || isset( $caps['contributor'] ) ) {
+				continue;
+			}
 
 			echo '<li>';
 			echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">';
@@ -521,12 +528,14 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
 function bp_members_adminbar_admin_menu() {
 
 	// Only show if viewing a user
-	if ( !bp_displayed_user_id() )
+	if ( ! bp_displayed_user_id() ) {
 		return false;
+	}
 
 	// Don't show this menu to non site admins or if you're viewing your own profile
-	if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() )
-		return false; ?>
+	if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) {
+		return false;
+	} ?>
 
 	<li id="bp-adminbar-adminoptions-menu">
 
@@ -569,7 +578,10 @@ function bp_notifications_buddybar_menu() {
 	echo '<li id="bp-adminbar-notifications-menu"><a href="' . esc_url( bp_loggedin_user_domain() ) . '">';
 	_e( 'Notifications', 'buddypress' );
 
-	if ( $notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) ) : ?>
+	$notification_count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
+	$notifications      = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() );
+
+	if ( ! empty( $notification_count ) ) : ?>
 		<span><?php echo bp_core_number_format( $notification_count ); ?></span>
 	<?php
 	endif;
@@ -577,7 +589,7 @@ function bp_notifications_buddybar_menu() {
 	echo '</a>';
 	echo '<ul>';
 
-	if ( $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ) ) {
+	if ( ! empty( $notifications ) ) {
 		$counter = 0;
 		for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
 			$alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
@@ -625,7 +637,7 @@ function bp_blogs_get_subdomain_base() {
 }
 
 /**
- * Alledgedly output an avatar upload form, but it hasn't done that since 2009.
+ * Allegedly output an avatar upload form, but it hasn't done that since 2009.
  *
  * @since BuddyPress (1.0.0)
  * @deprecated BuddyPress (2.1.0)
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php
new file mode 100644
index 0000000000000000000000000000000000000000..6adc75d734abdc903eb09cfe0e730f74742fc041
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php
@@ -0,0 +1,116 @@
+<?php
+/**
+ * Deprecated functions
+ *
+ * @package BuddyPress
+ * @subpackage Core
+ * @deprecated 2.2.0
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Detect a change in post status, and initiate an activity update if necessary.
+ *
+ * Posts get new activity updates when (a) they are being published, and (b)
+ * they have not already been published. This enables proper posting for
+ * regular posts as well as scheduled posts, while preventing post bumping.
+ *
+ * See #4090, #3746, #2546 for background.
+ *
+ * @since BuddyPress (2.0.0)
+ * @deprecated BuddyPress (2.2.0)
+ *
+ * @todo Support untrashing better
+ *
+ * @param string $new_status New status for the post.
+ * @param string $old_status Old status for the post.
+ * @param object $post Post data.
+ */
+function bp_blogs_catch_transition_post_status( $new_status, $old_status, $post ) {
+	_deprecated_function( __FUNCTION__, '2.2', 'bp_activity_catch_transition_post_type_status()' );
+	bp_activity_catch_transition_post_type_status( $new_status, $old_status, $post );
+}
+
+/**
+ * Record a new blog post in the BuddyPress activity stream.
+ *
+ * @deprecated BuddyPress (2.2.0)
+ *
+ * @param int $post_id ID of the post being recorded.
+ * @param object $post The WP post object passed to the 'save_post' action.
+ * @param int $user_id Optional. The user to whom the activity item will be
+ *        associated. Defaults to the post_author.
+ * @return bool|null Returns false on failure.
+ */
+function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) {
+	_deprecated_function( __FUNCTION__, '2.2', 'bp_activity_post_type_publish()' );
+	bp_activity_post_type_publish( $post_id, $post, $user_id );
+}
+
+/**
+ * Updates a blog post's corresponding activity entry during a post edit.
+ *
+ * @since BuddyPress (2.0.0)
+ * @deprecated BuddyPress (2.2.0)
+ *
+ * @see bp_blogs_catch_transition_post_status()
+ *
+ * @param WP_Post $post
+ */
+function bp_blogs_update_post( $post ) {
+	_deprecated_function( __FUNCTION__, '2.2', 'bp_activity_post_type_update()' );
+	bp_activity_post_type_update( $post );
+}
+
+/**
+ * Clear cache when a new blog is created.
+ *
+ * @since BuddyPress (1.0.0)
+ * @deprecated BuddyPress (2.2.0)
+ *
+ * @param BP_Blogs_Blog $recorded_blog_obj The recorded blog, passed by
+ *        'bp_blogs_new_blog'.
+ */
+function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) {
+	_deprecated_function( __FUNCTION__, '2.2', 'bp_blogs_clear_blog_object_cache()' );
+	bp_blogs_clear_blog_object_cache( false, $recorded_blog_obj->user_id );
+}
+
+/**
+ * Format 'new_member' activity actions.
+ *
+ * @since BuddyPress (2.0.0)
+ * @deprecated BuddyPress (2.2.0)
+ *
+ * @param string $action Static activity action.
+ * @param object $activity Activity object.
+ * @return string
+ */
+function bp_xprofile_format_activity_action_new_member( $action, $activity ) {
+	_deprecated_function( __FUNCTION__, '2.2', 'bp_members_format_activity_action_new_member()' );
+
+	$action = apply_filters( 'bp_xprofile_format_activity_action_new_member', $action, $activity );
+	return bp_members_format_activity_action_new_member( $action, $activity );
+}
+
+/**
+ * Add 'bp' to global group of network wide cachable objects.
+ *
+ * @since BuddyPress (1.1)
+ * @deprecated BuddyPress (2.2.0)
+ */
+function bp_core_add_global_group() {
+	_deprecated_function( __FUNCTION__, '2.2', 'This function has no replacement' );
+}
+
+/**
+ * Add a piece of message metadata.
+ *
+ * @deprecated BuddyPress (2.2.2)
+ */
+function bp_message_add_meta( $message_id, $meta_key, $meta_value, $unique = false ) {
+	_deprecated_function( __FUNCTION__, '2.3.0', 'bp_messages_add_meta()' );
+	return bp_messages_add_meta( $message_id, $meta_key, $meta_value, $unique );
+}
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php
new file mode 100644
index 0000000000000000000000000000000000000000..70854494c557a9c5ec451b65c42b764613d3cc74
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Deprecated functions.
+ *
+ * @deprecated 2.3.0
+ */
+
+// Exit if accessed directly.
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Return the referrer URL without the http(s)://
+ *
+ * @deprecated BuddyPress (2.3.0)
+ *
+ * @return string The referrer URL.
+ */
+function bp_core_referrer() {
+	_deprecated_function( __FUNCTION__, '2.3.0', 'bp_get_referer_path()' );
+	$referer = explode( '/', wp_get_referer() );
+	unset( $referer[0], $referer[1], $referer[2] );
+	return implode( '/', $referer );
+}
+
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.min.css b/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.min.css
index 7c0fe0a88c2dc452808ed3d06ba835449e57af92..dfc07fad0ca575eb9153c2610e7c007e86d90df0 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
 .ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.ac_results ul{width:100%;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-left:5px}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:right;margin:0 0 4px 5px;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px;background:#FFF9DF;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-right:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb.min.css b/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb.min.css
index 76c1cfb3a226b0df77c413f65584a00f3946bd61..7f552188b11647123542b6be1d10b0c44838ce6e 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb.min.css
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/css/autocomplete/jquery.autocompletefb.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
 .ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ac_results ul{width:100%;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-right:5px}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px;background:#FFF9DF;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.js b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.js
index b3116293773e1e0a970c57eeca41fb8b3b6b659c..aabee6aa008c8e99ec5f5f539baff8a19ca71182 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.js
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.js
@@ -326,7 +326,7 @@ $.Autocompleter = function(input, options) {
 					q: lastWord(term),
 					limit: options.max,
 					action: 'messages_autocomplete_results',
-					'cookie': encodeURIComponent(document.cookie)
+					'cookie': getAutocompleteCookies()
 				}, extraParams),
 				success: function(data) {
 					var parsed = options.parse && options.parse(data) || parse(data);
@@ -361,6 +361,29 @@ $.Autocompleter = function(input, options) {
 		jQuery('#send-to-input').removeClass('loading');
 	};
 
+	/* Returns a querystring of BP cookies (cookies beginning with 'bp-') */
+	function getAutocompleteCookies() {
+		var allCookies = document.cookie.split(';'),  // get all cookies and split into an array
+			bpCookies      = {},
+			cookiePrefix   = 'bp-',
+			i, cookie, delimiter, name, value;
+
+		// loop through cookies
+		for (i = 0; i < allCookies.length; i++) {
+			cookie    = allCookies[i];
+			delimiter = cookie.indexOf('=');
+			name      = jq.trim( unescape( cookie.slice(0, delimiter) ) );
+			value     = unescape( cookie.slice(delimiter + 1) );
+
+			// if BP cookie, store it
+			if ( name.indexOf(cookiePrefix) === 0 ) {
+				bpCookies[name] = value;
+			}
+		}
+
+		// returns BP cookies as querystring
+		return encodeURIComponent( jq.param(bpCookies) );
+	}
 };
 
 $.Autocompleter.defaults = {
@@ -727,4 +750,4 @@ $.Autocompleter.Selection = function(field, start, end) {
 	field.focus();
 };
 
-})(jQuery);
\ No newline at end of file
+})(jQuery);
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js
index 78bee3388006eb65536a3b6432d135bc7ae7d4d1..010199ebf6339ef5e6b39a706a64fa89783926eb 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocomplete.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-!function(a){a.fn.extend({autocomplete:function(b,c){var d="string"==typeof b;return c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c),c.highlight=c.highlight||function(a){return a},this.each(function(){new a.Autocompleter(this,c)})},result:function(a){return this.bind("result",a)},search:function(a){return this.trigger("search",[a])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(a){return this.trigger("setOptions",[a])},unautocomplete:function(){return this.trigger("unautocomplete")}}),a.Autocompleter=function(b,c){function d(){var a=w.selected();if(!a)return!1;var b=a.result;if(s=b,c.multiple){var d=f(r.val());d.length>1&&(b=d.slice(0,d.length-1).join(c.multipleSeparator)+c.multipleSeparator+b),b+=c.multipleSeparator}return r.val(b),j(),r.trigger("result",[a.data,a.value]),!0}function e(a,b){if(p==q.DEL)return void w.hide();var d=r.val();(b||d!=s)&&(s=d,d=g(d),d.length>=c.minChars?(r.addClass(c.loadingClass),jQuery("#send-to-input").addClass("loading"),c.matchCase||(d=d.toLowerCase()),l(d,k,j)):(n(),w.hide()))}function f(b){if(!b)return[""];var d=b.split(a.trim(c.multipleSeparator)),e=[];return a.each(d,function(b,c){a.trim(c)&&(e[b]=a.trim(c))}),e}function g(a){if(!c.multiple)return a;var b=f(a);return b[b.length-1]}function h(d,e){c.autoFill&&g(r.val()).toLowerCase()==d.toLowerCase()&&8!=p&&(r.val(r.val()+e.substring(g(s).length)),a.Autocompleter.Selection(b,s.length,s.length+e.length))}function i(){clearTimeout(o),o=setTimeout(j,200)}function j(){w.hide(),clearTimeout(o),n(),c.mustMatch&&r.search(function(a){a||r.val("")})}function k(a,b){if(b&&b.length&&u){n(),w.display(b,a);var c=b[0].value.split(";");b.value=c[0],h(a,b.value),w.show()}else j()}function l(d,e,f){c.matchCase||(d=d.toLowerCase());var h=t.load(d);if(h&&h.length)e(d,h);else if("string"==typeof c.url&&c.url.length>0){var i={};a.each(c.extraParams,function(a,b){i[a]="function"==typeof b?b():b}),a.ajax({mode:"abort",port:"autocomplete"+b.name,dataType:c.dataType,url:c.url,data:a.extend({q:g(d),limit:c.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},i),success:function(a){var b=c.parse&&c.parse(a)||m(a);t.add(d,b),e(d,b)}})}else f(d)}function m(b){for(var d=[],e=b.split("\n"),f=0;f<e.length;f++){var g=a.trim(e[f]);g&&(g=g.split("|"),d[d.length]={data:g,value:g[0],result:c.formatResult&&c.formatResult(g,g[0])||g[0]})}return d}function n(){r.removeClass(c.loadingClass),jQuery("#send-to-input").removeClass("loading")}var o,p,q={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},r=a(b).attr("autocomplete","off").addClass(c.inputClass),s="",t=a.Autocompleter.Cache(c),u=0,v={mouseDownOnSelect:!1},w=a.Autocompleter.Select(c,b,d,v);r.keydown(function(b){switch(p=b.keyCode,b.keyCode){case q.UP:b.preventDefault(),w.visible()?w.prev():e(0,!0);break;case q.DOWN:b.preventDefault(),w.visible()?w.next():e(0,!0);break;case q.PAGEUP:b.preventDefault(),w.visible()?w.pageUp():e(0,!0);break;case q.PAGEDOWN:b.preventDefault(),w.visible()?w.pageDown():e(0,!0);break;case c.multiple&&","==a.trim(c.multipleSeparator)&&q.COMMA:case q.TAB:case q.RETURN:d()&&(c.multiple||r.blur(),b.preventDefault(),r.focus());break;case q.ESC:w.hide();break;default:clearTimeout(o),o=setTimeout(e,c.delay)}}).keypress(function(){}).focus(function(){u++}).blur(function(){u=0,v.mouseDownOnSelect||i()}).click(function(){u++>1&&!w.visible()&&e(0,!0)}).bind("search",function(){function b(a,b){var d;if(b&&b.length)for(var e=0;e<b.length;e++)if(b[e].result.toLowerCase()==a.toLowerCase()){d=b[e];break}"function"==typeof c?c(d):r.trigger("result",d&&[d.data,d.value])}var c=arguments.length>1?arguments[1]:null;a.each(f(r.val()),function(a,c){l(c,b,b)})}).bind("flushCache",function(){t.flush()}).bind("setOptions",function(){a.extend(c,arguments[1]),"data"in arguments[1]&&t.populate()}).bind("unautocomplete",function(){w.unbind(),r.unbind()})},a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(a){return a[0]},autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(a,b){return a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:250,attachTo:"body"},a.Autocompleter.Cache=function(b){function c(a,c){b.matchCase||(a=a.toLowerCase());var d=a.indexOf(c);return-1==d?!1:0==d||b.matchContains}function d(a,c){h>b.cacheLength&&f(),g[a]||h++,g[a]=c}function e(){if(!b.data)return!1;var c={},e=0;b.url||(b.cacheLength=1),c[""]=[];for(var f=0,g=b.data.length;g>f;f++){var h=b.data[f];h="string"==typeof h?[h]:h;var i=b.formatItem(h,f+1,b.data.length);if(i!==!1){var j=i.charAt(0).toLowerCase();c[j]||(c[j]=[]);var k={value:i,data:h,result:b.formatResult&&b.formatResult(h)||i};c[j].push(k),e++<b.max&&c[""].push(k)}}a.each(c,function(a,c){b.cacheLength++,d(a,c)})}function f(){g={},h=0}var g={},h=0;return setTimeout(e,25),{flush:f,add:d,populate:e,load:function(d){if(!b.cacheLength||!h)return null;if(!b.url&&b.matchContains){var e=[];for(var f in g)if(f.length>0){var i=g[f];a.each(i,function(a,b){c(b.value,d)&&e.push(b)})}return e}if(g[d])return g[d];if(b.matchSubset)for(var j=d.length-1;j>=b.minChars;j--){var i=g[d.substr(0,j)];if(i){var e=[];return a.each(i,function(a,b){c(b.value,d)&&(e[e.length]=b)}),e}}return null}}},a.Autocompleter.Select=function(b,c,d,e){function f(){s&&(n=a("<div/>").hide().addClass(b.resultsClass).css("position","absolute").appendTo(b.attachTo),o=a("<ul>").appendTo(n).mouseover(function(b){g(b).nodeName&&"LI"==g(b).nodeName.toUpperCase()&&(q=a("li",o).removeClass(p.ACTIVE).index(g(b)),a(g(b)).addClass(p.ACTIVE))}).click(function(b){return a(g(b)).addClass(p.ACTIVE),d(),c.focus(),!1}).mousedown(function(){e.mouseDownOnSelect=!0}).mouseup(function(){e.mouseDownOnSelect=!1}),b.width>0&&n.css("width",b.width),s=!1)}function g(a){for(var b=a.target;b&&"LI"!=b.tagName;)b=b.parentNode;return b?b:[]}function h(a){l.slice(q,q+1).removeClass(),i(a);var c=l.slice(q,q+1).addClass(p.ACTIVE);if(b.scroll){var d=0;l.slice(0,q).each(function(){d+=this.offsetHeight}),d+c[0].offsetHeight-o.scrollTop()>o[0].clientHeight?o.scrollTop(d+c[0].offsetHeight-o.innerHeight()):d<o.scrollTop()&&o.scrollTop(d)}}function i(a){q+=a,0>q?q=l.size()-1:q>=l.size()&&(q=0)}function j(a){return b.max&&b.max<a?b.max:a}function k(){o.empty();for(var c=j(m.length),d=0;c>d;d++)if(m[d]){var e=b.formatItem(m[d].data,d+1,c,m[d].value,r);if(e!==!1){var f=a("<li>").html(b.highlight(e,r)).addClass(d%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(f,"ac_data",m[d])}}l=o.find("li"),b.selectFirst&&(l.slice(0,1).addClass(p.ACTIVE),q=0),o.bgiframe()}var l,m,n,o,p={ACTIVE:"ac_over"},q=-1,r="",s=!0;return{display:function(a,b){f(),m=a,r=b,k()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){h(0!=q&&0>q-8?-q:-8)},pageDown:function(){h(q!=l.size()-1&&q+8>l.size()?l.size()-1-q:8)},hide:function(){n&&n.hide(),q=-1},visible:function(){return n&&n.is(":visible")},current:function(){return this.visible()&&(l.filter("."+p.ACTIVE)[0]||b.selectFirst&&l[0])},show:function(){var d=a(c).offset();if(n.css({width:"string"==typeof b.width||b.width>0?b.width:a(c).width(),top:d.top+c.offsetHeight,left:d.left}).show(),b.scroll&&(o.scrollTop(0),o.css({maxHeight:b.scrollHeight,overflow:"auto"}),a.browser.msie&&"undefined"==typeof document.body.style.maxHeight)){var e=0;l.each(function(){e+=this.offsetHeight});var f=e>b.scrollHeight;o.css("height",f?b.scrollHeight:e),f||l.width(o.width()-parseInt(l.css("padding-left"))-parseInt(l.css("padding-right")))}},selected:function(){var b=l&&l.filter("."+p.ACTIVE).removeClass(p.ACTIVE);return b&&b.length&&a.data(b[0],"ac_data")},unbind:function(){n&&n.remove()}}},a.Autocompleter.Selection=function(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.collapse(!0),d.moveStart("character",b),d.moveEnd("character",c),d.select()}else a.setSelectionRange?a.setSelectionRange(b,c):a.selectionStart&&(a.selectionStart=b,a.selectionEnd=c);a.focus()}}(jQuery);
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+!function(a){a.fn.extend({autocomplete:function(b,c){var d="string"==typeof b;return c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c),c.highlight=c.highlight||function(a){return a},this.each(function(){new a.Autocompleter(this,c)})},result:function(a){return this.bind("result",a)},search:function(a){return this.trigger("search",[a])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(a){return this.trigger("setOptions",[a])},unautocomplete:function(){return this.trigger("unautocomplete")}}),a.Autocompleter=function(b,c){function d(){var a=x.selected();if(!a)return!1;var b=a.result;if(t=b,c.multiple){var d=f(s.val());d.length>1&&(b=d.slice(0,d.length-1).join(c.multipleSeparator)+c.multipleSeparator+b),b+=c.multipleSeparator}return s.val(b),j(),s.trigger("result",[a.data,a.value]),!0}function e(a,b){if(q==r.DEL)return void x.hide();var d=s.val();(b||d!=t)&&(t=d,d=g(d),d.length>=c.minChars?(s.addClass(c.loadingClass),jQuery("#send-to-input").addClass("loading"),c.matchCase||(d=d.toLowerCase()),l(d,k,j)):(n(),x.hide()))}function f(b){if(!b)return[""];var d=b.split(a.trim(c.multipleSeparator)),e=[];return a.each(d,function(b,c){a.trim(c)&&(e[b]=a.trim(c))}),e}function g(a){if(!c.multiple)return a;var b=f(a);return b[b.length-1]}function h(d,e){c.autoFill&&g(s.val()).toLowerCase()==d.toLowerCase()&&8!=q&&(s.val(s.val()+e.substring(g(t).length)),a.Autocompleter.Selection(b,t.length,t.length+e.length))}function i(){clearTimeout(p),p=setTimeout(j,200)}function j(){x.hide(),clearTimeout(p),n(),c.mustMatch&&s.search(function(a){a||s.val("")})}function k(a,b){if(b&&b.length&&v){n(),x.display(b,a);var c=b[0].value.split(";");b.value=c[0],h(a,b.value),x.show()}else j()}function l(d,e,f){c.matchCase||(d=d.toLowerCase());var h=u.load(d);if(h&&h.length)e(d,h);else if("string"==typeof c.url&&c.url.length>0){var i={};a.each(c.extraParams,function(a,b){i[a]="function"==typeof b?b():b}),a.ajax({mode:"abort",port:"autocomplete"+b.name,dataType:c.dataType,url:c.url,data:a.extend({q:g(d),limit:c.max,action:"messages_autocomplete_results",cookie:o()},i),success:function(a){var b=c.parse&&c.parse(a)||m(a);u.add(d,b),e(d,b)}})}else f(d)}function m(b){for(var d=[],e=b.split("\n"),f=0;f<e.length;f++){var g=a.trim(e[f]);g&&(g=g.split("|"),d[d.length]={data:g,value:g[0],result:c.formatResult&&c.formatResult(g,g[0])||g[0]})}return d}function n(){s.removeClass(c.loadingClass),jQuery("#send-to-input").removeClass("loading")}function o(){var a,b,c,d,e,f=document.cookie.split(";"),g={},h="bp-";for(a=0;a<f.length;a++)b=f[a],c=b.indexOf("="),d=jq.trim(unescape(b.slice(0,c))),e=unescape(b.slice(c+1)),0===d.indexOf(h)&&(g[d]=e);return encodeURIComponent(jq.param(g))}var p,q,r={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34},s=a(b).attr("autocomplete","off").addClass(c.inputClass),t="",u=a.Autocompleter.Cache(c),v=0,w={mouseDownOnSelect:!1},x=a.Autocompleter.Select(c,b,d,w);s.keydown(function(b){switch(q=b.keyCode,b.keyCode){case r.UP:b.preventDefault(),x.visible()?x.prev():e(0,!0);break;case r.DOWN:b.preventDefault(),x.visible()?x.next():e(0,!0);break;case r.PAGEUP:b.preventDefault(),x.visible()?x.pageUp():e(0,!0);break;case r.PAGEDOWN:b.preventDefault(),x.visible()?x.pageDown():e(0,!0);break;case c.multiple&&","==a.trim(c.multipleSeparator)&&r.COMMA:case r.TAB:case r.RETURN:d()&&(c.multiple||s.blur(),b.preventDefault(),s.focus());break;case r.ESC:x.hide();break;default:clearTimeout(p),p=setTimeout(e,c.delay)}}).keypress(function(){}).focus(function(){v++}).blur(function(){v=0,w.mouseDownOnSelect||i()}).click(function(){v++>1&&!x.visible()&&e(0,!0)}).bind("search",function(){function b(a,b){var d;if(b&&b.length)for(var e=0;e<b.length;e++)if(b[e].result.toLowerCase()==a.toLowerCase()){d=b[e];break}"function"==typeof c?c(d):s.trigger("result",d&&[d.data,d.value])}var c=arguments.length>1?arguments[1]:null;a.each(f(s.val()),function(a,c){l(c,b,b)})}).bind("flushCache",function(){u.flush()}).bind("setOptions",function(){a.extend(c,arguments[1]),"data"in arguments[1]&&u.populate()}).bind("unautocomplete",function(){x.unbind(),s.unbind()})},a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(a){return a[0]},autoFill:!1,width:0,multiple:!1,multipleSeparator:", ",highlight:function(a,b){return a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:!0,scrollHeight:250,attachTo:"body"},a.Autocompleter.Cache=function(b){function c(a,c){b.matchCase||(a=a.toLowerCase());var d=a.indexOf(c);return-1==d?!1:0==d||b.matchContains}function d(a,c){h>b.cacheLength&&f(),g[a]||h++,g[a]=c}function e(){if(!b.data)return!1;var c={},e=0;b.url||(b.cacheLength=1),c[""]=[];for(var f=0,g=b.data.length;g>f;f++){var h=b.data[f];h="string"==typeof h?[h]:h;var i=b.formatItem(h,f+1,b.data.length);if(i!==!1){var j=i.charAt(0).toLowerCase();c[j]||(c[j]=[]);var k={value:i,data:h,result:b.formatResult&&b.formatResult(h)||i};c[j].push(k),e++<b.max&&c[""].push(k)}}a.each(c,function(a,c){b.cacheLength++,d(a,c)})}function f(){g={},h=0}var g={},h=0;return setTimeout(e,25),{flush:f,add:d,populate:e,load:function(d){if(!b.cacheLength||!h)return null;if(!b.url&&b.matchContains){var e=[];for(var f in g)if(f.length>0){var i=g[f];a.each(i,function(a,b){c(b.value,d)&&e.push(b)})}return e}if(g[d])return g[d];if(b.matchSubset)for(var j=d.length-1;j>=b.minChars;j--){var i=g[d.substr(0,j)];if(i){var e=[];return a.each(i,function(a,b){c(b.value,d)&&(e[e.length]=b)}),e}}return null}}},a.Autocompleter.Select=function(b,c,d,e){function f(){s&&(n=a("<div/>").hide().addClass(b.resultsClass).css("position","absolute").appendTo(b.attachTo),o=a("<ul>").appendTo(n).mouseover(function(b){g(b).nodeName&&"LI"==g(b).nodeName.toUpperCase()&&(q=a("li",o).removeClass(p.ACTIVE).index(g(b)),a(g(b)).addClass(p.ACTIVE))}).click(function(b){return a(g(b)).addClass(p.ACTIVE),d(),c.focus(),!1}).mousedown(function(){e.mouseDownOnSelect=!0}).mouseup(function(){e.mouseDownOnSelect=!1}),b.width>0&&n.css("width",b.width),s=!1)}function g(a){for(var b=a.target;b&&"LI"!=b.tagName;)b=b.parentNode;return b?b:[]}function h(a){l.slice(q,q+1).removeClass(),i(a);var c=l.slice(q,q+1).addClass(p.ACTIVE);if(b.scroll){var d=0;l.slice(0,q).each(function(){d+=this.offsetHeight}),d+c[0].offsetHeight-o.scrollTop()>o[0].clientHeight?o.scrollTop(d+c[0].offsetHeight-o.innerHeight()):d<o.scrollTop()&&o.scrollTop(d)}}function i(a){q+=a,0>q?q=l.size()-1:q>=l.size()&&(q=0)}function j(a){return b.max&&b.max<a?b.max:a}function k(){o.empty();for(var c=j(m.length),d=0;c>d;d++)if(m[d]){var e=b.formatItem(m[d].data,d+1,c,m[d].value,r);if(e!==!1){var f=a("<li>").html(b.highlight(e,r)).addClass(d%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(f,"ac_data",m[d])}}l=o.find("li"),b.selectFirst&&(l.slice(0,1).addClass(p.ACTIVE),q=0),o.bgiframe()}var l,m,n,o,p={ACTIVE:"ac_over"},q=-1,r="",s=!0;return{display:function(a,b){f(),m=a,r=b,k()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){h(0!=q&&0>q-8?-q:-8)},pageDown:function(){h(q!=l.size()-1&&q+8>l.size()?l.size()-1-q:8)},hide:function(){n&&n.hide(),q=-1},visible:function(){return n&&n.is(":visible")},current:function(){return this.visible()&&(l.filter("."+p.ACTIVE)[0]||b.selectFirst&&l[0])},show:function(){var d=a(c).offset();if(n.css({width:"string"==typeof b.width||b.width>0?b.width:a(c).width(),top:d.top+c.offsetHeight,left:d.left}).show(),b.scroll&&(o.scrollTop(0),o.css({maxHeight:b.scrollHeight,overflow:"auto"}),a.browser.msie&&"undefined"==typeof document.body.style.maxHeight)){var e=0;l.each(function(){e+=this.offsetHeight});var f=e>b.scrollHeight;o.css("height",f?b.scrollHeight:e),f||l.width(o.width()-parseInt(l.css("padding-left"))-parseInt(l.css("padding-right")))}},selected:function(){var b=l&&l.filter("."+p.ACTIVE).removeClass(p.ACTIVE);return b&&b.length&&a.data(b[0],"ac_data")},unbind:function(){n&&n.remove()}}},a.Autocompleter.Selection=function(a,b,c){if(a.createTextRange){var d=a.createTextRange();d.collapse(!0),d.moveStart("character",b),d.moveEnd("character",c),d.select()}else a.setSelectionRange?a.setSelectionRange(b,c):a.selectionStart&&(a.selectionStart=b,a.selectionEnd=c);a.focus()}}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js
index bcf4f6f04c8819b85ff0f5934a12a7b39c9df157..e6cd2783477e2c5ad713e3c19e4a2a9b360eb2d3 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.autocompletefb.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 jQuery.fn.autoCompletefb=function(a){var b=this,c={ul:b,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};a&&jQuery.extend(c,a);var d={params:c,removeFind:function(a){return d.removeUsername(a),jQuery(a).unbind("click").parent().remove(),jQuery(c.inputClass,b).focus(),b.acfb},removeUsername:function(a){var b=a.parentNode.id.substr(a.parentNode.id.indexOf("-")+1);jQuery("#send-to-usernames").removeClass(b)}};return jQuery(c.foundClass+" img.p").click(function(){d.removeFind(this)}),jQuery(c.inputClass,b).autocomplete(c.urlLookup,c.acOptions),jQuery(c.inputClass,b).result(function(a,e,f){var f=c.foundClass.replace(/\./,""),e=String(e).split(" ("),g=e[1].substr(0,e[1].length-1);if(0===jQuery(c.inputClass).siblings("#un-"+g).length){var h="#link-"+g,i=jQuery(h).attr("href"),j='<li class="'+f+'" id="un-'+g+'"><span><a href="'+i+'">'+e[0]+'</a></span> <span class="p">X</span></li>',k=jQuery(c.inputClass,b).before(j);jQuery("#send-to-usernames").addClass(g),jQuery(".p",k[0].previousSibling).click(function(){d.removeFind(this)})}jQuery(c.inputClass,b).val("")}),jQuery(c.inputClass,b).focus(),d};
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js
index cb5bf51b7e400be8c3a6545b0cc58ff420546c5e..ebe7b8e15b5ef761df464d0627447d85fe30b4e6 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.bgiframe.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 !function(a){function b(a){return a&&a.constructor===Number?a+"px":a}a.fn.bgiframe=a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(c){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:!0,src:"javascript:false;"},c);var d='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==!1?"filter:Alpha(Opacity='0');":"")+"top:"+("auto"==c.top?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(c.top))+";left:"+("auto"==c.left?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(c.left))+";width:"+("auto"==c.width?"expression(this.parentNode.offsetWidth+'px')":b(c.width))+";height:"+("auto"==c.height?"expression(this.parentNode.offsetHeight+'px')":b(c.height))+';"/>';return this.each(function(){0===a(this).children("iframe.bgiframe").length&&this.insertBefore(document.createElement(d),this.firstChild)})}:function(){return this},a.fn.bgIframe=a.fn.bgiframe}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js
index 9f60cabca4b9db7b45dcaf1d2ada8e9a9968480e..cf25dce4c3ac95555ff5eff7bb3fa6a0049c86b7 100644
--- a/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js
+++ b/wp-content/plugins/buddypress/bp-core/deprecated/js/autocomplete/jquery.dimensions.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 !function(a){a.dimensions={version:"@VERSION"},a.each(["Height","Width"],function(c,d){a.fn["inner"+d]=function(){if(this[0]){var a="Height"==d?"Top":"Left",c="Height"==d?"Bottom":"Right";return this[d.toLowerCase()]()+b(this,"padding"+a)+b(this,"padding"+c)}},a.fn["outer"+d]=function(c){if(this[0]){var e="Height"==d?"Top":"Left",f="Height"==d?"Bottom":"Right";return c=a.extend({margin:!1},c||{}),this[d.toLowerCase()]()+b(this,"border"+e+"Width")+b(this,"border"+f+"Width")+b(this,"padding"+e)+b(this,"padding"+f)+(c.margin?b(this,"margin"+e)+b(this,"margin"+f):0)}}}),a.each(["Left","Top"],function(b,c){a.fn["scroll"+c]=function(b){return this[0]?void 0!=b?this.each(function(){this==window||this==document?window.scrollTo("Left"==c?b:a(window).scrollLeft(),"Top"==c?b:a(window).scrollTop()):this["scroll"+c]=b}):this[0]==window||this[0]==document?self["Left"==c?"pageXOffset":"pageYOffset"]||a.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]:void 0}}),a.fn.extend({position:function(){var a,c,d,e,f=this[0];return f&&(d=this.offsetParent(),a=this.offset(),c=d.offset(),a.top-=b(f,"marginTop"),a.left-=b(f,"marginLeft"),c.top+=b(d,"borderTopWidth"),c.left+=b(d,"borderLeftWidth"),e={top:a.top-c.top,left:a.left-c.left}),e},offsetParent:function(){for(var b=this[0].offsetParent;b&&!/^body|html$/i.test(b.tagName)&&"static"==a.css(b,"position");)b=b.offsetParent;return a(b)}});var b=function(b,c){return parseInt(a.css(b.jquery?b[0]:b,c))||0}}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/avatar.js b/wp-content/plugins/buddypress/bp-core/js/avatar.js
new file mode 100644
index 0000000000000000000000000000000000000000..dc887a7d360ec98e0ded723b4507a8fe5e69ac19
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/avatar.js
@@ -0,0 +1,641 @@
+/* globals bp, BP_Uploader, _, Backbone */
+
+window.bp = window.bp || {};
+
+( function( exports, $ ) {
+
+	// Bail if not set
+	if ( typeof BP_Uploader === 'undefined' ) {
+		return;
+	}
+
+	bp.Models      = bp.Models || {};
+	bp.Collections = bp.Collections || {};
+	bp.Views       = bp.Views || {};
+
+	bp.Avatar = {
+		start: function() {
+			/**
+			 * Remove the bp-legacy UI
+			 *
+			 * bp.Avatar successfully loaded, we can now
+			 * safely remove the Legacy UI.
+			 */
+			this.removeLegacyUI();
+
+			// Init some vars
+			this.views    = new Backbone.Collection();
+			this.jcropapi = {};
+			this.warning = null;
+
+			// Set up nav
+			this.setupNav();
+
+			// Avatars are uploaded files
+			this.avatars = bp.Uploader.filesUploaded;
+
+			// Wait till the queue is reset
+			bp.Uploader.filesQueue.on( 'reset', this.cropView, this );
+
+			/**
+			 * In Administration screens we're using Thickbox
+			 * We need to make sure to reset the views if it's closed
+			 */
+			$( 'body.wp-admin' ).on( 'tb_unload', '#TB_window', function() {
+				// Reset to the uploader view
+				bp.Avatar.nav.trigger( 'bp-avatar-view:changed', 'upload' );
+
+				// Reset to the uploader nav
+				_.each( bp.Avatar.navItems.models, function( model ) {
+					if ( model.id === 'upload' ) {
+						model.set( { active: 1 } );
+					} else {
+						model.set( { active: 0 } );
+					}
+				} );
+			} );
+		},
+
+		removeLegacyUI: function() {
+			// User
+			if ( $( '#avatar-upload-form' ).length ) {
+				$( '#avatar-upload' ).remove();
+				$( '#avatar-upload-form p' ).remove();
+
+			// Group Manage
+			} else if ( $( '#group-settings-form' ).length ) {
+				$( '#group-settings-form p' ).each( function( i ) {
+					if ( 0 !== i ) {
+						$( this ).remove();
+					}
+				} );
+
+				if ( $( '#delete-group-avatar-button' ).length ) {
+					$( '#delete-group-avatar-button' ).remove();
+				}
+
+			// Group Create
+			} else if ( $( '#group-create-body' ).length ) {
+				$( '.main-column p #file' ).remove();
+				$( '.main-column p #upload' ).remove();
+
+			// Admin Extended Profile
+			} else if ( $( '#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin' ).length ) {
+				$( '#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin' ).remove();
+			}
+		},
+
+		setView: function( view ) {
+			// Clear views
+			if ( ! _.isUndefined( this.views.models ) ) {
+				_.each( this.views.models, function( model ) {
+					model.get( 'view' ).remove();
+				}, this );
+			}
+
+			// Reset Views
+			this.views.reset();
+
+			// Reset Avatars (file uploaded)
+			if ( ! _.isUndefined( this.avatars ) ) {
+				this.avatars.reset();
+			}
+
+			// Reset the Jcrop API
+			if ( ! _.isEmpty( this.jcropapi ) ) {
+				this.jcropapi.destroy();
+				this.jcropapi = {};
+			}
+
+			// Load the required view
+			switch ( view ) {
+				case 'upload':
+					this.uploaderView();
+					break;
+
+				case 'delete':
+					this.deleteView();
+					break;
+			}
+		},
+
+		setupNav: function() {
+			var self = this,
+			    initView, activeView;
+
+			this.navItems = new Backbone.Collection();
+
+			_.each( BP_Uploader.settings.nav, function( item, index ) {
+				if ( ! _.isObject( item ) ) {
+					return;
+				}
+
+				// Reset active View
+				activeView = 0;
+
+				if ( 0 === index ) {
+					initView = item.id;
+					activeView = 1;
+				}
+
+				self.navItems.add( {
+					id     : item.id,
+					name   : item.caption,
+					href   : '#',
+					active : activeView,
+					hide   : _.isUndefined( item.hide ) ? 0 : item.hide
+				} );
+			} );
+
+			this.nav = new bp.Views.Nav( { collection: this.navItems } );
+			this.nav.inject( '.bp-avatar-nav' );
+
+			// Activate the initial view (uploader)
+			this.setView( initView );
+
+			// Listen to nav changes (it's like a do_action!)
+			this.nav.on( 'bp-avatar-view:changed', _.bind( this.setView, this ) );
+		},
+
+		uploaderView: function() {
+			// Listen to the Queued uploads
+			bp.Uploader.filesQueue.on( 'add', this.uploadProgress, this );
+
+			// Create the BuddyPress Uploader
+			var uploader = new bp.Views.Uploader();
+
+			// Add it to views
+			this.views.add( { id: 'upload', view: uploader } );
+
+			// Display it
+			uploader.inject( '.bp-avatar' );
+		},
+
+		uploadProgress: function() {
+			// Create the Uploader status view
+			var avatarStatus = new bp.Views.uploaderStatus( { collection: bp.Uploader.filesQueue } );
+
+			if ( ! _.isUndefined( this.views.get( 'status' ) ) ) {
+				this.views.set( { id: 'status', view: avatarStatus } );
+			} else {
+				this.views.add( { id: 'status', view: avatarStatus } );
+			}
+
+			// Display it
+	 		avatarStatus.inject( '.bp-avatar-status' );
+		},
+
+		cropView: function() {
+			var status;
+
+			// Bail there was an error during the Upload
+			if ( _.isEmpty( this.avatars.models ) ) {
+				return;
+			}
+
+			// Make sure to remove the uploads status
+			if ( ! _.isUndefined( this.views.get( 'status' ) ) ) {
+				status = this.views.get( 'status' );
+				status.get( 'view' ).remove();
+				this.views.remove( { id: 'status', view: status } );
+			}
+
+			// Create the Avatars view
+			var avatar = new bp.Views.Avatars( { collection: this.avatars } );
+			this.views.add( { id: 'crop', view: avatar } );
+
+			avatar.inject( '.bp-avatar' );
+		},
+
+		setAvatar: function( avatar ) {
+			var self = this,
+				crop;
+
+			// Remove the crop view
+			if ( ! _.isUndefined( this.views.get( 'crop' ) ) ) {
+				// Remove the JCrop API
+				if ( ! _.isEmpty( this.jcropapi ) ) {
+					this.jcropapi.destroy();
+					this.jcropapi = {};
+				}
+				crop = this.views.get( 'crop' );
+				crop.get( 'view' ).remove();
+				this.views.remove( { id: 'crop', view: crop } );
+			}
+
+			// Set the avatar !
+			bp.ajax.post( 'bp_avatar_set', {
+				json:          true,
+				original_file: avatar.get( 'url' ),
+				crop_w:        avatar.get( 'w' ),
+				crop_h:        avatar.get( 'h' ),
+				crop_x:        avatar.get( 'x' ),
+				crop_y:        avatar.get( 'y' ),
+				item_id:       avatar.get( 'item_id' ),
+				object:        avatar.get( 'object' ),
+				type:          _.isUndefined( avatar.get( 'type' ) ) ? 'crop' : avatar.get( 'type' ),
+				nonce:         avatar.get( 'nonces' ).set
+			} ).done( function( response ) {
+				var avatarStatus = new bp.Views.AvatarStatus( {
+					value : BP_Uploader.strings.feedback_messages[ response.feedback_code ],
+					type : 'success'
+				} );
+
+				self.views.add( {
+					id   : 'status',
+					view : avatarStatus
+				} );
+
+				avatarStatus.inject( '.bp-avatar-status' );
+
+				// Update each avatars of the page
+				$( '.' + avatar.get( 'object' ) + '-' + response.item_id + '-avatar' ).each( function() {
+					$(this).prop( 'src', response.avatar );
+				} );
+
+				// Inject the Delete nav
+				bp.Avatar.navItems.get( 'delete' ).set( { hide: 0 } );
+
+			} ).fail( function( response ) {
+				var feedback = BP_Uploader.strings.default_error;
+				if ( ! _.isUndefined( response ) ) {
+					feedback = BP_Uploader.strings.feedback_messages[ response.feedback_code ];
+				}
+
+				var avatarStatus = new bp.Views.AvatarStatus( {
+					value : feedback,
+					type : 'error'
+				} );
+
+				self.views.add( {
+					id   : 'status',
+					view : avatarStatus
+				} );
+
+				avatarStatus.inject( '.bp-avatar-status' );
+			} );
+		},
+
+		deleteView:function() {
+			// Create the delete model
+			var delete_model = new Backbone.Model( _.pick( BP_Uploader.settings.defaults.multipart_params.bp_params,
+				'object',
+				'item_id',
+				'nonces'
+			) );
+
+			// Create the delete view
+			var deleteView = new bp.Views.DeleteAvatar( { model: delete_model } );
+
+			// Add it to views
+			this.views.add( { id: 'delete', view: deleteView } );
+
+			// Display it
+			deleteView.inject( '.bp-avatar' );
+		},
+
+		deleteAvatar: function( model ) {
+			var self = this,
+				deleteView;
+
+			// Remove the delete view
+			if ( ! _.isUndefined( this.views.get( 'delete' ) ) ) {
+				deleteView = this.views.get( 'delete' );
+				deleteView.get( 'view' ).remove();
+				this.views.remove( { id: 'delete', view: deleteView } );
+			}
+
+			// Remove the avatar !
+			bp.ajax.post( 'bp_avatar_delete', {
+				json:          true,
+				item_id:       model.get( 'item_id' ),
+				object:        model.get( 'object' ),
+				nonce:         model.get( 'nonces' ).remove
+			} ).done( function( response ) {
+				var avatarStatus = new bp.Views.AvatarStatus( {
+					value : BP_Uploader.strings.feedback_messages[ response.feedback_code ],
+					type : 'success'
+				} );
+
+				self.views.add( {
+					id   : 'status',
+					view : avatarStatus
+				} );
+
+				avatarStatus.inject( '.bp-avatar-status' );
+
+				// Update each avatars of the page
+				$( '.' + model.get( 'object' ) + '-' + response.item_id + '-avatar').each( function() {
+					$( this ).prop( 'src', response.avatar );
+				} );
+
+				 // Remove the Delete nav
+				 bp.Avatar.navItems.get( 'delete' ).set( { active: 0, hide: 1 } );
+
+			} ).fail( function( response ) {
+				var feedback = BP_Uploader.strings.default_error;
+				if ( ! _.isUndefined( response ) ) {
+					feedback = BP_Uploader.strings.feedback_messages[ response.feedback_code ];
+				}
+
+				var avatarStatus = new bp.Views.AvatarStatus( {
+					value : feedback,
+					type : 'error'
+				} );
+
+				self.views.add( {
+					id   : 'status',
+					view : avatarStatus
+				} );
+
+				avatarStatus.inject( '.bp-avatar-status' );
+			} );
+		},
+
+		removeWarning: function() {
+			if ( ! _.isNull( this.warning ) ) {
+				this.warning.remove();
+			}
+		},
+
+		displayWarning: function( message ) {
+			this.removeWarning();
+
+			this.warning = new bp.Views.uploaderWarning( {
+				value: message
+			} );
+
+			this.warning.inject( '.bp-avatar-status' );
+		}
+	};
+
+	// Main Nav view
+	bp.Views.Nav = bp.View.extend( {
+		tagName:    'ul',
+		className:  'avatar-nav-items',
+
+		events: {
+			'click .bp-avatar-nav-item' : 'toggleView'
+		},
+
+		initialize: function() {
+			var hasAvatar = _.findWhere( this.collection.models, { id: 'delete' } );
+
+			// Display a message to inform about the delete tab
+			if ( 1 !== hasAvatar.get( 'hide' ) ) {
+				bp.Avatar.displayWarning( BP_Uploader.strings.has_avatar_warning );
+			}
+
+			_.each( this.collection.models, this.addNavItem, this );
+			this.collection.on( 'change:hide', this.showHideNavItem, this );
+		},
+
+		addNavItem: function( item ) {
+			/**
+			 * The delete nav is not added if no avatar
+			 * is set for the object
+			 */
+			if ( 1 === item.get( 'hide' ) ) {
+				return;
+			}
+
+			this.views.add( new bp.Views.NavItem( { model: item } ) );
+		},
+
+		showHideNavItem: function( item ) {
+			var isRendered = null;
+
+			/**
+			 * Loop in views to show/hide the nav item
+			 * BuddyPress is only using this for the delete nav
+			 */
+			_.each( this.views._views[''], function( view ) {
+				if ( 1 === view.model.get( 'hide' ) ) {
+					view.remove();
+				}
+
+				// Check to see if the nav is not already rendered
+				if ( item.get( 'id' ) === view.model.get( 'id' ) ) {
+					isRendered = true;
+				}
+			} );
+
+			// Add the Delete nav if not rendered
+			if ( ! _.isBoolean( isRendered ) ) {
+				this.addNavItem( item );
+			}
+		},
+
+		toggleView: function( event ) {
+			event.preventDefault();
+
+			// First make sure to remove all warnings
+			bp.Avatar.removeWarning();
+
+			var active = $( event.target ).data( 'nav' );
+
+			_.each( this.collection.models, function( model ) {
+				if ( model.id === active ) {
+					model.set( { active: 1 } );
+					this.trigger( 'bp-avatar-view:changed', model.id );
+				} else {
+					model.set( { active: 0 } );
+				}
+			}, this );
+		}
+	} );
+
+	// Nav item view
+	bp.Views.NavItem = bp.View.extend( {
+		tagName:    'li',
+		className:  'avatar-nav-item',
+		template: bp.template( 'bp-avatar-nav' ),
+
+		initialize: function() {
+			if ( 1 === this.model.get( 'active' ) ) {
+				this.el.className += ' current';
+			}
+			this.el.id += 'bp-avatar-' + this.model.get( 'id' );
+
+			this.model.on( 'change:active', this.setCurrentNav, this );
+		},
+
+		setCurrentNav: function( model ) {
+			if ( 1 === model.get( 'active' ) ) {
+				this.$el.addClass( 'current' );
+			} else {
+				this.$el.removeClass( 'current' );
+			}
+		}
+	} );
+
+	// Avatars view
+	bp.Views.Avatars = bp.View.extend( {
+		className: 'items',
+
+		initialize: function() {
+			_.each( this.collection.models, this.addItemView, this );
+		},
+
+		addItemView: function( item ) {
+			// Defaults to 150
+			var full_d = { full_h: 150, full_w: 150 };
+
+			// Make sure to take in account bp_core_avatar_full_height or bp_core_avatar_full_width php filters
+			if ( ! _.isUndefined( BP_Uploader.settings.crop.full_h ) && ! _.isUndefined( BP_Uploader.settings.crop.full_w ) ) {
+				full_d.full_h = BP_Uploader.settings.crop.full_h;
+				full_d.full_w = BP_Uploader.settings.crop.full_w;
+			}
+
+			// Set the avatar model
+			item.set( _.extend( _.pick( BP_Uploader.settings.defaults.multipart_params.bp_params,
+				'object',
+				'item_id',
+				'nonces'
+			), full_d ) );
+
+			// Add the view
+			this.views.add( new bp.Views.Avatar( { model: item } ) );
+		}
+	} );
+
+	// Avatar view
+	bp.Views.Avatar = bp.View.extend( {
+		className: 'item',
+		template: bp.template( 'bp-avatar-item' ),
+
+		events: {
+			'click .avatar-crop-submit': 'cropAvatar'
+		},
+
+		initialize: function() {
+			_.defaults( this.options, {
+				full_h:  BP_Uploader.settings.crop.full_h,
+				full_w:  BP_Uploader.settings.crop.full_w,
+				aspectRatio : 1
+			} );
+
+			// Display a warning if the image is smaller than minimum advised
+			if ( false !== this.model.get( 'feedback' ) ) {
+				bp.Avatar.displayWarning( this.model.get( 'feedback' ) );
+			}
+
+			this.on( 'ready', this.initCropper );
+		},
+
+		initCropper: function() {
+			var self = this,
+				tocrop = this.$el.find( '#avatar-to-crop img' ),
+				availableWidth = this.$el.width(),
+				selection = {}, crop_top, crop_bottom, crop_left, crop_right, nh, nw;
+
+			if ( ! _.isUndefined( this.options.full_h ) && ! _.isUndefined( this.options.full_w ) ) {
+				this.options.aspectRatio = this.options.full_w / this.options.full_h;
+			}
+
+			selection.w = this.model.get( 'width' );
+			selection.h = this.model.get( 'height' );
+
+			/**
+			 * Make sure the crop preview is at the right of the avatar
+			 * if the available width allowes it.
+			 */
+			if ( this.options.full_w + selection.w + 20 < availableWidth ) {
+				$( '#avatar-to-crop' ).addClass( 'adjust' );
+				this.$el.find( '.avatar-crop-management' ).addClass( 'adjust' );
+			}
+
+			if ( selection.h <= selection.w ) {
+				crop_top    = Math.round( selection.h / 4 );
+				nh = nw     = Math.round( selection.h / 2 );
+				crop_bottom = nh + crop_top;
+				crop_left   = ( selection.w - nw ) / 2;
+				crop_right  = nw + crop_left;
+			} else {
+				crop_left   = Math.round( selection.w / 4 );
+				nh = nw     = Math.round( selection.w / 2 );
+				crop_right  = nw + crop_left;
+				crop_top    = ( selection.h - nh ) / 2;
+				crop_bottom = nh + crop_top;
+			}
+
+			// Add the cropping interface
+			tocrop.Jcrop( {
+				onChange: _.bind( self.showPreview, self ),
+				onSelect: _.bind( self.showPreview, self ),
+				aspectRatio: self.options.aspectRatio,
+				setSelect: [ crop_left, crop_top, crop_right, crop_bottom ]
+			}, function() {
+				// Get the Jcrop API
+				bp.Avatar.jcropapi = this;
+			} );
+		},
+
+		cropAvatar: function( event ) {
+			event.preventDefault();
+
+			bp.Avatar.setAvatar( this.model );
+		},
+
+		showPreview: function( coords ) {
+			if ( ! coords.w || ! coords.h ) {
+				return;
+			}
+
+			if ( parseInt( coords.w, 10 ) > 0 ) {
+				var fw = this.options.full_w;
+				var fh = this.options.full_h;
+				var rx = fw / coords.w;
+				var ry = fh / coords.h;
+
+				// Update the model
+				this.model.set( { x: coords.x, y: coords.y, w: coords.w, h: coords.h } );
+
+				$( '#avatar-crop-preview' ).css( {
+					maxWidth:'none',
+					width: Math.round( rx *  this.model.get( 'width' ) )+ 'px',
+					height: Math.round( ry * this.model.get( 'height' ) )+ 'px',
+					marginLeft: '-' + Math.round( rx * this.model.get( 'x' ) ) + 'px',
+					marginTop: '-' + Math.round( ry * this.model.get( 'y' ) ) + 'px'
+				} );
+			}
+		}
+	} );
+
+	// BuddyPress Avatar Feedback view
+	bp.Views.AvatarStatus = bp.View.extend( {
+		tagName: 'p',
+		className: 'updated',
+		id: 'bp-avatar-feedback',
+
+		initialize: function() {
+			this.el.className += ' ' + this.options.type;
+			this.value = this.options.value;
+		},
+
+		render: function() {
+			this.$el.html( this.value );
+			return this;
+		}
+	} );
+
+	// BuddyPress Avatar Delete view
+	bp.Views.DeleteAvatar = bp.View.extend( {
+		tagName: 'div',
+		id: 'bp-delete-avatar-container',
+		template: bp.template( 'bp-avatar-delete' ),
+
+		events: {
+			'click #bp-delete-avatar': 'deleteAvatar'
+		},
+
+		deleteAvatar: function( event ) {
+			event.preventDefault();
+
+			bp.Avatar.deleteAvatar( this.model );
+		}
+	} );
+
+	bp.Avatar.start();
+
+})( bp, jQuery );
diff --git a/wp-content/plugins/buddypress/bp-core/js/avatar.min.js b/wp-content/plugins/buddypress/bp-core/js/avatar.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..3cba1e9c8c8add77b1cfdc6f3d066cdb30296b70
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/avatar.min.js
@@ -0,0 +1,2 @@
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Avatar={start:function(){this.removeLegacyUI(),this.views=new Backbone.Collection,this.jcropapi={},this.warning=null,this.setupNav(),this.avatars=bp.Uploader.filesUploaded,bp.Uploader.filesQueue.on("reset",this.cropView,this),b("body.wp-admin").on("tb_unload","#TB_window",function(){bp.Avatar.nav.trigger("bp-avatar-view:changed","upload"),_.each(bp.Avatar.navItems.models,function(a){a.set("upload"===a.id?{active:1}:{active:0})})})},removeLegacyUI:function(){b("#avatar-upload-form").length?(b("#avatar-upload").remove(),b("#avatar-upload-form p").remove()):b("#group-settings-form").length?(b("#group-settings-form p").each(function(a){0!==a&&b(this).remove()}),b("#delete-group-avatar-button").length&&b("#delete-group-avatar-button").remove()):b("#group-create-body").length?(b(".main-column p #file").remove(),b(".main-column p #upload").remove()):b("#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin").length&&b("#bp_xprofile_user_admin_avatar a.bp-xprofile-avatar-user-admin").remove()},setView:function(a){switch(_.isUndefined(this.views.models)||_.each(this.views.models,function(a){a.get("view").remove()},this),this.views.reset(),_.isUndefined(this.avatars)||this.avatars.reset(),_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),a){case"upload":this.uploaderView();break;case"delete":this.deleteView()}},setupNav:function(){var a,b,c=this;this.navItems=new Backbone.Collection,_.each(BP_Uploader.settings.nav,function(d,e){_.isObject(d)&&(b=0,0===e&&(a=d.id,b=1),c.navItems.add({id:d.id,name:d.caption,href:"#",active:b,hide:_.isUndefined(d.hide)?0:d.hide}))}),this.nav=new bp.Views.Nav({collection:this.navItems}),this.nav.inject(".bp-avatar-nav"),this.setView(a),this.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},uploaderView:function(){bp.Uploader.filesQueue.on("add",this.uploadProgress,this);var a=new bp.Views.Uploader;this.views.add({id:"upload",view:a}),a.inject(".bp-avatar")},uploadProgress:function(){var a=new bp.Views.uploaderStatus({collection:bp.Uploader.filesQueue});_.isUndefined(this.views.get("status"))?this.views.add({id:"status",view:a}):this.views.set({id:"status",view:a}),a.inject(".bp-avatar-status")},cropView:function(){var a;if(!_.isEmpty(this.avatars.models)){_.isUndefined(this.views.get("status"))||(a=this.views.get("status"),a.get("view").remove(),this.views.remove({id:"status",view:a}));var b=new bp.Views.Avatars({collection:this.avatars});this.views.add({id:"crop",view:b}),b.inject(".bp-avatar")}},setAvatar:function(a){var c,d=this;_.isUndefined(this.views.get("crop"))||(_.isEmpty(this.jcropapi)||(this.jcropapi.destroy(),this.jcropapi={}),c=this.views.get("crop"),c.get("view").remove(),this.views.remove({id:"crop",view:c})),bp.ajax.post("bp_avatar_set",{json:!0,original_file:a.get("url"),crop_w:a.get("w"),crop_h:a.get("h"),crop_x:a.get("x"),crop_y:a.get("y"),item_id:a.get("item_id"),object:a.get("object"),type:_.isUndefined(a.get("type"))?"crop":a.get("type"),nonce:a.get("nonces").set}).done(function(c){var e=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-avatar-status"),b("."+a.get("object")+"-"+c.item_id+"-avatar").each(function(){b(this).prop("src",c.avatar)}),bp.Avatar.navItems.get("delete").set({hide:0})}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.AvatarStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-avatar-status")})},deleteView:function(){var a=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces")),b=new bp.Views.DeleteAvatar({model:a});this.views.add({id:"delete",view:b}),b.inject(".bp-avatar")},deleteAvatar:function(a){var c,d=this;_.isUndefined(this.views.get("delete"))||(c=this.views.get("delete"),c.get("view").remove(),this.views.remove({id:"delete",view:c})),bp.ajax.post("bp_avatar_delete",{json:!0,item_id:a.get("item_id"),object:a.get("object"),nonce:a.get("nonces").remove}).done(function(c){var e=new bp.Views.AvatarStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-avatar-status"),b("."+a.get("object")+"-"+c.item_id+"-avatar").each(function(){b(this).prop("src",c.avatar)}),bp.Avatar.navItems.get("delete").set({active:0,hide:1})}).fail(function(a){var b=BP_Uploader.strings.default_error;_.isUndefined(a)||(b=BP_Uploader.strings.feedback_messages[a.feedback_code]);var c=new bp.Views.AvatarStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-avatar-status")})},removeWarning:function(){_.isNull(this.warning)||this.warning.remove()},displayWarning:function(a){this.removeWarning(),this.warning=new bp.Views.uploaderWarning({value:a}),this.warning.inject(".bp-avatar-status")}},bp.Views.Nav=bp.View.extend({tagName:"ul",className:"avatar-nav-items",events:{"click .bp-avatar-nav-item":"toggleView"},initialize:function(){var a=_.findWhere(this.collection.models,{id:"delete"});1!==a.get("hide")&&bp.Avatar.displayWarning(BP_Uploader.strings.has_avatar_warning),_.each(this.collection.models,this.addNavItem,this),this.collection.on("change:hide",this.showHideNavItem,this)},addNavItem:function(a){1!==a.get("hide")&&this.views.add(new bp.Views.NavItem({model:a}))},showHideNavItem:function(a){var b=null;_.each(this.views._views[""],function(c){1===c.model.get("hide")&&c.remove(),a.get("id")===c.model.get("id")&&(b=!0)}),_.isBoolean(b)||this.addNavItem(a)},toggleView:function(a){a.preventDefault(),bp.Avatar.removeWarning();var c=b(a.target).data("nav");_.each(this.collection.models,function(a){a.id===c?(a.set({active:1}),this.trigger("bp-avatar-view:changed",a.id)):a.set({active:0})},this)}}),bp.Views.NavItem=bp.View.extend({tagName:"li",className:"avatar-nav-item",template:bp.template("bp-avatar-nav"),initialize:function(){1===this.model.get("active")&&(this.el.className+=" current"),this.el.id+="bp-avatar-"+this.model.get("id"),this.model.on("change:active",this.setCurrentNav,this)},setCurrentNav:function(a){1===a.get("active")?this.$el.addClass("current"):this.$el.removeClass("current")}}),bp.Views.Avatars=bp.View.extend({className:"items",initialize:function(){_.each(this.collection.models,this.addItemView,this)},addItemView:function(a){var b={full_h:150,full_w:150};_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(b.full_h=BP_Uploader.settings.crop.full_h,b.full_w=BP_Uploader.settings.crop.full_w),a.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),b)),this.views.add(new bp.Views.Avatar({model:a}))}}),bp.Views.Avatar=bp.View.extend({className:"item",template:bp.template("bp-avatar-item"),events:{"click .avatar-crop-submit":"cropAvatar"},initialize:function(){_.defaults(this.options,{full_h:BP_Uploader.settings.crop.full_h,full_w:BP_Uploader.settings.crop.full_w,aspectRatio:1}),!1!==this.model.get("feedback")&&bp.Avatar.displayWarning(this.model.get("feedback")),this.on("ready",this.initCropper)},initCropper:function(){var a,c,d,e,f,g,h=this,i=this.$el.find("#avatar-to-crop img"),j=this.$el.width(),k={};_.isUndefined(this.options.full_h)||_.isUndefined(this.options.full_w)||(this.options.aspectRatio=this.options.full_h/this.options.full_w),k.w=this.model.get("width"),k.h=this.model.get("height"),this.options.full_w+k.w+20<j&&(b("#avatar-to-crop").addClass("adjust"),this.$el.find(".avatar-crop-management").addClass("adjust")),k.h<=k.w?(a=Math.round(k.h/4),f=g=Math.round(k.h/2),c=f+a,d=(k.w-g)/2,e=g+d):(d=Math.round(k.w/4),f=g=Math.round(k.w/2),e=g+d,a=(k.h-f)/2,c=f+a),i.Jcrop({onChange:_.bind(h.showPreview,h),onSelect:_.bind(h.showPreview,h),aspectRatio:h.options.aspectRatio,setSelect:[d,a,e,c]},function(){bp.Avatar.jcropapi=this})},cropAvatar:function(a){a.preventDefault(),bp.Avatar.setAvatar(this.model)},showPreview:function(a){if(a.w&&a.h&&parseInt(a.w,10)>0){var c=this.options.full_w,d=this.options.full_h,e=c/a.w,f=d/a.h;this.model.set({x:a.x,y:a.y,w:a.w,h:a.h}),b("#avatar-crop-preview").css({maxWidth:"none",width:Math.round(e*this.model.get("width"))+"px",height:Math.round(f*this.model.get("height"))+"px",marginLeft:"-"+Math.round(e*this.model.get("x"))+"px",marginTop:"-"+Math.round(f*this.model.get("y"))+"px"})}}}),bp.Views.AvatarStatus=bp.View.extend({tagName:"p",className:"updated",id:"bp-avatar-feedback",initialize:function(){this.el.className+=" "+this.options.type,this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.DeleteAvatar=bp.View.extend({tagName:"div",id:"bp-delete-avatar-container",template:bp.template("bp-avatar-delete"),events:{"click #bp-delete-avatar":"deleteAvatar"},deleteAvatar:function(a){a.preventDefault(),bp.Avatar.deleteAvatar(this.model)}}),bp.Avatar.start())}(bp,jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/bp-plupload.js b/wp-content/plugins/buddypress/bp-core/js/bp-plupload.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d0651b521078286f1034853785af5b529fcfbad
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/bp-plupload.js
@@ -0,0 +1,388 @@
+/* globals bp, plupload, BP_Uploader, _, JSON, Backbone */
+
+window.wp = window.wp || {};
+window.bp = window.bp || window.wp;
+
+( function( exports, $ ) {
+
+	// Bail if not set
+	if ( typeof BP_Uploader === 'undefined' ) {
+		return;
+	}
+
+	bp.Models      = bp.Models || {};
+	bp.Collections = bp.Collections || {};
+	bp.Views       = bp.Views || {};
+	bp.Uploader    = {};
+
+	/**
+	 * BuddyPress Uploader.
+	 *
+	 * This is an adapted version of wp.Uploader
+	 */
+	bp.Uploader.uploader = function() {
+		var self = this,
+			isIE = navigator.userAgent.indexOf('Trident/') !== -1 || navigator.userAgent.indexOf('MSIE ') !== -1;
+
+		this.params  = BP_Uploader.settings;
+		this.strings = BP_Uploader.strings;
+
+		this.supports = {
+			upload: this.params.browser.supported
+		};
+
+		this.supported = this.supports.upload;
+
+		if ( ! this.supported ) {
+			/*jshint -W020 */
+			BP_Uploader = undefined;
+			return;
+		}
+
+		// Make sure flash sends cookies (seems in IE it does without switching to urlstream mode)
+		if ( ! isIE && 'flash' === plupload.predictRuntime( this.params.defaults ) &&
+			( ! this.params.defaults.required_features || ! this.params.defaults.required_features.hasOwnProperty( 'send_binary_string' ) ) ) {
+
+			this.params.defaults.required_features = this.params.defaults.required_features || {};
+			this.params.defaults.required_features.send_binary_string = true;
+		}
+
+		this.uploader = new plupload.Uploader( this.params.defaults );
+
+		/**
+		 * After the Uploader has been initialized, initialize some behaviors for the dropzone.
+		 *
+		 * @event Init
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 */
+		this.uploader.bind( 'Init', function( uploader ) {
+			var container = $( '#' + self.params.defaults.container ),
+			    drop_element = $( '#' + self.params.defaults.drop_element );
+
+			if ( 'html4' === uploader.runtime ) {
+				uploader.settings.multipart_params.html4 = true;
+			}
+
+			if ( uploader.features.dragdrop && ! self.params.browser.mobile ) {
+				container.addClass( 'drag-drop' );
+				drop_element.bind( 'dragover.wp-uploader', function() {
+					container.addClass( 'drag-over' );
+				} ).bind( 'dragleave.wp-uploader, drop.wp-uploader', function() {
+					container.removeClass( 'drag-over' );
+				} );
+			} else {
+				container.removeClass( 'drag-drop' );
+				drop_element.unbind( '.wp-uploader' );
+			}
+
+		} );
+
+		// Init BuddyPress Uploader
+		this.uploader.init();
+
+		/**
+		 * Feedback callback.
+		 *
+		 * Add a new message to the errors collection, so it's possible
+		 * to give some feedback to the user
+		 *
+		 * @param  {string}        message
+		 * @param  {object}        data
+		 * @param  {plupload.File} file     File that was uploaded.
+		 */
+		this.feedback = function( message, data, file ) {
+			if ( ! _.isNull( file ) && file.item ) {
+				file.item.clear();
+			}
+
+			bp.Uploader.filesError.unshift( {
+				message: message,
+				data:    data,
+				file:    file
+			} );
+		};
+
+		/**
+		 * After files were filtered and added to the queue, create a model for each.
+		 *
+		 * @event FilesAdded
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 * @param {Array}             files    Array of file objects that were added to queue by the user.
+		 */
+		this.uploader.bind( 'FilesAdded', function( uploader, files ) {
+			var hundredmb = 100 * 1024 * 1024, max = parseInt( uploader.settings.max_file_size, 10 ),
+			    _this = this;
+
+			/**
+			 * In case the multiple selection is false (eg: avatar) stop the process and send
+			 * and event containing a warning
+			 */
+			if ( ! uploader.settings.multi_selection && files.length > 1 ) {
+				for ( var i in files ) {
+					uploader.removeFile( files[i] );
+				}
+
+				$( self ).trigger( 'bp-uploader-warning', self.strings.unique_file_warning );
+				return;
+			}
+
+			_.each( files, function( file ) {
+				var attributes;
+
+				// Ignore failed uploads.
+				if ( plupload.FAILED === file.status ) {
+					return;
+				}
+
+				if ( max > hundredmb && file.size > hundredmb && uploader.runtime !== 'html5' ) {
+					_this.uploadSizeError( uploader, file, true );
+				} else {
+					attributes = _.extend( {
+						id:        file.id,
+						file:      file,
+						uploading: true,
+						date:      new Date(),
+						filename:  file.name
+					}, _.pick( file, 'loaded', 'size', 'percent' ) );
+
+					file.item = new bp.Models.File( attributes );
+					bp.Uploader.filesQueue.add( file.item );
+				}
+
+			} );
+
+			uploader.refresh();
+			uploader.start();
+		} );
+
+		/**
+		 * Update each file item on progress
+		 *
+		 * @event UploadProgress
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 * @param {Object}            file
+		 */
+		this.uploader.bind( 'UploadProgress', function( uploader, file ) {
+			file.item.set( _.pick( file, 'loaded', 'percent' ) );
+		} );
+
+		/**
+		 * After a file is successfully uploaded, update its model.
+		 *
+		 * @event FileUploaded
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 * @param {plupload.File}     file     File that was uploaded.
+		 * @param {Object}            response Object with response properties.
+		 * @return {mixed}
+		 */
+		this.uploader.bind( 'FileUploaded', function( uploader, file, response ) {
+			var message = self.strings.default_error;
+
+			try {
+				response = JSON.parse( response.response );
+			} catch ( e ) {
+				return self.feedback( message, e, file );
+			}
+
+			if ( ! _.isObject( response ) || _.isUndefined( response.success ) ) {
+				return self.feedback( message, null, file );
+			} else if ( ! response.success ) {
+				if ( response.data && response.data.message ) {
+					message = response.data.message;
+				}
+
+				return self.feedback( message, response.data, file );
+			}
+
+			_.each(['file','loaded','size','percent'], function( key ) {
+				file.item.unset( key );
+			} );
+
+			file.item.set( _.extend( response.data, { uploading: false } ) );
+
+			//  Add the file to the Uploaded ones
+			bp.Uploader.filesUploaded.add( file.item );
+
+		} );
+
+		/**
+		 * Trigger an event to inform a new upload is being processed
+		 *
+		 * Mainly used to remove an eventual warning
+		 *
+		 * @event BeforeUpload
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 * @param {Array}             files    Array of file objects that were added to queue by the user.
+		 */
+		this.uploader.bind( 'BeforeUpload', function( uploader, files ) {
+			$( self ).trigger( 'bp-uploader-new-upload', uploader, files );
+		} );
+
+		/**
+		 * Reset the filesQueue once the upload is complete
+		 *
+		 * @event BeforeUpload
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 * @param {Array}             files    Array of file objects that were added to queue by the user.
+		 */
+		this.uploader.bind( 'UploadComplete', function( uploader, files ) {
+			$( self ).trigger( 'bp-uploader-upload-complete', uploader, files );
+			bp.Uploader.filesQueue.reset();
+		} );
+
+		/**
+		 * Map Plupload errors & Create a warning when plupload failed
+		 *
+		 * @event Error
+		 * @param {plupload.Uploader} uploader Uploader instance.
+		 * @param {Object}            pluploadError Plupload error
+		 */
+		this.uploader.bind( 'Error', function( uploader, pluploadError ) {
+			var message = self.strings.default_error,
+				key,
+				errors = {
+					'FAILED':                 self.strings.upload_failed,
+					'FILE_EXTENSION_ERROR':   self.strings.invalid_filetype,
+					'IMAGE_FORMAT_ERROR':     self.strings.not_an_image,
+					'IMAGE_MEMORY_ERROR':     self.strings.image_memory_exceeded,
+					'IMAGE_DIMENSIONS_ERROR': self.strings.image_dimensions_exceeded,
+					'GENERIC_ERROR':          self.strings.upload_failed,
+					'IO_ERROR':               self.strings.io_error,
+					'HTTP_ERROR':             self.strings.http_error,
+					'SECURITY_ERROR':         self.strings.security_error,
+					'FILE_SIZE_ERROR':        self.strings.file_exceeds_size_limit.replace( '%s' , pluploadError.file.name )
+				};
+
+			// Check for plupload errors.
+			for ( key in errors ) {
+				if ( pluploadError.code === plupload[ key ] ) {
+					message = errors[ key ];
+					break;
+				}
+			}
+
+			$( self ).trigger( 'bp-uploader-warning', message );
+			uploader.refresh();
+		} );
+	};
+
+	// Create a very generic Model for files
+	bp.Models.File = Backbone.Model.extend( {
+		file: {}
+	} );
+
+	// Add Collections to store queue, uploaded files and errors
+	$.extend( bp.Uploader, {
+		filesQueue    : new Backbone.Collection(),
+		filesUploaded : new Backbone.Collection(),
+		filesError    : new Backbone.Collection()
+	} );
+
+	// Extend wp.Backbone.View with .prepare() and .inject()
+	bp.View = bp.Backbone.View.extend( {
+		inject: function( selector ) {
+			this.render();
+			$(selector).html( this.el );
+			this.views.ready();
+		},
+
+		prepare: function() {
+			if ( ! _.isUndefined( this.model ) && _.isFunction( this.model.toJSON ) ) {
+				return this.model.toJSON();
+			} else {
+				return {};
+			}
+		}
+	} );
+
+	// BuddyPress Uploader main view
+	bp.Views.Uploader = bp.View.extend( {
+		className: 'bp-uploader-window',
+		template: bp.template( 'upload-window' ),
+
+		defaults: _.pick( BP_Uploader.settings.defaults, 'container', 'drop_element', 'browse_button' ),
+
+		initialize: function() {
+			this.warning = null;
+			this.model = new Backbone.Model( this.defaults );
+			this.on( 'ready', this.initUploader );
+		},
+
+		initUploader: function() {
+			this.uploader = new bp.Uploader.uploader();
+			$( this.uploader ).on( 'bp-uploader-warning', _.bind( this.setWarning, this ) );
+			$( this.uploader ).on( 'bp-uploader-new-upload', _.bind( this.resetWarning, this ) );
+		},
+
+		setWarning: function( event, message ) {
+			if ( _.isUndefined( message ) ) {
+				return;
+			}
+
+			this.warning = new bp.Views.uploaderWarning( {
+				value: message
+			} ).render();
+
+			this.$el.after( this.warning.el );
+		},
+
+		resetWarning: function() {
+			if ( _.isNull( this.warning ) ) {
+				return;
+			}
+
+			this.warning.remove();
+			this.warning = null;
+		}
+	} );
+
+	// BuddyPress Uploader warning view
+	bp.Views.uploaderWarning = bp.View.extend( {
+		tagName: 'p',
+		className: 'warning',
+		id: 'bp-uploader-warning',
+
+		initialize: function() {
+			this.value = this.options.value;
+		},
+
+		render: function() {
+			this.$el.html( this.value );
+			return this;
+		}
+	} );
+
+	// BuddyPress Uploader Files view
+	bp.Views.uploaderStatus = bp.View.extend( {
+		className: 'files',
+
+		initialize: function() {
+			_.each( this.collection.models, this.addFile, this );
+			this.collection.on( 'change:percent', this.progress, this );
+			bp.Uploader.filesError.on( 'add', this.feedback, this );
+		},
+
+		addFile: function( file ) {
+			this.views.add( new bp.Views.uploaderProgress( { model: file } ) );
+		},
+
+		progress:function( model ) {
+			if ( ! _.isUndefined( model.get( 'percent' ) ) ) {
+				$( '#' + model.get('id') + ' .bp-progress .bp-bar' ).css( 'width', model.get('percent') + '%' );
+			}
+		},
+
+		feedback: function( model ) {
+			if ( ! _.isUndefined( model.get( 'message' ) ) && ! _.isUndefined( model.get( 'file' ) ) ) {
+				$( '#' + model.get( 'file' ).id ).html( model.get( 'message' ) ).addClass( 'error' );
+			}
+		}
+	} );
+
+	// BuddyPress Uploader File progress view
+	bp.Views.uploaderProgress = bp.View.extend( {
+		className: 'bp-uploader-progress',
+		template: bp.template( 'progress-window' )
+	} );
+
+})( bp, jQuery );
diff --git a/wp-content/plugins/buddypress/bp-core/js/bp-plupload.min.js b/wp-content/plugins/buddypress/bp-core/js/bp-plupload.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..56ff8efe3cea91714476039e3febca01e4fa2a18
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/bp-plupload.min.js
@@ -0,0 +1,2 @@
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+window.wp=window.wp||{},window.bp=window.bp||window.wp,function(a,b){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.Uploader={},bp.Uploader.uploader=function(){var a=this,c=-1!==navigator.userAgent.indexOf("Trident/")||-1!==navigator.userAgent.indexOf("MSIE ");return this.params=BP_Uploader.settings,this.strings=BP_Uploader.strings,this.supports={upload:this.params.browser.supported},this.supported=this.supports.upload,this.supported?(c||"flash"!==plupload.predictRuntime(this.params.defaults)||this.params.defaults.required_features&&this.params.defaults.required_features.hasOwnProperty("send_binary_string")||(this.params.defaults.required_features=this.params.defaults.required_features||{},this.params.defaults.required_features.send_binary_string=!0),this.uploader=new plupload.Uploader(this.params.defaults),this.uploader.bind("Init",function(c){var d=b("#"+a.params.defaults.container),e=b("#"+a.params.defaults.drop_element);"html4"===c.runtime&&(c.settings.multipart_params.html4=!0),c.features.dragdrop&&!a.params.browser.mobile?(d.addClass("drag-drop"),e.bind("dragover.wp-uploader",function(){d.addClass("drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){d.removeClass("drag-over")})):(d.removeClass("drag-drop"),e.unbind(".wp-uploader"))}),this.uploader.init(),this.feedback=function(a,b,c){!_.isNull(c)&&c.item&&c.item.clear(),bp.Uploader.filesError.unshift({message:a,data:b,file:c})},this.uploader.bind("FilesAdded",function(c,d){var e=104857600,f=parseInt(c.settings.max_file_size,10),g=this;if(!c.settings.multi_selection&&d.length>1){for(var h in d)c.removeFile(d[h]);return void b(a).trigger("bp-uploader-warning",a.strings.unique_file_warning)}_.each(d,function(a){var b;plupload.FAILED!==a.status&&(f>e&&a.size>e&&"html5"!==c.runtime?g.uploadSizeError(c,a,!0):(b=_.extend({id:a.id,file:a,uploading:!0,date:new Date,filename:a.name},_.pick(a,"loaded","size","percent")),a.item=new bp.Models.File(b),bp.Uploader.filesQueue.add(a.item)))}),c.refresh(),c.start()}),this.uploader.bind("UploadProgress",function(a,b){b.item.set(_.pick(b,"loaded","percent"))}),this.uploader.bind("FileUploaded",function(b,c,d){var e=a.strings.default_error;try{d=JSON.parse(d.response)}catch(f){return a.feedback(e,f,c)}return!_.isObject(d)||_.isUndefined(d.success)?a.feedback(e,null,c):d.success?(_.each(["file","loaded","size","percent"],function(a){c.item.unset(a)}),c.item.set(_.extend(d.data,{uploading:!1})),void bp.Uploader.filesUploaded.add(c.item)):(d.data&&d.data.message&&(e=d.data.message),a.feedback(e,d.data,c))}),this.uploader.bind("BeforeUpload",function(c,d){b(a).trigger("bp-uploader-new-upload",c,d)}),this.uploader.bind("UploadComplete",function(c,d){b(a).trigger("bp-uploader-upload-complete",c,d),bp.Uploader.filesQueue.reset()}),void this.uploader.bind("Error",function(c,d){var e,f=a.strings.default_error,g={FAILED:a.strings.upload_failed,FILE_EXTENSION_ERROR:a.strings.invalid_filetype,IMAGE_FORMAT_ERROR:a.strings.not_an_image,IMAGE_MEMORY_ERROR:a.strings.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:a.strings.image_dimensions_exceeded,GENERIC_ERROR:a.strings.upload_failed,IO_ERROR:a.strings.io_error,HTTP_ERROR:a.strings.http_error,SECURITY_ERROR:a.strings.security_error,FILE_SIZE_ERROR:a.strings.file_exceeds_size_limit.replace("%s",d.file.name)};for(e in g)if(d.code===plupload[e]){f=g[e];break}b(a).trigger("bp-uploader-warning",f),c.refresh()})):void(BP_Uploader=void 0)},bp.Models.File=Backbone.Model.extend({file:{}}),b.extend(bp.Uploader,{filesQueue:new Backbone.Collection,filesUploaded:new Backbone.Collection,filesError:new Backbone.Collection}),bp.View=bp.Backbone.View.extend({inject:function(a){this.render(),b(a).html(this.el),this.views.ready()},prepare:function(){return!_.isUndefined(this.model)&&_.isFunction(this.model.toJSON)?this.model.toJSON():{}}}),bp.Views.Uploader=bp.View.extend({className:"bp-uploader-window",template:bp.template("upload-window"),defaults:_.pick(BP_Uploader.settings.defaults,"container","drop_element","browse_button"),initialize:function(){this.warning=null,this.model=new Backbone.Model(this.defaults),this.on("ready",this.initUploader)},initUploader:function(){this.uploader=new bp.Uploader.uploader,b(this.uploader).on("bp-uploader-warning",_.bind(this.setWarning,this)),b(this.uploader).on("bp-uploader-new-upload",_.bind(this.resetWarning,this))},setWarning:function(a,b){_.isUndefined(b)||(this.warning=new bp.Views.uploaderWarning({value:b}).render(),this.$el.after(this.warning.el))},resetWarning:function(){_.isNull(this.warning)||(this.warning.remove(),this.warning=null)}}),bp.Views.uploaderWarning=bp.View.extend({tagName:"p",className:"warning",id:"bp-uploader-warning",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}}),bp.Views.uploaderStatus=bp.View.extend({className:"files",initialize:function(){_.each(this.collection.models,this.addFile,this),this.collection.on("change:percent",this.progress,this),bp.Uploader.filesError.on("add",this.feedback,this)},addFile:function(a){this.views.add(new bp.Views.uploaderProgress({model:a}))},progress:function(a){_.isUndefined(a.get("percent"))||b("#"+a.get("id")+" .bp-progress .bp-bar").css("width",a.get("percent")+"%")},feedback:function(a){_.isUndefined(a.get("message"))||_.isUndefined(a.get("file"))||b("#"+a.get("file").id).html(a.get("message")).addClass("error")}}),bp.Views.uploaderProgress=bp.View.extend({className:"bp-uploader-progress",template:bp.template("progress-window")}))}(bp,jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/confirm.min.js b/wp-content/plugins/buddypress/bp-core/js/confirm.min.js
index c2211370a2ddb8374ad9877af13485681fd9b339..47ab062e0925e6710e0a932ecf701a4eadef0003 100644
--- a/wp-content/plugins/buddypress/bp-core/js/confirm.min.js
+++ b/wp-content/plugins/buddypress/bp-core/js/confirm.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 jQuery(document).ready(function(){jQuery("a.confirm").click(function(){return confirm(BP_Confirm.are_you_sure)?!0:!1})});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js
index e40b8bf224af6501390d0e83baf79ef95a77efaf..0e0aa88edd96a5cd72eb8dca7b15b3d35c6910fd 100644
--- a/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js
index 81ca3ada1110e8379a4bce78425d651ad2f8523b..20dffa43f40c493ee694d9865251a14d662f5b1c 100644
--- a/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 function bp_get_querystring(a){var b=location.search.split(a+"=")[1];return b?decodeURIComponent(b.split("&")[0]):null}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.js b/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.js
new file mode 100644
index 0000000000000000000000000000000000000000..ebcff575536c2f62b99201eaefedd5cf40a0429d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.js
@@ -0,0 +1,208 @@
+/* jshint undef: false */
+/* jshint -W065 */
+
+/*!
+ * jQuery.ScrollTo
+ * Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
+ * Licensed under MIT
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
+ * @projectDescription Easy element scrolling using jQuery.
+ * @author Ariel Flesler
+ * @version 1.4.12
+ */
+
+(function(factory) {
+	// AMD
+	if (typeof define === 'function' && define.amd) {
+		define(['jquery'], factory);
+	// CommonJS
+	} else if (typeof exports === 'object') {
+		factory(require('jquery'));
+	// Browser globals
+	} else {
+		factory(jQuery);
+	}
+}(function($) {
+
+	var $scrollTo = $.scrollTo = function(target, duration, settings) {
+		return $(window).scrollTo(target, duration, settings);
+	};
+
+	$scrollTo.defaults = {
+		axis: 'xy',
+		duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1,
+		limit: true
+	};
+
+	// Returns the element that needs to be animated to scroll the window.
+	// Kept for backwards compatibility (specially for localScroll & serialScroll)
+	$scrollTo.window = function() {
+		return $(window)._scrollable();
+	};
+
+	// Hack, hack, hack :)
+	// Returns the real elements to scroll (supports window/iframes, documents and regular nodes)
+	$.fn._scrollable = function() {
+		return this.map(function() {
+			var elem = this,
+					isWin = !elem.nodeName || $.inArray(elem.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) !== -1;
+
+			if (!isWin) {
+				return elem;
+			}
+
+			var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem;
+
+			return /webkit/i.test(navigator.userAgent) || doc.compatMode === 'BackCompat' ?
+					doc.body :
+					doc.documentElement;
+		});
+	};
+
+	$.fn.scrollTo = function(target, duration, settings) {
+		if (typeof duration === 'object') {
+			settings = duration;
+			duration = 0;
+		}
+		if (typeof settings === 'function') {
+			settings = {onAfter: settings};
+		}
+
+		if (target === 'max') {
+			target = 9e9;
+		}
+
+		settings = $.extend({}, $scrollTo.defaults, settings);
+		// Speed is still recognized for backwards compatibility
+		duration = duration || settings.duration;
+		// Make sure the settings are given right
+		settings.queue = settings.queue && settings.axis.length > 1;
+
+		// Let's keep the overall duration
+		if (settings.queue) {
+			duration /= 2;
+		}
+
+		settings.offset = both(settings.offset);
+		settings.over = both(settings.over);
+
+		return this._scrollable().each(function() {
+
+			// Null target yields nothing, just like jQuery does
+			if (target === null) {
+				return;
+			}
+
+			var elem = this,
+					$elem = $(elem),
+					targ = target, toff, attr = {},
+					win = $elem.is('html,body');
+
+			switch (typeof targ) {
+				// A number will pass the regex
+				case 'number':
+				case 'string':
+					if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
+						targ = both(targ);
+						// We are done
+						break;
+					}
+					// Relative/Absolute selector, no break!
+					targ = win ? $(targ) : $(targ, this);
+					if (!targ.length) {
+						return;
+					}
+					/* falls through */
+				case 'object':
+					// DOMElement / jQuery
+					if (targ.is || targ.style) {
+						// Get the real position of the target
+						toff = (targ = $(targ)).offset();
+					}
+			}
+
+			var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
+
+			$.each(settings.axis.split(''), function(i, axis) {
+				var Pos = axis === 'x' ? 'Left' : 'Top',
+						pos = Pos.toLowerCase(),
+						key = 'scroll' + Pos,
+						old = elem[key],
+						max = $scrollTo.max(elem, axis);
+
+				if (toff) {// jQuery / DOMElement
+					attr[key] = toff[pos] + (win ? 0 : old - $elem.offset()[pos]);
+
+					// If it's a dom element, reduce the margin
+					if (settings.margin) {
+						attr[key] -= parseInt(targ.css('margin' + Pos)) || 0;
+						attr[key] -= parseInt(targ.css('border' + Pos + 'Width')) || 0;
+					}
+
+					attr[key] += offset[pos] || 0;
+
+					// Scroll to a fraction of its width/height
+					if (settings.over[pos]) {
+						attr[key] += targ[axis === 'x' ? 'width' : 'height']() * settings.over[pos];
+					}
+				} else {
+					var val = targ[pos];
+					// Handle percentage values
+					attr[key] = val.slice && val.slice(-1) === '%' ?
+							parseFloat(val) / 100 * max
+							: val;
+				}
+
+				// Number or 'number'
+				if (settings.limit && /^\d+$/.test(attr[key])) {
+					// Check the limits
+					attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
+				}
+
+				// Queueing axes
+				if (!i && settings.queue) {
+					// Don't waste time animating, if there's no need.
+					if (old !== attr[key]) {
+						// Intermediate animation
+						animate(settings.onAfterFirst);
+					}
+					// Don't animate this axis again in the next iteration.
+					delete attr[key];
+				}
+			});
+
+			animate(settings.onAfter);
+
+			function animate(callback) {
+				$elem.animate(attr, duration, settings.easing, callback && function() {
+					callback.call(this, targ, settings);
+				});
+			}
+
+		}).end();
+	};
+
+	// Max scrolling position, works on quirks mode
+	// It only fails (not too badly) on IE, quirks mode.
+	$scrollTo.max = function(elem, axis) {
+		var Dim = axis === 'x' ? 'Width' : 'Height',
+				scroll = 'scroll' + Dim;
+
+		if (!$(elem).is('html,body')) {
+			return elem[scroll] - $(elem)[Dim.toLowerCase()]();
+		}
+
+		var size = 'client' + Dim,
+				html = elem.ownerDocument.documentElement,
+				body = elem.ownerDocument.body;
+
+		return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
+	};
+
+	function both(val) {
+		return $.isFunction(val) || typeof val === 'object' ? val : {top: val, left: val};
+	}
+
+	// AMD requirement
+	return $scrollTo;
+}));
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..db9faf3db7851e133cf1240b780ffd229c9ce100
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.min.js
@@ -0,0 +1,2 @@
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){function b(b){return a.isFunction(b)||"object"==typeof b?b:{top:b,left:b}}var c=a.scrollTo=function(b,c,d){return a(window).scrollTo(b,c,d)};return c.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1,limit:!0},c.window=function(){return a(window)._scrollable()},a.fn._scrollable=function(){return this.map(function(){var b=this,c=!b.nodeName||-1!==a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"]);if(!c)return b;var d=(b.contentWindow||b).document||b.ownerDocument||b;return/webkit/i.test(navigator.userAgent)||"BackCompat"===d.compatMode?d.body:d.documentElement})},a.fn.scrollTo=function(d,e,f){return"object"==typeof e&&(f=e,e=0),"function"==typeof f&&(f={onAfter:f}),"max"===d&&(d=9e9),f=a.extend({},c.defaults,f),e=e||f.duration,f.queue=f.queue&&f.axis.length>1,f.queue&&(e/=2),f.offset=b(f.offset),f.over=b(f.over),this._scrollable().each(function(){function g(a){j.animate(l,e,f.easing,a&&function(){a.call(this,k,f)})}if(null!==d){var h,i=this,j=a(i),k=d,l={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}if(k=m?a(k):a(k,this),!k.length)return;case"object":(k.is||k.style)&&(h=(k=a(k)).offset())}var n=a.isFunction(f.offset)&&f.offset(i,k)||f.offset;a.each(f.axis.split(""),function(a,b){var d="x"===b?"Left":"Top",e=d.toLowerCase(),o="scroll"+d,p=i[o],q=c.max(i,b);if(h)l[o]=h[e]+(m?0:p-j.offset()[e]),f.margin&&(l[o]-=parseInt(k.css("margin"+d))||0,l[o]-=parseInt(k.css("border"+d+"Width"))||0),l[o]+=n[e]||0,f.over[e]&&(l[o]+=k["x"===b?"width":"height"]()*f.over[e]);else{var r=k[e];l[o]=r.slice&&"%"===r.slice(-1)?parseFloat(r)/100*q:r}f.limit&&/^\d+$/.test(l[o])&&(l[o]=l[o]<=0?0:Math.min(l[o],q)),!a&&f.queue&&(p!==l[o]&&g(f.onAfterFirst),delete l[o])}),g(f.onAfter)}}).end()},c.max=function(b,c){var d="x"===c?"Width":"Height",e="scroll"+d;if(!a(b).is("html,body"))return b[e]-a(b)[d.toLowerCase()]();var f="client"+d,g=b.ownerDocument.documentElement,h=b.ownerDocument.body;return Math.max(g[e],h[e])-Math.min(g[f],h[f])},c});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.js b/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.js
index d5eefe3f45def617d000c88c86a2ca91bdab8462..717d9935dd6889a56f2c6c548fa04b38dd205ca2 100644
--- a/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.js
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.js
@@ -1,19 +1,25 @@
-/*! jquery.atwho - v0.5.0 - 2014-07-14
-* Copyright (c) 2014 chord.luo <chord.luo@gmail.com>; 
-* homepage: http://ichord.github.com/At.js 
+/*! jquery.atwho - v0.5.2 %>
+* Copyright (c) 2014 chord.luo <chord.luo@gmail.com>;
+* homepage: http://ichord.github.com/At.js
 * Licensed MIT
 */
+(function (root, factory) {
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module.
+    define(["jquery"], function ($) {
+      return (root.returnExportsGlobal = factory($));
+    });
+  } else if (typeof exports === 'object') {
+    // Node. Does not work with strict CommonJS, but
+    // only CommonJS-like enviroments that support module.exports,
+    // like Node.
+    module.exports = factory(require("jquery"));
+  } else {
+    factory(jQuery);
+  }
+}(this, function ($) {
 
-(function() {
-  (function(factory) {
-    if (typeof define === 'function' && define.amd) {
-      return define(['jquery'], factory);
-    } else {
-      return factory(window.jQuery);
-    }
-  })(function($) {
-
-var $CONTAINER, Api, App, Controller, DEFAULT_CALLBACKS, KEY_CODE, Model, View,
+var Api, App, Controller, DEFAULT_CALLBACKS, KEY_CODE, Model, View,
   __slice = [].slice;
 
 App = (function() {
@@ -22,20 +28,37 @@ App = (function() {
     this.controllers = {};
     this.alias_maps = {};
     this.$inputor = $(inputor);
-    this.iframe = null;
     this.setIframe();
     this.listen();
   }
 
-  App.prototype.setIframe = function(iframe) {
+  App.prototype.createContainer = function(doc) {
+    if ((this.$el = $("#atwho-container", doc)).length === 0) {
+      return $(doc.body).append(this.$el = $("<div id='atwho-container'></div>"));
+    }
+  };
+
+  App.prototype.setIframe = function(iframe, standalone) {
+    var _ref;
+    if (standalone == null) {
+      standalone = false;
+    }
     if (iframe) {
       this.window = iframe.contentWindow;
       this.document = iframe.contentDocument || this.window.document;
-      return this.iframe = iframe;
+      this.iframe = iframe;
     } else {
       this.document = document;
       this.window = window;
-      return this.iframe = null;
+      this.iframe = null;
+    }
+    if (this.iframeStandalone = standalone) {
+      if ((_ref = this.$el) != null) {
+        _ref.remove();
+      }
+      return this.createContainer(this.document);
+    } else {
+      return this.createContainer(document);
     }
   };
 
@@ -98,8 +121,7 @@ App = (function() {
       };
     })(this)).on('click.atwhoInner', (function(_this) {
       return function(e) {
-        var _ref;
-        return (_ref = _this.controller()) != null ? _ref.view.hide(e) : void 0;
+        return _this.dispatch();
       };
     })(this));
   };
@@ -112,7 +134,8 @@ App = (function() {
       c.destroy();
       delete this.controllers[_];
     }
-    return this.$inputor.off('.atwhoInner');
+    this.$inputor.off('.atwhoInner');
+    return this.$el.remove();
   };
 
   App.prototype.dispatch = function() {
@@ -225,7 +248,9 @@ Controller = (function() {
     this.pos = 0;
     this.cur_rect = null;
     this.range = null;
-    $CONTAINER.append(this.$el = $("<div id='atwho-ground-" + this.id + "'></div>"));
+    if ((this.$el = $("#atwho-ground-" + this.id, this.app.$el)).length === 0) {
+      this.app.$el.append(this.$el = $("<div id='atwho-ground-" + this.id + "'></div>"));
+    }
     this.model = new Model(this);
     this.view = new View(this);
   }
@@ -280,10 +305,14 @@ Controller = (function() {
   };
 
   Controller.prototype.content = function() {
+    var range;
     if (this.$inputor.is('textarea, input')) {
       return this.$inputor.val();
     } else {
-      return this.$inputor.text();
+      if (!(range = this.mark_range())) {
+        return;
+      }
+      return (range.startContainer.textContent || "").slice(0, range.startOffset);
     }
   };
 
@@ -313,14 +342,19 @@ Controller = (function() {
   };
 
   Controller.prototype.rect = function() {
-    var c, scale_bottom;
+    var c, iframe_offset, scale_bottom;
     if (!(c = this.$inputor.caret('offset', this.pos - 1, {
       iframe: this.app.iframe
     }))) {
       return;
     }
-    if (this.$inputor.attr('contentEditable') === 'true') {
-      c = (this.cur_rect || (this.cur_rect = c)) || c;
+    if (this.app.iframe && !this.app.iframeStandalone) {
+      iframe_offset = $(this.app.iframe).offset();
+      c.left += iframe_offset.left;
+      c.top += iframe_offset.top;
+    }
+    if (this.$inputor.is('[contentEditable]')) {
+      c = this.cur_rect || (this.cur_rect = c);
     }
     scale_bottom = this.app.document.selection ? 0 : 2;
     return {
@@ -331,19 +365,20 @@ Controller = (function() {
   };
 
   Controller.prototype.reset_rect = function() {
-    if (this.$inputor.attr('contentEditable') === 'true') {
+    if (this.$inputor.is('[contentEditable]')) {
       return this.cur_rect = null;
     }
   };
 
   Controller.prototype.mark_range = function() {
-    if (this.$inputor.attr('contentEditable') === 'true') {
-      if (this.app.window.getSelection) {
-        this.range = this.app.window.getSelection().getRangeAt(0);
-      }
-      if (this.app.document.selection) {
-        return this.ie8_range = this.app.document.selection.createRange();
-      }
+    var sel;
+    if (!this.$inputor.is('[contentEditable]')) {
+      return;
+    }
+    if (this.app.window.getSelection && (sel = this.app.window.getSelection()).rangeCount > 0) {
+      return this.range = sel.getRangeAt(0);
+    } else if (this.app.document.selection) {
+      return this.ie8_range = this.app.document.selection.createRange();
     }
   };
 
@@ -362,15 +397,15 @@ Controller = (function() {
   };
 
   Controller.prototype.insert = function(content, $li) {
-    var $inputor, content_node, pos, range, sel, source, start_str, text, wrapped_content;
+    var $inputor, node, pos, range, sel, source, start_str, text, wrapped_contents, _i, _len, _ref;
     $inputor = this.$inputor;
-    wrapped_content = this.callbacks('inserting_wrapper').call(this, $inputor, content, this.get_opt("suffix"));
+    wrapped_contents = this.callbacks('inserting_wrapper').call(this, $inputor, content, this.get_opt("suffix"));
     if ($inputor.is('textarea, input')) {
       source = $inputor.val();
       start_str = source.slice(0, Math.max(this.query.head_pos - this.at.length, 0));
-      text = "" + start_str + wrapped_content + (source.slice(this.query['end_pos'] || 0));
+      text = "" + start_str + wrapped_contents + (source.slice(this.query['end_pos'] || 0));
       $inputor.val(text);
-      $inputor.caret('pos', start_str.length + wrapped_content.length, {
+      $inputor.caret('pos', start_str.length + wrapped_contents.length, {
         iframe: this.app.iframe
       });
     } else if (range = this.range) {
@@ -378,16 +413,19 @@ Controller = (function() {
       range.setStart(range.endContainer, Math.max(pos, 0));
       range.setEnd(range.endContainer, range.endOffset);
       range.deleteContents();
-      content_node = $(wrapped_content, this.app.document)[0];
-      range.insertNode(content_node);
-      range.setEndAfter(content_node);
-      range.collapse(false);
+      _ref = $(wrapped_contents, this.app.document);
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        node = _ref[_i];
+        range.insertNode(node);
+        range.setEndAfter(node);
+        range.collapse(false);
+      }
       sel = this.app.window.getSelection();
       sel.removeAllRanges();
       sel.addRange(range);
     } else if (range = this.ie8_range) {
       range.moveStart('character', this.query.end_pos - this.query.head_pos - this.at.length);
-      range.pasteHTML(wrapped_content);
+      range.pasteHTML(wrapped_contents);
       range.collapse(false);
       range.select();
     }
@@ -515,8 +553,10 @@ View = (function() {
     return $menu.on('mouseenter.atwho-view', 'li', function(e) {
       $menu.find('.cur').removeClass('cur');
       return $(e.currentTarget).addClass('cur');
-    }).on('click', (function(_this) {
+    }).on('click.atwho-view', 'li', (function(_this) {
       return function(e) {
+        $menu.find('.cur').removeClass('cur');
+        $(e.currentTarget).addClass('cur');
         _this.choose(e);
         return e.preventDefault();
       };
@@ -541,10 +581,14 @@ View = (function() {
   };
 
   View.prototype.reposition = function(rect) {
-    var offset, _ref;
-    if (rect.bottom + this.$el.height() - $(window).scrollTop() > $(window).height()) {
+    var offset, overflowOffset, _ref, _window;
+    _window = this.context.app.iframeStandalone ? this.context.app.window : window;
+    if (rect.bottom + this.$el.height() - $(_window).scrollTop() > $(_window).height()) {
       rect.bottom = rect.top - this.$el.height();
     }
+    if (rect.left > (overflowOffset = $(_window).width() - this.$el.width() - 5)) {
+      rect.left = overflowOffset;
+    }
     offset = {
       left: rect.left,
       top: rect.bottom
@@ -563,7 +607,10 @@ View = (function() {
     if (!next.length) {
       next = this.$el.find('li:first');
     }
-    return next.addClass('cur');
+    next.addClass('cur');
+    return this.$el.animate({
+      scrollTop: Math.max(0, cur.innerHeight() * (next.index() + 2) - this.$el.height())
+    }, 150);
   };
 
   View.prototype.prev = function() {
@@ -573,7 +620,10 @@ View = (function() {
     if (!prev.length) {
       prev = this.$el.find('li:last');
     }
-    return prev.addClass('cur');
+    prev.addClass('cur');
+    return this.$el.animate({
+      scrollTop: Math.max(0, cur.innerHeight() * (prev.index() + 2) - this.$el.height())
+    }, 150);
   };
 
   View.prototype.show = function() {
@@ -585,6 +635,7 @@ View = (function() {
     this.context.mark_range();
     if (!this.visible()) {
       this.$el.show();
+      this.$el.scrollTop(0);
       this.context.trigger('shown');
     }
     if (rect = this.context.rect()) {
@@ -672,12 +723,14 @@ DEFAULT_CALLBACKS = {
     return _results;
   },
   matcher: function(flag, subtext, should_start_with_space) {
-    var match, regexp;
+    var match, regexp, _a, _y;
     flag = flag.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
     if (should_start_with_space) {
       flag = '(?:^|\\s)' + flag;
     }
-    regexp = new RegExp(flag + '([A-Za-z0-9_\+\-]*)$|' + flag + '([^\\x00-\\xff]*)$', 'gi');
+    _a = decodeURI("%C3%80");
+    _y = decodeURI("%C3%BF");
+    regexp = new RegExp("" + flag + "([A-Za-z" + _a + "-" + _y + "0-9_\+\-]*)$|" + flag + "([^\\x00-\\xff]*)$", 'gi');
     match = regexp.exec(subtext);
     if (match) {
       return match[2] || match[1];
@@ -690,7 +743,7 @@ DEFAULT_CALLBACKS = {
     _results = [];
     for (_i = 0, _len = data.length; _i < _len; _i++) {
       item = data[_i];
-      if (~item[search_key].toLowerCase().indexOf(query.toLowerCase())) {
+      if (~new String(item[search_key]).toLowerCase().indexOf(query.toLowerCase())) {
         _results.push(item);
       }
     }
@@ -705,7 +758,7 @@ DEFAULT_CALLBACKS = {
     _results = [];
     for (_i = 0, _len = items.length; _i < _len; _i++) {
       item = items[_i];
-      item.atwho_order = item[search_key].toLowerCase().indexOf(query.toLowerCase());
+      item.atwho_order = new String(item[search_key]).toLowerCase().indexOf(query.toLowerCase());
       if (item.atwho_order > -1) {
         _results.push(item);
       }
@@ -739,22 +792,22 @@ DEFAULT_CALLBACKS = {
     return value;
   },
   inserting_wrapper: function($inputor, content, suffix) {
-    var new_suffix, wrapped_content;
-    new_suffix = suffix === "" ? suffix : suffix || " ";
+    var wrapped_content;
+    suffix = suffix === "" ? suffix : suffix || " ";
     if ($inputor.is('textarea, input')) {
-      return '' + content + new_suffix;
+      return '' + content + suffix;
     } else if ($inputor.attr('contentEditable') === 'true') {
-      new_suffix = suffix === "" ? suffix : suffix || "&nbsp;";
+      suffix = suffix === " " ? "&nbsp;" : suffix;
       if (/firefox/i.test(navigator.userAgent)) {
-        wrapped_content = "<span>" + content + new_suffix + "</span>";
+        wrapped_content = "<span>" + content + suffix + "</span>";
       } else {
-        suffix = "<span contenteditable='false'>" + new_suffix + "<span>";
+        suffix = "<span contenteditable='false'>" + suffix + "</span>";
         wrapped_content = "<span contenteditable='false'>" + content + suffix + "</span>";
       }
       if (this.app.document.selection) {
         wrapped_content = "<span contenteditable='true'>" + content + "</span>";
       }
-      return wrapped_content;
+      return wrapped_content + "<span></span>";
     }
   }
 };
@@ -766,8 +819,8 @@ Api = {
       return c.model.load(data);
     }
   },
-  setIframe: function(iframe) {
-    this.setIframe(iframe);
+  setIframe: function(iframe, standalone) {
+    this.setIframe(iframe, standalone);
     return null;
   },
   run: function() {
@@ -779,14 +832,11 @@ Api = {
   }
 };
 
-$CONTAINER = $("<div id='atwho-container'></div>");
-
 $.fn.atwho = function(method) {
   var result, _args;
   _args = arguments;
-  $('body').append($CONTAINER);
   result = null;
-  this.filter('textarea, input, [contenteditable=true]').each(function() {
+  this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function() {
     var $this, app;
     if (!(app = ($this = $(this)).data("atwho"))) {
       $this.data('atwho', (app = new App(this)));
@@ -820,5 +870,6 @@ $.fn.atwho["default"] = {
   delay: null
 };
 
-  });
-}).call(this);
+
+
+}));
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.min.js
index 1b02d584d819caca2664992ba11d7cb919060496..c7859a58e4c9cc20158dc7186f0199ada8753286 100644
--- a/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.min.js
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-(function(){!function(a){return"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){var b,c,d,e,f,g,h,i,j=[].slice;d=function(){function b(b){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=a(b),this.iframe=null,this.setIframe(),this.listen()}return b.prototype.setIframe=function(a){return a?(this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a):(this.document=document,this.window=window,this.iframe=null)},b.prototype.controller=function(a){var b,c,d,e;if(this.alias_maps[a])c=this.controllers[this.alias_maps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.current_flag]},b.prototype.set_context_for=function(a){return this.current_flag=a,this},b.prototype.reg=function(a,b){var c,d;return c=(d=this.controllers)[a]||(d[a]=new e(this,a)),b.alias&&(this.alias_maps[b.alias]=a),c.init(b),this},b.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",function(a){return function(b){return a.on_keyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.on_keydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.get_opt("display_timeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this))},b.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner")},b.prototype.dispatch=function(){return a.map(this.controllers,function(a){return function(b){var c;return(c=b.get_opt("delay"))?(clearTimeout(a.delayedCallback),a.delayedCallback=setTimeout(function(){return b.look_up()?a.set_context_for(b.at):void 0},c)):b.look_up()?a.set_context_for(b.at):void 0}}(this))},b.prototype.on_keyup=function(b){var c;switch(b.keyCode){case g.ESC:b.preventDefault(),null!=(c=this.controller())&&c.view.hide();break;case g.DOWN:case g.UP:case g.CTRL:a.noop();break;case g.P:case g.N:b.ctrlKey||this.dispatch();break;default:this.dispatch()}},b.prototype.on_keydown=function(b){var c,d;if(c=null!=(d=this.controller())?d.view:void 0,c&&c.visible())switch(b.keyCode){case g.ESC:b.preventDefault(),c.hide(b);break;case g.UP:b.preventDefault(),c.prev();break;case g.DOWN:b.preventDefault(),c.next();break;case g.P:if(!b.ctrlKey)return;b.preventDefault(),c.prev();break;case g.N:if(!b.ctrlKey)return;b.preventDefault(),c.next();break;case g.TAB:case g.ENTER:if(!c.visible())return;b.preventDefault(),c.choose(b);break;default:a.noop()}},b}(),e=function(){function c(c,d){this.app=c,this.at=d,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,b.append(this.$el=a("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new h(this),this.view=new i(this)}return c.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},c.prototype.init=function(b){return this.setting=a.extend({},this.setting||a.fn.atwho["default"],b),this.view.init(),this.model.reload(this.setting.data)},c.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},c.prototype.call_default=function(){var b,c,d;d=arguments[0],b=2<=arguments.length?j.call(arguments,1):[];try{return f[d].apply(this,b)}catch(e){return c=e,a.error(""+c+" Or maybe At.js doesn't have function "+d)}},c.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.get_opt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},c.prototype.callbacks=function(a){return this.get_opt("callbacks")[a]||f[a]},c.prototype.get_opt=function(a){var b;try{return this.setting[a]}catch(c){return b=c,null}},c.prototype.content=function(){return this.$inputor.is("textarea, input")?this.$inputor.val():this.$inputor.text()},c.prototype.catch_query=function(){var a,b,c,d,e,f;return b=this.content(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.get_opt("start_with_space")),"string"==typeof d&&d.length<=this.get_opt("max_len",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,head_pos:e,end_pos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},c.prototype.rect=function(){var a,b;if(a=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return"true"===this.$inputor.attr("contentEditable")&&(a=this.cur_rect||(this.cur_rect=a)||a),b=this.app.document.selection?0:2,{left:a.left,top:a.top,bottom:a.top+a.height+b}},c.prototype.reset_rect=function(){return"true"===this.$inputor.attr("contentEditable")?this.cur_rect=null:void 0},c.prototype.mark_range=function(){return"true"===this.$inputor.attr("contentEditable")&&(this.app.window.getSelection&&(this.range=this.app.window.getSelection().getRangeAt(0)),this.app.document.selection)?this.ie8_range=this.app.document.selection.createRange():void 0},c.prototype.insert_content_for=function(b){var c,d,e;return d=b.data("value"),e=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!e?d:(c=a.extend({},b.data("item-data"),{"atwho-data-value":d,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,e,c))},c.prototype.insert=function(b){var c,d,e,f,g,h,i,j,k;return c=this.$inputor,k=this.callbacks("inserting_wrapper").call(this,c,b,this.get_opt("suffix")),c.is("textarea, input")?(h=c.val(),i=h.slice(0,Math.max(this.query.head_pos-this.at.length,0)),j=""+i+k+h.slice(this.query.end_pos||0),c.val(j),c.caret("pos",i.length+k.length,{iframe:this.app.iframe})):(f=this.range)?(e=f.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,f.setStart(f.endContainer,Math.max(e,0)),f.setEnd(f.endContainer,f.endOffset),f.deleteContents(),d=a(k,this.app.document)[0],f.insertNode(d),f.setEndAfter(d),f.collapse(!1),g=this.app.window.getSelection(),g.removeAllRanges(),g.addRange(f)):(f=this.ie8_range)&&(f.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),f.pasteHTML(k),f.collapse(!1),f.select()),c.is(":focus")||c.focus(),c.change()},c.prototype.render_view=function(a){var b;return b=this.get_opt("search_key"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.get_opt("limit")))},c.prototype.look_up=function(){var b,c;if(b=this.catch_query())return c=function(a){return a&&a.length>0?this.render_view(a):this.view.hide()},this.model.query(b.text,a.proxy(c,this)),b},c}(),h=function(){function b(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return b.prototype.destroy=function(){return this.storage.data(this.at,null)},b.prototype.saved=function(){return this.fetch()>0},b.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.get_opt("search_key"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remote_filter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},b.prototype.fetch=function(){return this.storage.data(this.at)||[]},b.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,a||[]))},b.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},b.prototype.reload=function(a){return this._load(a)},b.prototype._load=function(b){return"string"==typeof b?a.ajax(b,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(b)},b}(),i=function(){function b(b){this.context=b,this.$el=a("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return b.prototype.init=function(){var a;return a=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},b.prototype.destroy=function(){return this.$el.remove()},b.prototype.bind_event=function(){var b;return b=this.$el.find("ul"),b.on("mouseenter.atwho-view","li",function(c){return b.find(".cur").removeClass("cur"),a(c.currentTarget).addClass("cur")}).on("click",function(a){return function(b){return a.choose(b),b.preventDefault()}}(this))},b.prototype.visible=function(){return this.$el.is(":visible")},b.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insert_content_for(b),this.context.insert(this.context.callbacks("before_insert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.get_opt("hide_without_suffix")?this.stop_showing=!0:void 0},b.prototype.reposition=function(b){var c,d;return b.bottom+this.$el.height()-a(window).scrollTop()>a(window).height()&&(b.bottom=b.top-this.$el.height()),c={left:b.left,top:b.bottom},null!=(d=this.context.callbacks("before_reposition"))&&d.call(this.context,c),this.$el.offset(c),this.context.trigger("reposition",[c])},b.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur")},b.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur")},b.prototype.show=function(){var a;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},b.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(c,b))},b.prototype.render=function(b){var c,d,e,f,g,h,i;if(!(a.isArray(b)&&b.length>0))return void this.hide();for(this.$el.find("ul").empty(),d=this.$el.find("ul"),g=this.context.get_opt("tpl"),h=0,i=b.length;i>h;h++)e=b[h],e=a.extend({},e,{"atwho-at":this.context.at}),f=this.context.callbacks("tpl_eval").call(this.context,g,e),c=a(this.context.callbacks("highlighter").call(this.context,f,this.context.query.text)),c.data("item-data",e),d.append(c);return this.show(),this.context.get_opt("highlight_first")?d.find("li:first").addClass("cur"):void 0},b}(),g={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78},f={before_save:function(b){var c,d,e,f;if(!a.isArray(b))return b;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(a.isPlainObject(c)?c:{name:c});return f},matcher:function(a,b,c){var d,e;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c&&(a="(?:^|\\s)"+a),e=new RegExp(a+"([A-Za-z0-9_+-]*)$|"+a+"([^\\x00-\\xff]*)$","gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~d[c].toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remote_filter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=d[c].toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tpl_eval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+"<strong>"+c+"</strong>"+d+" <"})):a},before_insert:function(a){return a},inserting_wrapper:function(a,b,c){var d,e;return d=""===c?c:c||" ",a.is("textarea, input")?""+b+d:"true"===a.attr("contentEditable")?(d=""===c?c:c||"&nbsp;",/firefox/i.test(navigator.userAgent)?e="<span>"+b+d+"</span>":(c="<span contenteditable='false'>"+d+"<span>",e="<span contenteditable='false'>"+b+c+"</span>"),this.app.document.selection&&(e="<span contenteditable='true'>"+b+"</span>"),e):void 0}},c={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},setIframe:function(a){return this.setIframe(a),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},b=a("<div id='atwho-container'></div>"),a.fn.atwho=function(e){var f,g;return g=arguments,a("body").append(b),f=null,this.filter("textarea, input, [contenteditable=true]").each(function(){var b,h;return(h=(b=a(this)).data("atwho"))||b.data("atwho",h=new d(this)),"object"!=typeof e&&e?c[e]&&h?f=c[e].apply(h,Array.prototype.slice.call(g,1)):a.error("Method "+e+" does not exist on jQuery.caret"):h.reg(e.at,e)}),f||this},a.fn.atwho["default"]={at:void 0,alias:void 0,data:null,tpl:"<li data-value='${atwho-at}${name}'>${name}</li>",insert_tpl:"<span id='${id}'>${atwho-data-value}</span>",callbacks:f,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}})}).call(this);
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b,c,d,e,f,g,h,i=[].slice;c=function(){function b(b){this.current_flag=null,this.controllers={},this.alias_maps={},this.$inputor=a(b),this.setIframe(),this.listen()}return b.prototype.createContainer=function(b){return 0===(this.$el=a("#atwho-container",b)).length?a(b.body).append(this.$el=a("<div id='atwho-container'></div>")):void 0},b.prototype.setIframe=function(a,b){var c;return null==b&&(b=!1),a?(this.window=a.contentWindow,this.document=a.contentDocument||this.window.document,this.iframe=a):(this.document=document,this.window=window,this.iframe=null),(this.iframeStandalone=b)?(null!=(c=this.$el)&&c.remove(),this.createContainer(this.document)):this.createContainer(document)},b.prototype.controller=function(a){var b,c,d,e;if(this.alias_maps[a])c=this.controllers[this.alias_maps[a]];else{e=this.controllers;for(d in e)if(b=e[d],d===a){c=b;break}}return c?c:this.controllers[this.current_flag]},b.prototype.set_context_for=function(a){return this.current_flag=a,this},b.prototype.reg=function(a,b){var c,e;return c=(e=this.controllers)[a]||(e[a]=new d(this,a)),b.alias&&(this.alias_maps[b.alias]=a),c.init(b),this},b.prototype.listen=function(){return this.$inputor.on("keyup.atwhoInner",function(a){return function(b){return a.on_keyup(b)}}(this)).on("keydown.atwhoInner",function(a){return function(b){return a.on_keydown(b)}}(this)).on("scroll.atwhoInner",function(a){return function(b){var c;return null!=(c=a.controller())?c.view.hide(b):void 0}}(this)).on("blur.atwhoInner",function(a){return function(b){var c;return(c=a.controller())?c.view.hide(b,c.get_opt("display_timeout")):void 0}}(this)).on("click.atwhoInner",function(a){return function(){return a.dispatch()}}(this))},b.prototype.shutdown=function(){var a,b,c;c=this.controllers;for(b in c)a=c[b],a.destroy(),delete this.controllers[b];return this.$inputor.off(".atwhoInner"),this.$el.remove()},b.prototype.dispatch=function(){return a.map(this.controllers,function(a){return function(b){var c;return(c=b.get_opt("delay"))?(clearTimeout(a.delayedCallback),a.delayedCallback=setTimeout(function(){return b.look_up()?a.set_context_for(b.at):void 0},c)):b.look_up()?a.set_context_for(b.at):void 0}}(this))},b.prototype.on_keyup=function(b){var c;switch(b.keyCode){case f.ESC:b.preventDefault(),null!=(c=this.controller())&&c.view.hide();break;case f.DOWN:case f.UP:case f.CTRL:a.noop();break;case f.P:case f.N:b.ctrlKey||this.dispatch();break;default:this.dispatch()}},b.prototype.on_keydown=function(b){var c,d;if(c=null!=(d=this.controller())?d.view:void 0,c&&c.visible())switch(b.keyCode){case f.ESC:b.preventDefault(),c.hide(b);break;case f.UP:b.preventDefault(),c.prev();break;case f.DOWN:b.preventDefault(),c.next();break;case f.P:if(!b.ctrlKey)return;b.preventDefault(),c.prev();break;case f.N:if(!b.ctrlKey)return;b.preventDefault(),c.next();break;case f.TAB:case f.ENTER:if(!c.visible())return;b.preventDefault(),c.choose(b);break;default:a.noop()}},b}(),d=function(){function b(b,c){this.app=b,this.at=c,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.setting=null,this.query=null,this.pos=0,this.cur_rect=null,this.range=null,0===(this.$el=a("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=a("<div id='atwho-ground-"+this.id+"'></div>")),this.model=new g(this),this.view=new h(this)}return b.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},b.prototype.init=function(b){return this.setting=a.extend({},this.setting||a.fn.atwho["default"],b),this.view.init(),this.model.reload(this.setting.data)},b.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},b.prototype.call_default=function(){var b,c,d;d=arguments[0],b=2<=arguments.length?i.call(arguments,1):[];try{return e[d].apply(this,b)}catch(f){return c=f,a.error(""+c+" Or maybe At.js doesn't have function "+d)}},b.prototype.trigger=function(a,b){var c,d;return null==b&&(b=[]),b.push(this),c=this.get_opt("alias"),d=c?""+a+"-"+c+".atwho":""+a+".atwho",this.$inputor.trigger(d,b)},b.prototype.callbacks=function(a){return this.get_opt("callbacks")[a]||e[a]},b.prototype.get_opt=function(a){var b;try{return this.setting[a]}catch(c){return b=c,null}},b.prototype.content=function(){var a;if(this.$inputor.is("textarea, input"))return this.$inputor.val();if(a=this.mark_range())return(a.startContainer.textContent||"").slice(0,a.startOffset)},b.prototype.catch_query=function(){var a,b,c,d,e,f;return b=this.content(),a=this.$inputor.caret("pos",{iframe:this.app.iframe}),f=b.slice(0,a),d=this.callbacks("matcher").call(this,this.at,f,this.get_opt("start_with_space")),"string"==typeof d&&d.length<=this.get_opt("max_len",20)?(e=a-d.length,c=e+d.length,this.pos=e,d={text:d,head_pos:e,end_pos:c},this.trigger("matched",[this.at,d.text])):(d=null,this.view.hide()),this.query=d},b.prototype.rect=function(){var b,c,d;if(b=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return this.app.iframe&&!this.app.iframeStandalone&&(c=a(this.app.iframe).offset(),b.left+=c.left,b.top+=c.top),this.$inputor.is("[contentEditable]")&&(b=this.cur_rect||(this.cur_rect=b)),d=this.app.document.selection?0:2,{left:b.left,top:b.top,bottom:b.top+b.height+d}},b.prototype.reset_rect=function(){return this.$inputor.is("[contentEditable]")?this.cur_rect=null:void 0},b.prototype.mark_range=function(){var a;if(this.$inputor.is("[contentEditable]"))return this.app.window.getSelection&&(a=this.app.window.getSelection()).rangeCount>0?this.range=a.getRangeAt(0):this.app.document.selection?this.ie8_range=this.app.document.selection.createRange():void 0},b.prototype.insert_content_for=function(b){var c,d,e;return d=b.data("value"),e=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!e?d:(c=a.extend({},b.data("item-data"),{"atwho-data-value":d,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,e,c))},b.prototype.insert=function(b){var c,d,e,f,g,h,i,j,k,l,m,n;if(c=this.$inputor,k=this.callbacks("inserting_wrapper").call(this,c,b,this.get_opt("suffix")),c.is("textarea, input"))h=c.val(),i=h.slice(0,Math.max(this.query.head_pos-this.at.length,0)),j=""+i+k+h.slice(this.query.end_pos||0),c.val(j),c.caret("pos",i.length+k.length,{iframe:this.app.iframe});else if(f=this.range){for(e=f.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,f.setStart(f.endContainer,Math.max(e,0)),f.setEnd(f.endContainer,f.endOffset),f.deleteContents(),n=a(k,this.app.document),l=0,m=n.length;m>l;l++)d=n[l],f.insertNode(d),f.setEndAfter(d),f.collapse(!1);g=this.app.window.getSelection(),g.removeAllRanges(),g.addRange(f)}else(f=this.ie8_range)&&(f.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),f.pasteHTML(k),f.collapse(!1),f.select());return c.is(":focus")||c.focus(),c.change()},b.prototype.render_view=function(a){var b;return b=this.get_opt("search_key"),a=this.callbacks("sorter").call(this,this.query.text,a.slice(0,1001),b),this.view.render(a.slice(0,this.get_opt("limit")))},b.prototype.look_up=function(){var b,c;if(b=this.catch_query())return c=function(a){return a&&a.length>0?this.render_view(a):this.view.hide()},this.model.query(b.text,a.proxy(c,this)),b},b}(),g=function(){function b(a){this.context=a,this.at=this.context.at,this.storage=this.context.$inputor}return b.prototype.destroy=function(){return this.storage.data(this.at,null)},b.prototype.saved=function(){return this.fetch()>0},b.prototype.query=function(a,b){var c,d,e;return c=this.fetch(),d=this.context.get_opt("search_key"),c=this.context.callbacks("filter").call(this.context,a,c,d)||[],e=this.context.callbacks("remote_filter"),c.length>0||!e&&0===c.length?b(c):e.call(this.context,a,b)},b.prototype.fetch=function(){return this.storage.data(this.at)||[]},b.prototype.save=function(a){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,a||[]))},b.prototype.load=function(a){return!this.saved()&&a?this._load(a):void 0},b.prototype.reload=function(a){return this._load(a)},b.prototype._load=function(b){return"string"==typeof b?a.ajax(b,{dataType:"json"}).done(function(a){return function(b){return a.save(b)}}(this)):this.save(b)},b}(),h=function(){function b(b){this.context=b,this.$el=a("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return b.prototype.init=function(){var a;return a=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+a})},b.prototype.destroy=function(){return this.$el.remove()},b.prototype.bind_event=function(){var b;return b=this.$el.find("ul"),b.on("mouseenter.atwho-view","li",function(c){return b.find(".cur").removeClass("cur"),a(c.currentTarget).addClass("cur")}).on("click.atwho-view","li",function(c){return function(d){return b.find(".cur").removeClass("cur"),a(d.currentTarget).addClass("cur"),c.choose(d),d.preventDefault()}}(this))},b.prototype.visible=function(){return this.$el.is(":visible")},b.prototype.choose=function(a){var b,c;return(b=this.$el.find(".cur")).length&&(c=this.context.insert_content_for(b),this.context.insert(this.context.callbacks("before_insert").call(this.context,c,b),b),this.context.trigger("inserted",[b,a]),this.hide(a)),this.context.get_opt("hide_without_suffix")?this.stop_showing=!0:void 0},b.prototype.reposition=function(b){var c,d,e,f;return f=this.context.app.iframeStandalone?this.context.app.window:window,b.bottom+this.$el.height()-a(f).scrollTop()>a(f).height()&&(b.bottom=b.top-this.$el.height()),b.left>(d=a(f).width()-this.$el.width()-5)&&(b.left=d),c={left:b.left,top:b.bottom},null!=(e=this.context.callbacks("before_reposition"))&&e.call(this.context,c),this.$el.offset(c),this.context.trigger("reposition",[c])},b.prototype.next=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.next(),b.length||(b=this.$el.find("li:first")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},b.prototype.prev=function(){var a,b;return a=this.$el.find(".cur").removeClass("cur"),b=a.prev(),b.length||(b=this.$el.find("li:last")),b.addClass("cur"),this.$el.animate({scrollTop:Math.max(0,a.innerHeight()*(b.index()+2)-this.$el.height())},150)},b.prototype.show=function(){var a;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(a=this.context.rect())?this.reposition(a):void 0)},b.prototype.hide=function(a,b){var c;if(this.visible())return isNaN(b)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[a])):(c=function(a){return function(){return a.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(c,b))},b.prototype.render=function(b){var c,d,e,f,g,h,i;if(!(a.isArray(b)&&b.length>0))return void this.hide();for(this.$el.find("ul").empty(),d=this.$el.find("ul"),g=this.context.get_opt("tpl"),h=0,i=b.length;i>h;h++)e=b[h],e=a.extend({},e,{"atwho-at":this.context.at}),f=this.context.callbacks("tpl_eval").call(this.context,g,e),c=a(this.context.callbacks("highlighter").call(this.context,f,this.context.query.text)),c.data("item-data",e),d.append(c);return this.show(),this.context.get_opt("highlight_first")?d.find("li:first").addClass("cur"):void 0},b}(),f={DOWN:40,UP:38,ESC:27,TAB:9,ENTER:13,CTRL:17,P:80,N:78},e={before_save:function(b){var c,d,e,f;if(!a.isArray(b))return b;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(a.isPlainObject(c)?c:{name:c});return f},matcher:function(a,b,c){var d,e,f,g;return a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),c&&(a="(?:^|\\s)"+a),f=decodeURI("%C3%80"),g=decodeURI("%C3%BF"),e=new RegExp(""+a+"([A-Za-z"+f+"-"+g+"0-9_+-]*)$|"+a+"([^\\x00-\\xff]*)$","gi"),d=e.exec(b),d?d[2]||d[1]:null},filter:function(a,b,c){var d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],~new String(d[c]).toLowerCase().indexOf(a.toLowerCase())&&g.push(d);return g},remote_filter:null,sorter:function(a,b,c){var d,e,f,g;if(!a)return b;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],d.atwho_order=new String(d[c]).toLowerCase().indexOf(a.toLowerCase()),d.atwho_order>-1&&g.push(d);return g.sort(function(a,b){return a.atwho_order-b.atwho_order})},tpl_eval:function(a,b){var c;try{return a.replace(/\$\{([^\}]*)\}/g,function(a,c){return b[c]})}catch(d){return c=d,""}},highlighter:function(a,b){var c;return b?(c=new RegExp(">\\s*(\\w*?)("+b.replace("+","\\+")+")(\\w*)\\s*<","ig"),a.replace(c,function(a,b,c,d){return"> "+b+"<strong>"+c+"</strong>"+d+" <"})):a},before_insert:function(a){return a},inserting_wrapper:function(a,b,c){var d;return c=""===c?c:c||" ",a.is("textarea, input")?""+b+c:"true"===a.attr("contentEditable")?(c=" "===c?"&nbsp;":c,/firefox/i.test(navigator.userAgent)?d="<span>"+b+c+"</span>":(c="<span contenteditable='false'>"+c+"</span>",d="<span contenteditable='false'>"+b+c+"</span>"),this.app.document.selection&&(d="<span contenteditable='true'>"+b+"</span>"),d+"<span></span>"):void 0}},b={load:function(a,b){var c;return(c=this.controller(a))?c.model.load(b):void 0},setIframe:function(a,b){return this.setIframe(a,b),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},a.fn.atwho=function(d){var e,f;return f=arguments,e=null,this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function(){var g,h;return(h=(g=a(this)).data("atwho"))||g.data("atwho",h=new c(this)),"object"!=typeof d&&d?b[d]&&h?e=b[d].apply(h,Array.prototype.slice.call(f,1)):a.error("Method "+d+" does not exist on jQuery.caret"):h.reg(d.at,d)}),e||this},a.fn.atwho["default"]={at:void 0,alias:void 0,data:null,tpl:"<li data-value='${atwho-at}${name}'>${name}</li>",insert_tpl:"<span id='${id}'>${atwho-data-value}</span>",callbacks:e,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery.caret.js b/wp-content/plugins/buddypress/bp-core/js/jquery.caret.js
index caa7876c5eaef9dacc0ee199312af0a69793a571..e0de4bc82450d6e115c16330d520c1929e6bde87 100644
--- a/wp-content/plugins/buddypress/bp-core/js/jquery.caret.js
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery.caret.js
@@ -1,3 +1,19 @@
+(function (root, factory) {
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module.
+    define(["jquery"], function ($) {
+      return (root.returnExportsGlobal = factory($));
+    });
+  } else if (typeof exports === 'object') {
+    // Node. Does not work with strict CommonJS, but
+    // only CommonJS-like enviroments that support module.exports,
+    // like Node.
+    module.exports = factory(require("jquery"));
+  } else {
+    factory(jQuery);
+  }
+}(this, function ($) {
+
 /*
   Implement Github like autocomplete mentions
   http://ichord.github.com/At.js
@@ -6,361 +22,384 @@
   Licensed under the MIT license.
 */
 
-
 /*
 本插件操作 textarea 或者 input 内的插入符
 只实现了获得插入符在文本框中的位置,我设置
 插入符的位置.
 */
 
+"use strict";
+var EditableCaret, InputCaret, Mirror, Utils, discoveryIframeOf, methods, oDocument, oFrame, oWindow, pluginName, setContextBy;
 
-(function() {
-  (function(factory) {
-    if (typeof define === 'function' && define.amd) {
-      return define(['jquery'], factory);
-    } else {
-      return factory(window.jQuery);
-    }
-  })(function($) {
-    "use strict";
-    var EditableCaret, InputCaret, Mirror, Utils, discoveryIframeOf, methods, oDocument, oFrame, oWindow, pluginName, setContextBy;
-    pluginName = 'caret';
-    EditableCaret = (function() {
-      function EditableCaret($inputor) {
-        this.$inputor = $inputor;
-        this.domInputor = this.$inputor[0];
-      }
+pluginName = 'caret';
 
-      EditableCaret.prototype.setPos = function(pos) {
-        return this.domInputor;
-      };
+EditableCaret = (function() {
+  function EditableCaret($inputor) {
+    this.$inputor = $inputor;
+    this.domInputor = this.$inputor[0];
+  }
 
-      EditableCaret.prototype.getIEPosition = function() {
-        return $.noop();
-      };
+  EditableCaret.prototype.setPos = function(pos) {
+    return this.domInputor;
+  };
 
-      EditableCaret.prototype.getPosition = function() {
-        return $.noop();
-      };
+  EditableCaret.prototype.getIEPosition = function() {
+    return this.getPosition();
+  };
 
-      EditableCaret.prototype.getOldIEPos = function() {
-        var preCaretTextRange, textRange;
-        textRange = oDocument.selection.createRange();
-        preCaretTextRange = oDocument.body.createTextRange();
-        preCaretTextRange.moveToElementText(this.domInputor);
-        preCaretTextRange.setEndPoint("EndToEnd", textRange);
-        return preCaretTextRange.text.length;
-      };
+  EditableCaret.prototype.getPosition = function() {
+    var inputor_offset, offset;
+    offset = this.getOffset();
+    inputor_offset = this.$inputor.offset();
+    offset.left -= inputor_offset.left;
+    offset.top -= inputor_offset.top;
+    return offset;
+  };
 
-      EditableCaret.prototype.getPos = function() {
-        var clonedRange, pos, range;
-        if (range = this.range()) {
-          clonedRange = range.cloneRange();
-          clonedRange.selectNodeContents(this.domInputor);
-          clonedRange.setEnd(range.endContainer, range.endOffset);
-          pos = clonedRange.toString().length;
-          clonedRange.detach();
-          return pos;
-        } else if (oDocument.selection) {
-          return this.getOldIEPos();
-        }
-      };
+  EditableCaret.prototype.getOldIEPos = function() {
+    var preCaretTextRange, textRange;
+    textRange = oDocument.selection.createRange();
+    preCaretTextRange = oDocument.body.createTextRange();
+    preCaretTextRange.moveToElementText(this.domInputor);
+    preCaretTextRange.setEndPoint("EndToEnd", textRange);
+    return preCaretTextRange.text.length;
+  };
+
+  EditableCaret.prototype.getPos = function() {
+    var clonedRange, pos, range;
+    if (range = this.range()) {
+      clonedRange = range.cloneRange();
+      clonedRange.selectNodeContents(this.domInputor);
+      clonedRange.setEnd(range.endContainer, range.endOffset);
+      pos = clonedRange.toString().length;
+      clonedRange.detach();
+      return pos;
+    } else if (oDocument.selection) {
+      return this.getOldIEPos();
+    }
+  };
+
+  EditableCaret.prototype.getOldIEOffset = function() {
+    var range, rect;
+    range = oDocument.selection.createRange().duplicate();
+    range.moveStart("character", -1);
+    rect = range.getBoundingClientRect();
+    return {
+      height: rect.bottom - rect.top,
+      left: rect.left,
+      top: rect.top
+    };
+  };
 
-      EditableCaret.prototype.getOldIEOffset = function() {
-        var range, rect;
-        range = oDocument.selection.createRange().duplicate();
-        range.moveStart("character", -1);
-        rect = range.getBoundingClientRect();
-        return {
-          height: rect.bottom - rect.top,
+  EditableCaret.prototype.getOffset = function(pos) {
+    var clonedRange, offset, range, rect, shadowCaret;
+    if (oWindow.getSelection && (range = this.range())) {
+      if (range.endOffset - 1 > 0 && range.endContainer === !this.domInputor) {
+        clonedRange = range.cloneRange();
+        clonedRange.setStart(range.endContainer, range.endOffset - 1);
+        clonedRange.setEnd(range.endContainer, range.endOffset);
+        rect = clonedRange.getBoundingClientRect();
+        offset = {
+          height: rect.height,
+          left: rect.left + rect.width,
+          top: rect.top
+        };
+        clonedRange.detach();
+      }
+      if (!offset || (offset != null ? offset.height : void 0) === 0) {
+        clonedRange = range.cloneRange();
+        shadowCaret = $(oDocument.createTextNode("|"));
+        clonedRange.insertNode(shadowCaret[0]);
+        clonedRange.selectNode(shadowCaret[0]);
+        rect = clonedRange.getBoundingClientRect();
+        offset = {
+          height: rect.height,
           left: rect.left,
           top: rect.top
         };
-      };
+        shadowCaret.remove();
+        clonedRange.detach();
+      }
+    } else if (oDocument.selection) {
+      offset = this.getOldIEOffset();
+    }
+    if (offset) {
+      offset.top += $(oWindow).scrollTop();
+      offset.left += $(oWindow).scrollLeft();
+    }
+    return offset;
+  };
 
-      EditableCaret.prototype.getOffset = function(pos) {
-        var clonedRange, offset, range, rect;
-        if (oWindow.getSelection && (range = this.range())) {
-          if (range.endOffset - 1 < 0) {
-            return null;
-          }
-          clonedRange = range.cloneRange();
-          clonedRange.setStart(range.endContainer, range.endOffset - 1);
-          clonedRange.setEnd(range.endContainer, range.endOffset);
-          rect = clonedRange.getBoundingClientRect();
-          offset = {
-            height: rect.height,
-            left: rect.left + rect.width,
-            top: rect.top
-          };
-          clonedRange.detach();
-        } else if (oDocument.selection) {
-          offset = this.getOldIEOffset();
-        }
-        if (offset && !oFrame) {
-          offset.top += $(oWindow).scrollTop();
-          offset.left += $(oWindow).scrollLeft();
-        }
-        return offset;
-      };
+  EditableCaret.prototype.range = function() {
+    var sel;
+    if (!oWindow.getSelection) {
+      return;
+    }
+    sel = oWindow.getSelection();
+    if (sel.rangeCount > 0) {
+      return sel.getRangeAt(0);
+    } else {
+      return null;
+    }
+  };
 
-      EditableCaret.prototype.range = function() {
-        var sel;
-        if (!oWindow.getSelection) {
-          return;
-        }
-        sel = oWindow.getSelection();
-        if (sel.rangeCount > 0) {
-          return sel.getRangeAt(0);
-        } else {
-          return null;
-        }
-      };
+  return EditableCaret;
+
+})();
 
-      return EditableCaret;
+InputCaret = (function() {
+  function InputCaret($inputor) {
+    this.$inputor = $inputor;
+    this.domInputor = this.$inputor[0];
+  }
 
-    })();
-    InputCaret = (function() {
-      function InputCaret($inputor) {
-        this.$inputor = $inputor;
-        this.domInputor = this.$inputor[0];
+  InputCaret.prototype.getIEPos = function() {
+    var endRange, inputor, len, normalizedValue, pos, range, textInputRange;
+    inputor = this.domInputor;
+    range = oDocument.selection.createRange();
+    pos = 0;
+    if (range && range.parentElement() === inputor) {
+      normalizedValue = inputor.value.replace(/\r\n/g, "\n");
+      len = normalizedValue.length;
+      textInputRange = inputor.createTextRange();
+      textInputRange.moveToBookmark(range.getBookmark());
+      endRange = inputor.createTextRange();
+      endRange.collapse(false);
+      if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
+        pos = len;
+      } else {
+        pos = -textInputRange.moveStart("character", -len);
       }
+    }
+    return pos;
+  };
 
-      InputCaret.prototype.getIEPos = function() {
-        var endRange, inputor, len, normalizedValue, pos, range, textInputRange;
-        inputor = this.domInputor;
-        range = oDocument.selection.createRange();
-        pos = 0;
-        if (range && range.parentElement() === inputor) {
-          normalizedValue = inputor.value.replace(/\r\n/g, "\n");
-          len = normalizedValue.length;
-          textInputRange = inputor.createTextRange();
-          textInputRange.moveToBookmark(range.getBookmark());
-          endRange = inputor.createTextRange();
-          endRange.collapse(false);
-          if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
-            pos = len;
-          } else {
-            pos = -textInputRange.moveStart("character", -len);
-          }
-        }
-        return pos;
-      };
+  InputCaret.prototype.getPos = function() {
+    if (oDocument.selection) {
+      return this.getIEPos();
+    } else {
+      return this.domInputor.selectionStart;
+    }
+  };
 
-      InputCaret.prototype.getPos = function() {
-        if (oDocument.selection) {
-          return this.getIEPos();
-        } else {
-          return this.domInputor.selectionStart;
-        }
-      };
+  InputCaret.prototype.setPos = function(pos) {
+    var inputor, range;
+    inputor = this.domInputor;
+    if (oDocument.selection) {
+      range = inputor.createTextRange();
+      range.move("character", pos);
+      range.select();
+    } else if (inputor.setSelectionRange) {
+      inputor.setSelectionRange(pos, pos);
+    }
+    return inputor;
+  };
 
-      InputCaret.prototype.setPos = function(pos) {
-        var inputor, range;
-        inputor = this.domInputor;
-        if (oDocument.selection) {
-          range = inputor.createTextRange();
-          range.move("character", pos);
-          range.select();
-        } else if (inputor.setSelectionRange) {
-          inputor.setSelectionRange(pos, pos);
-        }
-        return inputor;
-      };
+  InputCaret.prototype.getIEOffset = function(pos) {
+    var h, textRange, x, y;
+    textRange = this.domInputor.createTextRange();
+    pos || (pos = this.getPos());
+    textRange.move('character', pos);
+    x = textRange.boundingLeft;
+    y = textRange.boundingTop;
+    h = textRange.boundingHeight;
+    return {
+      left: x,
+      top: y,
+      height: h
+    };
+  };
 
-      InputCaret.prototype.getIEOffset = function(pos) {
-        var h, textRange, x, y;
-        textRange = this.domInputor.createTextRange();
-        pos || (pos = this.getPos());
-        textRange.move('character', pos);
-        x = textRange.boundingLeft;
-        y = textRange.boundingTop;
-        h = textRange.boundingHeight;
-        return {
-          left: x,
-          top: y,
-          height: h
-        };
+  InputCaret.prototype.getOffset = function(pos) {
+    var $inputor, offset, position;
+    $inputor = this.$inputor;
+    if (oDocument.selection) {
+      offset = this.getIEOffset(pos);
+      offset.top += $(oWindow).scrollTop() + $inputor.scrollTop();
+      offset.left += $(oWindow).scrollLeft() + $inputor.scrollLeft();
+      return offset;
+    } else {
+      offset = $inputor.offset();
+      position = this.getPosition(pos);
+      return offset = {
+        left: offset.left + position.left - $inputor.scrollLeft(),
+        top: offset.top + position.top - $inputor.scrollTop(),
+        height: position.height
       };
+    }
+  };
 
-      InputCaret.prototype.getOffset = function(pos) {
-        var $inputor, offset, position;
-        $inputor = this.$inputor;
-        if (oDocument.selection) {
-          offset = this.getIEOffset(pos);
-          offset.top += $(oWindow).scrollTop() + $inputor.scrollTop();
-          offset.left += $(oWindow).scrollLeft() + $inputor.scrollLeft();
-          return offset;
-        } else {
-          offset = $inputor.offset();
-          position = this.getPosition(pos);
-          return offset = {
-            left: offset.left + position.left - $inputor.scrollLeft(),
-            top: offset.top + position.top - $inputor.scrollTop(),
-            height: position.height
-          };
-        }
-      };
+  InputCaret.prototype.getPosition = function(pos) {
+    var $inputor, at_rect, end_range, format, html, mirror, start_range;
+    $inputor = this.$inputor;
+    format = function(value) {
+      value = value.replace(/<|>|`|"|&/g, '?').replace(/\r\n|\r|\n/g, "<br/>");
+      if (/firefox/i.test(navigator.userAgent)) {
+        value = value.replace(/\s/g, '&nbsp;');
+      }
+      return value;
+    };
+    if (pos === void 0) {
+      pos = this.getPos();
+    }
+    start_range = $inputor.val().slice(0, pos);
+    end_range = $inputor.val().slice(pos);
+    html = "<span style='position: relative; display: inline;'>" + format(start_range) + "</span>";
+    html += "<span id='caret' style='position: relative; display: inline;'>|</span>";
+    html += "<span style='position: relative; display: inline;'>" + format(end_range) + "</span>";
+    mirror = new Mirror($inputor);
+    return at_rect = mirror.create(html).rect();
+  };
 
-      InputCaret.prototype.getPosition = function(pos) {
-        var $inputor, at_rect, end_range, format, html, mirror, start_range;
-        $inputor = this.$inputor;
-        format = function(value) {
-          return value.replace(/</g, '&lt').replace(/>/g, '&gt').replace(/`/g, '&#96').replace(/"/g, '&quot').replace(/\r\n|\r|\n/g, "<br />");
-        };
-        if (pos === void 0) {
-          pos = this.getPos();
-        }
-        start_range = $inputor.val().slice(0, pos);
-        end_range = $inputor.val().slice(pos);
-        html = "<span style='position: relative; display: inline;'>" + format(start_range) + "</span>";
-        html += "<span id='caret' style='position: relative; display: inline;'>|</span>";
-        html += "<span style='position: relative; display: inline;'>" + format(end_range) + "</span>";
-        mirror = new Mirror($inputor);
-        return at_rect = mirror.create(html).rect();
-      };
+  InputCaret.prototype.getIEPosition = function(pos) {
+    var h, inputorOffset, offset, x, y;
+    offset = this.getIEOffset(pos);
+    inputorOffset = this.$inputor.offset();
+    x = offset.left - inputorOffset.left;
+    y = offset.top - inputorOffset.top;
+    h = offset.height;
+    return {
+      left: x,
+      top: y,
+      height: h
+    };
+  };
 
-      InputCaret.prototype.getIEPosition = function(pos) {
-        var h, inputorOffset, offset, x, y;
-        offset = this.getIEOffset(pos);
-        inputorOffset = this.$inputor.offset();
-        x = offset.left - inputorOffset.left;
-        y = offset.top - inputorOffset.top;
-        h = offset.height;
-        return {
-          left: x,
-          top: y,
-          height: h
-        };
-      };
+  return InputCaret;
 
-      return InputCaret;
+})();
 
-    })();
-    Mirror = (function() {
-      Mirror.prototype.css_attr = ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle", "borderTopWidth", "boxSizing", "fontFamily", "fontSize", "fontWeight", "height", "letterSpacing", "lineHeight", "marginBottom", "marginLeft", "marginRight", "marginTop", "outlineWidth", "overflow", "overflowX", "overflowY", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop", "textAlign", "textOverflow", "textTransform", "whiteSpace", "wordBreak", "wordWrap"];
+Mirror = (function() {
+  Mirror.prototype.css_attr = ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle", "borderTopWidth", "boxSizing", "fontFamily", "fontSize", "fontWeight", "height", "letterSpacing", "lineHeight", "marginBottom", "marginLeft", "marginRight", "marginTop", "outlineWidth", "overflow", "overflowX", "overflowY", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop", "textAlign", "textOverflow", "textTransform", "whiteSpace", "wordBreak", "wordWrap"];
 
-      function Mirror($inputor) {
-        this.$inputor = $inputor;
-      }
+  function Mirror($inputor) {
+    this.$inputor = $inputor;
+  }
 
-      Mirror.prototype.mirrorCss = function() {
-        var css,
-          _this = this;
-        css = {
-          position: 'absolute',
-          left: -9999,
-          top: 0,
-          zIndex: -20000
-        };
-        if (this.$inputor.prop('tagName') === 'TEXTAREA') {
-          this.css_attr.push('width');
-        }
-        $.each(this.css_attr, function(i, p) {
-          return css[p] = _this.$inputor.css(p);
-        });
-        return css;
-      };
+  Mirror.prototype.mirrorCss = function() {
+    var css,
+      _this = this;
+    css = {
+      position: 'absolute',
+      left: -9999,
+      top: 0,
+      zIndex: -20000
+    };
+    if (this.$inputor.prop('tagName') === 'TEXTAREA') {
+      this.css_attr.push('width');
+    }
+    $.each(this.css_attr, function(i, p) {
+      return css[p] = _this.$inputor.css(p);
+    });
+    return css;
+  };
 
-      Mirror.prototype.create = function(html) {
-        this.$mirror = $('<div></div>');
-        this.$mirror.css(this.mirrorCss());
-        this.$mirror.html(html);
-        this.$inputor.after(this.$mirror);
-        return this;
-      };
+  Mirror.prototype.create = function(html) {
+    this.$mirror = $('<div></div>');
+    this.$mirror.css(this.mirrorCss());
+    this.$mirror.html(html);
+    this.$inputor.after(this.$mirror);
+    return this;
+  };
 
-      Mirror.prototype.rect = function() {
-        var $flag, pos, rect;
-        $flag = this.$mirror.find("#caret");
-        pos = $flag.position();
-        rect = {
-          left: pos.left,
-          top: pos.top,
-          height: $flag.height()
-        };
-        this.$mirror.remove();
-        return rect;
-      };
+  Mirror.prototype.rect = function() {
+    var $flag, pos, rect;
+    $flag = this.$mirror.find("#caret");
+    pos = $flag.position();
+    rect = {
+      left: pos.left,
+      top: pos.top,
+      height: $flag.height()
+    };
+    this.$mirror.remove();
+    return rect;
+  };
 
-      return Mirror;
+  return Mirror;
+
+})();
+
+Utils = {
+  contentEditable: function($inputor) {
+    return !!($inputor[0].contentEditable && $inputor[0].contentEditable === 'true');
+  }
+};
+
+methods = {
+  pos: function(pos) {
+    if (pos || pos === 0) {
+      return this.setPos(pos);
+    } else {
+      return this.getPos();
+    }
+  },
+  position: function(pos) {
+    if (oDocument.selection) {
+      return this.getIEPosition(pos);
+    } else {
+      return this.getPosition(pos);
+    }
+  },
+  offset: function(pos) {
+    var offset;
+    offset = this.getOffset(pos);
+    return offset;
+  }
+};
+
+oDocument = null;
+
+oWindow = null;
+
+oFrame = null;
+
+setContextBy = function(settings) {
+  var iframe;
+  if (iframe = settings != null ? settings.iframe : void 0) {
+    oFrame = iframe;
+    oWindow = iframe.contentWindow;
+    return oDocument = iframe.contentDocument || oWindow.document;
+  } else {
+    oFrame = void 0;
+    oWindow = window;
+    return oDocument = document;
+  }
+};
+
+discoveryIframeOf = function($dom) {
+  var error;
+  oDocument = $dom[0].ownerDocument;
+  oWindow = oDocument.defaultView || oDocument.parentWindow;
+  try {
+    return oFrame = oWindow.frameElement;
+  } catch (_error) {
+    error = _error;
+  }
+};
+
+$.fn.caret = function(method, value, settings) {
+  var caret;
+  if (methods[method]) {
+    if ($.isPlainObject(value)) {
+      setContextBy(value);
+      value = void 0;
+    } else {
+      setContextBy(settings);
+    }
+    caret = Utils.contentEditable(this) ? new EditableCaret(this) : new InputCaret(this);
+    return methods[method].apply(caret, [value]);
+  } else {
+    return $.error("Method " + method + " does not exist on jQuery.caret");
+  }
+};
+
+$.fn.caret.EditableCaret = EditableCaret;
+
+$.fn.caret.InputCaret = InputCaret;
+
+$.fn.caret.Utils = Utils;
+
+$.fn.caret.apis = methods;
 
-    })();
-    Utils = {
-      contentEditable: function($inputor) {
-        return !!($inputor[0].contentEditable && $inputor[0].contentEditable === 'true');
-      }
-    };
-    methods = {
-      pos: function(pos) {
-        if (pos || pos === 0) {
-          return this.setPos(pos);
-        } else {
-          return this.getPos();
-        }
-      },
-      position: function(pos) {
-        if (oDocument.selection) {
-          return this.getIEPosition(pos);
-        } else {
-          return this.getPosition(pos);
-        }
-      },
-      offset: function(pos) {
-        var iOffset, offset;
-        offset = this.getOffset(pos);
-        if (oFrame) {
-          iOffset = $(oFrame).offset();
-          offset.top += iOffset.top;
-          offset.left += iOffset.left;
-        }
-        return offset;
-      }
-    };
-    oDocument = null;
-    oWindow = null;
-    oFrame = null;
-    setContextBy = function(settings) {
-      var iframe;
-      if (iframe = settings != null ? settings.iframe : void 0) {
-        oFrame = iframe;
-        oWindow = iframe.contentWindow;
-        return oDocument = iframe.contentDocument || oWindow.document;
-      } else {
-        oFrame = void 0;
-        oWindow = window;
-        return oDocument = document;
-      }
-    };
-    discoveryIframeOf = function($dom) {
-      var error;
-      oDocument = $dom[0].ownerDocument;
-      oWindow = oDocument.defaultView || oDocument.parentWindow;
-      try {
-        return oFrame = oWindow.frameElement;
-      } catch (_error) {
-        error = _error;
-      }
-    };
-    $.fn.caret = function(method, value, settings) {
-      var caret;
-      if (methods[method]) {
-        if ($.isPlainObject(value)) {
-          setContextBy(value);
-          value = void 0;
-        } else {
-          setContextBy(settings);
-        }
-        caret = Utils.contentEditable(this) ? new EditableCaret(this) : new InputCaret(this);
-        return methods[method].apply(caret, [value]);
-      } else {
-        return $.error("Method " + method + " does not exist on jQuery.caret");
-      }
-    };
-    $.fn.caret.EditableCaret = EditableCaret;
-    $.fn.caret.InputCaret = InputCaret;
-    $.fn.caret.Utils = Utils;
-    return $.fn.caret.apis = methods;
-  });
 
-}).call(this);
+}));
diff --git a/wp-content/plugins/buddypress/bp-core/js/jquery.caret.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery.caret.min.js
index 3aa9226d3c6dd4a07d0dca7658dc0df423cac1fc..46a850a4e034c34584c934425acc4e8bdaa6d7c0 100644
--- a/wp-content/plugins/buddypress/bp-core/js/jquery.caret.min.js
+++ b/wp-content/plugins/buddypress/bp-core/js/jquery.caret.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-(function(){!function(a){return"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;return k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(){return this.domInputor},b.prototype.getIEPosition=function(){return a.noop()},b.prototype.getPosition=function(){return a.noop()},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(){var b,c,d,e;if(j.getSelection&&(d=this.range())){if(d.endOffset-1<0)return null;b=d.cloneRange(),b.setStart(d.endContainer,d.endOffset-1),b.setEnd(d.endContainer,d.endOffset),e=b.getBoundingClientRect(),c={height:e.height,left:e.left+e.width,top:e.top},b.detach()}else h.selection&&(c=this.getOldIEOffset());return c&&!i&&(c.top+=a(j).scrollTop(),c.left+=a(j).scrollLeft()),c},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h,i;return b=this.$inputor,f=function(a){return a.replace(/</g,"&lt").replace(/>/g,"&gt").replace(/`/g,"&#96").replace(/"/g,"&quot").replace(/\r\n|\r|\n/g,"<br />")},void 0===a&&(a=this.getPos()),i=b.val().slice(0,a),e=b.val().slice(a),g="<span style='position: relative; display: inline;'>"+f(i)+"</span>",g+="<span id='caret' style='position: relative; display: inline;'>|</span>",g+="<span style='position: relative; display: inline;'>"+f(e)+"</span>",h=new d(b),c=h.create(g).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(b){var c,d;return d=this.getOffset(b),i&&(c=a(i).offset(),d.top+=c.top,d.left+=c.left),d}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g})}).call(this);
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return a.returnExportsGlobal=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(){return this.domInputor},b.prototype.getIEPosition=function(){return this.getPosition()},b.prototype.getPosition=function(){var a,b;return b=this.getOffset(),a=this.$inputor.offset(),b.left-=a.left,b.top-=a.top,b},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(){var b,c,d,e,f;return j.getSelection&&(d=this.range())?(d.endOffset-1>0&&d.endContainer===!this.domInputor&&(b=d.cloneRange(),b.setStart(d.endContainer,d.endOffset-1),b.setEnd(d.endContainer,d.endOffset),e=b.getBoundingClientRect(),c={height:e.height,left:e.left+e.width,top:e.top},b.detach()),c&&0!==(null!=c?c.height:void 0)||(b=d.cloneRange(),f=a(h.createTextNode("|")),b.insertNode(f[0]),b.selectNode(f[0]),e=b.getBoundingClientRect(),c={height:e.height,left:e.left,top:e.top},f.remove(),b.detach())):h.selection&&(c=this.getOldIEOffset()),c&&(c.top+=a(j).scrollTop(),c.left+=a(j).scrollLeft()),c},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h,i;return b=this.$inputor,f=function(a){return a=a.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"<br/>"),/firefox/i.test(navigator.userAgent)&&(a=a.replace(/\s/g,"&nbsp;")),a},void 0===a&&(a=this.getPos()),i=b.val().slice(0,a),e=b.val().slice(a),g="<span style='position: relative; display: inline;'>"+f(i)+"</span>",g+="<span id='caret' style='position: relative; display: inline;'>|</span>",g+="<span style='position: relative; display: inline;'>"+f(e)+"</span>",h=new d(b),c=h.create(g).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(a){var b;return b=this.getOffset(a)}},h=null,j=null,i=null,l=function(a){var b;return(b=null!=a?a.iframe:void 0)?(i=b,j=b.contentWindow,h=b.contentDocument||j.document):(i=void 0,j=window,h=document)},f=function(a){var b;h=a[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(c){b=c}},a.fn.caret=function(d,f,h){var i;return g[d]?(a.isPlainObject(f)?(l(f),f=void 0):l(h),i=e.contentEditable(this)?new b(this):new c(this),g[d].apply(i,[f])):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/webcam.js b/wp-content/plugins/buddypress/bp-core/js/webcam.js
new file mode 100644
index 0000000000000000000000000000000000000000..2584465f03ae8b3c62cbf9cbe0daf983ddcca652
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/webcam.js
@@ -0,0 +1,307 @@
+/* globals bp, BP_Uploader, _, Backbone */
+
+window.bp = window.bp || {};
+
+( function() {
+
+	// Bail if not set
+	if ( typeof BP_Uploader === 'undefined' ) {
+		return;
+	}
+
+	bp.Models      = bp.Models || {};
+	bp.Collections = bp.Collections || {};
+	bp.Views       = bp.Views || {};
+
+	bp.WebCam = {
+		start: function() {
+			this.params = {
+				video:          null,
+				videoStream:    null,
+				capture_enable: false,
+				capture:        null,
+				canvas:         null,
+				warning:        null,
+				flipped:        false
+			};
+
+			bp.Avatar.nav.on( 'bp-avatar-view:changed', _.bind( this.setView, this ) );
+		},
+
+		setView: function( view ) {
+			if ( 'camera' !== view ) {
+				// Stop the camera if needed
+				if ( ! _.isNull( this.params.video ) ) {
+					this.stop();
+
+					// Remove all warnings as we're changing the view
+					this.removeWarning();
+				}
+
+				// Stop as this is not Camera area
+				return;
+			}
+
+			// Create the WebCam view
+			var cameraView = new bp.Views.WebCamAvatar( { model: new Backbone.Model( { user_media: false } ) } );
+
+			// Make sure the flipped param is reset
+			this.params.flipped = false;
+
+			// Add it to views
+			bp.Avatar.views.add( { id: 'camera', view: cameraView } );
+
+			// Display it
+	        cameraView.inject( '.bp-avatar' );
+		},
+
+		removeView: function() {
+			var camera;
+
+			if ( ! _.isUndefined( bp.Avatar.views.get( 'camera' ) ) ) {
+				camera = bp.Avatar.views.get( 'camera' );
+				camera.get( 'view' ).remove();
+				bp.Avatar.views.remove( { id: 'camera', view: camera } );
+			}
+		},
+
+		gotStream: function( stream ) {
+			var video = bp.WebCam.params.video;
+			bp.WebCam.params.videoStream = stream;
+
+			// User Feedback
+			bp.WebCam.displayWarning( 'loaded' );
+
+			video.onerror = function () {
+				// User Feedback
+				bp.WebCam.displayWarning( 'videoerror' );
+
+				if ( video ) {
+					bp.WebCam.stop();
+				}
+			};
+
+			stream.onended = bp.WebCam.noStream();
+
+			if ( video.mozSrcObject !== undefined ) {
+				video.mozSrcObject = stream;
+				video.play();
+			} else if ( navigator.mozGetUserMedia ) {
+				video.src = stream;
+				video.play();
+			} else if ( window.URL ) {
+				video.src = window.URL.createObjectURL( stream );
+			} else {
+				video.src = stream;
+			}
+
+			bp.WebCam.params.capture_enable = true;
+		},
+
+		stop: function() {
+			bp.WebCam.params.capture_enable = false;
+			if ( bp.WebCam.params.videoStream ) {
+				if ( bp.WebCam.params.videoStream.stop ) {
+					bp.WebCam.params.videoStream.stop();
+				} else if ( bp.WebCam.params.videoStream.msStop ) {
+					bp.WebCam.params.videoStream.msStop();
+				}
+				bp.WebCam.params.videoStream.onended = null;
+				bp.WebCam.params.videoStream = null;
+			}
+			if ( bp.WebCam.params.video ) {
+				bp.WebCam.params.video.onerror = null;
+				bp.WebCam.params.video.pause();
+				if ( bp.WebCam.params.video.mozSrcObject ) {
+					bp.WebCam.params.video.mozSrcObject = null;
+				}
+				bp.WebCam.params.video.src = '';
+			}
+		},
+
+		noStream: function() {
+			if ( _.isNull( bp.WebCam.params.videoStream ) ) {
+				// User Feedback
+				bp.WebCam.displayWarning( 'noaccess' );
+
+				bp.WebCam.removeView();
+			}
+		},
+
+		setAvatar: function( avatar ) {
+			if ( ! avatar.get( 'url' ) ) {
+				bp.WebCam.displayWarning( 'nocapture' );
+			}
+
+			// Remove the view
+			bp.WebCam.removeView();
+
+			bp.Avatar.setAvatar( avatar );
+		},
+
+		removeWarning: function() {
+			if ( ! _.isNull( this.params.warning ) ) {
+				this.params.warning.remove();
+			}
+		},
+
+		displayWarning: function( code ) {
+			this.removeWarning();
+
+			this.params.warning = new bp.Views.uploaderWarning( {
+				value: BP_Uploader.strings.camera_warnings[code]
+			} );
+
+			this.params.warning.inject( '.bp-avatar-status' );
+		}
+	};
+
+	// BuddyPress WebCam view
+	bp.Views.WebCamAvatar = bp.View.extend( {
+		tagName: 'div',
+		id: 'bp-webcam-avatar',
+		template: bp.template( 'bp-avatar-webcam' ),
+
+		events: {
+			'click .avatar-webcam-capture': 'captureStream',
+			'click .avatar-webcam-save': 'saveCapture'
+		},
+
+		initialize: function() {
+			var params;
+
+			if ( navigator.getUserMedia || navigator.oGetUserMedia || navigator.mozGetUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia ) {
+
+				// We need to add some cropping stuff to use bp.Avatar.setAvatar()
+				params = _.extend( _.pick( BP_Uploader.settings.defaults.multipart_params.bp_params,
+					'object',
+					'item_id',
+					'nonces'
+					), {
+						user_media:  true,
+						w: BP_Uploader.settings.crop.full_w,
+						h: BP_Uploader.settings.crop.full_h,
+						x: 0,
+						y: 0,
+						type: 'camera'
+					}
+				);
+
+				this.model.set( params );
+			}
+
+			this.on( 'ready', this.useStream, this );
+		},
+
+		useStream:function() {
+			// No support for user media... Stop!
+			if ( ! this.model.get( 'user_media' ) ) {
+				return;
+			}
+
+			this.options.video = new bp.Views.WebCamVideo();
+			this.options.canvas = new bp.Views.WebCamCanvas();
+
+			this.$el.find( '#avatar-to-crop' ).append( this.options.video.el );
+			this.$el.find( '#avatar-crop-pane' ).append( this.options.canvas.el );
+
+			bp.WebCam.params.video = this.options.video.el;
+			bp.WebCam.params.canvas = this.options.canvas.el;
+
+			// User Feedback
+			bp.WebCam.displayWarning( 'requesting' );
+
+			if ( navigator.getUserMedia ) {
+				navigator.getUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCams.noStream );
+			}  else if ( navigator.oGetUserMedia ) {
+				navigator.oGetUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCam.noStream );
+			} else if ( navigator.mozGetUserMedia ) {
+				navigator.mozGetUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCam.noStream );
+			} else if ( navigator.webkitGetUserMedia ) {
+				navigator.webkitGetUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCam.noStream );
+			} else if (navigator.msGetUserMedia) {
+				navigator.msGetUserMedia( { video:true, audio:false }, bp.WebCams.gotStream, bp.WebCam.noStream );
+			} else {
+				// User Feedback
+				bp.WebCam.displayWarning( 'errormsg' );
+			}
+		},
+
+		captureStream: function( event ) {
+			var sx, sc;
+			event.preventDefault();
+
+			if ( ! bp.WebCam.params.capture_enable ) {
+				// User Feedback
+				bp.WebCam.displayWarning( 'loading' );
+				return;
+			}
+
+			if ( this.model.get( 'h' ) > this.options.video.el.videoHeight || this.model.get( 'w' ) > this.options.video.el.videoWidth ) {
+				bp.WebCam.displayWarning( 'videoerror' );
+				return;
+			}
+
+			// Set the offset
+			sc = this.options.video.el.videoHeight;
+			sx = ( this.options.video.el.videoWidth - sc ) / 2;
+
+			// Flip only once.
+			if ( ! bp.WebCam.params.flipped ) {
+				this.options.canvas.el.getContext( '2d' ).translate( this.model.get( 'w' ), 0 );
+				this.options.canvas.el.getContext( '2d' ).scale( -1, 1 );
+				bp.WebCam.params.flipped = true;
+			}
+
+			this.options.canvas.el.getContext( '2d' ).drawImage( this.options.video.el, sx, 0, sc, sc, 0, 0, this.model.get( 'w' ), this.model.get( 'h' ) );
+			bp.WebCam.params.capture = this.options.canvas.el.toDataURL( 'image/png' );
+			this.model.set( 'url', bp.WebCam.params.capture );
+
+			// User Feedback
+			bp.WebCam.displayWarning( 'ready' );
+		},
+
+		saveCapture: function( event ) {
+			event.preventDefault();
+
+			if ( ! bp.WebCam.params.capture ) {
+				// User Feedback
+				bp.WebCam.displayWarning( 'nocapture' );
+				return;
+			}
+
+			bp.WebCam.stop();
+			bp.WebCam.setAvatar( this.model );
+		}
+	} );
+
+	// BuddyPress Video stream view
+	bp.Views.WebCamVideo = bp.View.extend( {
+		tagName: 'video',
+		id: 'bp-webcam-video',
+		attributes: {
+			autoplay: 'autoplay'
+		}
+	} );
+
+	// BuddyPress Canvas (capture) view
+	bp.Views.WebCamCanvas = bp.View.extend( {
+		tagName: 'canvas',
+		id: 'bp-webcam-canvas',
+		attributes: {
+			width:  150,
+			height: 150
+		},
+
+		initialize: function() {
+			// Make sure to take in account bp_core_avatar_full_height or bp_core_avatar_full_width php filters
+			if ( ! _.isUndefined( BP_Uploader.settings.crop.full_h ) && ! _.isUndefined( BP_Uploader.settings.crop.full_w ) ) {
+				this.el.attributes.width.value  = BP_Uploader.settings.crop.full_w;
+				this.el.attributes.height.value = BP_Uploader.settings.crop.full_h;
+			}
+		}
+	} );
+
+	bp.WebCam.start();
+
+})( bp, jQuery );
diff --git a/wp-content/plugins/buddypress/bp-core/js/webcam.min.js b/wp-content/plugins/buddypress/bp-core/js/webcam.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..dc418e4d767227b63ab74e2c75127d6cafef7eef
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-core/js/webcam.min.js
@@ -0,0 +1,2 @@
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+window.bp=window.bp||{},function(){"undefined"!=typeof BP_Uploader&&(bp.Models=bp.Models||{},bp.Collections=bp.Collections||{},bp.Views=bp.Views||{},bp.WebCam={start:function(){this.params={video:null,videoStream:null,capture_enable:!1,capture:null,canvas:null,warning:null,flipped:!1},bp.Avatar.nav.on("bp-avatar-view:changed",_.bind(this.setView,this))},setView:function(a){if("camera"!==a)return void(_.isNull(this.params.video)||(this.stop(),this.removeWarning()));var b=new bp.Views.WebCamAvatar({model:new Backbone.Model({user_media:!1})});this.params.flipped=!1,bp.Avatar.views.add({id:"camera",view:b}),b.inject(".bp-avatar")},removeView:function(){var a;_.isUndefined(bp.Avatar.views.get("camera"))||(a=bp.Avatar.views.get("camera"),a.get("view").remove(),bp.Avatar.views.remove({id:"camera",view:a}))},gotStream:function(a){var b=bp.WebCam.params.video;bp.WebCam.params.videoStream=a,bp.WebCam.displayWarning("loaded"),b.onerror=function(){bp.WebCam.displayWarning("videoerror"),b&&bp.WebCam.stop()},a.onended=bp.WebCam.noStream(),void 0!==b.mozSrcObject?(b.mozSrcObject=a,b.play()):navigator.mozGetUserMedia?(b.src=a,b.play()):b.src=window.URL?window.URL.createObjectURL(a):a,bp.WebCam.params.capture_enable=!0},stop:function(){bp.WebCam.params.capture_enable=!1,bp.WebCam.params.videoStream&&(bp.WebCam.params.videoStream.stop?bp.WebCam.params.videoStream.stop():bp.WebCam.params.videoStream.msStop&&bp.WebCam.params.videoStream.msStop(),bp.WebCam.params.videoStream.onended=null,bp.WebCam.params.videoStream=null),bp.WebCam.params.video&&(bp.WebCam.params.video.onerror=null,bp.WebCam.params.video.pause(),bp.WebCam.params.video.mozSrcObject&&(bp.WebCam.params.video.mozSrcObject=null),bp.WebCam.params.video.src="")},noStream:function(){_.isNull(bp.WebCam.params.videoStream)&&(bp.WebCam.displayWarning("noaccess"),bp.WebCam.removeView())},setAvatar:function(a){a.get("url")||bp.WebCam.displayWarning("nocapture"),bp.WebCam.removeView(),bp.Avatar.setAvatar(a)},removeWarning:function(){_.isNull(this.params.warning)||this.params.warning.remove()},displayWarning:function(a){this.removeWarning(),this.params.warning=new bp.Views.uploaderWarning({value:BP_Uploader.strings.camera_warnings[a]}),this.params.warning.inject(".bp-avatar-status")}},bp.Views.WebCamAvatar=bp.View.extend({tagName:"div",id:"bp-webcam-avatar",template:bp.template("bp-avatar-webcam"),events:{"click .avatar-webcam-capture":"captureStream","click .avatar-webcam-save":"saveCapture"},initialize:function(){var a;(navigator.getUserMedia||navigator.oGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia)&&(a=_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,"object","item_id","nonces"),{user_media:!0,w:BP_Uploader.settings.crop.full_w,h:BP_Uploader.settings.crop.full_h,x:0,y:0,type:"camera"}),this.model.set(a)),this.on("ready",this.useStream,this)},useStream:function(){this.model.get("user_media")&&(this.options.video=new bp.Views.WebCamVideo,this.options.canvas=new bp.Views.WebCamCanvas,this.$el.find("#avatar-to-crop").append(this.options.video.el),this.$el.find("#avatar-crop-pane").append(this.options.canvas.el),bp.WebCam.params.video=this.options.video.el,bp.WebCam.params.canvas=this.options.canvas.el,bp.WebCam.displayWarning("requesting"),navigator.getUserMedia?navigator.getUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCams.noStream):navigator.oGetUserMedia?navigator.oGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.mozGetUserMedia?navigator.mozGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.webkitGetUserMedia?navigator.webkitGetUserMedia({video:!0},bp.WebCam.gotStream,bp.WebCam.noStream):navigator.msGetUserMedia?navigator.msGetUserMedia({video:!0,audio:!1},bp.WebCams.gotStream,bp.WebCam.noStream):bp.WebCam.displayWarning("errormsg"))},captureStream:function(a){var b,c;return a.preventDefault(),bp.WebCam.params.capture_enable?this.model.get("h")>this.options.video.el.videoHeight||this.model.get("w")>this.options.video.el.videoWidth?void bp.WebCam.displayWarning("videoerror"):(c=this.options.video.el.videoHeight,b=(this.options.video.el.videoWidth-c)/2,bp.WebCam.params.flipped||(this.options.canvas.el.getContext("2d").translate(this.model.get("w"),0),this.options.canvas.el.getContext("2d").scale(-1,1),bp.WebCam.params.flipped=!0),this.options.canvas.el.getContext("2d").drawImage(this.options.video.el,b,0,c,c,0,0,this.model.get("w"),this.model.get("h")),bp.WebCam.params.capture=this.options.canvas.el.toDataURL("image/png"),this.model.set("url",bp.WebCam.params.capture),void bp.WebCam.displayWarning("ready")):void bp.WebCam.displayWarning("loading")},saveCapture:function(a){return a.preventDefault(),bp.WebCam.params.capture?(bp.WebCam.stop(),void bp.WebCam.setAvatar(this.model)):void bp.WebCam.displayWarning("nocapture")}}),bp.Views.WebCamVideo=bp.View.extend({tagName:"video",id:"bp-webcam-video",attributes:{autoplay:"autoplay"}}),bp.Views.WebCamCanvas=bp.View.extend({tagName:"canvas",id:"bp-webcam-canvas",attributes:{width:150,height:150},initialize:function(){_.isUndefined(BP_Uploader.settings.crop.full_h)||_.isUndefined(BP_Uploader.settings.crop.full_w)||(this.el.attributes.width.value=BP_Uploader.settings.crop.full_w,this.el.attributes.height.value=BP_Uploader.settings.crop.full_h)}}),bp.WebCam.start())}(bp,jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-core/js/widget-members.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.js
index 1db1ef2417af3f8cf8d5c27d30576f1ddcfcf206..b8af2cc936917d5f6437ea6fc345dc9ebf9fb8c1 100644
--- a/wp-content/plugins/buddypress/bp-core/js/widget-members.js
+++ b/wp-content/plugins/buddypress/bp-core/js/widget-members.js
@@ -17,7 +17,7 @@ jQuery(document).ready( function() {
 			function(response)
 			{
 				jQuery(link).removeClass('loading');
-				member_wiget_response(response);
+				member_widget_response(response);
 			});
 
 			return false;
@@ -25,7 +25,7 @@ jQuery(document).ready( function() {
 	);
 });
 
-function member_wiget_response(response) {
+function member_widget_response(response) {
 	response = response.substr(0, response.length-1);
 	response = response.split('[[SPLIT]]');
 
diff --git a/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js
index f6a25feeac8ef2dd5e8b51e51fdfdec876931e0f..787221ba8403b779c0ead386ec3abe713b28571d 100644
--- a/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js
+++ b/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-function member_wiget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#members-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),member_wiget_response(b)}),!1})});
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+function member_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]),jQuery(".widget ul#members-list").fadeIn(200)}):jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b),jQuery(".widget ul#members-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#members-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),member_widget_response(b)}),!1})});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php
index 57e76247d561582ba0f7b4d141073cd5b12542bf..4bb00b8a2073432326dbbca813fd84972bee889e 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php
@@ -7,4 +7,4 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
index 817b24812f328597caa41d4e51eff0ee1128be84..e977fe653c1ae8238bc382eaf06e97dd2ba5c656 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Bootstrap bbPress 1.x, and manipulate globals to integrate with BuddyPress.
@@ -18,7 +18,7 @@ function bp_forums_load_bbpress() {
 	global $wpdb, $wp_roles, $current_user, $wp_users_object;
 	global $bb, $bbdb, $bb_table_prefix, $bb_current_user;
 	global $bb_roles, $wp_taxonomy_object, $bb_queries;
-	
+
 	// Return if we've already run this function.
 	if ( is_object( $bbdb ) )
 		return;
@@ -86,8 +86,25 @@ function bp_forums_load_bbpress() {
 		bb_init_roles( $bb_roles );
 	}
 
+	/**
+	 * Fires during the bootstrap setup for bbPress 1.x.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'bb_got_roles' );
+
+	/**
+	 * Fires during the bootstrap setup for bbPress 1.x.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'bb_init'      );
+
+	/**
+	 * Fires during the bootstrap setup for bbPress 1.x.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'init_roles'   );
 
 	$bb_current_user = $current_user;
@@ -124,6 +141,11 @@ function bp_forums_load_bbpress() {
 		bb_update_option( 'uri', BB_URL );
 	}
 
+	/**
+	 * Fires inside an anonymous function that is run on bbPress shutdown.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ) );
 }
 add_action( 'bbpress_init', 'bp_forums_load_bbpress' );
@@ -171,7 +193,7 @@ class BP_Forums_BB_Auth {
  * bbPress needs the DB class to be BPDB, but we want to use WPDB, so we can extend it and use this.
  *
  * The class is pluggable, so that plugins that swap out WPDB with a custom
- * database class (such as HyperDB and SharDB) can provide their own versions
+ * database class (such as HyperDB and ShareDB) can provide their own versions
  * of BPDB which extend the appropriate base class.
  */
 if ( ! class_exists( 'BPDB' ) ) :
@@ -196,7 +218,7 @@ if ( ! class_exists( 'BPDB' ) ) :
 		/**
 		 * Determine if a database supports a particular feature.
 		 *
-		 * Overriden here to work around differences between bbPress's
+		 * Overridden here to work around differences between bbPress's
 		 * and WordPress's implementations. In particular, when
 		 * BuddyPress tries to run bbPress' SQL installation script,
 		 * the collation check always failed. The capability is long
@@ -339,7 +361,7 @@ function bp_bb_dbDelta($queries, $execute = true) {
 			if ( array_key_exists(strtolower($table), $cqueries) ) {
 				// Clear the field and index arrays
 				$cfields = $indices = array();
-				// Get all of the field names in the query from between the parens
+				// Get all of the field names in the query from between the parents
 				preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2);
 				$qryline = trim($match2[1]);
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php
index 65810a303359bc613457496bd0542f6e1a68c386..d922a21942ebb027e09dde45cebe91d24a5d1afa 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php
@@ -4,4 +4,4 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
index 204a95392515104d1a6f7d7c9feb458b8522a088..63114394015c8aa05a607b9689f00e0e040f4b2c 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /* Apply WordPress defined filters */
 add_filter( 'bp_forums_bbconfig_location', 'wp_filter_kses', 1 );
@@ -83,6 +83,13 @@ function bp_forums_filter_kses( $content ) {
 	$forums_allowedtags['code'] = array();
 	$forums_allowedtags['blockquote'] = array();
 
+	/**
+	 * Filters the allowed HTML tags for forum posts.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $forums_allowedtags Array of allowed HTML tags.
+	 */
 	$forums_allowedtags = apply_filters( 'bp_forums_allowed_tags', $forums_allowedtags );
 	return wp_kses( $content, $forums_allowedtags );
 }
@@ -97,8 +104,13 @@ function bp_forums_filter_kses( $content ) {
  * @return string Link of the form http://example.com/forums/tag/tagname/.
  */
 function bp_forums_filter_tag_link( $link, $tag, $page, $context ) {
-	global $bp;
-
+	/**
+	 * Filters the link for a forum topic tags directory.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value Link for the forum topic tag directory.
+	 */
 	return apply_filters( 'bp_forums_filter_tag_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/tag/' . $tag . '/' );
 }
 add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4);
@@ -127,8 +139,6 @@ function bp_forums_make_nofollow_filter( $text ) {
 /**
  * Append forum topic to page title.
  *
- * @global object $bp Global BuddyPress settings object.
- *
  * @see bp_modify_page_title()
  *
  * @param string $title New page title; see {@link bp_modify_page_title()}.
@@ -138,7 +148,6 @@ function bp_forums_make_nofollow_filter( $text ) {
  * @return string Page title with forum topic title appended.
  */
 function bp_forums_add_forum_topic_to_page_title( $title, $original_title, $sep, $seplocation  ) {
-	global $bp;
 
 	if ( bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) )
 		if ( bp_has_forum_topic_posts() )
@@ -153,24 +162,19 @@ add_filter( 'bp_modify_page_title', 'bp_forums_add_forum_topic_to_page_title', 9
  *
  * Prevents embedded anchor tags.
  *
- * @global object $bp Global BuddyPress settings object.
- *
  * @param string $content Edited post content.
  * @return string $content Sanitized post content.
  */
 function bp_forums_strip_mentions_on_post_edit( $content ) {
-	global $bp;
-
-	$content = htmlspecialchars_decode( $content );
-
-	$pattern = "|<a href=&#039;" . bp_get_root_domain() . "/" . bp_get_members_root_slug() . "/[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
-
-	$content = preg_replace( $pattern, "$1", $content );
+	$content   = htmlspecialchars_decode( $content );
+	$directory = bp_get_members_directory_permalink();
+	$pattern   = "|<a href=&#039;{$directory}[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
+	$content   = preg_replace( $pattern, "$1", $content );
 
 	return $content;
 }
 add_filter( 'bp_get_the_topic_post_edit_text', 'bp_forums_strip_mentions_on_post_edit' );
-add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
+add_filter( 'bp_get_the_topic_text',           'bp_forums_strip_mentions_on_post_edit' );
 
 /** "Replied to" SQL filters *************************************************/
 
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
index 796eadc0265a04aaf07b573f18de8622bf3c3acb..05fbedac1f4038346504cdbb276469db685148b9 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** bbPress 2.x ***************************************************************/
 
@@ -79,6 +79,8 @@ function bp_forums_has_directory() {
  * @return object bbPress forum object.
  */
 function bp_forums_get_forum( $forum_id ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 	return bb_get_forum( $forum_id );
 }
@@ -100,6 +102,8 @@ function bp_forums_get_forum( $forum_id ) {
  * @return int ID of the newly created forum.
  */
 function bp_forums_new_forum( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -129,9 +133,11 @@ function bp_forums_new_forum( $args = '' ) {
  *     @type bool $forum_order Order.
  *     @type int $forum_is_category Whether the forum is a category. Default: 0.
  * }
- * @return bool Ttrue on success, false on failure.
+ * @return bool True on success, false on failure.
  */
 function bp_forums_update_forum( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -157,6 +163,8 @@ function bp_forums_delete_group_forum( $group_id ) {
 	$forum_id = groups_get_groupmeta( $group_id, 'forum_id' );
 
 	if ( !empty( $forum_id ) && is_int( $forum_id ) ) {
+
+		/** This action is documented in bp-forums/bp-forums-screens */
 		do_action( 'bbpress_init' );
 		bb_delete_forum( $forum_id );
 	}
@@ -188,6 +196,8 @@ add_action( 'groups_delete_group', 'bp_forums_delete_group_forum' );
  * @return array Found topics.
  */
 function bp_forums_get_forum_topics( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -230,6 +240,14 @@ function bp_forums_get_forum_topics( $args = '' ) {
 		$topics = array();
 	}
 
+	/**
+	 * Filters the found forum topics for provided arguments.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array $topics Array of found topics. Passed by reference.
+	 * @param array $r      Array of parsed arguments for query. Passed by reference.
+	 */
 	return apply_filters_ref_array( 'bp_forums_get_forum_topics', array( &$topics, &$r ) );
 }
 
@@ -240,6 +258,8 @@ function bp_forums_get_forum_topics( $args = '' ) {
  * @return object Details about the topic.
  */
 function bp_forums_get_topic_details( $topic_id ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$query = new BB_Query( 'topic', 'topic_id=' . $topic_id . '&page=1' /* Page override so bbPress doesn't use the URI */ );
@@ -256,6 +276,8 @@ function bp_forums_get_topic_details( $topic_id ) {
  * @return int|bool ID of the topic (if found), false on failure.
  */
 function bp_forums_get_topic_id_from_slug( $topic_slug ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	if ( empty( $topic_slug ) )
@@ -293,8 +315,9 @@ function bp_forums_get_topic_id_from_slug( $topic_slug ) {
  *         {@link bp_forums_get_topic_details()}.
  */
 function bp_forums_new_topic( $args = '' ) {
-	global $bp;
+	$bp = buddypress();
 
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -308,7 +331,7 @@ function bp_forums_new_topic( $args = '' ) {
 		'topic_start_time'       => bp_core_current_time(),
 		'topic_time'             => bp_core_current_time(),
 		'topic_open'             => 1,
-		'topic_tags'             => false, // accepts array or comma delim
+		'topic_tags'             => false, // accepts array or comma delimited
 		'forum_id'               => 0      // accepts ids or slugs
 	) );
 	extract( $r, EXTR_SKIP );
@@ -334,6 +357,13 @@ function bp_forums_new_topic( $args = '' ) {
 	if ( !bp_forums_insert_post( array( 'topic_id' => $topic_id, 'post_text' => $topic_text, 'post_time' => $topic_time, 'poster_id' => $topic_poster ) ) )
 		return false;
 
+	/**
+	 * Fires after a new forum topic has been created.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $topic_id ID of the newly created topic post.
+	 */
 	do_action( 'bp_forums_new_topic', $topic_id );
 
 	return $topic_id;
@@ -354,6 +384,8 @@ function bp_forums_new_topic( $args = '' ) {
  *         {@link bp_forums_get_topic_details()}.
  */
 function bp_forums_update_topic( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -385,6 +417,8 @@ function bp_forums_update_topic( $args = '' ) {
 }
 
 function bp_forums_sticky_topic( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -412,6 +446,8 @@ function bp_forums_sticky_topic( $args = '' ) {
  * @return bool True on success, false on failure.
  */
 function bp_forums_openclose_topic( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -437,6 +473,8 @@ function bp_forums_openclose_topic( $args = '' ) {
  * @return bool True on success, false on failure.
  */
 function bp_forums_delete_topic( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -455,6 +493,7 @@ function bp_forums_delete_topic( $args = '' ) {
 function bp_forums_total_topic_count() {
 	global $bbdb;
 
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	if ( isset( $bbdb ) ) {
@@ -471,6 +510,13 @@ function bp_forums_total_topic_count() {
 		$count = 0;
 	}
 
+	/**
+	 * Filters the total topic count for the site.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $count Total topic count.
+	 */
 	return apply_filters( 'bp_forums_total_topic_count', $count );
 }
 
@@ -491,6 +537,8 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
 	$reply_exists = false;
 
 	if ( $text && $topic_id && $user_id ) {
+
+		/** This action is documented in bp-forums/bp-forums-screens */
 		do_action( 'bbpress_init' );
 
 		$args = array(
@@ -512,6 +560,16 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
 		$reply_exists = (bool) !empty( $query->results );
 	}
 
+	/**
+	 * Filters whether a user has already left this particular reply on a given post.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool   $reply_exists Whether or not a reply exists.
+	 * @param string $text         The text of the comment.
+	 * @param int    $topic_id     The topic ID.
+	 * @param int    $user_id      The user ID.
+	 */
 	return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );
 }
 	/**
@@ -539,6 +597,8 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) {
  * @return int $count The topic count.
  */
 function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	if ( !$user_id )
@@ -578,6 +638,8 @@ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' )
  * @return int $count Topic count.
  */
 function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	if ( !$user_id )
@@ -609,6 +671,14 @@ function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active'
 		$count = 0;
 	}
 
+	/**
+	 * Filters the total number of topics replied to by a given user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $count   Total number of topics replied to by a given user.
+	 * @param int $user_id The user ID.
+	 */
 	return apply_filters( 'bp_forums_total_replied_count_for_user', $count, $user_id );
 }
 
@@ -693,6 +763,8 @@ function bp_forums_get_topic_extras( $topics ) {
  * @return array List of posts.
  */
 function bp_forums_get_topic_posts( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$defaults = array(
@@ -717,6 +789,8 @@ function bp_forums_get_topic_posts( $args = '' ) {
  * @return object Post object.
  */
 function bp_forums_get_post( $post_id ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 	return bb_get_post( $post_id );
 }
@@ -732,6 +806,8 @@ function bp_forums_get_post( $post_id ) {
  * @return bool True on success, false on failure.
  */
 function bp_forums_delete_post( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$r = wp_parse_args( $args, array(
@@ -763,6 +839,8 @@ function bp_forums_delete_post( $args = '' ) {
  * @return int|bool ID of the new post on success, false on failure.
  */
 function bp_forums_insert_post( $args = '' ) {
+
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	$defaults = array(
@@ -802,8 +880,17 @@ function bp_forums_insert_post( $args = '' ) {
 
 	$post_id = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) );
 
-	if ( !empty( $post_id ) )
+	if ( !empty( $post_id ) ) {
+
+		/**
+		 * Fires if there was a new post created.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $post_id ID of the newly created forum post.
+		 */
 		do_action( 'bp_forums_new_post', $post_id );
+	}
 
 	return $post_id;
 }
@@ -819,11 +906,13 @@ function bp_forums_insert_post( $args = '' ) {
  * @return array Posts with BP-data added.
  */
 function bp_forums_get_post_extras( $posts ) {
-	global $bp, $wpdb;
+	global $wpdb;
 
 	if ( empty( $posts ) )
 		return $posts;
 
+	$bp = buddypress();
+
 	// Get the user ids
 	foreach ( (array) $posts as $post ) $user_ids[] = $post->poster_id;
 	$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
@@ -853,6 +942,13 @@ function bp_forums_get_post_extras( $posts ) {
 		}
 	}
 
+	/**
+	 * Filters BP-specific details about a set of posts.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array $posts Array of posts holding BP-specific details.
+	 */
 	return apply_filters( 'bp_forums_get_post_extras', $posts );
 }
 
@@ -866,6 +962,7 @@ function bp_forums_get_post_extras( $posts ) {
 function bp_forums_get_forum_topicpost_count( $forum_id ) {
 	global $wpdb, $bbdb;
 
+	/** This action is documented in bp-forums/bp-forums-screens */
 	do_action( 'bbpress_init' );
 
 	// Need to find a bbPress function that does this
@@ -905,6 +1002,14 @@ add_filter( 'user_has_cap', 'bp_forums_filter_caps' );
  * @return int Forum ID.
  */
 function bp_forums_parent_forum_id() {
+
+	/**
+	 * Filters the parent forum ID for the bbPress abstraction layer.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int BP_FORUMS_PARENT_FORUM_ID The Parent forum ID constant.
+	 */
 	return apply_filters( 'bp_forums_parent_forum_id', BP_FORUMS_PARENT_FORUM_ID );
 }
 
@@ -920,6 +1025,14 @@ function bp_forums_parent_forum_id() {
  *         directory, otherwise false.
  */
 function bp_forums_enable_global_directory_stickies() {
+
+	/**
+	 * Filters whether or not sticky topics should be broken out of regular topic order.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $value Whether or not to break out of topic order.
+	 */
 	return apply_filters( 'bp_forums_enable_global_directory_stickies', defined( 'BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES' ) && BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES );
 }
 
@@ -964,7 +1077,7 @@ add_action( 'topic_loop_start', 'bp_forums_embed' );
  * Wrapper function for {@link bb_get_postmeta()}.
  *
  * @package BuddyPress_Forums
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  */
 function bp_embed_forum_cache( $cache, $id, $cachekey ) {
 	return bb_get_postmeta( $id, $cachekey );
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
index bbabdd459e9bf2188089453f4d26dd312ef3f84d..dbb32eee8053a5786480047b49313abe94a49543 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php
@@ -13,7 +13,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Forums_Component extends BP_Component {
 
@@ -57,8 +57,9 @@ class BP_Forums_Component extends BP_Component {
 			define( 'BP_FORUMS_SLUG', $this->id );
 
 		// The location of the bbPress stand-alone config file
-		if ( isset( $bp->site_options['bb-config-location'] ) )
-			$this->bbconfig = $bp->site_options['bb-config-location'];
+		$bbconfig = bp_core_get_root_option( 'bb-config-location' );
+		if ( '' !== $bbconfig )
+			$this->bbconfig = $bbconfig;
 
 		// All globals for messaging component.
 		// Note that global_tables is included in this array.
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
index d9e30800193f28a78c7a6e18b44f033e126add66..6778edc7bf2e618abd1176ce41e342c04c91f2fa 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Load the Forums directory.
@@ -28,6 +28,11 @@ function bp_forums_directory_forums_setup() {
 
 		bp_update_is_directory( true, 'forums' );
 
+		/**
+		 * Fires early in the initialization of bbPress-based areas of BuddyPress.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'bbpress_init' );
 
 		// Check to see if the user has posted a new topic from the forums page.
@@ -75,8 +80,20 @@ function bp_forums_directory_forums_setup() {
 			}
 		}
 
+		/**
+		 * Fires right before the loading of the forums directory screen template file.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'bp_forums_directory_forums_setup' );
 
+		/**
+		 * Filters the template to load for the forums directory screen.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $template Path to the forums template to load.
+		 */
 		bp_core_load_template( apply_filters( 'bp_forums_template_directory_forums_setup', 'forums/index' ) );
 	}
 }
@@ -86,8 +103,21 @@ add_action( 'bp_screens', 'bp_forums_directory_forums_setup', 2 );
  * Load the Topics Started screen.
  */
 function bp_member_forums_screen_topics() {
+
+	/**
+	 * Fires right before the loading of the forums topics started screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_member_forums_screen_topics' );
 
+	/**
+	 * Filters the template to load for the forums topics started screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $template Path to the forums topics started template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_member_forums_screen_topics', 'members/single/home' ) );
 }
 
@@ -95,8 +125,21 @@ function bp_member_forums_screen_topics() {
  * Load the Replied To screen.
  */
 function bp_member_forums_screen_replies() {
+
+	/**
+	 * Fires right before the loading of the forums replied to screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_member_forums_screen_replies' );
 
+	/**
+	 * Filters the template to load for the forums replied to screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $template Path to the forums replied to template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_member_forums_screen_replies', 'members/single/home' ) );
 }
 
@@ -106,8 +149,21 @@ function bp_member_forums_screen_replies() {
  * Note that this feature is not fully implemented at the moment.
  */
 function bp_member_forums_screen_favorites() {
+
+	/**
+	 * Fires right before the loading of the forums favorites screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_member_forums_screen_favorites' );
 
+	/**
+	 * Filters the template to load for the forums favorites screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $template Path to the forums favorites template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_member_forums_screen_favorites', 'members/single/home' ) );
 }
 
@@ -119,8 +175,20 @@ function bp_forums_screen_single_forum() {
 	if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || !bp_action_variable( 0 ) )
 		return false;
 
+	/**
+	 * Fires right before the loading of the forums single forum screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_forums_screen_single_forum' );
 
+	/**
+	 * Filters the template to load for the forums single forum screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $template Path to the forums single forum template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_forums_screen_single_forum', 'forums/single/forum' ) );
 }
 add_action( 'bp_screens', 'bp_forums_screen_single_forum' );
@@ -133,19 +201,31 @@ function bp_forums_screen_single_topic() {
 	if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || !bp_action_variable( 0 ) )
 		return false;
 
+	/**
+	 * Fires right before the loading of the forums single topic screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_forums_screen_single_topic' );
 
+	/**
+	 * Filters the template to load for the forums single topic screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $template Path to the forums single topic template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_forums_screen_single_topic', 'forums/single/topic' ) );
 }
 add_action( 'bp_screens', 'bp_forums_screen_single_topic' );
 
 
-/** Theme Compatability *******************************************************/
+/** Theme Compatibility *******************************************************/
 
 /**
  * The main theme compat class for legacy BuddyPress forums.
  *
- * This class sets up the necessary theme compatability actions to safely output
+ * This class sets up the necessary theme compatibility actions to safely output
  * old forum template parts to the_title and the_content areas of a theme.
  *
  * @since BuddyPress (1.7.0)
@@ -162,7 +242,7 @@ class BP_Forum_Legacy_Theme_Compat {
 	}
 
 	/**
-	 * Are we looking at something that needs old forum theme compatability?
+	 * Are we looking at something that needs old forum theme compatibility?
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
index 27cc975987724d5aa592302f6d9a2d2fd0ad0930..93f3f7841a4354c46607dec6362d9a34b45830fc 100644
--- a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
+++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php
@@ -7,7 +7,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the forums component slug.
@@ -27,8 +27,14 @@ function bp_forums_slug() {
 	 * @return string Slug for the forums component.
 	 */
 	function bp_get_forums_slug() {
-		global $bp;
-		return apply_filters( 'bp_get_forums_slug', $bp->forums->slug );
+		/**
+		 * Filters the forums component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Forums component slug.
+		 */
+		return apply_filters( 'bp_get_forums_slug', buddypress()->forums->slug );
 	}
 
 /**
@@ -49,8 +55,14 @@ function bp_forums_root_slug() {
 	 * @return string Root slug for the forums component.
 	 */
 	function bp_get_forums_root_slug() {
-		global $bp;
-		return apply_filters( 'bp_get_forums_root_slug', $bp->forums->root_slug );
+		/**
+		 * Filters the forums component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $root_slug Forums component root slug.
+		 */
+		return apply_filters( 'bp_get_forums_root_slug', buddypress()->forums->root_slug );
 	}
 
 /**
@@ -61,7 +73,7 @@ function bp_forums_root_slug() {
  * @uses bp_get_forums_directory_permalink()
  */
 function bp_forums_directory_permalink() {
-	echo bp_get_forums_directory_permalink();
+	echo esc_url( bp_get_forums_directory_permalink() );
 }
 	/**
 	 * Return permalink for the forum directory.
@@ -69,13 +81,21 @@ function bp_forums_directory_permalink() {
 	 * @since BuddyPress (1.5.0)
 	 *
 	 * @uses apply_filters()
-	 * @uses traisingslashit()
+	 * @uses trailingslashit()
 	 * @uses bp_get_root_domain()
 	 * @uses bp_get_forums_root_slug()
 	 *
 	 * @return string The permalink for the forums component directory.
 	 */
 	function bp_get_forums_directory_permalink() {
+
+		/**
+		 * Filters the permalink for the forum directory.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Permalink for the forum directory.
+		 */
 		return apply_filters( 'bp_get_forums_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ) );
 	}
 
@@ -91,7 +111,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var int
 	 */
-	var $current_topic = -1;
+	public $current_topic = -1;
 
 	/**
 	 * The number of topics returned by the paged query.
@@ -99,7 +119,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var int
 	 */
-	var $topic_count;
+	public $topic_count;
 
 	/**
 	 * Array of topics located by the query.
@@ -107,7 +127,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var array
 	 */
-	var $topics;
+	public $topics;
 
 	/**
 	 * The topic object currently being iterated on.
@@ -115,7 +135,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var object
 	 */
-	var $topic;
+	public $topic;
 
 	/**
 	 * The ID of the forum whose topics are being queried.
@@ -123,7 +143,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var int
 	 */
-	var $forum_id;
+	public $forum_id;
 
 	/**
 	 * A flag for whether the loop is currently being iterated.
@@ -131,23 +151,23 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var bool
 	 */
-	var $in_the_loop;
+	public $in_the_loop;
 
 	/**
 	 * The page number being requested.
 	 *
 	 * @access public
-	 * @var public
+	 * @var int
 	 */
-	var $pag_page;
+	public $pag_page;
 
 	/**
 	 * The number of items being requested per page.
 	 *
 	 * @access public
-	 * @var public
+	 * @var int
 	 */
-	var $pag_num;
+	public $pag_num;
 
 	/**
 	 * An HTML string containing pagination links.
@@ -155,7 +175,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var string
 	 */
-	var $pag_links;
+	public $pag_links;
 
 	/**
 	 * The total number of topics matching the query parameters.
@@ -163,7 +183,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var int
 	 */
-	var $total_topic_count;
+	public $total_topic_count;
 
 	/**
 	 * Whether requesting a single topic. Not currently used.
@@ -171,7 +191,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var bool
 	 */
-	var $single_topic = false;
+	public $single_topic = false;
 
 	/**
 	 * Term to sort by. Not currently used.
@@ -179,7 +199,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var string
 	 */
-	var $sort_by;
+	public $sort_by;
 
 	/**
 	 * Sort order. Not currently used.
@@ -187,7 +207,7 @@ class BP_Forums_Template_Forum {
 	 * @access public
 	 * @var string
 	 */
-	var $order;
+	public $order;
 
 	/**
 	 * Constructor method.
@@ -199,14 +219,14 @@ class BP_Forums_Template_Forum {
 	 * @param int $user_id The ID of the user to whom topics should be
 	 *        limited. Pass false to remove this filter.
 	 * @param int $page The number of the page being requested.
-	 * @param int $per_page The number of items being requested perpage.
+	 * @param int $per_page The number of items being requested per page.
 	 * @param string $no_stickies Requested sticky format.
 	 * @param string $search_terms Filter results by a string.
 	 * @param int $offset Optional. Offset results by a given numeric value.
 	 * @param int $number Optional. Total number of items to retrieve.
 	 */
 	function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {
-		global $bp;
+		$bp = buddypress();
 
 		$this->pag_page     = $page;
 		$this->pag_num      = $per_page;
@@ -234,6 +254,19 @@ class BP_Forums_Template_Forum {
 				break;
 		}
 
+		/**
+		 * Filters the forums template topics.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param array  $topics      Array of topics being set for display.
+		 * @param string $type        The sort order/kind. 'newest',
+		 *                            'popular', 'unreplied', 'tags'.
+		 * @param int    $forum_id    ID for the current forum.
+		 * @param int    $per_page    The number of the page being requested.
+		 * @param int    $max         The max number of posts to show.
+		 * @param string $no_stickies Requested sticky format.
+		 */
 		$this->topics = apply_filters( 'bp_forums_template_topics', $this->topics, $type, $forum_id, $per_page, $max, $no_stickies );
 
 		if ( !(int) $this->topics ) {
@@ -281,7 +314,37 @@ class BP_Forums_Template_Forum {
 			}
 		}
 
-		$this->topic_count       = apply_filters_ref_array( 'bp_forums_template_topic_count',                                 array( $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) );
+		/**
+		 * Filters the topic count for the forum being displayed.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int    $topic_count Topic count to be displayed.
+		 * @param array  $topics      Array of topics to be displayed.
+		 * @param string $type        The sort order/kind. 'newest',
+		 *                            'popular', 'unreplied', 'tags'.
+		 * @param int    $forum_id    ID for the current forum.
+		 * @param int    $per_page    The number of the page being requested.
+		 * @param int    $max         The max number of posts to show.
+		 * @param string $no_stickies Requested sticky format.
+		 */
+		$this->topic_count = apply_filters_ref_array( 'bp_forums_template_topic_count', array( $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) );
+
+		/**
+		 * Filters the total topic count for the forum being displayed.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int    $total_topic_count Total topic count found.
+		 * @param int    $topic_count       Topic count to be displayed.
+		 * @param array  $topics            Array of topics to be displayed.
+		 * @param string $type              The sort order/kind. 'newest',
+		 *                                  'popular', 'unreplied', 'tags'.
+		 * @param int    $forum_id          ID for the current forum.
+		 * @param int    $per_page          The number of the page being requested.
+		 * @param int    $max               The max number of posts to show.
+		 * @param string $no_stickies       Requested sticky format.
+		 */
 		$this->total_topic_count = apply_filters_ref_array( 'bp_forums_template_total_topic_count', array( $this->total_topic_count, $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) );
 
 		// Fetch extra information for topics, so we don't have to query inside the loop
@@ -295,7 +358,8 @@ class BP_Forums_Template_Forum {
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => array(),
 			) );
 		}
 	}
@@ -351,6 +415,12 @@ class BP_Forums_Template_Forum {
 		if ( $this->current_topic + 1 < $this->topic_count ) {
 			return true;
 		} elseif ( $this->current_topic + 1 == $this->topic_count ) {
+
+			/**
+			 * Fires right before the rewinding of user topics.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action('forum_loop_end');
 			// Do some cleaning up after the loop
 			$this->rewind_topics();
@@ -372,8 +442,15 @@ class BP_Forums_Template_Forum {
 		$this->topic = $this->next_topic();
 		$this->topic = (object)$this->topic;
 
-		if ( $this->current_topic == 0 ) // loop has just started
-			do_action('forum_loop_start');
+		if ( $this->current_topic == 0 ) {
+
+			/**
+			 * Fires if the current topic item is the first in the topic loop.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'forum_loop_start' );
+		}
 	}
 }
 
@@ -417,7 +494,9 @@ class BP_Forums_Template_Forum {
  *         false otherwise.
  */
 function bp_has_forum_topics( $args = '' ) {
-	global $forum_template, $bp;
+	global $forum_template;
+
+	$bp = buddypress();
 
 	/***
 	 * Set the defaults based on the current page. Any of these will be overridden
@@ -567,7 +646,8 @@ function bp_has_forum_topics( $args = '' ) {
 				'current'   => $forum_template->pag_page,
 				'prev_text' => _x( '&larr;', 'Forum topic pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Forum topic pagination next text', 'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => array(),
 			) );
 
 		} else {
@@ -579,6 +659,14 @@ function bp_has_forum_topics( $args = '' ) {
 		$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms );
 	}
 
+	/**
+	 * Filters whether or not there are topics to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool   $value          Whether or not there are topics to display.
+	 * @param object $forum_template Global $forum_template object.
+	 */
 	return apply_filters( 'bp_has_topics', $forum_template->has_topics(), $forum_template );
 }
 
@@ -620,6 +708,13 @@ function bp_the_topic_id() {
 	function bp_get_the_topic_id() {
 		global $forum_template;
 
+		/**
+		 * Filters the ID of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $topic_id ID for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_id', $forum_template->topic->topic_id );
 	}
 
@@ -637,6 +732,13 @@ function bp_the_topic_title() {
 	function bp_get_the_topic_title() {
 		global $forum_template;
 
+		/**
+		 * Filters the title of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $topic_title Title for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_title', stripslashes( $forum_template->topic->topic_title ) );
 	}
 
@@ -654,6 +756,13 @@ function bp_the_topic_slug() {
 	function bp_get_the_topic_slug() {
 		global $forum_template;
 
+		/**
+		 * Filters the slug of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $topic_slug Slug for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_slug', $forum_template->topic->topic_slug );
 	}
 
@@ -672,6 +781,14 @@ function bp_the_topic_text() {
 		global $forum_template;
 
 		$post = bb_get_first_post( (int) $forum_template->topic->topic_id, false );
+
+		/**
+		 * Filters the text of the first post in the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $post_text Text for the first post in the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_text', esc_attr( $post->post_text ) );
 	}
 
@@ -689,6 +806,13 @@ function bp_the_topic_poster_id() {
 	function bp_get_the_topic_poster_id() {
 		global $forum_template;
 
+		/**
+		 * Filters the ID of the user who posted the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $topic_poster ID for the user.
+		 */
 		return apply_filters( 'bp_get_the_topic_poster_id', $forum_template->topic->topic_poster );
 	}
 
@@ -733,6 +857,13 @@ function bp_the_topic_poster_avatar( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters the avatar for the user who posted the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML for the display of the user's avatar.
+		 */
 		return apply_filters( 'bp_get_the_topic_poster_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->topic_poster, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
 	}
 
@@ -755,6 +886,13 @@ function bp_the_topic_poster_name() {
 		if ( !$name = bp_core_get_userlink( $poster_id ) )
 			return __( 'Deleted User', 'buddypress' );
 
+		/**
+		 * Filters the name of the user who posted the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $name Name for the user who posted the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_poster_name', $name );
 	}
 
@@ -774,6 +912,15 @@ function bp_the_topic_object_id() {
 	function bp_get_the_topic_object_id() {
 		global $forum_template;
 
+		/**
+		 * Filters the ID of the object associated with the current topic in the loop.
+		 *
+		 * Objects are things like associated groups.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $object_id ID for the object associated with the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_object_id', $forum_template->topic->object_id );
 	}
 
@@ -799,6 +946,16 @@ function bp_the_topic_object_name() {
 		else
 			$retval = '';
 
+		/**
+		 * Filters the name of the object associated with the current topic in the loop.
+		 *
+		 * Objects are things like groups. So this filter would return the
+		 * name of the group associated with the forum topic, if it exists.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $retval Name for the object associated with the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_object_name', $retval );
 	}
 
@@ -819,6 +976,16 @@ function bp_the_topic_object_slug() {
 	function bp_get_the_topic_object_slug() {
 		global $forum_template;
 
+		/**
+		 * Filters the slug of the object associated with the current topic in the loop.
+		 *
+		 * Objects are things like groups. So this filter would return the
+		 * slug of the group associated with the forum topic, if it exists.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $object_slug Slug for the object associated with the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_object_slug', $forum_template->topic->object_slug );
 	}
 
@@ -839,11 +1006,22 @@ function bp_the_topic_object_permalink() {
 	function bp_get_the_topic_object_permalink() {
 
 		// Currently this will only work with group forums, extended support in the future
-		if ( bp_is_active( 'groups' ) )
-			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' );
-		else
+		if ( bp_is_active( 'groups' ) ) {
+			$permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_get_the_topic_object_slug() . '/forum' );
+		} else {
 			$permalink = '';
+		}
 
+		/**
+		 * Filters the permalink of the object associated with the current topic in the loop.
+		 *
+		 * Objects are things like groups. So this filter would return the
+		 * slug of the group associated with the forum topic, if it exists.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $permalink Permalink for the object associated with the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_object_permalink', $permalink );
 	}
 
@@ -862,13 +1040,21 @@ function bp_the_topic_last_poster_name() {
 	function bp_get_the_topic_last_poster_name() {
 		global $forum_template;
 
-		$domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login ) ;
+		$domain = bp_core_get_user_domain( $forum_template->topic->topic_last_poster, $forum_template->topic->topic_last_poster_nicename, $forum_template->topic->topic_last_poster_login );
 
 		// In the case where no user is found, bp_core_get_user_domain() may return the URL
 		// of the Members directory
-		if ( !$domain || $domain == bp_core_get_root_domain() . '/' . bp_get_members_root_slug() . '/' )
+		if ( empty( $domain ) || ( bp_get_members_directory_permalink() === $domain ) ) {
 			return __( 'Deleted User', 'buddypress' );
+		}
 
+		/**
+		 * Filters the linked name of the user who last posted to the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML link to the profile of the user who last posted.
+		 */
 		return apply_filters( 'bp_get_the_topic_last_poster_name', '<a href="' . $domain . '">' . $forum_template->topic->topic_last_poster_displayname . '</a>' );
 	}
 
@@ -919,6 +1105,13 @@ function bp_the_topic_object_avatar( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters the avatar of the object associated with the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value HTML output for the object associated with the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_object_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->object_id, 'type' => $type, 'object' => 'group', 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
 	}
 
@@ -963,6 +1156,13 @@ function bp_the_topic_last_poster_avatar( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters the avatar for the user who last posted to the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML output for the avatar for the user who last posted.
+		 */
 		return apply_filters( 'bp_get_the_topic_last_poster_avatar', bp_core_fetch_avatar( array( 'email' => $forum_template->topic->topic_last_poster_email, 'item_id' => $forum_template->topic->topic_last_poster, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
 	}
 
@@ -980,6 +1180,13 @@ function bp_the_topic_start_time() {
 	function bp_get_the_topic_start_time() {
 		global $forum_template;
 
+		/**
+		 * Filters the start time of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $topic_start_time Start time for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_start_time', $forum_template->topic->topic_start_time );
 	}
 
@@ -997,6 +1204,13 @@ function bp_the_topic_time() {
 	function bp_get_the_topic_time() {
 		global $forum_template;
 
+		/**
+		 * Filters the topic time of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $topic_time Topic time for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_time', $forum_template->topic->topic_time );
 	}
 
@@ -1014,6 +1228,13 @@ function bp_the_topic_forum_id() {
 	function bp_get_the_topic_forum_id() {
 		global $forum_template;
 
+		/**
+		 * Filters the ID of the forum associated with the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $forum_id ID of the forum associated with the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_forum_id', $forum_template->topic->forum_id );
 	}
 
@@ -1031,6 +1252,13 @@ function bp_the_topic_status() {
 	function bp_get_the_topic_status() {
 		global $forum_template;
 
+		/**
+		 * Filters the status of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $topic_status Status of the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_status', $forum_template->topic->topic_status );
 	}
 
@@ -1048,6 +1276,13 @@ function bp_the_topic_is_topic_open() {
 	function bp_get_the_topic_is_topic_open() {
 		global $forum_template;
 
+		/**
+		 * Filters whether or not the current topic in the loop is open.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $topic_open Whether or not the current topic is open.
+		 */
 		return apply_filters( 'bp_get_the_topic_is_topic_open', $forum_template->topic->topic_open );
 	}
 
@@ -1065,6 +1300,13 @@ function bp_the_topic_last_post_id() {
 	function bp_get_the_topic_last_post_id() {
 		global $forum_template;
 
+		/**
+		 * Filters the ID of the last post in the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $topic_last_post_id ID for the last post in the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_last_post_id', $forum_template->topic->topic_last_post_id );
 	}
 
@@ -1082,6 +1324,13 @@ function bp_the_topic_is_sticky() {
 	function bp_get_the_topic_is_sticky() {
 		global $forum_template;
 
+		/**
+		 * Filters whether or not the current topic in the loop is sticky.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param bool $topic_sticky Whether or not the current topic is sticky.
+		 */
 		return apply_filters( 'bp_get_the_topic_is_sticky', $forum_template->topic->topic_sticky );
 	}
 
@@ -1099,10 +1348,21 @@ function bp_the_topic_total_post_count() {
 	function bp_get_the_topic_total_post_count() {
 		global $forum_template;
 
-		if ( $forum_template->topic->topic_posts == 1 )
+		if ( $forum_template->topic->topic_posts == 1 ) {
+
+			/**
+			 * Filters a 'x posts' string with the number of posts in the current topic.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param string $value 'X posts' string value for the current topic.
+			 */
 			return apply_filters( 'bp_get_the_topic_total_post_count', sprintf( __( '%d post', 'buddypress' ), $forum_template->topic->topic_posts ) );
-		else
+		} else {
+
+			/** This filter is documented in bp-forums/bp-forums-template.php */
 			return apply_filters( 'bp_get_the_topic_total_post_count', sprintf( __( '%d posts', 'buddypress' ), $forum_template->topic->topic_posts ) );
+		}
 	}
 
 /**
@@ -1119,6 +1379,13 @@ function bp_the_topic_total_posts() {
 	function bp_get_the_topic_total_posts() {
 		global $forum_template;
 
+		/**
+		 * Filters the total number of posts in the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param int $topic_posts Total number of posts in the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_total_posts', $forum_template->topic->topic_posts );
 	}
 
@@ -1136,6 +1403,13 @@ function bp_the_topic_tag_count() {
 	function bp_get_the_topic_tag_count() {
 		global $forum_template;
 
+		/**
+		 * Filters the tag count for the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $tag_count Tag count for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_tag_count', $forum_template->topic->tag_count );
 	}
 
@@ -1151,15 +1425,15 @@ function bp_the_topic_permalink() {
 	 * @return string Permalink for the current topic.
 	 */
 	function bp_get_the_topic_permalink() {
-		global $forum_template, $bp;
+		global $forum_template;
 
 		// The topic is in a loop where its parent object is loaded
 		if ( bp_get_the_topic_object_slug() ) {
-			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_the_topic_object_slug() . '/forum' );
+			$permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_get_the_topic_object_slug() . '/forum' );
 
 		// We are viewing a single group topic, so use the current item
 		} elseif ( bp_is_group_forum_topic() ) {
-			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' );
+			$permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_current_item() . '/forum' );
 
 		// We are unsure what the context is, so fallback to forum root slug
 		} elseif ( bp_is_single_item() ) {
@@ -1170,6 +1444,13 @@ function bp_the_topic_permalink() {
 			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() );
 		}
 
+		/**
+		 * Filters the permalink for the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Permalink for the current topic in the loop.
+		 */
 		return apply_filters( 'bp_get_the_topic_permalink', trailingslashit( $permalink . 'topic/' . $forum_template->topic->topic_slug ) );
 	}
 
@@ -1189,6 +1470,13 @@ function bp_the_topic_time_since_created() {
 	function bp_get_the_topic_time_since_created() {
 		global $forum_template;
 
+		/**
+		 * Filters a 'time since' string describing when the current topic was created.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value 'Time since' value for the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_time_since_created', bp_core_time_since( strtotime( $forum_template->topic->topic_start_time ) ) );
 	}
 
@@ -1219,6 +1507,14 @@ function bp_the_topic_latest_post_excerpt( $args = '' ) {
 		$post = bp_forums_get_post( $forum_template->topic->topic_last_post_id );
 		$post = bp_create_excerpt( $post->post_text, $length );
 
+		/**
+		 * Filters an excerpt from the latest post of the current topic in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $post   Post exceprt for the current topic.
+		 * @param string $length String length to trim excerpt down to.
+		 */
 		return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post, $length );
 	}
 
@@ -1238,6 +1534,13 @@ function bp_the_topic_time_since_last_post() {
 	function bp_get_the_topic_time_since_last_post() {
 		global $forum_template;
 
+		/**
+		 * Filters a 'time since' string describing when the last post in the current topic was created.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value The 'time since' string for the last post in the current topic.
+		 */
 		return apply_filters( 'bp_get_the_topic_time_since_last_post', bp_core_time_since( strtotime( $forum_template->topic->topic_time ) ) );
 	}
 
@@ -1273,7 +1576,7 @@ function bp_the_topic_admin_links( $args = '' ) {
 	 * Return the admin links for the current topic in the loop.
 	 *
 	 * @param array $args {
-	 *     @type string $seperator The character to use when separating
+	 *     @type string $separator The character to use when separating
 	 *           links. Default: '|'.
 	 * }
 	 * @return HTML string containing the admin links for the current topic.
@@ -1282,7 +1585,7 @@ function bp_the_topic_admin_links( $args = '' ) {
 		global $forum_template;
 
 		$defaults = array(
-			'seperator' => '|'
+			'separator' => '|'
 		);
 
 		$r = wp_parse_args( $args, $defaults );
@@ -1304,7 +1607,7 @@ function bp_the_topic_admin_links( $args = '' ) {
 			$links[] = '<a class="confirm" id="topic-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete', 'bp_forums_delete_topic' ) . '">' . __( 'Delete Topic', 'buddypress' ) . '</a>';
 		}
 
-		return implode( ' ' . $seperator . ' ', (array) $links );
+		return implode( ' ' . $separator . ' ', (array) $links );
 	}
 
 /**
@@ -1335,6 +1638,16 @@ function bp_the_topic_css_class() {
 		if ( !isset( $forum_template->topic->topic_open ) || 0 == (int) $forum_template->topic->topic_open )
 			$class .= ' closed';
 
+		/**
+		 * Filters the CSS class for the current topic in the loop.
+		 *
+		 * This class may contain keywords like 'alt', 'sticky', or 'closed',
+		 * based on context.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param string $value Concatenated classes for the current topic in the loop.
+		 */
 		return apply_filters( 'bp_get_the_topic_css_class', trim( $class ) );
 	}
 
@@ -1350,8 +1663,13 @@ function bp_my_forum_topics_link() {
 	 * @return string Link to the 'personal' topics tab.
 	 */
 	function bp_get_my_forum_topics_link() {
-		global $bp;
-
+		/**
+		 * Filters the permalink to the 'personal' topics tab.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Permalink to the 'personal' topics tab.
+		 */
 		return apply_filters( 'bp_get_my_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/personal/' );
 	}
 
@@ -1367,8 +1685,13 @@ function bp_unreplied_forum_topics_link() {
 	 * @return string Link to the 'unreplied' topics tab.
 	 */
 	function bp_get_unreplied_forum_topics_link() {
-		global $bp;
-
+		/**
+		 * Filters the permalink to the 'unreplied' topics tab.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Permalink to the 'unreplied' topics tab.
+		 */
 		return apply_filters( 'bp_get_unreplied_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/unreplied/' );
 	}
 
@@ -1384,8 +1707,13 @@ function bp_popular_forum_topics_link() {
 	 * @return string Link to the 'popular' topics tab.
 	 */
 	function bp_get_popular_forum_topics_link() {
-		global $bp;
-
+		/**
+		 * Filters the permalink to the 'popular' topics tab.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Permalink to the 'popular' topics tab.
+		 */
 		return apply_filters( 'bp_get_popular_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/popular/' );
 	}
 
@@ -1401,8 +1729,13 @@ function bp_newest_forum_topics_link() {
 	 * @return string Link to the forums directory.
 	 */
 	function bp_get_newest_forum_topics_link() {
-		global $bp;
-
+		/**
+		 * Filters the link to the forums directory.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Link to the forums directory.
+		 */
 		return apply_filters( 'bp_get_newest_forum_topics_link', bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' );
 	}
 
@@ -1420,11 +1753,19 @@ function bp_forum_topic_type() {
 	 * @return string Type of the currently viewed topic list.
 	 */
 	function bp_get_forum_topic_type() {
-		global $bp;
 
 		if ( !bp_is_directory() || !bp_current_action() )
 			return 'newest';
 
+		/**
+		 * Filters the currently viewed topic list type.
+		 *
+		 * Eg, 'newest', 'popular', etc.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Currently viewed topic list type.
+		 */
 		return apply_filters( 'bp_get_forum_topic_type', bp_current_action() );
 	}
 
@@ -1434,7 +1775,7 @@ function bp_forum_topic_type() {
  * @since BuddyPress (1.5.0)
  */
 function bp_forum_topic_new_reply_link() {
-	echo bp_get_forum_topic_new_reply_link();
+	echo esc_url( bp_get_forum_topic_new_reply_link() );
 }
 	/**
 	 * Return the permalink for the New Reply button at the top of forum topics.
@@ -1459,7 +1800,13 @@ function bp_forum_topic_new_reply_link() {
 			), bp_get_the_topic_permalink() );
 		}
 
-		// Tack on the #post-topic-reply anchor before returning
+		/**
+		 * Filters the permalink for the New Reply button at the top of forum topics.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Permalink for the New Reply button.
+		 */
 		return apply_filters( 'bp_get_forum_topic_new_reply_link', $link . '#post-topic-reply', $link );
 	}
 
@@ -1496,6 +1843,13 @@ function bp_forum_pagination() {
 	function bp_get_forum_pagination() {
 		global $forum_template;
 
+		/**
+		 * Filters the pagination links for the current topic list.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $pag_links HTML pagination links.
+		 */
 		return apply_filters( 'bp_get_forum_pagination', $forum_template->pag_links );
 	}
 
@@ -1513,7 +1867,7 @@ function bp_forum_pagination_count() {
 	 * @return string
 	 */
 	function bp_get_forum_pagination_count() {
-		global $bp, $forum_template;
+		global $forum_template;
 
 		$start_num  = intval( ( $forum_template->pag_page - 1 ) * $forum_template->pag_num ) + 1;
 		$from_num   = bp_core_number_format( $start_num );
@@ -1524,7 +1878,23 @@ function bp_forum_pagination_count() {
 		if ( 'tags' == $forum_template->type && !empty( $forum_template->search_terms ) )
 			$pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
 
-		return apply_filters( 'bp_get_forum_pagination_count', sprintf( _n( 'Viewing 1 topic', 'Viewing %1$s - %2$s of %3$s topics', (int) $forum_template->total_topic_count, 'buddypress' ), $from_num, $to_num, $total, $pag_filter ), $from_num, $to_num, $total );
+		if ( 1 == $forum_template->total_topic_count ) {
+			$message = __( 'Viewing 1 topic', 'buddypress' );
+		} else {
+			$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s topic', 'Viewing %1$s - %2$s of %3$s topics', (int) $forum_template->total_topic_count, 'buddypress' ), $from_num, $to_num, $total, $pag_filter );
+		}
+
+		/**
+		 * Filters the pagination count for the current topic list.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $message  Pagination count for the current topic list.
+		 * @param string $from_num Low end count in the view.
+		 * @param string $to_num   High end count in the view.
+		 * @param string $total    Total count of topics found.
+		 */
+		return apply_filters( 'bp_get_forum_pagination_count', $message, $from_num, $to_num, $total );
 	}
 
 /**
@@ -1533,7 +1903,6 @@ function bp_forum_pagination_count() {
  * @return bool True if currently editing a topic, otherwise false.
  */
 function bp_is_edit_topic() {
-	global $bp;
 
 	if ( bp_is_action_variable( 'post' ) && bp_is_action_variable( 'edit' ) )
 		return false;
@@ -1553,7 +1922,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var int
 	 */
-	var $current_post = -1;
+	public $current_post = -1;
 
 	/**
 	 * The number of posts returned by the paged query.
@@ -1561,7 +1930,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var int
 	 */
-	var $post_count;
+	public $post_count;
 
 	/**
 	 * Array of posts located by the query.
@@ -1569,7 +1938,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var array
 	 */
-	var $posts;
+	public $posts;
 
 	/**
 	 * The post object currently being iterated on.
@@ -1577,7 +1946,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var object
 	 */
-	var $post;
+	public $post;
 
 	/**
 	 * The ID of the forum whose topic is being queried.
@@ -1585,7 +1954,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var int
 	 */
-	var $forum_id;
+	public $forum_id;
 
 	/**
 	 * The ID of the topic whose posts are being queried.
@@ -1593,7 +1962,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var int
 	 */
-	var $topic_id;
+	public $topic_id;
 
 	/**
 	 * The topic object to which the posts belong.
@@ -1601,7 +1970,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var object
 	 */
-	var $topic;
+	public $topic;
 
 	/**
 	 * A flag for whether the loop is currently being iterated.
@@ -1609,7 +1978,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var bool
 	 */
-	var $in_the_loop;
+	public $in_the_loop;
 
 	/**
 	 * Contains a 'total_pages' property holding total number of pages in
@@ -1626,7 +1995,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var public
 	 */
-	var $pag_page;
+	public $pag_page;
 
 	/**
 	 * The number of items being requested per page.
@@ -1634,7 +2003,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var public
 	 */
-	var $pag_num;
+	public $pag_num;
 
 	/**
 	 * An HTML string containing pagination links.
@@ -1642,7 +2011,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var string
 	 */
-	var $pag_links;
+	public $pag_links;
 
 	/**
 	 * The total number of posts matching the query parameters.
@@ -1650,7 +2019,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var int
 	 */
-	var $total_post_count;
+	public $total_post_count;
 
 	/**
 	 * Whether requesting a single topic. Not currently used.
@@ -1658,7 +2027,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var bool
 	 */
-	var $single_post = false;
+	public $single_post = false;
 
 	/**
 	 * Term to sort by.
@@ -1666,7 +2035,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var string
 	 */
-	var $sort_by;
+	public $sort_by;
 
 	/**
 	 * Sort order.
@@ -1674,7 +2043,7 @@ class BP_Forums_Template_Topic {
 	 * @access public
 	 * @var string
 	 */
-	var $order;
+	public $order;
 
 	/**
 	 * Constructor method.
@@ -1685,11 +2054,11 @@ class BP_Forums_Template_Topic {
 	 * @param string $order Direction to order results.
 	 */
 	function __construct( $topic_id, $per_page, $max, $order ) {
-		global $bp, $current_user, $forum_template;
+		global $forum_template;
 
-                if ( !isset( $forum_template ) ) {
-                        $forum_template = new stdClass;
-                }
+		if ( !isset( $forum_template ) ) {
+			$forum_template = new stdClass;
+		}
 
 		$this->pag_page        = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1;
 		$this->pag_num         = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
@@ -1735,7 +2104,8 @@ class BP_Forums_Template_Topic {
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Forum thread pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Forum thread pagination next text', 'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => array(),
 			) );
 
 			$this->pag->total_pages = ceil( (int) $this->total_post_count / (int) $this->pag_num );
@@ -1795,6 +2165,12 @@ class BP_Forums_Template_Topic {
 		if ( $this->current_post + 1 < $this->post_count ) {
 			return true;
 		} elseif ( $this->current_post + 1 == $this->post_count ) {
+
+			/**
+			 * Fires right before the rewinding of user posts.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action('topic_loop_end');
 			// Do some cleaning up after the loop
 			$this->rewind_posts();
@@ -1810,14 +2186,20 @@ class BP_Forums_Template_Topic {
 	 * @see bp_the_forum_topic_post()
 	 */
 	function the_post() {
-		global $post;
 
 		$this->in_the_loop = true;
 		$this->post = $this->next_post();
 		$this->post = (object)$this->post;
 
-		if ( $this->current_post == 0 ) // loop has just started
-			do_action('topic_loop_start');
+		if ( $this->current_post == 0 ) {
+
+			/**
+			 * Fires if the current post item is the first in the topic loop.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'topic_loop_start' );
+		}
 	}
 }
 
@@ -1863,6 +2245,14 @@ function bp_has_forum_topic_posts( $args = '' ) {
 			return false;
 	}
 
+	/**
+	 * Filters whether or not there are topics to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool                     $value          Whether or not there are topics.
+	 * @param BP_Forums_Template_Topic $topic_template Topic template global to use when rendering.
+	 */
 	return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template );
 }
 
@@ -1900,6 +2290,13 @@ function bp_the_topic_post_id() {
 	function bp_get_the_topic_post_id() {
 		global $topic_template;
 
+		/**
+		 * Filters the ID of the current post in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $post_id ID of the current post.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_id', $topic_template->post->post_id );
 	}
 
@@ -1917,6 +2314,13 @@ function bp_the_topic_post_content() {
 	function bp_get_the_topic_post_content() {
 		global $topic_template;
 
+		/**
+		 * Filters the content of the current post in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $post_text The content of the current post.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_content', stripslashes( $topic_template->post->post_text ) );
 	}
 
@@ -1949,6 +2353,16 @@ function bp_the_topic_post_css_class() {
 		if ( 0 == (int) $topic_template->post->post_status )
 			$class .= ' open';
 
+		/**
+		 * Filters the CSS class for the current post in the loop.
+		 *
+		 * This class may contain keywords like 'alt', 'deleted', or 'open',
+		 * based on context.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param string $value Concatenated classes for the current post in the loop.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_css_class', trim( $class ) );
 	}
 
@@ -1993,6 +2407,13 @@ function bp_the_topic_post_poster_avatar( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters the avatar of the user who posted the current post in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Avatar of the user who posted the current post.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_poster_avatar', bp_core_fetch_avatar( array( 'item_id' => $topic_template->post->poster_id, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt ) ) );
 	}
 
@@ -2013,6 +2434,13 @@ function bp_the_topic_post_poster_name() {
 		if ( empty( $topic_template->post->poster_name ) || ( !$link = bp_core_get_user_domain( $topic_template->post->poster_id ) ) )
 			return __( 'Deleted User', 'buddypress' );
 
+		/**
+		 * Filters the name of the user who posted the current post in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML link for the poster's name.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_poster_name', '<a href="' . $link . '" title="' . $topic_template->post->poster_name . '">' . $topic_template->post->poster_name . '</a>' );
 	}
 
@@ -2031,6 +2459,13 @@ function bp_the_topic_post_poster_link() {
 	function bp_get_the_topic_post_poster_link() {
 		global $topic_template;
 
+		/**
+		 * Filters a link to the profile of the user who posted the current post.
+		 *
+		 * @since BuddyPress (1.2.1)
+		 *
+		 * @param string $value Link for the current poster's profile.
+		 */
 		return apply_filters( 'bp_the_topic_post_poster_link', bp_core_get_user_domain( $topic_template->post->poster_id ) );
 	}
 
@@ -2050,6 +2485,13 @@ function bp_the_topic_post_time_since() {
 	function bp_get_the_topic_post_time_since() {
 		global $topic_template;
 
+		/**
+		 * Filters the 'since' string describing when the current post in the loop was posted.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value The 'since' string.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_time_since', bp_core_time_since( strtotime( $topic_template->post->post_time ) ) );
 	}
 
@@ -2057,7 +2499,7 @@ function bp_the_topic_post_time_since() {
  * Output whether the current post in the loop belongs to the logged-in user.
  */
 function bp_the_topic_post_is_mine() {
-	echo bp_the_topic_post_is_mine();
+	echo bp_get_the_topic_post_is_mine();
 }
 	/**
 	 * Does the current post belong to the logged-in user?
@@ -2066,7 +2508,7 @@ function bp_the_topic_post_is_mine() {
 	 *         the logged-in user, otherwise false.
 	 */
 	function bp_get_the_topic_post_is_mine() {
-		global $bp, $topic_template;
+		global $topic_template;
 
 		return bp_loggedin_user_id() == $topic_template->post->poster_id;
 	}
@@ -2112,6 +2554,13 @@ function bp_the_topic_post_admin_links( $args = '' ) {
 		$links[]  = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a>';
 		$links[] .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>';
 
+		/**
+		 * Filters the admin links for the current post in the loop.
+		 *
+		 * @since BuddyPress (1.2.7)
+		 *
+		 * @param string $value HTML string containing the admin links for the current post.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_admin_links', implode( $separator, $links ), $links, $r );
 	}
 
@@ -2128,6 +2577,14 @@ function bp_the_topic_post_edit_text() {
 	 */
 	function bp_get_the_topic_post_edit_text() {
 		$post = bp_forums_get_post( bp_action_variable( 4 ) );
+
+		/**
+		 * Filters the text to edit when editing a post.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param string $value The text to edit when editing a post.
+		 */
 		return apply_filters( 'bp_get_the_topic_post_edit_text', esc_attr( $post->post_text ) );
 	}
 
@@ -2145,6 +2602,14 @@ function bp_the_topic_pagination() {
 	function bp_get_the_topic_pagination() {
 		global $topic_template;
 
+
+		/**
+		 * Filters the pagination links for the current topic page.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $pag_links HTML pagination links.
+		 */
 		return apply_filters( 'bp_get_the_topic_pagination', $topic_template->pag_links );
 	}
 
@@ -2156,14 +2621,30 @@ function bp_the_topic_pagination() {
  * @return string
  */
 function bp_the_topic_pagination_count() {
-	global $bp, $topic_template;
+	global $topic_template;
 
 	$start_num = intval( ( $topic_template->pag_page - 1 ) * $topic_template->pag_num ) + 1;
 	$from_num = bp_core_number_format( $start_num );
 	$to_num = bp_core_number_format( ( $start_num + ( $topic_template->pag_num - 1  ) > $topic_template->total_post_count ) ? $topic_template->total_post_count : $start_num + ( $topic_template->pag_num - 1 ) );
 	$total = bp_core_number_format( $topic_template->total_post_count );
 
-	echo apply_filters( 'bp_the_topic_pagination_count', sprintf( _n( 'Viewing 1 post', 'Viewing %1$s - %2$s of %3$s posts', (int) $topic_template->total_post_count, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
+	if ( 1 == $topic_template->total_post_count ) {
+		$message = __( 'Viewing 1 post', 'buddypress' );
+	} else {
+		$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s post', 'Viewing %1$s - %2$s of %3$s posts', (int) $topic_template->total_post_count, 'buddypress' ), $from_num, $to_num, $total );
+	}
+
+	/**
+	 * Filters the pagination count for the current topic page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $message  Pagination count for the current topic page.
+	 * @param string $from_num Low end count in the view.
+	 * @param string $to_num   High end count in the view.
+	 * @param string $total    Total count of topics found.
+	 */
+	echo apply_filters( 'bp_the_topic_pagination_count', $message, $from_num, $to_num, $total );
 }
 
 /**
@@ -2181,6 +2662,13 @@ function bp_the_topic_is_last_page() {
 	function bp_get_the_topic_is_last_page() {
 		global $topic_template;
 
+		/**
+		 * Filters whether or not a user is on the last page in the current topic.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param bool $value Whether or not user is on last page.
+		 */
 		return apply_filters( 'bp_get_the_topic_is_last_page', $topic_template->pag_page == $topic_template->pag->total_pages );
 	}
 
@@ -2196,6 +2684,13 @@ function bp_directory_forums_search_form() {
 		<input type="submit" id="forums_search_submit" name="forums_search_submit" value="' . __( 'Search', 'buddypress' ) . '" />
 	</form>';
 
+	/**
+	 * Filters the forums directory search form.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string HTML search form for the forums directory.
+	 */
 	echo apply_filters( 'bp_directory_forums_search_form', $search_form_html );
 }
 
@@ -2217,10 +2712,9 @@ function bp_forum_permalink( $forum_id = 0 ) {
 	 * @return string|bool False on failure, a URL on success.
 	 */
 	function bp_get_forum_permalink( $forum_id = 0 ) {
-		global $bp;
 
 		if ( bp_is_groups_component() ) {
-			$permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_current_item() . '/forum' );
+			$permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_current_item() . '/forum' );
 		} else {
 			if ( empty( $forum_id ) ) {
 				global $topic_template;
@@ -2234,6 +2728,13 @@ function bp_forum_permalink( $forum_id = 0 ) {
 				return false;
 		}
 
+		/**
+		 * Filters the permalink to a given forum.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Peramlink to the given forum.
+		 */
 		return apply_filters( 'bp_get_forum_permalink', trailingslashit( $permalink ) );
 	}
 
@@ -2255,7 +2756,6 @@ function bp_forum_name( $forum_id = 0 ) {
 	 * @return string|bool False on failure, a name on success.
 	 */
 	function bp_get_forum_name( $forum_id = 0 ) {
-		global $bp;
 
 		if ( empty( $forum_id ) ) {
 			global $topic_template;
@@ -2263,10 +2763,20 @@ function bp_forum_name( $forum_id = 0 ) {
 				$forum_id = $topic_template->forum_id;
 		}
 
-		if ( $forum = bp_forums_get_forum( $forum_id ) )
+		if ( $forum = bp_forums_get_forum( $forum_id ) ) {
+
+			/**
+			 * Filters the name of a given forum.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $forum_name Name of the given forum.
+			 * @param string $forum_id   ID of the given forum.
+			 */
 			return apply_filters( 'bp_get_forum_name', $forum->forum_name, $forum->forum_id );
-		else
+		} else {
 			return false;
+		}
 	}
 
 /**
@@ -2330,6 +2840,14 @@ function bp_forum_topic_tag_list() {
 		if ( 'string' == $format )
 			$tags = implode( ', ', $tags );
 
+		/**
+		 * Filters the current topic's tag list.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string|array $tags   List or array of tags for the current topic.
+		 * @param string       $format Requested format for the tags.
+		 */
 		return apply_filters( 'bp_forum_topic_tag_list', $tags, $format );
 	}
 
@@ -2348,6 +2866,13 @@ function bp_forum_topic_has_tags() {
 	if ( !empty( $topic_template->topic_tags ) )
 		$has_tags = true;
 
+	/**
+	 * Filters whether or not a forum topic has any tags.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $has_tags Whether or not there are any tags.
+	 */
 	return apply_filters( 'bp_forum_topic_has_tags', $has_tags );
 }
 
@@ -2365,6 +2890,13 @@ function bp_forum_action() {
 	function bp_get_forum_action() {
 		global $topic_template;
 
+		/**
+		 * Filters the url to use in a forum form 'action'.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL to use in the forum form 'action'.
+		 */
 		return apply_filters( 'bp_get_forum_action', bp_get_root_domain() . esc_attr( $_SERVER['REQUEST_URI'] ) );
 	}
 
@@ -2380,6 +2912,14 @@ function bp_forum_topic_action() {
 	 * @return string URL of the current page, minus query args.
 	 */
 	function bp_get_forum_topic_action() {
+
+		/**
+		 * Filters the url to use in a forum topic form 'action'.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL to use in the forum topic form 'action'.
+		 */
 		return apply_filters( 'bp_get_forum_topic_action', $_SERVER['REQUEST_URI'] );
 	}
 
@@ -2397,8 +2937,18 @@ function bp_forum_topic_count_for_user( $user_id = 0 ) {
 	 * Return the total topic count for a given user.
 	 *
 	 * @param int $user_id See {@link bp_forums_total_topic_count_for_user}.
+	 *
+	 * @return int
 	 */
 	function bp_get_forum_topic_count_for_user( $user_id = 0 ) {
+
+		/**
+		 * Filters the total topic count for a given user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Total topic count for the given user.
+		 */
 		return apply_filters( 'bp_get_forum_topic_count_for_user', bp_forums_total_topic_count_for_user( $user_id ) );
 	}
 
@@ -2416,7 +2966,17 @@ function bp_forum_topic_count( $user_id = 0 ) {
 	 * Return the total topic count for a given user.
 	 *
 	 * @param int $user_id See {@link bp_forums_total_topic_count()}.
+	 *
+	 * @return int
 	 */
 	function bp_get_forum_topic_count( $user_id = 0 ) {
+
+		/**
+		 * Filters the total topic count for a given user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Total topic count for the given user.
+		 */
 		return apply_filters( 'bp_get_forum_topic_count', bp_forums_total_topic_count( $user_id ) );
 	}
diff --git a/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php
index 5262fdfc603a2685f9b9be3738b4c63b70d63c26..ce6cea7d3132b4526511e3f99dcb0abacc97f9a5 100644
--- a/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php
+++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Outputs the markup for the bb-forums-admin panel
@@ -100,10 +100,10 @@ function bp_forums_bbpress_admin() {
 					<li><?php _e( 'And more!', 'buddypress' ); ?></p></li>
 				</ul>
 
-				<p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component.  For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/' ) ?></p>
+				<p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component.  For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'https://codex.buddypress.org/legacy/getting-started/using-bbpress-2-2-with-buddypress/' ) ?></p>
 
 				<div>
-					<a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
+					<a class="button thickbox button-primary" href="<?php echo esc_url( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
 				</div>
 			</div>
 
@@ -140,7 +140,7 @@ function bp_forums_bbpress_install_wizard() {
 		case 'existing':
 			if ( isset( $_REQUEST['doinstall'] ) && ( 1 == (int) $_REQUEST['doinstall'] ) ) {
 				if ( !bp_forums_configure_existing_install() ) {
-					_e( 'The bb-config.php file was not found at that location, please try again.', 'buddypress' );
+					_e( 'The bb-config.php file was not found at that location. Please try again.', 'buddypress' );
 				} else {
 					?>
 					<h3><?php _e( 'Forums were set up correctly using your existing bbPress install!', 'buddypress' ) ?></h3>
@@ -184,7 +184,7 @@ function bp_forums_bbpress_install_wizard() {
 				<h3><?php _e( 'New bbPress Installation', 'buddypress' ) ?></h3>
 				<p><?php _e( "You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click
 				process. When you're ready, hit the link below.", 'buddypress' ) ?></p>
-				<p><a class="button-primary" href="<?php echo wp_nonce_url( $post_url . '&step=new&doinstall=1', 'bp_forums_new_install_init' ) ?>"><?php _e( 'Complete Installation', 'buddypress' ) ?></a></p>
+				<p><a class="button-primary" href="<?php echo esc_url( wp_nonce_url( $post_url . '&step=new&doinstall=1', 'bp_forums_new_install_init' ) ); ?>"><?php _e( 'Complete Installation', 'buddypress' ) ?></a></p>
 
 				<?php
 			}
@@ -222,8 +222,8 @@ function bp_forums_bbpress_install_wizard() {
 					</ul>
 
 					<div>
-						<a class="button button-primary" href="<?php echo $post_url . '&step=new' ?>"><?php _e( 'Install Group Forums', 'buddypress' ) ?></a> &nbsp;
-						<a class="button" href="<?php echo $post_url . '&step=existing' ?>"><?php _e( 'Use Existing Installation', 'buddypress' ) ?></a>
+						<a class="button button-primary" href="<?php echo esc_url( $post_url ) . '&step=new' ?>"><?php _e( 'Install Group Forums', 'buddypress' ) ?></a> &nbsp;
+						<a class="button" href="<?php echo esc_url( $post_url ) . '&step=existing' ?>"><?php _e( 'Use Existing Installation', 'buddypress' ) ?></a>
 					</div>
 				</div>
 
@@ -243,9 +243,9 @@ function bp_forums_bbpress_install_wizard() {
 						<li><?php _e( 'And more!', 'buddypress' ); ?></p></li>
 					</ul>
 
-					<p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component.  For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/' ) ?></p>
+					<p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component.  For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'https://codex.buddypress.org/legacy/getting-started/using-bbpress-2-2-with-buddypress/' ) ?></p>
 					<div>
-						<a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
+						<a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_url( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> &nbsp;
 					</div>
 				</div>
 
diff --git a/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php b/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php
index d6290604885f03c77fc94791a677fa1b659bc5be..b9ad67fbf19f866eca3293a0c78352527487ea55 100644
--- a/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php
+++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 function bp_forums_add_admin_menu() {
 
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
index 7a1aa15aece310a364fe0f2bf7e7129e81f97373..ac7289a047b25fa5eda7090299bf0a1165306376 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Catch and process friendship requests.
@@ -40,7 +40,7 @@ function friends_action_add_friend() {
 			bp_core_add_message( __( 'Friendship requested', 'buddypress' ) );
 		}
 
-	} else if ( 'is_friend' == $friendship_status ) {
+	} elseif ( 'is_friend' == $friendship_status ) {
 		bp_core_add_message( __( 'You are already friends with this user', 'buddypress' ), 'error' );
 	} else {
 		bp_core_add_message( __( 'You already have a pending friendship request with this user', 'buddypress' ), 'error' );
@@ -78,7 +78,7 @@ function friends_action_remove_friend() {
 			bp_core_add_message( __( 'Friendship canceled', 'buddypress' ) );
 		}
 
-	} else if ( 'is_friends' == $friendship_status ) {
+	} elseif ( 'is_friends' == $friendship_status ) {
 		bp_core_add_message( __( 'You are not yet friends with this user', 'buddypress' ), 'error' );
 	} else {
 		bp_core_add_message( __( 'You have a pending friendship request with this user', 'buddypress' ), 'error' );
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
index f5e32ed234e17d22d9776fb49cb2223050363c79..7a74e4c4a3eebf1c76663eb394809e4a1b709a90 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Record an activity item related to the Friends component.
@@ -113,6 +113,11 @@ function friends_register_activity_actions() {
 	// < BP 1.6 backpat
 	bp_activity_set_action( $bp->friends->id, 'friends_register_activity_action', __( 'New friendship created', 'buddypress' ) );
 
+	/**
+	 * Fires after all default bp-friends activity actions have been registered.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'friends_register_activity_actions' );
 }
 add_action( 'bp_register_activity_actions', 'friends_register_activity_actions' );
@@ -139,6 +144,14 @@ function bp_friends_format_activity_action_friendship_accepted( $action, $activi
 		$action     = apply_filters( 'friends_activity_friendsip_accepted_action', $action, $friendship );
 	}
 
+	/**
+	 * Filters the 'friendship_accepted' activity action format.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action String text for the 'friendship_accepted' action.
+	 * @param object $activity Activity data.
+	 */
 	return apply_filters( 'bp_friends_format_activity_action_friendship_accepted', $action, $activity );
 }
 
@@ -165,6 +178,14 @@ function bp_friends_format_activity_action_friendship_created( $action, $activit
 		$action     = apply_filters( 'friends_activity_friendsip_accepted_action', $action, $friendship );
 	}
 
+	/**
+	 * Filters the 'friendship_created' activity action format.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action String text for the 'friendship_created' action.
+	 * @param object $activity Activity data.
+	 */
 	return apply_filters( 'bp_friends_format_activity_action_friendship_created', $action, $activity );
 }
 
@@ -206,6 +227,136 @@ function bp_friends_prefetch_activity_object_data( $activities ) {
 }
 add_filter( 'bp_activity_prefetch_object_data', 'bp_friends_prefetch_activity_object_data' );
 
+/**
+ * Set up activity arguments for use with the 'friends' scope.
+ *
+ * For details on the syntax, see {@link BP_Activity_Query}.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array $retval Empty array by default
+ * @param array $filter Current activity arguments
+ * @return array
+ */
+function bp_friends_filter_activity_scope( $retval = array(), $filter = array() ) {
+
+	// Determine the user_id
+	if ( ! empty( $filter['user_id'] ) ) {
+		$user_id = $filter['user_id'];
+	} else {
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+	}
+
+	// Determine friends of user
+	$friends = friends_get_friend_user_ids( $user_id );
+	if ( empty( $friends ) ) {
+		$friends = array( 0 );
+	}
+
+	$retval = array(
+		'relation' => 'AND',
+		array(
+			'column'  => 'user_id',
+			'compare' => 'IN',
+			'value'   => (array) $friends
+		),
+
+		// we should only be able to view sitewide activity content for friends
+		array(
+			'column' => 'hide_sitewide',
+			'value'  => 0
+		),
+
+		// overrides
+		'override' => array(
+			'filter'      => array( 'user_id' => 0 ),
+			'show_hidden' => true
+		),
+	);
+
+	return $retval;
+}
+add_filter( 'bp_activity_set_friends_scope_args', 'bp_friends_filter_activity_scope', 10, 2 );
+
+/**
+ * Set up activity arguments for use with the 'just-me' scope.
+ *
+ * For details on the syntax, see {@link BP_Activity_Query}.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array $retval Empty array by default
+ * @param array $filter Current activity arguments
+ * @return array
+ */
+function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = array() ) {
+
+	// Determine the user_id
+	if ( ! empty( $filter['user_id'] ) ) {
+		$user_id = $filter['user_id'];
+	} else {
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+	}
+
+	// Get the requested action
+	$action = $filter['filter']['action'];
+
+	// Make sure actions are listed in an array
+	if ( ! is_array( $action ) ) {
+		$action = explode( ',', $filter['filter']['action'] );
+	}
+
+	$action = array_flip( array_filter( $action ) );
+
+	/**
+	 * If filtering activities for something other than the friendship_created
+	 * action return without changing anything
+	 */
+	if ( ! empty( $action ) && ! isset( $action['friendship_created'] ) ) {
+		return $retval;
+	}
+
+	// Juggle existing override value
+	$override = array();
+	if ( ! empty( $retval['override'] ) ) {
+		$override = $retval['override'];
+		unset( $retval['override'] );
+	}
+
+	/**
+	 * Else make sure to get the friendship_created action, the user is involved in
+	 * - user initiated the friendship
+	 * - user has been requested a friendship
+	 */
+	$retval = array(
+		'relation' => 'OR',
+		$retval,
+		array(
+			'relation' => 'AND',
+			array(
+				'column' => 'component',
+				'value'  => 'friends',
+			),
+			array(
+				'column' => 'secondary_item_id',
+				'value'  => $user_id,
+			),
+		)
+	);
+
+	// Juggle back override value
+	if ( ! empty( $override ) ) {
+		$retval['override'] = $override;
+	}
+
+	return $retval;
+}
+add_filter( 'bp_activity_set_just-me_scope_args', 'bp_friends_filter_activity_just_me_scope', 20, 2 );
+
 /**
  * Add activity stream items when one members accepts another members request
  * for virtual friendship.
@@ -218,16 +369,10 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_friends_prefetch_activity_ob
  * @param object $friendship Optional
  */
 function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) {
-
-	// Bail if Activity component is not active
 	if ( ! bp_is_active( 'activity' ) ) {
 		return;
 	}
 
-	// Get links to both members profiles
-	$initiator_link = bp_core_get_userlink( $initiator_user_id );
-	$friend_link    = bp_core_get_userlink( $friend_user_id    );
-
 	// Record in activity streams for the initiator
 	friends_record_activity( array(
 		'user_id'           => $initiator_user_id,
@@ -235,14 +380,5 @@ function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_use
 		'item_id'           => $friendship_id,
 		'secondary_item_id' => $friend_user_id
 	) );
-
-	// Record in activity streams for the friend
-	friends_record_activity( array(
-		'user_id'           => $friend_user_id,
-		'type'              => 'friendship_created',
-		'item_id'           => $friendship_id,
-		'secondary_item_id' => $initiator_user_id,
-		'hide_sitewide'     => true // We've already got the first entry site wide
-	) );
 }
 add_action( 'friends_friendship_accepted', 'bp_friends_friendship_accepted_activity', 10, 4 );
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
index 417525c96658a5a35a38f5e18654176d2ce8edda..646b71b86de6a9a5d29ae216fc450ed605fa1113 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Clear friends-related cache for members of a specific friendship.
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php
index 2ceba538863ad69e887fed7a036161a1b2e959c8..0b496ebde3e294d444ee7dd0681774b0351eacc5 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php
@@ -7,623 +7,6 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
-/**
- * BuddyPress Friendship object.
- */
-class BP_Friends_Friendship {
-
-	/**
-	 * ID of the friendship.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $id;
-
-	/**
-	 * User ID of the friendship initiator.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $initiator_user_id;
-
-	/**
-	 * User ID of the 'friend' - the one invited to the friendship.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $friend_user_id;
-
-	/**
-	 * Has the friendship been confirmed/accepted?
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $is_confirmed;
-
-	/**
-	 * Is this a "limited" friendship?
-	 *
-	 * Not currently used by BuddyPress.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $is_limited;
-
-	/**
-	 * Date the friendship was created.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $date_created;
-
-	/**
-	 * Is this a request?
-	 *
-	 * Not currently used in BuddyPress.
-	 *
-	 * @access public
-	 * @var unknown
-	 */
-	public $is_request;
-
-	/**
-	 * Should additional friend details be queried?
-	 *
-	 * @access public
-	 * @var bool
-	 */
-	public $populate_friend_details;
-
-	/**
-	 * Details about the friend.
-	 *
-	 * @access public
-	 * @var BP_Core_User
-	 */
-	public $friend;
-
-	/**
-	 * Constructor method.
-	 *
-	 * @param int $id Optional. The ID of an existing friendship.
-	 * @param bool $is_request Deprecated.
-	 * @param bool $populate_friend_details True if friend details should
-	 *        be queried.
-	 */
-	public function __construct( $id = null, $is_request = false, $populate_friend_details = true ) {
-		$this->is_request = $is_request;
-
-		if ( !empty( $id ) ) {
-			$this->id                      = $id;
-			$this->populate_friend_details = $populate_friend_details;
-			$this->populate( $this->id );
-		}
-	}
-
-	/**
-	 * Set up data about the current friendship.
-	 */
-	public function populate() {
-		global $wpdb, $bp;
-
-		if ( $friendship = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->friends->table_name} WHERE id = %d", $this->id ) ) ) {
-			$this->initiator_user_id = $friendship->initiator_user_id;
-			$this->friend_user_id    = $friendship->friend_user_id;
-			$this->is_confirmed      = $friendship->is_confirmed;
-			$this->is_limited        = $friendship->is_limited;
-			$this->date_created      = $friendship->date_created;
-		}
-
-		if ( !empty( $this->populate_friend_details ) ) {
-			if ( $this->friend_user_id == bp_displayed_user_id() ) {
-				$this->friend = new BP_Core_User( $this->initiator_user_id );
-			} else {
-				$this->friend = new BP_Core_User( $this->friend_user_id );
-			}
-		}
-	}
-
-	/**
-	 * Save the current friendship to the database.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->initiator_user_id = apply_filters( 'friends_friendship_initiator_user_id_before_save', $this->initiator_user_id, $this->id );
-		$this->friend_user_id    = apply_filters( 'friends_friendship_friend_user_id_before_save',    $this->friend_user_id,    $this->id );
-		$this->is_confirmed      = apply_filters( 'friends_friendship_is_confirmed_before_save',      $this->is_confirmed,      $this->id );
-		$this->is_limited        = apply_filters( 'friends_friendship_is_limited_before_save',        $this->is_limited,        $this->id );
-		$this->date_created      = apply_filters( 'friends_friendship_date_created_before_save',      $this->date_created,      $this->id );
-
-		do_action_ref_array( 'friends_friendship_before_save', array( &$this ) );
-
-		// Update
-		if (!empty( $this->id ) ) {
-			$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = %s ) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );
-
-		// Save
-		} else {
-			$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, %s )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );
-			$this->id = $wpdb->insert_id;
-		}
-
-		do_action( 'friends_friendship_after_save', array( &$this ) );
-
-		return $result;
-	}
-
-	public function delete() {
-		global $wpdb, $bp;
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d", $this->id ) );
-	}
-
-	/** Static Methods ********************************************************/
-
-	/**
-	 * Get the IDs of a given user's friends.
-	 *
-	 * @param int $user_id ID of the user whose friends are being retreived.
-	 * @param bool $friend_requests_only Optional. Whether to fetch
-	 *        unaccepted requests only. Default: false.
-	 * @param bool $assoc_arr Optional. True to receive an array of arrays
-	 *        keyed as 'user_id' => $user_id; false to get a one-dimensional
-	 *        array of user IDs. Default: false.
-	 */
-	public static function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) {
-		global $wpdb, $bp;
-
-		if ( !empty( $friend_requests_only ) ) {
-			$oc_sql = 'AND is_confirmed = 0';
-			$friend_sql = $wpdb->prepare( " WHERE friend_user_id = %d", $user_id );
-		} else {
-			$oc_sql = 'AND is_confirmed = 1';
-			$friend_sql = $wpdb->prepare( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
-		}
-
-		$friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" );
-		$fids = array();
-
-		for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
-			if ( !empty( $assoc_arr ) ) {
-				$fids[] = array( 'user_id' => ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id );
-			} else {
-				$fids[] = ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id;
-			}
-		}
-
-		return $fids;
-	}
-
-	/**
-	 * Get the ID of the friendship object, if any, between a pair of users.
-	 *
-	 * @param int $user_id The ID of the first user.
-	 * @param int $friend_id The ID of the second user.
-	 * @return int|bool The ID of the friendship object if found, otherwise
-	 *         false.
-	 */
-	public static function get_friendship_id( $user_id, $friend_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->friends->table_name} WHERE ( initiator_user_id = %d AND friend_user_id = %d ) OR ( initiator_user_id = %d AND friend_user_id = %d ) AND is_confirmed = 1", $user_id, $friend_id, $friend_id, $user_id ) );
-	}
-
-	/**
-	 * Get a list of IDs of users who have requested friendship of a given user.
-	 *
-	 * @param int $user_id The ID of the user who has received the
-	 *        friendship requests.
-	 * @return array|bool An array of user IDs, or false if none are found.
-	 */
-	public static function get_friendship_request_user_ids( $user_id ) {
-		$friend_requests = wp_cache_get( $user_id, 'bp_friends_requests' );
-
-		if ( false === $friend_requests ) {
-			global $wpdb, $bp;
-
-			$friend_requests = $wpdb->get_col( $wpdb->prepare( "SELECT initiator_user_id FROM {$bp->friends->table_name} WHERE friend_user_id = %d AND is_confirmed = 0", $user_id ) );
-
-			wp_cache_set( $user_id, $friend_requests, 'bp_friends_requests' );
-		}
-
-		return $friend_requests;
-	}
-
-	/**
-	 * Get a total friend count for a given user.
-	 *
-	 * @param int $user_id Optional. ID of the user whose friendships you
-	 *        are counting. Default: displayed user (if any), otherwise
-	 *        logged-in user.
-	 * @return int Friend count for the user.
-	 */
-	public static function total_friend_count( $user_id = 0 ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
-
-		/* This is stored in 'total_friend_count' usermeta.
-		   This function will recalculate, update and return. */
-
-		$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ) );
-
-		// Do not update meta if user has never had friends
-		if ( empty( $count ) && !bp_get_user_meta( $user_id, 'total_friend_count', true ) )
-			return 0;
-
-		bp_update_user_meta( $user_id, 'total_friend_count', (int) $count );
-
-		return absint( $count );
-	}
-
-	/**
-	 * Search the friends of a user by a search string.
-	 *
-	 * @param string $filter The search string, matched against xprofile
-	 *        fields (if available), or usermeta 'nickname' field.
-	 * @param int $user_id ID of the user whose friends are being searched.
-	 * @param int $limit Optional. Max number of friends to return.
-	 * @param int $page Optional. The page of results to return. Default:
-	 *        null (no pagination - return all results).
-	 * @return array|bool On success, an array: {
-	 *     @type array $friends IDs of friends returned by the query.
-	 *     @type int $count Total number of friends (disregarding
-	 *           pagination) who match the search.
-	 * }. Returns false on failure.
-	 */
-	public static function search_friends( $filter, $user_id, $limit = null, $page = null ) {
-		global $wpdb, $bp;
-
-		// TODO: Optimize this function.
-
-		if ( empty( $user_id ) )
-			$user_id = bp_loggedin_user_id();
-
-		// Only search for matching strings at the beginning of the
-		// name (@todo - figure out why this restriction)
-		$search_terms_like = bp_esc_like( $filter ) . '%';
-
-		$pag_sql = '';
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		if ( !$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ) )
-			return false;
-
-		// Get all the user ids for the current user's friends.
-		$fids = implode( ',', wp_parse_id_list( $friend_ids ) );
-
-		if ( empty( $fids ) )
-			return false;
-
-		// filter the user_ids based on the search criteria.
-		if ( bp_is_active( 'xprofile' ) ) {
-			$sql       = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s {$pag_sql}", $search_terms_like );
-			$total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s", $search_terms_like );
-		} else {
-			$sql       = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s' {$pag_sql}", $search_terms_like );
-			$total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s", $search_terms_like );
-		}
-
-		$filtered_friend_ids = $wpdb->get_col( $sql );
-		$total_friend_ids    = $wpdb->get_var( $total_sql );
-
-		if ( empty( $filtered_friend_ids ) )
-			return false;
-
-		return array( 'friends' => $filtered_friend_ids, 'total' => (int) $total_friend_ids );
-	}
-
-	/**
-	 * Check friendship status between two users.
-	 *
-	 * Note that 'pending' means that $initiator_userid has sent a friend
-	 * request to $possible_friend_userid that has not yet been approved,
-	 * while 'awaiting_response' is the other way around ($possible_friend_userid
-	 * sent the initial request)
-	 *
-	 * @param int $initiator_userid The ID of the user who is the initiator
-	 *        of the potential friendship/request.
-	 * @param int $possible_friend_userid The ID of the user who is the
-	 *        recipient of the potential friendship/request.
-	 * @return string The friendship status, from among 'not_friends',
-	 *        'is_friend', 'pending', and 'awaiting_response'.
-	 */
-	public static function check_is_friend( $initiator_userid, $possible_friend_userid ) {
-		global $wpdb, $bp;
-
-		if ( empty( $initiator_userid ) || empty( $possible_friend_userid ) ) {
-			return false;
-		}
-
-		$result = $wpdb->get_results( $wpdb->prepare( "SELECT id, initiator_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id = %d) OR (initiator_user_id = %d AND friend_user_id = %d)", $initiator_userid, $possible_friend_userid, $possible_friend_userid, $initiator_userid ) );
-
-		if ( ! empty( $result ) ) {
-			if ( 0 == (int) $result[0]->is_confirmed ) {
-				$status = $initiator_userid == $result[0]->initiator_user_id ? 'pending' : 'awaiting_response';
-			} else {
-				$status = 'is_friend';
-			}
-		} else {
-			$status = 'not_friends';
-		}
-
-		return $status;
-	}
-
-	/**
-	 * Get the last active date of many users at once.
-	 *
-	 * @todo Why is this in the Friends component?
-	 *
-	 * @param array $user_ids IDs of users whose last_active meta is
-	 *        being queried.
-	 * @return array Array of last_active values + user_ids.
-	 */
-	public static function get_bulk_last_active( $user_ids ) {
-		global $wpdb;
-
-		$last_activities = BP_Core_User::get_last_activity( $user_ids );
-
-		// Sort and structure as expected in legacy function
-		usort( $last_activities, create_function( '$a, $b', '
-			if ( $a["date_recorded"] == $b["date_recorded"] ) {
-				return 0;
-			}
-
-			return ( strtotime( $a["date_recorded"] ) < strtotime( $b["date_recorded"] ) ) ? 1 : -1;
-		' ) );
-
-		$retval = array();
-		foreach ( $last_activities as $last_activity ) {
-			$u = new stdClass;
-			$u->last_activity = $last_activity['date_recorded'];
-			$u->user_id       = $last_activity['user_id'];
-
-			$retval[] = $u;
-		}
-
-		return $retval;
-	}
-
-	/**
-	 * Mark a friendship as accepted.
-	 *
-	 * @param int $friendship_id ID of the friendship to be accepted.
-	 * @return int Number of database rows updated.
-	 */
-	public static function accept($friendship_id) {
-		global $wpdb, $bp;
-	 	return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, bp_loggedin_user_id() ) );
-	}
-
-	/**
-	 * Remove a friendship or a friendship request INITIATED BY the logged-in user.
-	 *
-	 * @param int $friendship_id ID of the friendship to be withdrawn.
-	 * @return int Number of database rows deleted.
-	 */
-	public static function withdraw($friendship_id) {
-		global $wpdb, $bp;
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND initiator_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
-	}
-
-	/**
-	 * Remove a friendship or a friendship request MADE OF the logged-in user.
-	 *
-	 * @param int $friendship_id ID of the friendship to be rejected.
-	 * @return int Number of database rows deleted.
-	 */
-	public static function reject($friendship_id) {
-		global $wpdb, $bp;
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND friend_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
-	}
-
-	/**
-	 * Search users.
-	 *
-	 * @todo Why does this exist, and why is it in bp-friends?
-	 *
-	 * @param string $filter String to search by.
-	 * @param int $user_id A user ID param that is unused.
-	 * @param int $limit Optional. Max number of records to return.
-	 * @param int $page Optional. Number of the page to return. Default:
-	 *        false (no pagination - return all results).
-	 * @return array $filtered_ids IDs of users who match the query.
-	 */
-	public static function search_users( $filter, $user_id, $limit = null, $page = null ) {
-		global $wpdb, $bp;
-
-		// Only search for matching strings at the beginning of the
-		// name (@todo - figure out why this restriction)
-		$search_terms_like = bp_esc_like( $filter ) . '%';
-
-		$usermeta_table = $wpdb->base_prefix . 'usermeta';
-		$users_table    = $wpdb->base_prefix . 'users';
-
-		$pag_sql = '';
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) );
-
-		// filter the user_ids based on the search criteria.
-		if ( bp_is_active( 'xprofile' ) ) {
-			$sql = $wpdb->prepare( "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE %s ORDER BY d.value DESC {$pag_sql}", $search_terms_like );
-		} else {
-			$sql = $wpdb->prepare( "SELECT DISTINCT user_id as id FROM {$usermeta_table} WHERE meta_value LIKE %s ORDER BY d.value DESC {$pag_sql}", $search_terms_like );
-		}
-
-		$filtered_fids = $wpdb->get_col($sql);
-
-		if ( empty( $filtered_fids ) )
-			return false;
-
-		return $filtered_fids;
-	}
-
-	/**
-	 * Get a count of users who match a search term.
-	 *
-	 * @todo Why does this exist, and why is it in bp-friends?
-	 *
-	 * @param string $filter Search term.
-	 * @return int Count of users matching the search term.
-	 */
-	public static function search_users_count( $filter ) {
-		global $wpdb, $bp;
-
-		// Only search for matching strings at the beginning of the
-		// name (@todo - figure out why this restriction)
-		$search_terms_like = bp_esc_like( $filter ) . '%';
-
-		$usermeta_table = $wpdb->prefix . 'usermeta';
-		$users_table    = $wpdb->base_prefix . 'users';
-
-		// filter the user_ids based on the search criteria.
-		if ( bp_is_active( 'xprofile' ) ) {
-			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE %s", $search_terms_like );
-		} else {
-			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$usermeta_table} WHERE meta_value LIKE %s", $search_terms_like );
-		}
-
-		$user_count = $wpdb->get_col($sql);
-
-		if ( empty( $user_count ) )
-			return false;
-
-		return $user_count[0];
-	}
-
-	/**
-	 * Sort a list of user IDs by their display names.
-	 *
-	 * @todo Why does this exist, and why is it in bp-friends?
-	 *
-	 * @param array $user_ids Array of user IDs.
-	 * @return array User IDs, sorted by the associated display names.
-	 */
-	public static function sort_by_name( $user_ids ) {
-		global $wpdb, $bp;
-
-		if ( !bp_is_active( 'xprofile' ) )
-			return false;
-
-		$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
-
-		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} pd, {$bp->profile->table_name_fields} pf WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} ) ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ) );
-	}
-
-	/**
-	 * Get a list of random friend IDs.
-	 *
-	 * @param int $user_id ID of the user whose friends are being retrieved.
-	 * @param int $total_friends Optional. Number of random friends to get.
-	 *        Default: 5.
-	 * @return array|bool An array of random friend user IDs on success;
-	 *         false if none are found.
-	 */
-	public static function get_random_friends( $user_id, $total_friends = 5 ) {
-		global $wpdb, $bp;
-
-		$fids    = array();
-		$sql     = $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE (friend_user_id = %d || initiator_user_id = %d) && is_confirmed = 1 ORDER BY rand() LIMIT %d", $user_id, $user_id, $total_friends );
-		$results = $wpdb->get_results( $sql );
-
-		for ( $i = 0, $count = count( $results ); $i < $count; ++$i ) {
-			$fids[] = ( $results[$i]->friend_user_id == $user_id ) ? $results[$i]->initiator_user_id : $results[$i]->friend_user_id;
-		}
-
-		// remove duplicates
-		if ( count( $fids ) > 0 )
-			return array_flip( array_flip( $fids ) );
-		else
-			return false;
-	}
-
-	/**
-	 * Get a count of a user's friends who can be invited to a given group.
-	 *
-	 * Users can invite any of their friends except:
-	 *
-	 * - users who are already in the group
-	 * - users who have a pending invite to the group
-	 * - users who have been banned from the group
-	 *
-	 * @param int $user_id ID of the user whose friends are being counted.
-	 * @param int $group_id ID of the group friends are being invited to.
-	 * @return int $invitable_count Eligible friend count.
-	 */
-	public static function get_invitable_friend_count( $user_id, $group_id ) {
-
-		// Setup some data we'll use below
-		$is_group_admin  = BP_Groups_Member::check_is_admin( $user_id, $group_id );
-		$friend_ids      = BP_Friends_Friendship::get_friend_user_ids( $user_id );
-		$invitable_count = 0;
-
-		for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) {
-
-			// If already a member, they cannot be invited again
-			if ( BP_Groups_Member::check_is_member( (int) $friend_ids[$i], $group_id ) )
-				continue;
-
-			// If user already has invite, they cannot be added
-			if ( BP_Groups_Member::check_has_invite( (int) $friend_ids[$i], $group_id )  )
-				continue;
-
-			// If user is not group admin and friend is banned, they cannot be invited
-			if ( ( false === $is_group_admin ) && BP_Groups_Member::check_is_banned( (int) $friend_ids[$i], $group_id ) )
-				continue;
-
-			$invitable_count++;
-		}
-
-		return $invitable_count;
-	}
-
-	/**
-	 * Get the friend user IDs for a given friendship.
-	 *
-	 * @param int $friendship_id ID of the friendship.
-	 * @return object friend_user_id and initiator_user_id.
-	 */
-	public static function get_user_ids_for_friendship( $friendship_id ) {
-		global $wpdb, $bp;
-		return $wpdb->get_row( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE id = %d", $friendship_id ) );
-	}
-
-	/**
-	 * Delete all friendships and friend notifications related to a user.
-	 *
-	 * @param int $user_id ID of the user being expunged.
-	 */
-	public static function delete_all_for_user( $user_id ) {
-		global $wpdb, $bp;
-
-		// Get friends of $user_id
-		$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );
-
-		// Delete all friendships related to $user_id
-		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE friend_user_id = %d OR initiator_user_id = %d", $user_id, $user_id ) );
-
-		// Delete friend request notifications for members who have a
-		// notification from this user.
-		if ( bp_is_active( 'notifications' ) ) {
-			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->notifications->table_name} WHERE component_name = 'friends' AND ( component_action = 'friendship_request' OR component_action = 'friendship_accepted' ) AND item_id = %d", $user_id ) );
-		}
-
-		// Loop through friend_ids and update their counts
-		foreach ( (array) $friend_ids as $friend_id ) {
-			BP_Friends_Friendship::total_friend_count( $friend_id );
-		}
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-friends-friendship.php';
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php
index 6ada0e7ca2ec490f728288b1fccf641615c66861..f04c0ce0e0a5b20cc4b77669c6d14409246e02ef 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php
@@ -15,7 +15,6 @@
  *
  * @since BuddyPress (1.7.0)
  *
- * @global BuddyPress $bp Global BuddyPress settings.
  * @global WPDB $wpdb WordPress database access object.
  *
  * @param BP_User_Query $user_query The BP_User_Query object.
@@ -23,13 +22,15 @@
  *        data for, as determined by BP_User_Query.
  */
 function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) {
-	global $bp, $wpdb;
+	global $wpdb;
 
 	// stop if user isn't logged in
 	if ( ! is_user_logged_in() ) {
 		return;
 	}
 
+	$bp = buddypress();
+
 	// Fetch whether or not the user is a friend of the current user
 	$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids_sql} ) ) OR (initiator_user_id IN ( {$user_ids_sql} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
 
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
index 0e4a4021e8120555b8a252a809749de5d6520c35..d52420a82e7f4688bcb0fdbb316d6a992e6c1685 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php
@@ -13,7 +13,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Create a new friendship.
@@ -59,16 +59,28 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept =
 
 	// Send notifications
 	if ( empty( $force_accept ) ) {
-		$action = 'friends_friendship_requested';
+		$action = 'requested';
 
 	// Update friend totals
 	} else {
-		$action = 'friends_friendship_accepted';
+		$action = 'accepted';
 		friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id, 'add' );
 	}
 
-	// Call the above titled action and pass friendship data into it
-	do_action( $action, $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship );
+	/**
+	 * Fires at the end of initiating a new friendship connection.
+	 *
+	 * This is a variable hook, depending on context.
+	 * The two potential hooks are: friends_friendship_requested, friends_friendship_accepted.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int    $id ID of the pending friendship connection.
+	 * @param int    $initiator_user_id ID of the friendship initiator.
+	 * @param int    $friend_user_id ID of the friend user.
+	 * @param object $friendship BuddyPress Friendship Object.
+	 */
+	do_action( 'friends_friendship_' . $action, $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship );
 
 	return true;
 }
@@ -87,18 +99,46 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) {
 	$friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid );
 	$friendship    = new BP_Friends_Friendship( $friendship_id );
 
+	/**
+	 * Fires before the deletion of a friendship activity item
+	 * for the user who canceled the friendship.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $friendship_id ID of the friendship object, if any, between a pair of users.
+	 * @param int $initiator_userid ID of the friendship initiator.
+	 * @param int $friend_userid ID of the friend user.
+	 */
 	do_action( 'friends_before_friendship_delete', $friendship_id, $initiator_userid, $friend_userid );
 
-	// Remove the activity stream item for the user who canceled the friendship
-	friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => bp_displayed_user_id() ) );
-
-	// This hook is misleadingly named - the friendship is not yet deleted.
-	// This is your last chance to do something while the friendship exists
+	// Remove the activity stream items about the friendship id
+	friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_created', 'user_id' => 0 ) );
+
+	/**
+	 * Fires before the friendship connection is removed.
+	 *
+	 * This hook is misleadingly named - the friendship is not yet deleted.
+	 * This is your last chance to do something while the friendship exists.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $friendship_id ID of the friendship object, if any, between a pair of users.
+	 * @param int $initiator_userid ID of the friendship initiator.
+	 * @param int $friend_userid ID of the friend user.
+	 */
 	do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid );
 
 	if ( $friendship->delete() ) {
 		friends_update_friend_totals( $initiator_userid, $friend_userid, 'remove' );
 
+		/**
+		 * Fires after the friendship connection is removed.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param int $initiator_userid ID of the friendship initiator.
+		 * @param int $friend_userid ID of the friend user.
+		 */
 		do_action( 'friends_friendship_post_delete', $initiator_userid, $friend_userid );
 
 		return true;
@@ -117,7 +157,7 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) {
  */
 function friends_accept_friendship( $friendship_id ) {
 
-	// Get the friesdhip data
+	// Get the friendship data
 	$friendship = new BP_Friends_Friendship( $friendship_id, true, false );
 
 	// Accepting friendship
@@ -126,6 +166,16 @@ function friends_accept_friendship( $friendship_id ) {
 		// Bump the friendship counts
 		friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id );
 
+		/**
+		 * Fires after a friendship is accepted.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int    $id ID of the pending friendship object.
+		 * @param int    $initiator_user_id ID of the friendship initiator.
+		 * @param int    $friend_user_id ID of the user requested friendship with.
+		 * @param object $friendship BuddyPress Friendship Object.
+		 */
 		do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship );
 
 		return true;
@@ -144,6 +194,15 @@ function friends_reject_friendship( $friendship_id ) {
 	$friendship = new BP_Friends_Friendship( $friendship_id, true, false );
 
 	if ( empty( $friendship->is_confirmed ) && BP_Friends_Friendship::reject( $friendship_id ) ) {
+
+		/**
+		 * Fires after a friendship request is rejected.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int                   $friendship_id ID of the pending friendship.
+		 * @param BP_Friends_Friendship $friendships Friendship object. Passed by reference.
+		 */
 		do_action_ref_array( 'friends_friendship_rejected', array( $friendship_id, &$friendship ) );
 		return true;
 	}
@@ -168,7 +227,14 @@ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) {
 		// @deprecated Since 1.9
 		do_action_ref_array( 'friends_friendship_whithdrawn', array( $friendship_id, &$friendship ) );
 
-		// @since 1.9
+		/**
+		 * Fires after a friendship request has been withdrawn.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int                   $friendship_id ID of the friendship.
+		 * @param BP_Friends_Friendship $friendship Friendship object. Passed by reference.
+		 */
 		do_action_ref_array( 'friends_friendship_withdrawn',  array( $friendship_id, &$friendship ) );
 
 		return true;
@@ -234,6 +300,13 @@ function friends_get_total_friend_count( $user_id = 0 ) {
 	if ( empty( $count ) )
 		$count = 0;
 
+	/**
+	 * Filters the total friend count for a given user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param int $count Total friend count for a given user.
+	 */
 	return apply_filters( 'friends_get_total_friend_count', $count );
 }
 
@@ -269,7 +342,7 @@ function friends_get_friendship_id( $initiator_user_id, $friend_user_id ) {
 /**
  * Get the IDs of a given user's friends.
  *
- * @param int $user_id ID of the user whose friends are being retreived.
+ * @param int $user_id ID of the user whose friends are being retrieved.
  * @param bool $friend_requests_only Optional. Whether to fetch unaccepted
  *        requests only. Default: false.
  * @param bool $assoc_arr Optional. True to receive an array of arrays keyed as
@@ -315,7 +388,7 @@ function friends_get_friendship_request_user_ids( $user_id ) {
  *
  * @see BP_Core_User::get_users() for a description of return value.
  *
- * @param int $user_id ID of the user whose friends are being retreived.
+ * @param int $user_id ID of the user whose friends are being retrieved.
  * @param int $per_page Optional. Number of results to return per page.
  *        Default: 0 (no pagination; show all results).
  * @param int $page Optional. Number of the page of results to return.
@@ -325,6 +398,17 @@ function friends_get_friendship_request_user_ids( $user_id ) {
  * @return array See {@link BP_Core_User::get_users()}.
  */
 function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filter = '' ) {
+
+	/**
+	 * Filters a user's most recently active friends.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array {
+	 *     @type int   $total_users Total number of users matched by query params.
+	 *     @type array $paged_users The current page of users matched by query params.
+	 * }
+	 */
 	return apply_filters( 'friends_get_recently_active', BP_Core_User::get_users( 'active', $per_page, $page, $user_id, $filter ) );
 }
 
@@ -333,7 +417,7 @@ function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filte
  *
  * @see BP_Core_User::get_users() for a description of return value.
  *
- * @param int $user_id ID of the user whose friends are being retreived.
+ * @param int $user_id ID of the user whose friends are being retrieved.
  * @param int $per_page Optional. Number of results to return per page.
  *        Default: 0 (no pagination; show all results).
  * @param int $page Optional. Number of the page of results to return.
@@ -343,6 +427,17 @@ function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filte
  * @return array See {@link BP_Core_User::get_users()}.
  */
 function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter = '' ) {
+
+	/**
+	 * Filters a user's friends listed in alphabetical order.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @return array {
+	 *     @type int   $total_users Total number of users matched by query params.
+	 *     @type array $paged_users The current page of users matched by query params.
+	 * }
+	 */
 	return apply_filters( 'friends_get_alphabetically', BP_Core_User::get_users( 'alphabetical', $per_page, $page, $user_id, $filter ) );
 }
 
@@ -351,7 +446,7 @@ function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter
  *
  * @see BP_Core_User::get_users() for a description of return value.
  *
- * @param int $user_id ID of the user whose friends are being retreived.
+ * @param int $user_id ID of the user whose friends are being retrieved.
  * @param int $per_page Optional. Number of results to return per page.
  *        Default: 0 (no pagination; show all results).
  * @param int $page Optional. Number of the page of results to return.
@@ -361,6 +456,17 @@ function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter
  * @return array See {@link BP_Core_User::get_users()}.
  */
 function friends_get_newest( $user_id, $per_page = 0, $page = 0, $filter = '' ) {
+
+	/**
+	 * Filters a user's friends listed from newest to oldest.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array {
+	 *     @type int   $total_users Total number of users matched by query params.
+	 *     @type array $paged_users The current page of users matched by query params.
+	 * }
+	 */
 	return apply_filters( 'friends_get_newest', BP_Core_User::get_users( 'newest', $per_page, $page, $user_id, $filter ) );
 }
 
@@ -402,7 +508,13 @@ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) {
 	// Assume no friends
 	$friends = array();
 
-	// Default args
+	/**
+	 * Filters default arguments for list of friends a user can invite into this group.
+	 *
+	 * @since BuddyPress (1.5.4)
+	 *
+	 * @param array $value Array of default parameters for invite list.
+	 */
 	$args = apply_filters( 'bp_friends_pre_get_invite_list', array(
 		'user_id'  => $user_id,
 		'type'     => 'alphabetical',
@@ -449,7 +561,15 @@ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) {
 	if ( empty( $friends ) )
 		$friends = false;
 
-	// Allow friends to be filtered
+	/**
+	 * Filters the list of potential friends that can be invited to this group.
+	 *
+	 * @since BuddyPress (1.5.4)
+	 *
+	 * @param array|bool $friends Array friends available to invite or false for no friends.
+	 * @param int        $user_id ID of the user checked for who they can invite.
+	 * @param int        $group_id ID of the group being checked on.
+	 */
 	return apply_filters( 'bp_friends_get_invite_list', $friends, $user_id, $group_id );
 }
 
@@ -554,6 +674,13 @@ function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $sta
  */
 function friends_remove_data( $user_id ) {
 
+	/**
+	 * Fires before deletion of friend-related data for a given user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $user_id ID for the user whose friend data is being removed.
+	 */
 	do_action( 'friends_before_remove_data', $user_id );
 
 	BP_Friends_Friendship::delete_all_for_user( $user_id );
@@ -561,6 +688,13 @@ function friends_remove_data( $user_id ) {
 	// Remove usermeta
 	bp_delete_user_meta( $user_id, 'total_friend_count' );
 
+	/**
+	 * Fires after deletion of friend-related data for a given user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id ID for the user whose friend data is being removed.
+	 */
 	do_action( 'friends_remove_data', $user_id );
 }
 add_action( 'wpmu_delete_user',  'friends_remove_data' );
@@ -579,6 +713,15 @@ function bp_friends_prime_mentions_results() {
 		return;
 	}
 
+	// Bail out if the site has a ton of users.
+	if ( is_multisite() && wp_is_large_network( 'users' ) ) {
+		return;
+	}
+
+	if ( friends_get_total_friend_count( get_current_user_id() ) > 150 ) {
+		return;
+	}
+
 	$friends_query = array(
 		'count_total'     => '',                    // Prevents total count
 		'populate_extras' => false,
@@ -594,7 +737,12 @@ function bp_friends_prime_mentions_results() {
 		$result        = new stdClass();
 		$result->ID    = $user->user_nicename;
 		$result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
-		$result->name  = bp_core_get_user_displayname( $user->ID );
+
+		if ( ! empty( $user->display_name ) && ! bp_disable_profile_sync() ) {
+			$result->name = $user->display_name;
+		} else {
+			$result->name = bp_core_get_user_displayname( $user->ID );
+		}
 
 		$results[] = $result;
 	}
@@ -603,4 +751,4 @@ function bp_friends_prime_mentions_results() {
 		'friends' => $results,
 	) );
 }
-add_action( 'bp_activity_mentions_prime_results', 'bp_friends_prime_mentions_results' );
\ No newline at end of file
+add_action( 'bp_activity_mentions_prime_results', 'bp_friends_prime_mentions_results' );
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
index 1fd1167cba26617c4ae7bfe635f76067798a9693..aa42f4c47ce274fef7ec0c0c7ade321c55dd129f 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php
@@ -9,7 +9,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Friends_Component extends BP_Component {
 
@@ -239,6 +239,21 @@ class BP_Friends_Component extends BP_Component {
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_friends_requests'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
index 4fb805ba91905cb841c27a34e5aac0af8b0f3f07..7c4c236ed8b5b8e58640b60a3d63887c4ecec323 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Emails ********************************************************************/
 
@@ -56,13 +56,51 @@ To view %3$s\'s profile: %4$s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 	}
 
-	// Send the message
+	/**
+	 * Filters the email address for who is getting the friend request.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $to Email address for who is getting the friend request.
+	 */
 	$to      = apply_filters( 'friends_notification_new_request_to', $to );
+
+	/**
+	 * Filters the subject for the friend request email.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $subject Subject line to be used in friend request email.
+	 * @param string $initiator_name Name of the person requesting friendship.
+	 */
 	$subject = apply_filters( 'friends_notification_new_request_subject', $subject, $initiator_name );
+
+	/**
+	 * Filters the message for the friend request email.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $message Message to be used in friend request email.
+	 * @param string $initiator_name Name of the person requesting friendship.
+	 * @param string $initiator_link Profile link of person requesting friendship.
+	 * @param string $all_requests_link User's friends request management link.
+	 * @param string $settings_link Email recipient's settings management link.
+	 */
 	$message = apply_filters( 'friends_notification_new_request_message', $message, $initiator_name, $initiator_link, $all_requests_link, $settings_link );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the new friend request email is sent.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int    $friend_id ID of the request recipient.
+	 * @param string $subject Text for the friend request subject field.
+	 * @param string $message Text for the friend request message field.
+	 * @param int    $friendship_id ID of the friendship object.
+	 * @param int    $initiator_id ID of the friendship requester.
+	 */
 	do_action( 'bp_friends_sent_request_email', $friend_id, $subject, $message, $friendship_id, $initiator_id );
 }
 add_action( 'friends_friendship_requested', 'friends_notification_new_request', 10, 3 );
@@ -105,13 +143,50 @@ To view %2$s\'s profile: %3$s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 	}
 
-	// Send the message
+	/**
+	 * Filters the email address for whose friend request got accepted.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $to Email address for whose friend request got accepted.
+	 */
 	$to      = apply_filters( 'friends_notification_accepted_request_to', $to );
+
+	/**
+	 * Filters the subject for the friend request accepted email.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $subject Subject line to be used in friend request accepted email.
+	 * @param string $friend_name Name of the person who accepted the friendship request.
+	 */
 	$subject = apply_filters( 'friends_notification_accepted_request_subject', $subject, $friend_name );
+
+	/**
+	 * Filters the message for the friend request accepted email.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $message Message to be used in friend request email.
+	 * @param string $friend_name Name of the person who accepted the friendship request.
+	 * @param string $friend_link Profile link of person who accepted the friendship request.
+	 * @param string $settings_link Email recipient's settings management link.
+	 */
 	$message = apply_filters( 'friends_notification_accepted_request_message', $message, $friend_name, $friend_link, $settings_link );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the friend request accepted email is sent.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int    $initiator_id ID of the friendship requester.
+	 * @param string $subject Text for the friend request subject field.
+	 * @param string $message Text for the friend request message field.
+	 * @param int    $friendship_id ID of the friendship object.
+	 * @param int    $friend_id ID of the request recipient.
+	 */
 	do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id );
 }
 add_action( 'friends_friendship_accepted', 'friends_notification_accepted_request', 10, 3 );
@@ -136,13 +211,16 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
 		case 'friendship_accepted':
 			$link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends' );
 
+			// $action and $amount are used to generate dynamic filter names.
+			$action = 'accepted';
+
 			// Set up the string and the filter
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items );
-				$filter = 'bp_friends_multiple_friendship_accepted_notification';
+				$amount = 'multiple';
 			} else {
 				$text = sprintf( __( '%s accepted your friendship request', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
-				$filter = 'bp_friends_single_friendship_accepted_notification';
+				$amount = 'single';
 			}
 
 			break;
@@ -150,13 +228,15 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
 		case 'friendship_request':
 			$link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/?new';
 
+			$action = 'request';
+
 			// Set up the string and the filter
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items );
-				$filter = 'bp_friends_multiple_friendship_request_notification';
+				$amount = 'multiple';
 			} else {
 				$text = sprintf( __( 'You have a friendship request from %s', 'buddypress' ),  bp_core_get_user_displayname( $item_id ) );
-				$filter = 'bp_friends_single_friendship_request_notification';
+				$amount = 'single';
 			}
 
 			break;
@@ -164,14 +244,46 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t
 
 	// Return either an HTML link or an array, depending on the requested format
 	if ( 'string' == $format ) {
-		$return = apply_filters( $filter, '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id );
+
+		/**
+		 * Filters the format of friendship notifications based on type and amount * of notifications pending.
+		 *
+		 * This is a variable filter that has four possible versions.
+		 * The four possible versions are:
+		 *   - bp_friends_single_friendship_accepted_notification
+		 *   - bp_friends_multiple_friendship_accepted_notification
+		 *   - bp_friends_single_friendship_request_notification
+		 *   - bp_friends_multiple_friendship_request_notification
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string|array $value       Depending on format, an HTML link to new requests profile
+		 *                                  tab or array with link and text.
+		 * @param int          $total_items The total number of messaging-related notifications
+		 *                                  waiting for the user.
+		 * @param int          $item_id     The primary item ID.
+		 */
+		$return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id );
 	} else {
-		$return = apply_filters( $filter, array(
+		/** This filter is documented in bp-friends/bp-friends-notifications.php */
+		$return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', array(
 			'link' => $link,
 			'text' => $text
 		), (int) $total_items, $item_id );
 	}
 
+	/**
+	 * Fires at the end of the bp-friends notification format callback.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string       $action            The kind of notification being rendered.
+	 * @param int          $item_id           The primary item ID.
+	 * @param int          $secondary_item_id The secondary item ID.
+	 * @param int          $total_items       The total number of messaging-related notifications
+	 *                                        waiting for the user.
+	 * @param array|string $return            Notification text string or array of link and text.
+	 */
 	do_action( 'friends_format_notifications', $action, $item_id, $secondary_item_id, $total_items, $return );
 
 	return $return;
@@ -217,7 +329,7 @@ add_action( 'friends_screen_my_friends', 'bp_friends_mark_friendship_accepted_no
  * @since BuddyPress (1.9.0)
  * @param int $friendship_id The unique ID of the friendship
  * @param int $initiator_user_id The friendship initiator user ID
- * @param int $friend_user_id The friendship request reciever user ID
+ * @param int $friend_user_id The friendship request receiver user ID
  */
 function bp_friends_friendship_requested_notification( $friendship_id, $initiator_user_id, $friend_user_id ) {
 	if ( bp_is_active( 'notifications' ) ) {
@@ -255,7 +367,7 @@ add_action( 'friends_friendship_rejected', 'bp_friends_mark_friendship_rejected_
  * @since BuddyPress (1.9.0)
  * @param int $friendship_id The unique ID of the friendship
  * @param int $initiator_user_id The friendship initiator user ID
- * @param int $friend_user_id The friendship request reciever user ID
+ * @param int $friend_user_id The friendship request receiver user ID
  */
 function bp_friends_add_friendship_accepted_notification( $friendship_id, $initiator_user_id, $friend_user_id ) {
 
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
index 381c8d2648055e9a9342ef6beeceace7a24b98c5..77055812bc48ed6c2b25d45c9832fe6415242a5c 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php
@@ -12,15 +12,27 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Catch and process the My Friends page.
  */
 function friends_screen_my_friends() {
 
+	/**
+	 * Fires before the loading of template for the My Friends page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'friends_screen_my_friends' );
 
+	/**
+	 * Filters the template used to display the My Friends page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the my friends template to load.
+	 */
 	bp_core_load_template( apply_filters( 'friends_template_my_friends', 'members/single/home' ) );
 }
 
@@ -62,8 +74,20 @@ function friends_screen_requests() {
 		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) );
 	}
 
+	/**
+	 * Fires before the loading of template for the friends requests page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'friends_screen_requests' );
 
+	/**
+	 * Filters the template used to display the My Friends page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the friends request template to load.
+	 */
 	bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
 }
 
@@ -102,7 +126,14 @@ function friends_screen_notification_settings() {
 				<td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php checked( $accept_requests, 'no', true ) ?>/></td>
 			</tr>
 
-			<?php do_action( 'friends_screen_notification_settings' ); ?>
+			<?php
+
+			/**
+			 * Fires after the last table row on the friends notification screen.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 */
+			do_action( 'friends_screen_notification_settings' ); ?>
 
 		</tbody>
 	</table>
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
index d9ffa8d3d90d22c5ee6bf6b322fb7bed86eb34ab..41821d83a51b38ff5c3a04647293eba1ffbc9c6a 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the friends component slug.
@@ -26,6 +26,14 @@ function bp_friends_slug() {
 	 * @since BuddyPress (1.5.0)
 	 */
 	function bp_get_friends_slug() {
+
+		/**
+		 * Filters the friends component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Friends component slug.
+		 */
 		return apply_filters( 'bp_get_friends_slug', buddypress()->friends->slug );
 	}
 
@@ -45,6 +53,14 @@ function bp_friends_root_slug() {
 	 * @since BuddyPress (1.5.0)
 	 */
 	function bp_get_friends_root_slug() {
+
+		/**
+		 * Filters the friends component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Friends component root slug.
+		 */
 		return apply_filters( 'bp_get_friends_root_slug', buddypress()->friends->root_slug );
 	}
 
@@ -212,10 +228,22 @@ function bp_member_total_friend_count() {
 	function bp_get_member_total_friend_count() {
 		global $members_template;
 
-		if ( 1 == (int) $members_template->member->total_friend_count )
+		if ( 1 == (int) $members_template->member->total_friend_count ) {
+
+			/**
+			 * Filters text used to denote total friend count.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @param string $value String of the form "x friends".
+			 * @param int    $value Total friend count for current member in the loop.
+			 */
 			return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
-		else
+		} else {
+
+			/** This filter is documented in bp-friends/bp-friends-template.php */
 			return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) );
+		}
 	}
 
 /**
@@ -242,9 +270,16 @@ function bp_potential_friend_id( $user_id = 0 ) {
 
 		if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) )
 			$user_id = $friends_template->friendship->friend->id;
-		else if ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
+		elseif ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
 			$user_id = bp_displayed_user_id();
 
+		/**
+		 * Filters the ID of current user in the friend request loop.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param int $user_id ID of current user in the friend request loop.
+		 */
 		return apply_filters( 'bp_get_potential_friend_id', (int) $user_id );
 	}
 
@@ -268,6 +303,13 @@ function bp_is_friend( $user_id = 0 ) {
 	if ( bp_loggedin_user_id() == $user_id )
 		return false;
 
+	/**
+	 * Filters the status of friendship between logged in user and given user.
+	 *
+	 * @since BuddyPress (1.2.10)
+	 *
+	 * @param string $value String status of friendship. Possible values are 'is_friend', 'not_friends', 'pending'.
+	 */
 	return apply_filters( 'bp_is_friend', friends_check_friendship_status( bp_loggedin_user_id(), $user_id ), $user_id );
 }
 
@@ -370,7 +412,13 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false
 				break;
 		}
 
-		// Filter and return the HTML button
+		/**
+		 * Filters the HTML for the add friend button.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $button HTML markup for add friend button.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_add_friend_button', $button ) );
 	}
 
@@ -422,6 +470,13 @@ function bp_get_friendship_requests( $user_id = 0 ) {
 		$requests = 0;
 	}
 
+	/**
+	 * Filters the total pending friendship requests for a user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array|int An array of user IDs if found, or a 0 if none are found.
+	 */
 	return apply_filters( 'bp_get_friendship_requests', $requests );
 }
 
@@ -432,7 +487,7 @@ function bp_friend_friendship_id() {
 	echo bp_get_friend_friendship_id();
 }
 	/**
-	 * Return the ID of the frinedship between the logged-in user and the current user in the loop.
+	 * Return the ID of the friendship between the logged-in user and the current user in the loop.
 	 *
 	 * @return int ID of the friendship.
 	 */
@@ -444,6 +499,13 @@ function bp_friend_friendship_id() {
 			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
+		/**
+		 * Filters the ID of the friendship between the logged in user and the current user in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $friendship_id ID of the friendship.
+		 */
 		return apply_filters( 'bp_get_friend_friendship_id', $friendship_id );
 	}
 
@@ -466,6 +528,13 @@ function bp_friend_accept_request_link() {
 			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
+		/**
+		 * Filters the URL for accepting the current friendship request in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Accept-friendship URL.
+		 */
 		return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) );
 	}
 
@@ -488,6 +557,13 @@ function bp_friend_reject_request_link() {
 			wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
 		}
 
+		/**
+		 * Filters the URL for rejecting the current friendship request in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Reject-friendship URL.
+		 */
 		return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) );
 	}
 
@@ -506,6 +582,14 @@ function bp_total_friend_count( $user_id = 0 ) {
 	 * @return int Total friend count.
 	 */
 	function bp_get_total_friend_count( $user_id = 0 ) {
+
+		/**
+		 * Filters the total friend count for a given user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Total friend count.
+		 */
 		return apply_filters( 'bp_get_total_friend_count', friends_get_total_friend_count( $user_id ) );
 	}
 	add_filter( 'bp_get_total_friend_count', 'bp_core_number_format' );
@@ -531,6 +615,13 @@ function bp_friend_total_requests_count( $user_id = 0 ) {
 		if ( empty( $user_id ) )
 			$user_id = bp_loggedin_user_id();
 
+		/**
+		 * Filters the total friendship request count for a given user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Friendship request count.
+		 */
 		return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) );
 	}
 
@@ -584,6 +675,13 @@ function bp_friends_get_profile_stats( $args = '' ) {
 		}
 	}
 
-	// Filter and return
+	/**
+	 * Filters the number of friends in user's profile.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $value Formatted string displaying total friends count.
+	 * @param array  $r Array of arguments for string formatting and output.
+	 */
 	return apply_filters( 'bp_friends_get_profile_stats', $r['output'], $r );
 }
diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-widgets.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-widgets.php
index 5116ca38429c3376b13215876679abb4428d08d0..ad4205d31e02662483f8c9b28058893934455182 100644
--- a/wp-content/plugins/buddypress/bp-friends/bp-friends-widgets.php
+++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-widgets.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( ! defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register the friends widget.
@@ -76,7 +76,17 @@ class BP_Core_Friends_Widget extends WP_Widget {
 			$instance['friend_default'] = 'active';
 		}
 
-		$title = apply_filters( 'widget_title', $instance['title'] );
+		/**
+		 * Filters the Friends widget title.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $instance The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
 
 		echo $before_widget;
 
@@ -145,7 +155,7 @@ class BP_Core_Friends_Widget extends WP_Widget {
 	 * Process a widget save.
 	 *
 	 * @param array $new_instance The parameters saved by the user.
-	 * @param array $old_instance The paramaters as previously saved to the database.
+	 * @param array $old_instance The parameters as previously saved to the database.
 	 * @return array $instance The processed settings to save.
 	 */
 	function update( $new_instance, $old_instance ) {
diff --git a/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-friendship.php b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-friendship.php
new file mode 100644
index 0000000000000000000000000000000000000000..5181c4ad293c7c4650d19ad2fcb67a896a3486fc
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-friendship.php
@@ -0,0 +1,682 @@
+<?php
+/**
+ * BuddyPress Friends Classes
+ *
+ * @package BuddyPress
+ * @subpackage FriendsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Friendship object.
+ */
+class BP_Friends_Friendship {
+
+	/**
+	 * ID of the friendship.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $id;
+
+	/**
+	 * User ID of the friendship initiator.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $initiator_user_id;
+
+	/**
+	 * User ID of the 'friend' - the one invited to the friendship.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $friend_user_id;
+
+	/**
+	 * Has the friendship been confirmed/accepted?
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $is_confirmed;
+
+	/**
+	 * Is this a "limited" friendship?
+	 *
+	 * Not currently used by BuddyPress.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $is_limited;
+
+	/**
+	 * Date the friendship was created.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $date_created;
+
+	/**
+	 * Is this a request?
+	 *
+	 * Not currently used in BuddyPress.
+	 *
+	 * @access public
+	 * @var unknown
+	 */
+	public $is_request;
+
+	/**
+	 * Should additional friend details be queried?
+	 *
+	 * @access public
+	 * @var bool
+	 */
+	public $populate_friend_details;
+
+	/**
+	 * Details about the friend.
+	 *
+	 * @access public
+	 * @var BP_Core_User
+	 */
+	public $friend;
+
+	/**
+	 * Constructor method.
+	 *
+	 * @param int $id Optional. The ID of an existing friendship.
+	 * @param bool $is_request Deprecated.
+	 * @param bool $populate_friend_details True if friend details should
+	 *        be queried.
+	 */
+	public function __construct( $id = null, $is_request = false, $populate_friend_details = true ) {
+		$this->is_request = $is_request;
+
+		if ( !empty( $id ) ) {
+			$this->id                      = $id;
+			$this->populate_friend_details = $populate_friend_details;
+			$this->populate( $this->id );
+		}
+	}
+
+	/**
+	 * Set up data about the current friendship.
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( $friendship = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->friends->table_name} WHERE id = %d", $this->id ) ) ) {
+			$this->initiator_user_id = $friendship->initiator_user_id;
+			$this->friend_user_id    = $friendship->friend_user_id;
+			$this->is_confirmed      = $friendship->is_confirmed;
+			$this->is_limited        = $friendship->is_limited;
+			$this->date_created      = $friendship->date_created;
+		}
+
+		if ( !empty( $this->populate_friend_details ) ) {
+			if ( $this->friend_user_id == bp_displayed_user_id() ) {
+				$this->friend = new BP_Core_User( $this->initiator_user_id );
+			} else {
+				$this->friend = new BP_Core_User( $this->friend_user_id );
+			}
+		}
+	}
+
+	/**
+	 * Save the current friendship to the database.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->initiator_user_id = apply_filters( 'friends_friendship_initiator_user_id_before_save', $this->initiator_user_id, $this->id );
+		$this->friend_user_id    = apply_filters( 'friends_friendship_friend_user_id_before_save',    $this->friend_user_id,    $this->id );
+		$this->is_confirmed      = apply_filters( 'friends_friendship_is_confirmed_before_save',      $this->is_confirmed,      $this->id );
+		$this->is_limited        = apply_filters( 'friends_friendship_is_limited_before_save',        $this->is_limited,        $this->id );
+		$this->date_created      = apply_filters( 'friends_friendship_date_created_before_save',      $this->date_created,      $this->id );
+
+		/**
+		 * Fires before processing and saving the current friendship request.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param Object $value Current friendship request object.
+		 */
+		do_action_ref_array( 'friends_friendship_before_save', array( &$this ) );
+
+		// Update
+		if (!empty( $this->id ) ) {
+			$result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = %s WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );
+
+		// Save
+		} else {
+			$result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, %s )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );
+			$this->id = $wpdb->insert_id;
+		}
+
+		/**
+		 * Fires after processing and saving the current friendship request.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param Object $value Current friendship request object.
+		 */
+		do_action( 'friends_friendship_after_save', array( &$this ) );
+
+		return $result;
+	}
+
+	public function delete() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d", $this->id ) );
+	}
+
+	/** Static Methods ********************************************************/
+
+	/**
+	 * Get the IDs of a given user's friends.
+	 *
+	 * @param int $user_id ID of the user whose friends are being retrieved.
+	 * @param bool $friend_requests_only Optional. Whether to fetch
+	 *        unaccepted requests only. Default: false.
+	 * @param bool $assoc_arr Optional. True to receive an array of arrays
+	 *        keyed as 'user_id' => $user_id; false to get a one-dimensional
+	 *        array of user IDs. Default: false.
+	 */
+	public static function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) {
+		global $wpdb;
+
+		if ( !empty( $friend_requests_only ) ) {
+			$oc_sql = 'AND is_confirmed = 0';
+			$friend_sql = $wpdb->prepare( " WHERE friend_user_id = %d", $user_id );
+		} else {
+			$oc_sql = 'AND is_confirmed = 1';
+			$friend_sql = $wpdb->prepare( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
+		}
+
+		$bp = buddypress();
+		$friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" );
+		$fids = array();
+
+		for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
+			if ( !empty( $assoc_arr ) ) {
+				$fids[] = array( 'user_id' => ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id );
+			} else {
+				$fids[] = ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id;
+			}
+		}
+
+		return $fids;
+	}
+
+	/**
+	 * Get the ID of the friendship object, if any, between a pair of users.
+	 *
+	 * @param int $user_id The ID of the first user.
+	 * @param int $friend_id The ID of the second user.
+	 * @return int|bool The ID of the friendship object if found, otherwise
+	 *         false.
+	 */
+	public static function get_friendship_id( $user_id, $friend_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->friends->table_name} WHERE ( initiator_user_id = %d AND friend_user_id = %d ) OR ( initiator_user_id = %d AND friend_user_id = %d ) AND is_confirmed = 1", $user_id, $friend_id, $friend_id, $user_id ) );
+	}
+
+	/**
+	 * Get a list of IDs of users who have requested friendship of a given user.
+	 *
+	 * @param int $user_id The ID of the user who has received the
+	 *        friendship requests.
+	 * @return array|bool An array of user IDs, or false if none are found.
+	 */
+	public static function get_friendship_request_user_ids( $user_id ) {
+		$friend_requests = wp_cache_get( $user_id, 'bp_friends_requests' );
+
+		if ( false === $friend_requests ) {
+			global $wpdb;
+
+			$bp = buddypress();
+
+			$friend_requests = $wpdb->get_col( $wpdb->prepare( "SELECT initiator_user_id FROM {$bp->friends->table_name} WHERE friend_user_id = %d AND is_confirmed = 0", $user_id ) );
+
+			wp_cache_set( $user_id, $friend_requests, 'bp_friends_requests' );
+		}
+
+		return $friend_requests;
+	}
+
+	/**
+	 * Get a total friend count for a given user.
+	 *
+	 * @param int $user_id Optional. ID of the user whose friendships you
+	 *        are counting. Default: displayed user (if any), otherwise
+	 *        logged-in user.
+	 * @return int Friend count for the user.
+	 */
+	public static function total_friend_count( $user_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
+
+		$bp = buddypress();
+
+		/* This is stored in 'total_friend_count' usermeta.
+		   This function will recalculate, update and return. */
+
+		$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ) );
+
+		// Do not update meta if user has never had friends
+		if ( empty( $count ) && !bp_get_user_meta( $user_id, 'total_friend_count', true ) )
+			return 0;
+
+		bp_update_user_meta( $user_id, 'total_friend_count', (int) $count );
+
+		return absint( $count );
+	}
+
+	/**
+	 * Search the friends of a user by a search string.
+	 *
+	 * @param string $filter The search string, matched against xprofile
+	 *        fields (if available), or usermeta 'nickname' field.
+	 * @param int $user_id ID of the user whose friends are being searched.
+	 * @param int $limit Optional. Max number of friends to return.
+	 * @param int $page Optional. The page of results to return. Default:
+	 *        null (no pagination - return all results).
+	 * @return array|bool On success, an array: {
+	 *     @type array $friends IDs of friends returned by the query.
+	 *     @type int $count Total number of friends (disregarding
+	 *           pagination) who match the search.
+	 * }. Returns false on failure.
+	 */
+	public static function search_friends( $filter, $user_id, $limit = null, $page = null ) {
+		global $wpdb;
+
+		// TODO: Optimize this function.
+
+		if ( empty( $user_id ) )
+			$user_id = bp_loggedin_user_id();
+
+		// Only search for matching strings at the beginning of the
+		// name (@todo - figure out why this restriction)
+		$search_terms_like = bp_esc_like( $filter ) . '%';
+
+		$pag_sql = '';
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		if ( !$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ) )
+			return false;
+
+		// Get all the user ids for the current user's friends.
+		$fids = implode( ',', wp_parse_id_list( $friend_ids ) );
+
+		if ( empty( $fids ) )
+			return false;
+
+		$bp = buddypress();
+
+		// filter the user_ids based on the search criteria.
+		if ( bp_is_active( 'xprofile' ) ) {
+			$sql       = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s {$pag_sql}", $search_terms_like );
+			$total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s", $search_terms_like );
+		} else {
+			$sql       = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s' {$pag_sql}", $search_terms_like );
+			$total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s", $search_terms_like );
+		}
+
+		$filtered_friend_ids = $wpdb->get_col( $sql );
+		$total_friend_ids    = $wpdb->get_var( $total_sql );
+
+		if ( empty( $filtered_friend_ids ) )
+			return false;
+
+		return array( 'friends' => $filtered_friend_ids, 'total' => (int) $total_friend_ids );
+	}
+
+	/**
+	 * Check friendship status between two users.
+	 *
+	 * Note that 'pending' means that $initiator_userid has sent a friend
+	 * request to $possible_friend_userid that has not yet been approved,
+	 * while 'awaiting_response' is the other way around ($possible_friend_userid
+	 * sent the initial request)
+	 *
+	 * @param int $initiator_userid The ID of the user who is the initiator
+	 *        of the potential friendship/request.
+	 * @param int $possible_friend_userid The ID of the user who is the
+	 *        recipient of the potential friendship/request.
+	 * @return string The friendship status, from among 'not_friends',
+	 *        'is_friend', 'pending', and 'awaiting_response'.
+	 */
+	public static function check_is_friend( $initiator_userid, $possible_friend_userid ) {
+		global $wpdb;
+
+		if ( empty( $initiator_userid ) || empty( $possible_friend_userid ) ) {
+			return false;
+		}
+
+		$bp = buddypress();
+
+		$result = $wpdb->get_results( $wpdb->prepare( "SELECT id, initiator_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id = %d) OR (initiator_user_id = %d AND friend_user_id = %d)", $initiator_userid, $possible_friend_userid, $possible_friend_userid, $initiator_userid ) );
+
+		if ( ! empty( $result ) ) {
+			if ( 0 == (int) $result[0]->is_confirmed ) {
+				$status = $initiator_userid == $result[0]->initiator_user_id ? 'pending' : 'awaiting_response';
+			} else {
+				$status = 'is_friend';
+			}
+		} else {
+			$status = 'not_friends';
+		}
+
+		return $status;
+	}
+
+	/**
+	 * Get the last active date of many users at once.
+	 *
+	 * @todo Why is this in the Friends component?
+	 *
+	 * @param array $user_ids IDs of users whose last_active meta is
+	 *        being queried.
+	 * @return array Array of last_active values + user_ids.
+	 */
+	public static function get_bulk_last_active( $user_ids ) {
+		global $wpdb;
+
+		$last_activities = BP_Core_User::get_last_activity( $user_ids );
+
+		// Sort and structure as expected in legacy function
+		usort( $last_activities, create_function( '$a, $b', '
+			if ( $a["date_recorded"] == $b["date_recorded"] ) {
+				return 0;
+			}
+
+			return ( strtotime( $a["date_recorded"] ) < strtotime( $b["date_recorded"] ) ) ? 1 : -1;
+		' ) );
+
+		$retval = array();
+		foreach ( $last_activities as $last_activity ) {
+			$u = new stdClass;
+			$u->last_activity = $last_activity['date_recorded'];
+			$u->user_id       = $last_activity['user_id'];
+
+			$retval[] = $u;
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Mark a friendship as accepted.
+	 *
+	 * @param int $friendship_id ID of the friendship to be accepted.
+	 * @return int Number of database rows updated.
+	 */
+	public static function accept($friendship_id) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+	 	return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, bp_loggedin_user_id() ) );
+	}
+
+	/**
+	 * Remove a friendship or a friendship request INITIATED BY the logged-in user.
+	 *
+	 * @param int $friendship_id ID of the friendship to be withdrawn.
+	 * @return int Number of database rows deleted.
+	 */
+	public static function withdraw($friendship_id) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND initiator_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
+	}
+
+	/**
+	 * Remove a friendship or a friendship request MADE OF the logged-in user.
+	 *
+	 * @param int $friendship_id ID of the friendship to be rejected.
+	 * @return int Number of database rows deleted.
+	 */
+	public static function reject($friendship_id) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE id = %d AND friend_user_id = %d", $friendship_id, bp_loggedin_user_id() ) );
+	}
+
+	/**
+	 * Search users.
+	 *
+	 * @todo Why does this exist, and why is it in bp-friends?
+	 *
+	 * @param string $filter String to search by.
+	 * @param int $user_id A user ID param that is unused.
+	 * @param int $limit Optional. Max number of records to return.
+	 * @param int $page Optional. Number of the page to return. Default:
+	 *        false (no pagination - return all results).
+	 * @return array $filtered_ids IDs of users who match the query.
+	 */
+	public static function search_users( $filter, $user_id, $limit = null, $page = null ) {
+		global $wpdb;
+
+		// Only search for matching strings at the beginning of the
+		// name (@todo - figure out why this restriction)
+		$search_terms_like = bp_esc_like( $filter ) . '%';
+
+		$usermeta_table = $wpdb->base_prefix . 'usermeta';
+		$users_table    = $wpdb->base_prefix . 'users';
+
+		$pag_sql = '';
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * intval( $limit ) ), intval( $limit ) );
+
+		$bp = buddypress();
+
+		// filter the user_ids based on the search criteria.
+		if ( bp_is_active( 'xprofile' ) ) {
+			$sql = $wpdb->prepare( "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE %s ORDER BY d.value DESC {$pag_sql}", $search_terms_like );
+		} else {
+			$sql = $wpdb->prepare( "SELECT DISTINCT user_id as id FROM {$usermeta_table} WHERE meta_value LIKE %s ORDER BY d.value DESC {$pag_sql}", $search_terms_like );
+		}
+
+		$filtered_fids = $wpdb->get_col($sql);
+
+		if ( empty( $filtered_fids ) )
+			return false;
+
+		return $filtered_fids;
+	}
+
+	/**
+	 * Get a count of users who match a search term.
+	 *
+	 * @todo Why does this exist, and why is it in bp-friends?
+	 *
+	 * @param string $filter Search term.
+	 * @return int Count of users matching the search term.
+	 */
+	public static function search_users_count( $filter ) {
+		global $wpdb;
+
+		// Only search for matching strings at the beginning of the
+		// name (@todo - figure out why this restriction)
+		$search_terms_like = bp_esc_like( $filter ) . '%';
+
+		$usermeta_table = $wpdb->prefix . 'usermeta';
+		$users_table    = $wpdb->base_prefix . 'users';
+
+		$bp = buddypress();
+
+		// filter the user_ids based on the search criteria.
+		if ( bp_is_active( 'xprofile' ) ) {
+			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE %s", $search_terms_like );
+		} else {
+			$sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$usermeta_table} WHERE meta_value LIKE %s", $search_terms_like );
+		}
+
+		$user_count = $wpdb->get_col($sql);
+
+		if ( empty( $user_count ) )
+			return false;
+
+		return $user_count[0];
+	}
+
+	/**
+	 * Sort a list of user IDs by their display names.
+	 *
+	 * @todo Why does this exist, and why is it in bp-friends?
+	 *
+	 * @param array $user_ids Array of user IDs.
+	 * @return array User IDs, sorted by the associated display names.
+	 */
+	public static function sort_by_name( $user_ids ) {
+		global $wpdb;
+
+		if ( !bp_is_active( 'xprofile' ) )
+			return false;
+
+		$bp = buddypress();
+
+		$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
+
+		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} pd, {$bp->profile->table_name_fields} pf WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} ) ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ) );
+	}
+
+	/**
+	 * Get a list of random friend IDs.
+	 *
+	 * @param int $user_id ID of the user whose friends are being retrieved.
+	 * @param int $total_friends Optional. Number of random friends to get.
+	 *        Default: 5.
+	 * @return array|bool An array of random friend user IDs on success;
+	 *         false if none are found.
+	 */
+	public static function get_random_friends( $user_id, $total_friends = 5 ) {
+		global $wpdb;
+
+		$bp      = buddypress();
+		$fids    = array();
+		$sql     = $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE (friend_user_id = %d || initiator_user_id = %d) && is_confirmed = 1 ORDER BY rand() LIMIT %d", $user_id, $user_id, $total_friends );
+		$results = $wpdb->get_results( $sql );
+
+		for ( $i = 0, $count = count( $results ); $i < $count; ++$i ) {
+			$fids[] = ( $results[$i]->friend_user_id == $user_id ) ? $results[$i]->initiator_user_id : $results[$i]->friend_user_id;
+		}
+
+		// remove duplicates
+		if ( count( $fids ) > 0 )
+			return array_flip( array_flip( $fids ) );
+		else
+			return false;
+	}
+
+	/**
+	 * Get a count of a user's friends who can be invited to a given group.
+	 *
+	 * Users can invite any of their friends except:
+	 *
+	 * - users who are already in the group
+	 * - users who have a pending invite to the group
+	 * - users who have been banned from the group
+	 *
+	 * @param int $user_id ID of the user whose friends are being counted.
+	 * @param int $group_id ID of the group friends are being invited to.
+	 * @return int $invitable_count Eligible friend count.
+	 */
+	public static function get_invitable_friend_count( $user_id, $group_id ) {
+
+		// Setup some data we'll use below
+		$is_group_admin  = BP_Groups_Member::check_is_admin( $user_id, $group_id );
+		$friend_ids      = BP_Friends_Friendship::get_friend_user_ids( $user_id );
+		$invitable_count = 0;
+
+		for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) {
+
+			// If already a member, they cannot be invited again
+			if ( BP_Groups_Member::check_is_member( (int) $friend_ids[$i], $group_id ) )
+				continue;
+
+			// If user already has invite, they cannot be added
+			if ( BP_Groups_Member::check_has_invite( (int) $friend_ids[$i], $group_id )  )
+				continue;
+
+			// If user is not group admin and friend is banned, they cannot be invited
+			if ( ( false === $is_group_admin ) && BP_Groups_Member::check_is_banned( (int) $friend_ids[$i], $group_id ) )
+				continue;
+
+			$invitable_count++;
+		}
+
+		return $invitable_count;
+	}
+
+	/**
+	 * Get the friend user IDs for a given friendship.
+	 *
+	 * @param int $friendship_id ID of the friendship.
+	 * @return object friend_user_id and initiator_user_id.
+	 */
+	public static function get_user_ids_for_friendship( $friendship_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_row( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE id = %d", $friendship_id ) );
+	}
+
+	/**
+	 * Delete all friendships and friend notifications related to a user.
+	 *
+	 * @param int $user_id ID of the user being expunged.
+	 */
+	public static function delete_all_for_user( $user_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// Get friends of $user_id
+		$friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );
+
+		// Delete all friendships related to $user_id
+		$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE friend_user_id = %d OR initiator_user_id = %d", $user_id, $user_id ) );
+
+		// Delete friend request notifications for members who have a
+		// notification from this user.
+		if ( bp_is_active( 'notifications' ) ) {
+			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->notifications->table_name} WHERE component_name = 'friends' AND ( component_action = 'friendship_request' OR component_action = 'friendship_accepted' ) AND item_id = %d", $user_id ) );
+		}
+
+		// Loop through friend_ids and update their counts
+		foreach ( (array) $friend_ids as $friend_id ) {
+			BP_Friends_Friendship::total_friend_count( $friend_id );
+		}
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-friends/js/widget-friends.js b/wp-content/plugins/buddypress/bp-friends/js/widget-friends.js
index 98e09126c349deffef15e997502e26f8f6722851..42bce563c05ac6958f9d4684b3934af8ec458b8c 100644
--- a/wp-content/plugins/buddypress/bp-friends/js/widget-friends.js
+++ b/wp-content/plugins/buddypress/bp-friends/js/widget-friends.js
@@ -17,7 +17,7 @@ jQuery(document).ready( function() {
 			function(response)
 			{
 				jQuery(link).removeClass('loading');
-				friend_wiget_response(response);
+				friend_widget_response(response);
 			});
 
 			return false;
@@ -25,7 +25,7 @@ jQuery(document).ready( function() {
 	);
 });
 
-function friend_wiget_response(response) {
+function friend_widget_response(response) {
 	response = response.substr(0, response.length-1);
 	response = response.split('[[SPLIT]]');
 
diff --git a/wp-content/plugins/buddypress/bp-friends/js/widget-friends.min.js b/wp-content/plugins/buddypress/bp-friends/js/widget-friends.min.js
index 6b5588ebb6872dc1bf1c43212c7f29dc7597685d..3cd5b73b755ad816d4d5a4a87d83e10d271e5d40 100644
--- a/wp-content/plugins/buddypress/bp-friends/js/widget-friends.min.js
+++ b/wp-content/plugins/buddypress/bp-friends/js/widget-friends.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-function friend_wiget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(a[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#friends-list").html(b),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#friends-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#friends-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),friend_wiget_response(b)}),!1})});
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+function friend_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#friends-list").fadeOut(200,function(){jQuery(".widget ul#friends-list").html(a[1]),jQuery(".widget ul#friends-list").fadeIn(200)}):jQuery(".widget ul#friends-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#friends-list").html(b),jQuery(".widget ul#friends-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#friends-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#friends-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_friends",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-friends").val(),"max-friends":jQuery("input#friends_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),friend_widget_response(b)}),!1})});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/admin/css/admin-rtl.min.css b/wp-content/plugins/buddypress/bp-groups/admin/css/admin-rtl.min.css
index b4fb43925dc7b3a1143e9e7186704af3370eb31a..519280b642a23cf8bcf77d1dc561a24692f76b85 100644
--- a/wp-content/plugins/buddypress/bp-groups/admin/css/admin-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-groups/admin/css/admin-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-body.toplevel_page_bp-groups table.groups th#members,body.toplevel_page_bp-groups table.groups th#status{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#bp-groups-form .avatar{float:right;margin-left:10px;margin-top:1px}#bp-groups-edit-form input{outline:0}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%;margin-bottom:6px}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}#bp-groups-new-members-list{margin:0}#bp_group_settings legend{margin:10px 0;font-weight:700}#bp_group_settings ul{margin:0}.bp-groups-settings-section{margin-top:10px}#bp-groups-permalink-box{line-height:24px;color:#666}.bp-groups-member-type{position:relative}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:left;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-right:15px}table.bp-group-members .uid-column{padding-right:20px;padding-left:20px}table.bp-group-members .uname-column{width:70%}table.bp-group-members .urole-column{padding-right:20px;padding-left:20px}
\ No newline at end of file
+body.toplevel_page_bp-groups table.groups th#members,body.toplevel_page_bp-groups table.groups th#status{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#bp-groups-form .avatar{float:right;margin-left:10px;margin-top:1px}#bp-groups-edit-form input{outline:0}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%;margin-bottom:6px}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}#bp-groups-new-members-list,#bp_group_settings ul{margin:0}#bp_group_settings legend{margin:10px 0;font-weight:700}.bp-groups-settings-section{margin-top:10px}#bp-groups-permalink-box{line-height:24px;color:#666}.bp-groups-member-type{position:relative}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:left;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-right:15px}table.bp-group-members .uid-column,table.bp-group-members .urole-column{padding-right:20px;padding-left:20px}table.bp-group-members .uname-column{width:70%}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css
index 66ec40d001d004c251098c830f57e1e4ba3ab8aa..3d1ab69dff4b7ac09166a8f2f93943a393bd2c30 100644
--- a/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css
+++ b/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-body.toplevel_page_bp-groups table.groups th#members,body.toplevel_page_bp-groups table.groups th#status{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#bp-groups-form .avatar{float:left;margin-right:10px;margin-top:1px}#bp-groups-edit-form input{outline:0}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%;margin-bottom:6px}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}#bp-groups-new-members-list{margin:0}#bp_group_settings legend{margin:10px 0;font-weight:700}#bp_group_settings ul{margin:0}.bp-groups-settings-section{margin-top:10px}#bp-groups-permalink-box{line-height:24px;color:#666}.bp-groups-member-type{position:relative}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:right;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-left:15px}table.bp-group-members .uid-column{padding-left:20px;padding-right:20px}table.bp-group-members .uname-column{width:70%}table.bp-group-members .urole-column{padding-left:20px;padding-right:20px}
\ No newline at end of file
+body.toplevel_page_bp-groups table.groups th#members,body.toplevel_page_bp-groups table.groups th#status{width:10%}body.toplevel_page_bp-groups table.groups th#last_active{width:15%}#bp-groups-form .avatar{float:left;margin-right:10px;margin-top:1px}#bp-groups-edit-form input{outline:0}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%;margin-bottom:6px}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}#bp-groups-new-members-list,#bp_group_settings ul{margin:0}#bp_group_settings legend{margin:10px 0;font-weight:700}.bp-groups-settings-section{margin-top:10px}#bp-groups-permalink-box{line-height:24px;color:#666}.bp-groups-member-type{position:relative}.bp-groups-member-type>h4{margin-bottom:.5em}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px}.bp-group-admin-pagination{position:absolute;text-align:right;width:100%}.bp-group-admin-pagination.table-top{top:0}.bp-group-admin-pagination.table-bottom{bottom:0}.bp-group-admin-pagination-viewing{color:#777;font-size:12px;font-style:italic}.bp-group-admin-pagination-links{white-space:nowrap;padding-left:15px}table.bp-group-members .uid-column,table.bp-group-members .urole-column{padding-left:20px;padding-right:20px}table.bp-group-members .uname-column{width:70%}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js
index c8d28f6d405d617e112edc1996baf828a8949329..6fc16b57d15b3138c5afe22df01b3784afb8ee3d 100644
--- a/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js
+++ b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 !function(a){function b(b,c){a("#bp-groups-new-members-list").append('<li data-login="'+c.item.value+'"><a href="#" class="bp-groups-remove-new-member">x</a> '+c.item.label+"</li>")}var c="undefined"!=typeof group_id?"&group_id="+group_id:"";a(document).ready(function(){window.warn_on_leave=!1,a(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+c,delay:500,minLength:2,position:"undefined"!=typeof isRtl&&isRtl?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){a(this).addClass("open")},close:function(){a(this).removeClass("open"),a(this).val("")},select:function(a,c){b(a,c)}}),a("#bp-groups-new-members").prop("placeholder",BP_Group_Admin.add_member_placeholder),a("#bp_group_add_members").on("click",".bp-groups-remove-new-member",function(b){b.preventDefault(),a(b.target.parentNode).remove()}),a(document).on("change",'input#bp-groups-name, input#bp-groups-description, select.bp-groups-role, #bp-groups-settings-section-status input[type="radio"]',function(){window.warn_on_leave=!0}),a("input#save").on("click",function(){var b=[];a("#bp-groups-new-members-list li").each(function(){b.push(a(this).data("login"))}),b.length&&a("#bp-groups-new-members").val("").val(b.join(", ")),window.warn_on_leave=!1}),window.onbeforeunload=function(){return window.warn_on_leave?BP_Group_Admin.warn_on_leave:void 0}})}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
index 163e4074527b83cb18886c90012b4c37db1e7326..8f46fcc7077c86c30096c09b7a02221e5b2d33dd 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Protect access to single groups.
@@ -34,7 +34,7 @@ function bp_groups_group_access_protection() {
 			$user_has_access = true;
 
 		// User doesn't have access, so set up redirect args
-		} else if ( is_user_logged_in() ) {
+		} elseif ( is_user_logged_in() ) {
 			$no_access_args = array(
 				'message'  => __( 'You do not have access to this group.', 'buddypress' ),
 				'root'     => bp_get_group_permalink( $current_group ) . 'home/',
@@ -95,7 +95,6 @@ add_action( 'bp_actions', 'bp_groups_group_access_protection' );
  * Catch and process group creation form submissions.
  */
 function groups_action_create_group() {
-	global $bp;
 
 	// If we're not at domain.org/groups/create/ then return false
 	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
@@ -106,9 +105,11 @@ function groups_action_create_group() {
 
  	if ( !bp_user_can_create_groups() ) {
 		bp_core_add_message( __( 'Sorry, you are not allowed to create groups.', 'buddypress' ), 'error' );
-		bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) );
+		bp_core_redirect( bp_get_groups_directory_permalink() );
 	}
 
+	$bp = buddypress();
+
 	// Make sure creation steps are in the right order
 	groups_action_sort_creation_steps();
 
@@ -123,13 +124,13 @@ function groups_action_create_group() {
 
 		$reset_steps = true;
 		$keys        = array_keys( $bp->groups->group_creation_steps );
-		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . array_shift( $keys ) . '/' );
+		bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . array_shift( $keys ) ) );
 	}
 
 	// 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' );
-		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/' );
+		bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create' ) );
 	}
 
 	// Fetch the currently completed steps variable
@@ -144,7 +145,7 @@ function groups_action_create_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' );
-			bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/' );
+			bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create' ) );
 		}
 	}
 
@@ -157,14 +158,14 @@ function groups_action_create_group() {
 		if ( 'group-details' == bp_get_groups_current_create_step() ) {
 			if ( empty( $_POST['group-name'] ) || empty( $_POST['group-desc'] ) || !strlen( trim( $_POST['group-name'] ) ) || !strlen( trim( $_POST['group-desc'] ) ) ) {
 				bp_core_add_message( __( 'Please fill in all of the required fields', 'buddypress' ), 'error' );
-				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
+				bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . bp_get_groups_current_create_step() ) );
 			}
 
 			$new_group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : 0;
 
 			if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) {
-				bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
-				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
+				bp_core_add_message( __( 'There was an error saving group details. Please try again.', 'buddypress' ), 'error' );
+				bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . bp_get_groups_current_create_step() ) );
 			}
 		}
 
@@ -183,16 +184,23 @@ function groups_action_create_group() {
 
 			if ( 'private' == $_POST['group-status'] )
 				$group_status = 'private';
-			else if ( 'hidden' == $_POST['group-status'] )
+			elseif ( 'hidden' == $_POST['group-status'] )
 				$group_status = 'hidden';
 
 			if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) {
-				bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
-				bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
+				bp_core_add_message( __( 'There was an error saving group details. Please try again.', 'buddypress' ), 'error' );
+				bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . bp_get_groups_current_create_step() ) );
 			}
 
-			// Set the invite status
-			// Checked against a whitelist for security
+			/**
+			 * Filters the allowed invite statuses.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param array $value Array of statuses allowed.
+			 *                     Possible values are 'members,
+			 *                     'mods', and 'admins'.
+			 */
 			$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
 			$invite_status	       = !empty( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
 
@@ -212,8 +220,24 @@ function groups_action_create_group() {
 			groups_send_invites( bp_loggedin_user_id(), $bp->groups->new_group_id );
 		}
 
+		/**
+		 * Fires before finalization of group creation and cookies are set.
+		 *
+		 * This hook is a variable hook dependent on the current step
+		 * in the creation process.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'groups_create_group_step_save_' . bp_get_groups_current_create_step() );
-		do_action( 'groups_create_group_step_complete' ); // Mostly for clearing cache on a generic action name
+
+		/**
+		 * Fires after the group creation step is completed.
+		 *
+		 * Mostly for clearing cache on a generic action name.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'groups_create_group_step_complete' );
 
 		/**
 		 * Once we have successfully saved the details for this step of the creation process
@@ -235,12 +259,22 @@ function groups_action_create_group() {
 			unset( $bp->groups->current_create_step );
 			unset( $bp->groups->completed_create_steps );
 
-			// Once we compelete all steps, record the group creation in the activity stream.
+			setcookie( 'bp_new_group_id', false, time() - 3600, COOKIEPATH );
+			setcookie( 'bp_completed_create_steps', false, time() - 3600, COOKIEPATH );
+
+			// Once we completed all steps, record the group creation in the activity stream.
 			groups_record_activity( array(
 				'type' => 'created_group',
 				'item_id' => $bp->groups->new_group_id
 			) );
 
+			/**
+			 * Fires after the group has been successfully created.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param int $new_group_id ID of the newly created group.
+			 */
 			do_action( 'groups_group_create_complete', $bp->groups->new_group_id );
 
 			bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
@@ -261,7 +295,7 @@ function groups_action_create_group() {
 				}
 			}
 
-			bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $next_step . '/' );
+			bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . $next_step ) );
 		}
 	}
 
@@ -280,7 +314,7 @@ function groups_action_create_group() {
 		}
 
 		bp_core_add_message( $message, $error );
-		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-invites/' );
+		bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/group-invites' ) );
 	}
 
 	// Group avatar is handled separately
@@ -312,6 +346,13 @@ function groups_action_create_group() {
 		}
 	}
 
+	/**
+	 * Filters the template to load for the group creation screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to the group creation template to load.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) );
 }
 add_action( 'bp_actions', 'groups_action_create_group' );
@@ -320,7 +361,6 @@ add_action( 'bp_actions', 'groups_action_create_group' );
  * Catch and process "Join Group" button clicks.
  */
 function groups_action_join_group() {
-	global $bp;
 
 	if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'join' ) )
 		return false;
@@ -329,6 +369,8 @@ function groups_action_join_group() {
 	if ( !check_admin_referer( 'groups_join_group' ) )
 		return false;
 
+	$bp = buddypress();
+
 	// 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 ) ) {
 
@@ -349,6 +391,13 @@ function groups_action_join_group() {
 		bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
 	}
 
+	/**
+	 * Filters the template to load for the single group screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to the single group template to load.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
 }
 add_action( 'bp_actions', 'groups_action_join_group' );
@@ -398,6 +447,7 @@ function groups_action_leave_group() {
 		bp_core_redirect( $redirect );
 	}
 
+	/** This filter is documented in bp-groups/bp-groups-actions.php */
 	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
 }
 add_action( 'bp_actions', 'groups_action_leave_group' );
@@ -405,14 +455,15 @@ add_action( 'bp_actions', 'groups_action_leave_group' );
 /**
  * Sort the group creation steps.
  *
- * @return bool|null False on failure.
+ * @return false|null False on failure.
  */
 function groups_action_sort_creation_steps() {
-	global $bp;
 
 	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
 		return false;
 
+	$bp = buddypress();
+
 	if ( !is_array( $bp->groups->group_creation_steps ) )
 		return false;
 
@@ -429,6 +480,13 @@ function groups_action_sort_creation_steps() {
 
 	foreach( (array) $temp as $position => $step )
 		$bp->groups->group_creation_steps[$step['slug']] = array( 'name' => $step['name'], 'position' => $position );
+
+	/**
+	 * Fires after group creation sets have been sorted.
+	 *
+	 * @since 2.3.0
+	 */
+	do_action( 'groups_action_sort_creation_steps' );
 }
 
 /**
@@ -439,7 +497,7 @@ function groups_action_redirect_to_random_group() {
 	if ( bp_is_groups_component() && isset( $_GET['random-group'] ) ) {
 		$group = BP_Groups_Group::get_random( 1, 1 );
 
-		bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group['groups'][0]->slug . '/' );
+		bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . $group['groups'][0]->slug ) );
 	}
 }
 add_action( 'bp_actions', 'groups_action_redirect_to_random_group' );
@@ -449,7 +507,7 @@ add_action( 'bp_actions', 'groups_action_redirect_to_random_group' );
  *
  * @since BuddyPress (1.2.0)
  *
- * @return bool|null False on failure.
+ * @return false|null False on failure.
  */
 function groups_action_group_feed() {
 
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
index 5d1a401a45e825c91aaf93458db623cb673ed40c..65efa6fd05c029e1d637dce160e21d19dfeb8d89 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Activity Functions
+ * BuddyPress Groups Activity Functions.
  *
  * These functions handle the recording, deleting and formatting of activity
  * for the user and for this specific component.
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register activity actions for the Groups component.
@@ -43,6 +43,15 @@ function groups_register_activity_actions() {
 		array( 'activity', 'group', 'member', 'member_groups' )
 	);
 
+	bp_activity_set_action(
+		$bp->groups->id,
+		'group_details_updated',
+		__( 'Group details edited', 'buddypress' ),
+		'bp_groups_format_activity_action_group_details_updated',
+		__( 'Group Updates', 'buddypress' ),
+		array( 'activity', 'group', 'member', 'member_groups' )
+	);
+
 	// 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
@@ -66,6 +75,11 @@ function groups_register_activity_actions() {
 		);
 	}
 
+	/**
+	 * Fires at end of registration of the default activity actions for the Groups component.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'groups_register_activity_actions' );
 }
 add_action( 'bp_register_activity_actions', 'groups_register_activity_actions' );
@@ -75,8 +89,9 @@ add_action( 'bp_register_activity_actions', 'groups_register_activity_actions' )
  *
  * @since BuddyPress (2.0.0)
  *
- * @param string $action Static activity action.
+ * @param string $action   Static activity action.
  * @param object $activity Activity data object.
+ *
  * @return string
  */
 function bp_groups_format_activity_action_created_group( $action, $activity ) {
@@ -90,6 +105,14 @@ function bp_groups_format_activity_action_created_group( $action, $activity ) {
 
 	$action = sprintf( __( '%1$s created the group %2$s', 'buddypress'), $user_link, $group_link );
 
+	/**
+	 * Filters the 'created_group' activity actions.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $action   The 'created_group' activity action.
+	 * @param object $activity Activity data object.
+	 */
 	return apply_filters( 'groups_activity_created_group_action', $action, $activity );
 }
 
@@ -98,8 +121,9 @@ function bp_groups_format_activity_action_created_group( $action, $activity ) {
  *
  * @since BuddyPress (2.0.0)
  *
- * @param string $action Static activity action.
+ * @param string $action   Static activity action.
  * @param object $activity Activity data object.
+ *
  * @return string
  */
 function bp_groups_format_activity_action_joined_group( $action, $activity ) {
@@ -124,6 +148,68 @@ function bp_groups_format_activity_action_joined_group( $action, $activity ) {
 		$action = apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( $action, $activity->user_id, &$group ) );
 	}
 
+	/**
+	 * Filters the 'joined_group' activity actions.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   The 'joined_group' activity actions.
+	 * @param object $activity Activity data object.
+	 */
+	return apply_filters( 'bp_groups_format_activity_action_joined_group', $action, $activity );
+}
+
+/**
+ * Format 'group_details_updated' activity actions.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  string $action   Static activity action.
+ * @param  object $activity Activity data object.
+ *
+ * @return string
+ */
+function bp_groups_format_activity_action_group_details_updated( $action, $activity ) {
+	$user_link = bp_core_get_userlink( $activity->user_id );
+
+	$group = groups_get_group( array(
+		'group_id'        => $activity->item_id,
+		'populate_extras' => false,
+	) );
+	$group_link = '<a href="' . esc_url( bp_get_group_permalink( $group ) ) . '">' . esc_html( $group->name ) . '</a>';
+
+	/*
+	 * Changed group details are stored in groupmeta, keyed by the activity
+	 * timestamp. See {@link bp_groups_group_details_updated_add_activity()}.
+	 */
+	$changed = groups_get_groupmeta( $activity->item_id, 'updated_details_' . $activity->date_recorded );
+
+	// No changed details were found, so use a generic message.
+	if ( empty( $changed ) ) {
+		$action = sprintf( __( '%1$s updated details for the group %2$s', 'buddypress' ), $user_link, $group_link );
+
+	// Name and description changed - to keep things short, don't describe changes in detail.
+	} elseif ( isset( $changed['name'] ) && isset( $changed['description'] ) ) {
+		$action = sprintf( __( '%1$s changed the name and description of the group %2$s', 'buddypress' ), $user_link, $group_link );
+
+	// Name only.
+	} elseif ( ! empty( $changed['name']['old'] ) && ! empty( $changed['name']['new'] ) ) {
+		$action = sprintf( __( '%1$s changed the name of the group %2$s from "%3$s" to "%4$s"', 'buddypress' ), $user_link, $group_link, esc_html( $changed['name']['old'] ), esc_html( $changed['name']['new'] ) );
+
+	// Description only.
+	} elseif ( ! empty( $changed['description']['old'] ) && ! empty( $changed['description']['new'] ) ) {
+		$action = sprintf( __( '%1$s changed the description of the group %2$s from "%3$s" to "%4$s"', 'buddypress' ), $user_link, $group_link, esc_html( $changed['description']['old'] ), esc_html( $changed['description']['new'] ) );
+
+	}
+
+	/**
+	 * Filters the 'group_details_updated' activity actions.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   The 'group_details_updated' activity actions.
+	 * @param object $activity Activity data object.
+	 */
 	return apply_filters( 'bp_groups_format_activity_action_joined_group', $action, $activity );
 }
 
@@ -135,6 +221,7 @@ function bp_groups_format_activity_action_joined_group( $action, $activity ) {
  * @since BuddyPress (2.0.0)
  *
  * @param array $activities Array of activity items.
+ *
  * @return array
  */
 function bp_groups_prefetch_activity_object_data( $activities ) {
@@ -179,6 +266,69 @@ function bp_groups_prefetch_activity_object_data( $activities ) {
 }
 add_filter( 'bp_activity_prefetch_object_data', 'bp_groups_prefetch_activity_object_data' );
 
+/**
+ * Set up activity arguments for use with the 'groups' scope.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param array $retval Empty array by default
+ * @param array $filter Current activity arguments
+ *
+ * @return array
+ */
+function bp_groups_filter_activity_scope( $retval = array(), $filter = array() ) {
+
+	// Determine the user_id
+	if ( ! empty( $filter['user_id'] ) ) {
+		$user_id = $filter['user_id'];
+	} else {
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+	}
+
+	// Determine groups of user
+	$groups = groups_get_user_groups( $user_id );
+	if ( empty( $groups['groups'] ) ) {
+		$groups = array( 'groups' => 0 );
+	}
+
+	// Should we show all items regardless of sitewide visibility?
+	$show_hidden = array();
+	if ( ! empty( $user_id ) && ( $user_id !== bp_loggedin_user_id() ) ) {
+		$show_hidden = array(
+			'column' => 'hide_sitewide',
+			'value'  => 0
+		);
+	}
+
+	$retval = array(
+		'relation' => 'AND',
+		array(
+			'relation' => 'AND',
+			array(
+				'column' => 'component',
+				'value'  => buddypress()->groups->id
+			),
+			array(
+				'column'  => 'item_id',
+				'compare' => 'IN',
+				'value'   => (array) $groups['groups']
+			),
+		),
+		$show_hidden,
+
+		// overrides
+		'override' => array(
+			'filter'      => array( 'user_id' => 0 ),
+			'show_hidden' => true
+		),
+	);
+
+	return $retval;
+}
+add_filter( 'bp_activity_set_groups_scope_args', 'bp_groups_filter_activity_scope', 10, 2 );
+
 /**
  * Record an activity item related to the Groups component.
  *
@@ -188,14 +338,14 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_groups_prefetch_activity_obj
  * @see bp_activity_add() for more detailed description of parameters and
  *      return values.
  *
- * @param array $args {
+ * @param array|string $args {
  *     An array of arguments for the new activity item. Accepts all parameters
  *     of {@link bp_activity_add()}. However, this wrapper provides some
  *     additional defaults, as described below:
- *     @type string $component Default: the id of your Groups component
- *           (usually 'groups').
- *     @type bool $hide_sitewide Default: True if the current group is not
- *           public, otherwise false.
+ *     @type string $component     Default: the id of your Groups component
+ *                                 (usually 'groups').
+ *     @type bool   $hide_sitewide Default: True if the current group is not
+ *                                 public, otherwise false.
  * }
  * @return bool See {@link bp_activity_add()}.
  */
@@ -240,7 +390,8 @@ function groups_record_activity( $args = '' ) {
  * Update the last_activity meta value for a given group.
  *
  * @param int $group_id Optional. The ID of the group whose last_activity is
- *        being updated. Default: the current group's ID.
+ *                      being updated. Default: the current group's ID.
+ *
  * @return bool|null False on failure.
  */
 function groups_update_last_activity( $group_id = 0 ) {
@@ -255,18 +406,20 @@ function groups_update_last_activity( $group_id = 0 ) {
 
 	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
 }
+add_action( 'groups_join_group',           'groups_update_last_activity' );
 add_action( 'groups_leave_group',          'groups_update_last_activity' );
 add_action( 'groups_created_group',        'groups_update_last_activity' );
 add_action( 'groups_new_forum_topic',      'groups_update_last_activity' );
 add_action( 'groups_new_forum_topic_post', 'groups_update_last_activity' );
 
 /**
- * Add an activity stream item when a member joins a group
+ * Add an activity stream item when a member joins a group.
  *
  * @since BuddyPress (1.9.0)
  *
- * @param int $user_id ID of the user joining the group.
+ * @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 ) {
@@ -279,9 +432,20 @@ function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) {
 	// Get the group so we can get it's name
 	$group = groups_get_group( array( 'group_id' => $group_id ) );
 
+	/**
+	 * Filters the 'membership_accepted' activity actions.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value    The 'membership_accepted' activity action.
+	 * @param int    $user_id  ID of the user joining the group.
+	 * @param int    $group_id ID of the group. Passed by reference.
+	 */
+	$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
 	groups_record_activity( array(
-		'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 ) ),
+		'action'  => $action,
 		'type'    => 'joined_group',
 		'item_id' => $group_id,
 		'user_id' => $user_id
@@ -289,6 +453,79 @@ function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) {
 }
 add_action( 'groups_membership_accepted', 'bp_groups_membership_accepted_add_activity', 10, 2 );
 
+/**
+ * Add an activity item when a group's details are updated.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param  int             $group_id       ID of the group.
+ * @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.
+ */
+function bp_groups_group_details_updated_add_activity( $group_id, $old_group, $notify_members ) {
+
+	// Bail if Activity is not active.
+	if ( ! bp_is_active( 'activity' ) ) {
+		return false;
+	}
+
+	if ( ! isset( $old_group->name ) || ! isset( $old_group->description ) ) {
+		return false;
+	}
+
+	// If the admin has opted not to notify members, don't post an activity item either
+	if ( empty( $notify_members ) ) {
+		return;
+	}
+
+	$group = groups_get_group( array(
+		'group_id' => $group_id,
+	) );
+
+	/*
+	 * Store the changed data, which will be used to generate the activity
+	 * action. Since we haven't yet created the activity item, we store the
+	 * old group data in groupmeta, keyed by the timestamp that we'll put
+	 * on the activity item.
+	 */
+	$changed = array();
+
+	if ( $group->name !== $old_group->name ) {
+		$changed['name'] = array(
+			'old' => $old_group->name,
+			'new' => $group->name,
+		);
+	}
+
+	if ( $group->description !== $old_group->description ) {
+		$changed['description'] = array(
+			'old' => $old_group->description,
+			'new' => $group->description,
+		);
+	}
+
+	// If there are no changes, don't post an activity item.
+	if ( empty( $changed ) ) {
+		return;
+	}
+
+	$time = bp_core_current_time();
+	groups_update_groupmeta( $group_id, 'updated_details_' . $time, $changed );
+
+	// Record in activity streams.
+	return groups_record_activity( array(
+		'type'          => 'group_details_updated',
+		'item_id'       => $group_id,
+		'user_id'       => bp_loggedin_user_id(),
+		'recorded_time' => $time,
+
+	) );
+
+}
+add_action( 'groups_details_updated', 'bp_groups_group_details_updated_add_activity', 10, 3 );
+
 /**
  * Delete all activity items related to a specific group.
  *
@@ -316,7 +553,7 @@ add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_activity',
  * @since BuddyPress (1.9.0)
  *
  * @param int $group_id ID of the group.
- * @param int $user_id ID of the user leaving the group.
+ * @param int $user_id  ID of the user leaving the group.
  */
 function bp_groups_leave_group_delete_recent_activity( $group_id, $user_id ) {
 
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php
index ffcbf94d2fd0cbd4c213365df0e3661abbeb465b..19b88d887836eb1c6fc6288a3920f5ab4a0fbe3b 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * BuddyPress Groups component admin screen
+ * BuddyPress Groups component admin screen.
  *
  * Props to WordPress core for the Comments admin screen, and its contextual
  * help text, on which this implementation is heavily based.
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 // Include WP's list table class
 if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
@@ -51,6 +51,7 @@ add_action( bp_core_admin_hook(), 'bp_groups_add_admin_menu' );
  * @since BuddyPress (1.7.0)
  *
  * @param array $custom_menus Array of BP top-level menu items.
+ *
  * @return array Menu item array, with Groups added.
  */
 function bp_groups_admin_menu_order( $custom_menus = array() ) {
@@ -81,7 +82,13 @@ function bp_groups_admin_load() {
 
 	$doaction = bp_admin_list_table_current_bulk_action();
 
-	// Call an action for plugins to hook in early
+	/**
+	 * Fires at top of groups admin page.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $doaction Current $_GET action being performed in admin screen.
+	 */
 	do_action( 'bp_groups_admin_load', $doaction );
 
 	// Edit screen
@@ -102,7 +109,7 @@ function bp_groups_admin_load() {
 
 		bp_core_redirect( $redirect_to );
 
-	} else if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
+	} elseif ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {
 		// columns screen option
 		add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) );
 
@@ -117,7 +124,7 @@ function bp_groups_admin_load() {
 		// Help panel - sidebar links
 		get_current_screen()->set_help_sidebar(
 			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
-			'<p><a href="http://buddypress.org/support">' . __( 'Support Forums', 'buddypress' ) . '</a></p>'
+			'<p><a href="https://buddypress.org/support">' . __( 'Support Forums', 'buddypress' ) . '</a></p>'
 		);
 
 		// Register metaboxes for the edit screen.
@@ -126,9 +133,14 @@ function bp_groups_admin_load() {
 		add_meta_box( 'bp_group_add_members', _x( 'Add New Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_add_new_members', get_current_screen()->id, 'normal', 'core' );
 		add_meta_box( 'bp_group_members', _x( 'Manage Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_members', get_current_screen()->id, 'normal', 'core' );
 
+		/**
+		 * Fires after the registration of all of the default group meta boxes.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 */
 		do_action( 'bp_groups_admin_meta_boxes' );
 
-		// Enqueue javascripts
+		// Enqueue JavaScript files
 		wp_enqueue_script( 'postbox' );
 		wp_enqueue_script( 'dashboard' );
 
@@ -160,7 +172,7 @@ function bp_groups_admin_load() {
 		// Help panel - sidebar links
 		get_current_screen()->set_help_sidebar(
 			'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
-			'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+			'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 		);
 	}
 
@@ -211,16 +223,37 @@ function bp_groups_admin_load() {
 		// 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!
+			if ( empty( $_POST['bp-groups-name'] ) && empty( $_POST['bp-groups-description'] ) ) {
+				$error = -3;
+			} elseif ( empty( $_POST['bp-groups-name'] ) ) {
+				$error = -1;
+			} elseif ( empty( $_POST['bp-groups-description'] ) ) {
+				$error = -2;
+			}
 		}
 
 		// Enable discussion forum
 		$enable_forum   = ( isset( $_POST['group-show-forum'] ) ) ? 1 : 0;
 
-		// Privacy setting
+		/**
+		 * Filters the allowed status values for the group.
+		 *
+		 * @since BuddyPress (1.0.2)
+		 *
+		 * @param array $value Array of allowed group statuses.
+		 */
 		$allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
 		$status         = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
 
-		// Invite status
+		/**
+		 * Filters the allowed invite status values for the group.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param array $value Array of allowed invite statuses.
+		 */
 		$allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
 		$invite_status	       = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
 
@@ -308,7 +341,7 @@ function bp_groups_admin_load() {
 
 								if ( 'admin' == $existing_role || 'mod' == $existing_role ) {
 									$result = groups_demote_member( $user_id, $group_id );
-								} else if ( 'banned' == $existing_role ) {
+								} elseif ( 'banned' == $existing_role ) {
 									$result = groups_unban_member( $user_id, $group_id );
 								}
 
@@ -338,7 +371,13 @@ function bp_groups_admin_load() {
 			}
 		}
 
-		// Call actions for plugins to do something before we redirect
+		/**
+		 * Fires before redirect so plugins can do something first on save action.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param int $group_id ID of the group being edited.
+		 */
 		do_action( 'bp_group_admin_edit_after', $group_id );
 
 		// Create the redirect URL
@@ -371,7 +410,13 @@ function bp_groups_admin_load() {
 			$redirect_to = add_query_arg( 'error_modified', $error_modified, $redirect_to );
 		}
 
-		// Redirect
+		/**
+		 * Filters the URL to redirect to after successfully editing a group.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $redirect_to URL to redirect user to.
+		 */
 		wp_redirect( apply_filters( 'bp_group_admin_edit_redirect', $redirect_to ) );
 		exit;
 
@@ -388,9 +433,10 @@ function bp_groups_admin_load() {
  *
  * @since BuddyPress (1.7.0)
  *
- * @param string $value Will always be false unless another plugin filters it first.
- * @param string $option Screen option name.
+ * @param string $value     Will always be false unless another plugin filters it first.
+ * @param string $option    Screen option name.
  * @param string $new_value Screen option form value.
+ *
  * @return string Option value. False to abandon update.
  */
 function bp_groups_admin_screen_options( $value, $option, $new_value ) {
@@ -406,7 +452,7 @@ function bp_groups_admin_screen_options( $value, $option, $new_value ) {
 }
 
 /**
- * Select the appropirate Groups admin screen, and output it.
+ * Select the appropriate Groups admin screen, and output it.
  *
  * @since BuddyPress (1.7.0)
  */
@@ -419,7 +465,7 @@ function bp_groups_admin() {
 		bp_groups_admin_edit();
 
 	// Display the group deletion confirmation screen
-	} else if ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {
+	} elseif ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {
 		bp_groups_admin_delete();
 
 	// Otherwise, display the groups index screen
@@ -455,8 +501,25 @@ function bp_groups_admin_edit() {
 		}
 
 		if ( ! empty( $errors ) ) {
-			$messages[] = __( 'An error occurred when trying to update your group details.', 'buddypress' );
-		} else if ( ! empty( $updated ) ) {
+			switch ( $errors ) {
+				case -1 :
+					$messages[] = __( 'Group name cannot be empty.', 'buddypress' );
+					break;
+
+				case -2 :
+					$messages[] = __( 'Group description cannot be empty.', 'buddypress' );
+					break;
+
+				case -3 :
+					$messages[] = __( 'Group name and description cannot be empty.', 'buddypress' );
+					break;
+
+				default :
+					$messages[] = __( 'An error occurred when trying to update your group details.', 'buddypress' );
+					break;
+			}
+
+		} elseif ( ! empty( $updated ) ) {
 			$messages[] = __( 'The group has been updated successfully.', 'buddypress' );
 		}
 
@@ -483,13 +546,23 @@ function bp_groups_admin_edit() {
 
 	// Get the group from the database
 	$group      = groups_get_group( 'group_id=' . $_GET['gid'] );
+
+	/** This filter is documented in bp-groups/bp-groups-template.php */
 	$group_name = isset( $group->name ) ? apply_filters( 'bp_get_group_name', $group->name ) : '';
 
 	// 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 );
 
-	// Call an action for plugins to modify the group before we display the edit form
+	/**
+	 * Fires before the display of the edit form.
+	 *
+	 * Useful for plugins to modify the group before display.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param BP_Groups_Group $this Instance of the current group being edited. Passed by reference.
+	 */
 	do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?>
 
 	<div class="wrap">
@@ -497,7 +570,7 @@ function bp_groups_admin_edit() {
 		<h2><?php _e( 'Edit Group', 'buddypress' ); ?>
 
 			<?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
-				<a class="add-new-h2" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
+				<a class="add-new-h2" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
 			<?php endif; ?>
 
 		</h2>
@@ -509,7 +582,7 @@ function bp_groups_admin_edit() {
 
 		<?php if ( ! empty( $group ) ) : ?>
 
-			<form action="<?php echo esc_attr( $form_url ); ?>" id="bp-groups-edit-form" method="post">
+			<form action="<?php echo esc_url( $form_url ); ?>" id="bp-groups-edit-form" method="post">
 				<div id="poststuff">
 
 					<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
@@ -601,7 +674,7 @@ function bp_groups_admin_delete() {
 
 		<p><strong><?php _e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
 
-		<a class="button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'gid' => implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ?>"><?php _e( 'Delete Permanently', 'buddypress' ) ?></a>
+		<a class="button-primary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'gid' => implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ); ?>"><?php _e( 'Delete Permanently', 'buddypress' ) ?></a>
 		<a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php _e( 'Cancel', 'buddypress' ) ?></a>
 	</div>
 
@@ -615,7 +688,7 @@ function bp_groups_admin_delete() {
  *
  * @since BuddyPress (1.7.0)
  *
- * @global BP_Group_List_Table $bp_groups_list_table Group screen list table.
+ * @global BP_Groups_List_Table $bp_groups_list_table Group screen list table.
  * @global string $plugin_page Currently viewed plugin page.
  */
 function bp_groups_admin_index() {
@@ -635,7 +708,15 @@ function bp_groups_admin_index() {
 	// Prepare the group items for display
 	$bp_groups_list_table->prepare_items();
 
-	// Call an action for plugins to modify the messages before we display the edit form
+	/**
+	 * Fires before the display of messages for the edit form.
+	 *
+	 * Useful for plugins to modify the messages before display.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param array $messages Array of messages to be displayed.
+	 */
 	do_action( 'bp_groups_admin_index', $messages ); ?>
 
 	<div class="wrap">
@@ -644,7 +725,7 @@ function bp_groups_admin_index() {
 			<?php _e( 'Groups', 'buddypress' ); ?>
 
 			<?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
-				<a class="add-new-h2" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
+				<a class="add-new-h2" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
 			<?php endif; ?>
 
 			<?php if ( !empty( $_REQUEST['s'] ) ) : ?>
@@ -733,14 +814,13 @@ function bp_groups_admin_edit_metabox_add_new_members( $item ) {
  *
  * @since BuddyPress (1.7.0)
  *
- * @param BP_Groups_Group $item The BP_Groups_Group object for the current
- *        group.
+ * @param BP_Groups_Group $item The BP_Groups_Group object for the current group.
  */
 function bp_groups_admin_edit_metabox_members( $item ) {
 
 	// 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(),
 		'mod'    => array(),
@@ -770,7 +850,7 @@ function bp_groups_admin_edit_metabox_members( $item ) {
 		$pagination[ $type ] = bp_groups_admin_create_pagination_links( $member_type_query, $type );
 	}
 
-	// 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
@@ -849,7 +929,17 @@ function bp_groups_admin_edit_metabox_members( $item ) {
 					<?php if ( has_filter( 'bp_groups_admin_manage_member_row' ) ) : ?>
 						<tr>
 							<td colspan="3">
-								<?php do_action( 'bp_groups_admin_manage_member_row', $type_user->ID, $item ); ?>
+								<?php
+
+								/**
+								 * Fires after the listing of a single row for members in a group on the group edit screen.
+								 *
+								 * @since BuddyPress (1.8.0)
+								 *
+								 * @param int             $ID   ID of the user being rendered.
+								 * @param BP_Groups_Group $item Object for the current group.
+								 */
+								do_action( 'bp_groups_admin_manage_member_row', $type_user->ID, $item ); ?>
 							</td>
 						</tr>
 					<?php endif; ?>
@@ -890,7 +980,7 @@ function bp_groups_admin_edit_metabox_status( $item ) {
 	<div id="submitcomment" class="submitbox">
 		<div id="major-publishing-actions">
 			<div id="delete-action">
-				<a class="submitdelete deletion" href="<?php echo wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-groups-delete' ) ?>"><?php _e( 'Delete Group', 'buddypress' ) ?></a>
+				<a class="submitdelete deletion" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-groups-delete' ) ); ?>"><?php _e( 'Delete Group', 'buddypress' ) ?></a>
 			</div>
 
 			<div id="publishing-action">
@@ -914,8 +1004,9 @@ function bp_groups_admin_edit_metabox_status( $item ) {
  *
  * @since BuddyPress (1.8.0)
  *
- * @param BP_Group_Member_Query $query A BP_Group_Member_Query object.
- * @param string $member_type member|mod|admin|banned.
+ * @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.
  */
 function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query, $member_type ) {
@@ -949,12 +1040,16 @@ function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query,
 		'current'   => $page,
 	) );
 
-	$viewing_text = sprintf(
-		_n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $query->total_users, 'buddypress' ),
-		number_format_i18n( $current_page_start ),
-		number_format_i18n( $current_page_end ),
-		(int) $query->total_users
-	);
+	if ( 1 == $query->total_users ) {
+		$viewing_text = __( 'Viewing 1 member', 'buddypress' );
+	} else {
+		$viewing_text = sprintf(
+			_n( 'Viewing %1$s - %2$s of %3$s member', 'Viewing %1$s - %2$s of %3$s members', $query->total_users, 'buddypress' ),
+			bp_core_number_format( $current_page_start ),
+			bp_core_number_format( $current_page_end ),
+			bp_core_number_format( $query->total_users )
+		);
+	}
 
 	$pagination .= '<span class="bp-group-admin-pagination-viewing">' . $viewing_text . '</span>';
 	$pagination .= '<span class="bp-group-admin-pagination-links">' . $pag_links . '</span>';
@@ -968,6 +1063,7 @@ function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query,
  * @since BuddyPress (1.7.0)
  *
  * @param array $user_ids Array of user IDs.
+ *
  * @return array Array of user_logins corresponding to $user_ids.
  */
 function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) {
@@ -1038,6 +1134,7 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 * e.g. "All", "Pending", "Approved", "Spam"...
 	 *
 	 * @since BuddyPress (1.7.0)
+	 *
 	 * @access public
 	 * @var string
 	 */
@@ -1047,11 +1144,20 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 * Group counts for each group type.
 	 *
 	 * @since BuddyPress (1.7.0)
+	 *
 	 * @access public
 	 * @var int
 	 */
 	public $group_counts = 0;
 
+	/**
+	 * Multidimensional array of group visibility types and their groups.
+	 *
+	 * @link https://buddypress.trac.wordpress.org/ticket/6277
+	 * @var array
+	 */
+	public $group_type_ids = array();
+
 	/**
 	 * Constructor
 	 *
@@ -1143,7 +1249,7 @@ class BP_Groups_List_Table extends WP_List_Table {
 			$this->group_counts[ $group_type ] = count( $group_ids );
 		}
 
-		// If we're viewing a specific group, flatten all activites into a single array.
+		// If we're viewing a specific group, flatten all activities into a single array.
 		if ( $include_id ) {
 			$groups = array( (array) groups_get_group( 'group_id=' . $include_id ) );
 		} else {
@@ -1236,7 +1342,7 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
-	 * @param object $item The current group item in the loop.
+	 * @param object|array $item The current group item in the loop.
 	 */
 	public function single_row( $item = array() ) {
 		static $even = false;
@@ -1249,6 +1355,14 @@ class BP_Groups_List_Table extends WP_List_Table {
 			$row_classes = array( 'alternate', 'odd' );
 		}
 
+		/**
+		 * Filters the classes applied to a single row in the groups list table.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param array  $row_classes Array of classes to apply to the row.
+		 * @param string $value       ID of the current group being displayed.
+		 */
 		$row_classes = apply_filters( 'bp_groups_admin_row_class', $row_classes, $item['id'] );
 		$row_class = ' class="' . implode( ' ', $row_classes ) . '"';
 
@@ -1268,12 +1382,22 @@ class BP_Groups_List_Table extends WP_List_Table {
 		$url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?>
 
 		<ul class="subsubsub">
-			<li class="all"><a href="<?php echo esc_attr( esc_url( $url_base ) ); ?>" class="<?php if ( 'all' == $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
-			<li class="public"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'public', $url_base ) ) ); ?>" class="<?php if ( 'public' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Public <span class="count">(%s)</span>', 'Public <span class="count">(%s)</span>', $this->group_counts['public'], 'buddypress' ), number_format_i18n( $this->group_counts['public'] ) ); ?></a> |</li>
-			<li class="private"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'private', $url_base ) ) ); ?>" class="<?php if ( 'private' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', $this->group_counts['private'], 'buddypress' ), number_format_i18n( $this->group_counts['private'] ) ); ?></a> |</li>
-			<li class="hidden"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'hidden', $url_base ) ) ); ?>" class="<?php if ( 'hidden' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Hidden <span class="count">(%s)</span>', 'Hidden <span class="count">(%s)</span>', $this->group_counts['hidden'], 'buddypress' ), number_format_i18n( $this->group_counts['hidden'] ) ); ?></a></li>
-
-			<?php do_action( 'bp_groups_list_table_get_views', $url_base, $this->view ); ?>
+			<li class="all"><a href="<?php echo esc_url( $url_base ); ?>" class="<?php if ( 'all' == $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li>
+			<li class="public"><a href="<?php echo esc_url( add_query_arg( 'group_status', 'public', $url_base ) ); ?>" class="<?php if ( 'public' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Public <span class="count">(%s)</span>', 'Public <span class="count">(%s)</span>', $this->group_counts['public'], 'buddypress' ), number_format_i18n( $this->group_counts['public'] ) ); ?></a> |</li>
+			<li class="private"><a href="<?php echo esc_url( add_query_arg( 'group_status', 'private', $url_base ) ); ?>" class="<?php if ( 'private' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', $this->group_counts['private'], 'buddypress' ), number_format_i18n( $this->group_counts['private'] ) ); ?></a> |</li>
+			<li class="hidden"><a href="<?php echo esc_url( add_query_arg( 'group_status', 'hidden', $url_base ) ); ?>" class="<?php if ( 'hidden' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Hidden <span class="count">(%s)</span>', 'Hidden <span class="count">(%s)</span>', $this->group_counts['hidden'], 'buddypress' ), number_format_i18n( $this->group_counts['hidden'] ) ); ?></a></li>
+
+			<?php
+
+			/**
+			 * Fires inside listing of views so plugins can add their own.
+			 *
+			 * @since BuddyPress (1.7.0)
+			 *
+			 * @param string $url_base Current URL base for view.
+			 * @param string $view     Current view being displayed.
+			 */
+			do_action( 'bp_groups_list_table_get_views', $url_base, $this->view ); ?>
 		</ul>
 	<?php
 	}
@@ -1286,6 +1410,14 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 * @return array Key/value pairs for the bulk actions dropdown.
 	 */
 	public function get_bulk_actions() {
+
+		/**
+		 * Filters the list of bulk actions to display on a single group row.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array $value Array of bulk actions to display.
+		 */
 		return apply_filters( 'bp_groups_list_table_get_bulk_actions', array(
 			'delete' => __( 'Delete', 'buddypress' )
 		) );
@@ -1301,6 +1433,14 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 * @return array Array of column titles.
 	 */
 	public function get_columns() {
+
+		/**
+		 * Filters the titles for the columns for the groups list table.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $value Array of slugs and titles for the columns.
+		 */
 		return apply_filters( 'bp_groups_list_table_get_columns', array(
 			'cb'          => '<input name type="checkbox" />',
 			'comment'     => _x( 'Name', 'Groups admin Group Name column header',               'buddypress' ),
@@ -1312,7 +1452,7 @@ class BP_Groups_List_Table extends WP_List_Table {
 	}
 
 	/**
-	 * Get the column names for sortable columns
+	 * Get the column names for sortable columns.
 	 *
 	 * Note: It's not documented in WP, but the second item in the
 	 * nested arrays below is $desc_first. Normally, we would set
@@ -1390,6 +1530,15 @@ class BP_Groups_List_Table extends WP_List_Table {
 		$delete_url = wp_nonce_url( $base_url . "&amp;action=delete", 'bp-groups-delete' );
 		$edit_url   = $base_url . '&amp;action=edit';
 		$view_url   = bp_get_group_permalink( $item_obj );
+
+		/**
+		 * Filters the group name for a group's column content.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $value Name of the group being rendered.
+		 * @param array  $item  Array for the current group item.
+		 */
 		$group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'] ), $item );
 
 		// Rollover actions
@@ -1403,7 +1552,14 @@ class BP_Groups_List_Table extends WP_List_Table {
 		// Visit
 		$actions['view']   = sprintf( '<a href="%s">%s</a>', esc_url( $view_url   ), __( 'View',   'buddypress' ) );
 
-		// Other plugins can filter which actions are shown
+		/**
+		 * Filters the actions that will be shown for the column content.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array $value Array of actions to be displayed for the column content.
+		 * @param array $item  The current group item in the loop.
+		 */
 		$actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item );
 
 		// Get group name and avatar
@@ -1432,9 +1588,18 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
-	 * @param array Information about the current row.
+	 * @param array $item Information about the current row.
 	 */
 	public function column_description( $item = array() ) {
+
+		/**
+		 * Filters the markup for the Description column.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Markup for the Description column.
+		 * @param array  $item  The current group item in the loop.
+		 */
 		echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) );
 	}
 
@@ -1443,7 +1608,7 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
-	 * @param array Information about the current row.
+	 * @param array $item Information about the current row.
 	 */
 	public function column_status( $item = array() ) {
 		$status      = $item['status'];
@@ -1463,6 +1628,14 @@ class BP_Groups_List_Table extends WP_List_Table {
 				break;
 		}
 
+		/**
+		 * Filters the markup for the Status column.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $status_desc Markup for the Status column.
+		 * @parma array  $item        The current group item in the loop.
+		 */
 		echo apply_filters_ref_array( 'bp_groups_admin_get_group_status', array( $status_desc, $item ) );
 	}
 
@@ -1471,10 +1644,19 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
-	 * @param array Information about the current row.
+	 * @param array $item Information about the current row.
 	 */
 	public function column_members( $item = array() ) {
 		$count = groups_get_groupmeta( $item['id'], 'total_member_count' );
+
+		/**
+		 * Filters the markup for the number of Members column.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param int   $count Markup for the number of Members column.
+		 * @parma array $item  The current group item in the loop.
+		 */
 		echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) );
 	}
 
@@ -1483,22 +1665,43 @@ class BP_Groups_List_Table extends WP_List_Table {
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
-	 * @param array Information about the current row.
+	 * @param array $item Information about the current row.
 	 */
 	public function column_last_active( $item = array() ) {
 		$last_active = groups_get_groupmeta( $item['id'], 'last_activity' );
+
+		/**
+		 * Filters the markup for the Last Active column.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $last_active Markup for the Last Active column.
+		 * @parma array  $item        The current group item in the loop.
+		 */
 		echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
 	}
 
 	/**
-	 * Allow plugins to add their costum column.
+	 * Allow plugins to add their custom column.
+	 *
+	 * @since BuddyPress (2.0.0)
 	 *
-	 * @since BuddyPress 2.0.0
+	 * @param array  $item        Information about the current row.
+	 * @param string $column_name The column name.
 	 *
-	 * @param array Information about the current row.
-	 * @param string the column name.
+	 * @return string
 	 */
 	public function column_default( $item = array(), $column_name = '' ) {
+
+		/**
+		 * Filters a string to allow plugins to add custom column content.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $value       Empty string.
+		 * @param string $column_name Name of the column being rendered.
+		 * @param array  $item        The current group item in the loop.
+		 */
 		return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item );
 	}
 }
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
index 33e7679a9be3713e60768bf227e3753bd178d631..8a307e01d792634bda110a8970487e593d734f42 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Toolbar
+ * BuddyPress Groups Toolbar.
  *
  * Handles the groups functions related to the WordPress Toolbar.
  *
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Add the Group Admin top-level menu when viewing group pages.
@@ -19,19 +19,22 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @todo Add dynamic menu items for group extensions.
  *
- * @return bool|null False if not on a group page, or if user does not have
- *        access to group admin options.
+ * @return false|null False if not on a group page, or if user does not have
+ *                    access to group admin options.
  */
 function bp_groups_group_admin_menu() {
-	global $wp_admin_bar, $bp;
+	global $wp_admin_bar;
+	$bp = buddypress();
 
 	// Only show if viewing a group
-	if ( !bp_is_group() )
+	if ( ! bp_is_group() || bp_is_group_create() ) {
 		return false;
+	}
 
 	// Only show this menu to group admins and super admins
-	if ( !bp_current_user_can( 'bp_moderate' ) && !bp_group_is_admin() )
+	if ( ! bp_current_user_can( 'bp_moderate' ) && ! bp_group_is_admin() ) {
 		return false;
+	}
 
 	// Unique ID for the 'Edit Group' menu
 	$bp->group_admin_menu_id = 'group-admin';
@@ -43,67 +46,39 @@ function bp_groups_group_admin_menu() {
 		'href'  => bp_get_group_permalink( $bp->groups->current_group )
 	) );
 
-	// Group Admin > Edit details
-	$wp_admin_bar->add_menu( array(
-		'parent' => $bp->group_admin_menu_id,
-		'id'     => 'edit-details',
-		'title'  => __( 'Edit Details', 'buddypress' ),
-		'href'   =>  bp_get_groups_action_link( 'admin/edit-details' )
-	) );
-
-	// Group Admin > Group settings
-	$wp_admin_bar->add_menu( array(
-		'parent' => $bp->group_admin_menu_id,
-		'id'     => 'group-settings',
-		'title'  => __( 'Edit Settings', 'buddypress' ),
-		'href'   =>  bp_get_groups_action_link( 'admin/group-settings' )
-	) );
+	// Index of the Manage tabs parent slug
+	$nav_index = $bp->groups->current_group->slug . '_manage';
 
-	// Group Admin > Group avatar
-	if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && $bp->avatar->show_avatars ) {
-		$wp_admin_bar->add_menu( array(
-			'parent' => $bp->group_admin_menu_id,
-			'id'     => 'group-avatar',
-			'title'  => __( 'Edit Profile Photo', 'buddypress' ),
-			'href'   =>  bp_get_groups_action_link( 'admin/group-avatar' )
-		) );
+	// Check if current group has Manage tabs
+	if ( empty( $bp->bp_options_nav[ $nav_index ] ) ) {
+		return;
 	}
 
-	// Group Admin > Manage invitations
-	if ( bp_is_active( 'friends' ) ) {
-		$wp_admin_bar->add_menu( array(
-			'parent' => $bp->group_admin_menu_id,
-			'id'     => 'manage-invitations',
-			'title'  => __( 'Manage Invitations', 'buddypress' ),
-			'href'   =>  bp_get_groups_action_link( 'send-invites' )
-		) );
-	}
+	// Build the Group Admin menus
+	foreach ( $bp->bp_options_nav[ $nav_index ] as $menu ) {
+		/**
+		 * Should we add the current manage link in the Group's "Edit" Admin Bar menu ?
+		 *
+		 * All core items will be added, plugins can use a new parameter in the BP Group Extension API
+		 * to also add the link to the "edit screen" of their group component. To do so, set the
+		 * the 'show_in_admin_bar' argument of your edit screen to true
+		 */
+		if ( $menu['show_in_admin_bar'] ) {
+			$title = sprintf( _x( 'Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress' ), $menu['name'] );
 
-	// Group Admin > Manage members
-	$wp_admin_bar->add_menu( array(
-		'parent' => $bp->group_admin_menu_id,
-		'id'     => 'manage-members',
-		'title'  => __( 'Manage Members', 'buddypress' ),
-		'href'   =>  bp_get_groups_action_link( 'admin/manage-members' )
-	) );
+			// Title is specific for delete
+			if ( 'delete-group' == $menu['slug'] ) {
+				$title = sprintf( _x( '%s Group', 'Group WP Admin Bar delete link', 'buddypress' ), $menu['name'] );
+			}
 
-	// Group Admin > Membership Requests
-	if ( bp_get_group_status( $bp->groups->current_group ) == 'private' ) {
-		$wp_admin_bar->add_menu( array(
-			'parent' => $bp->group_admin_menu_id,
-			'id'     => 'membership-requests',
-			'title'  => __( 'Membership Requests', 'buddypress' ),
-			'href'   =>  bp_get_groups_action_link( 'admin/membership-requests' )
-		) );
+			$wp_admin_bar->add_menu( array(
+				'parent' => $bp->group_admin_menu_id,
+				'id'     => $menu['slug'],
+				'title'  => $title,
+				'href'   => bp_get_groups_action_link( 'admin/' . $menu['slug'] )
+			) );
+		}
 	}
-
-	// Delete Group
-	$wp_admin_bar->add_menu( array(
-		'parent' => $bp->group_admin_menu_id,
-		'id'     => 'delete-group',
-		'title'  => __( 'Delete Group', 'buddypress' ),
-		'href'   =>  bp_get_groups_action_link( 'admin/delete-group' )
-	) );
 }
 add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 99 );
 
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
index 498cbee5ff6612c9a0ebb398a65ebe33884c9d8e..c8df9cde5d3587b56d4b57a529b585f37452953b 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Caching
+ * BuddyPress Groups Caching.
  *
  * Caching functions handle the clearing of cached objects and pages on specific
  * actions throughout BuddyPress.
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Slurp up metadata for a set of groups.
@@ -24,11 +24,13 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * $group_ids and adds it to WP cache. This improves efficiency when using
  * groupmeta within a loop context.
  *
- * @param int|str|array $group_ids Accepts a single group_id, or a
- *        comma-separated list or array of group ids.
+ *
+ * @param int|string|array|bool $group_ids Accepts a single group_id, or a
+ *                                         comma-separated list or array of
+ *                                         group ids.
  */
 function bp_groups_update_meta_cache( $group_ids = false ) {
-	global $bp;
+	$bp = buddypress();
 
 	$cache_args = array(
 		'object_ids' 	   => $group_ids,
@@ -45,7 +47,7 @@ function bp_groups_update_meta_cache( $group_ids = false ) {
 /**
  * Clear the cached group count.
  *
- * @param $group_id Not used.
+ * @param int $group_id Not used.
  */
 function groups_clear_group_object_cache( $group_id ) {
 	wp_cache_delete( 'bp_total_group_count', 'bp' );
@@ -75,6 +77,9 @@ add_action( 'groups_settings_updated', 'bp_groups_delete_group_cache' );
  * Bust group cache when modifying metadata.
  *
  * @since BuddyPress (2.0.0)
+ *
+ * @param int $meta_id
+ * @param int $group_id
  */
 function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) {
 	wp_cache_delete( $group_id, 'bp_groups' );
@@ -87,7 +92,7 @@ add_action( 'added_group_meta', 'bp_groups_delete_group_cache_on_metadata_change
  *
  * @since BuddyPress (1.6.0)
  *
- * @param int $group_id ID of the group.
+ * @param int             $group_id  ID of the group.
  * @param BP_Groups_Group $group_obj Group object.
  */
 function bp_groups_clear_group_creator_cache( $group_id, $group_obj ) {
@@ -97,12 +102,12 @@ function bp_groups_clear_group_creator_cache( $group_id, $group_obj ) {
 add_action( 'groups_created_group', 'bp_groups_clear_group_creator_cache', 10, 2 );
 
 /**
- * Clears caches for all members in a group when a group is deleted
+ * Clears caches for all members in a group when a group is deleted.
  *
  * @since BuddyPress (1.6.0)
  *
  * @param BP_Groups_Group $group_obj Group object.
- * @param array User IDs who were in this group.
+ * @param array           $user_ids  User IDs who were in this group.
  */
 function bp_groups_clear_group_members_caches( $group_obj, $user_ids ) {
 	// Clears the 'total groups' cache for each member in a group
@@ -135,7 +140,7 @@ add_action( 'groups_delete_invite', 'bp_groups_clear_invite_count_for_user' );
  * @since BuddyPress (2.0.0)
  *
  * @param int $group_id The group ID. Not used in this function.
- * @param int $user_id The user ID.
+ * @param int $user_id  The user ID.
  */
 function bp_groups_clear_invite_count_on_uninvite( $group_id, $user_id ) {
 	bp_groups_clear_invite_count_for_user( $user_id );
@@ -147,7 +152,7 @@ add_action( 'groups_uninvite_user', 'bp_groups_clear_invite_count_on_uninvite',
  *
  * @since BuddyPress (2.0.0)
  *
- * @param int $group_id The group ID. Not used in this function.
+ * @param int   $group_id      The group ID. Not used in this function.
  * @param array $invited_users Array of invited user IDs.
  */
 function bp_groups_clear_invite_count_on_send( $group_id, $invited_users ) {
@@ -161,7 +166,7 @@ add_action( 'groups_send_invites', 'bp_groups_clear_invite_count_on_send', 10, 2
  * Clear a user's cached group count.
  *
  * @param int $group_id The group ID. Not used in this function.
- * @param int $user_id The user ID.
+ * @param int $user_id  The user ID.
  */
 function groups_clear_group_user_object_cache( $group_id, $user_id ) {
 	wp_cache_delete( 'bp_total_groups_for_user_' . $user_id, 'bp' );
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
index 24fed9c49fd878c8b25875134ccf3121ffe0c31e..736691f5b279241c19337ef2db09f792056a4add 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * BuddyPress Groups Classes
  *
@@ -8,4505 +7,10 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
-
-/**
- * BuddyPress Group object.
- */
-class BP_Groups_Group {
-
-	/**
-	 * ID of the group.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $id;
-
-	/**
-	 * User ID of the group's creator.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $creator_id;
-
-	/**
-	 * Name of the group.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $name;
-
-	/**
-	 * Group slug.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $slug;
-
-	/**
-	 * Group description.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $description;
-
-	/**
-	 * Group status.
-	 *
-	 * Core statuses are 'public', 'private', and 'hidden'.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $status;
-
-	/**
-	 * Should (legacy) bbPress forums be enabled for this group?
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $enable_forum;
-
-	/**
-	 * Date the group was created.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $date_created;
-
-	/**
-	 * Data about the group's admins.
-	 *
-	 * @access public
-	 * @var array
-	 */
-	public $admins;
-
-	/**
-	 * Data about the group's moderators.
-	 *
-	 * @access public
-	 * @var array
-	 */
-	public $mods;
-
-	/**
-	 * Total count of group members.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $total_member_count;
-
-	/**
-	 * Is the current user a member of this group?
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var bool
-	 */
-	public $is_member;
-
-	/**
-	 * Does the current user have an outstanding invitation to this group?
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @var bool
-	 */
-	public $is_invited;
-
-	/**
-	 * Does the current user have a pending membership request to this group?
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @var bool
-	 */
-	public $is_pending;
-
-	/**
-	 * Timestamp of the last activity that happened in this group.
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var string
-	 */
-	public $last_activity;
-
-	/**
-	 * If this is a private or hidden group, does the current user have access?
-	 *
-	 * @since BuddyPress (1.6.0)
-	 * @var bool
-	 */
-	public $user_has_access;
-
-	/**
-	 * Raw arguments passed to the constructor.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 * @var array
-	 */
-	public $args;
-
-	/**
-	 * Constructor method.
-	 *
-	 * @param int $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.
-	 *     @type bool $populate_extras Whether to fetch "extra" data about
-	 *           the group (group admins/mods, access for the current user).
-	 *           Default: false.
-	 * }
-	 */
-	public function __construct( $id = null, $args = array() ) {
-		$this->args = wp_parse_args( $args, array(
-			'populate_extras' => false,
-		) );
-
-		if ( !empty( $id ) ) {
-			$this->id = $id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Set up data about the current group.
-	 */
-	public function populate() {
-		global $wpdb;
-
-		// Get BuddyPress
-		$bp    = buddypress();
-
-		// Check cache for group data
-		$group = wp_cache_get( $this->id, 'bp_groups' );
-
-		// 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 ) );
-
-			wp_cache_set( $this->id, $group, 'bp_groups' );
-		}
-
-		// No group found so set the ID and bail
-		if ( empty( $group ) || is_wp_error( $group ) ) {
-			$this->id = 0;
-			return;
-		}
-
-		// Group found so setup the object variables
-		$this->id           = $group->id;
-		$this->creator_id   = $group->creator_id;
-		$this->name         = stripslashes( $group->name );
-		$this->slug         = $group->slug;
-		$this->description  = stripslashes( $group->description );
-		$this->status       = $group->status;
-		$this->enable_forum = $group->enable_forum;
-		$this->date_created = $group->date_created;
-
-		// Are we getting extra group data?
-		if ( ! empty( $this->args['populate_extras'] ) ) {
-
-			// Get group admins and mods
-			$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
-			foreach ( (array) $admin_mods as $user ) {
-				if ( !empty( $user->is_admin ) ) {
-					$this->admins[] = $user;
-				} else {
-					$this->mods[] = $user;
-				}
-			}
-
-			// Set up some specific group vars from meta. Excluded
-			// 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
-			$user_id          = bp_loggedin_user_id();
-			$this->is_member  = BP_Groups_Member::check_is_member( $user_id, $this->id );
-			$this->is_invited = BP_Groups_Member::check_has_invite( $user_id, $this->id );
-			$this->is_pending = BP_Groups_Member::check_for_membership_request( $user_id, $this->id );
-
-			// If this is a private or hidden group, does the current user have access?
-			if ( ( 'private' === $this->status ) || ( 'hidden' === $this->status ) ) {
-
-				// Assume user does not have access to hidden/private groups
-				$this->user_has_access = false;
-
-				// 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;
-				}
-			} else {
-				$this->user_has_access = true;
-			}
-		}
-	}
-
-	/**
-	 * Save the current group to the database.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->creator_id   = apply_filters( 'groups_group_creator_id_before_save',   $this->creator_id,   $this->id );
-		$this->name         = apply_filters( 'groups_group_name_before_save',         $this->name,         $this->id );
- 		$this->slug         = apply_filters( 'groups_group_slug_before_save',         $this->slug,         $this->id );
-		$this->description  = apply_filters( 'groups_group_description_before_save',  $this->description,  $this->id );
- 		$this->status       = apply_filters( 'groups_group_status_before_save',       $this->status,       $this->id );
-		$this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id );
-		$this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id );
-
-		do_action_ref_array( 'groups_group_before_save', array( &$this ) );
-
-		// Groups need at least a name
-		if ( empty( $this->name ) ) {
-			return false;
-		}
-
-		// Set slug with group title if not passed
-		if ( empty( $this->slug ) ) {
-			$this->slug = sanitize_title( $this->name );
-		}
-
-		// Sanity check
-		if ( empty( $this->slug ) ) {
-			return false;
-		}
-
-		// Check for slug conflicts if creating new group
-		if ( empty( $this->id ) ) {
-			$this->slug = groups_check_slug( $this->slug );
-		}
-
-		if ( !empty( $this->id ) ) {
-			$sql = $wpdb->prepare(
-				"UPDATE {$bp->groups->table_name} SET
-					creator_id = %d,
-					name = %s,
-					slug = %s,
-					description = %s,
-					status = %s,
-					enable_forum = %d,
-					date_created = %s
-				WHERE
-					id = %d
-				",
-					$this->creator_id,
-					$this->name,
-					$this->slug,
-					$this->description,
-					$this->status,
-					$this->enable_forum,
-					$this->date_created,
-					$this->id
-			);
-		} else {
-			$sql = $wpdb->prepare(
-				"INSERT INTO {$bp->groups->table_name} (
-					creator_id,
-					name,
-					slug,
-					description,
-					status,
-					enable_forum,
-					date_created
-				) VALUES (
-					%d, %s, %s, %s, %s, %d, %s
-				)",
-					$this->creator_id,
-					$this->name,
-					$this->slug,
-					$this->description,
-					$this->status,
-					$this->enable_forum,
-					$this->date_created
-			);
-		}
-
-		if ( false === $wpdb->query($sql) )
-			return false;
-
-		if ( empty( $this->id ) )
-			$this->id = $wpdb->insert_id;
-
-		do_action_ref_array( 'groups_group_after_save', array( &$this ) );
-
-		wp_cache_delete( $this->id, 'bp_groups' );
-
-		return true;
-	}
-
-	/**
-	 * Delete the current group.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function delete() {
-		global $wpdb, $bp;
-
-		// Delete groupmeta for the group
-		groups_delete_groupmeta( $this->id );
-
-		// 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
-		$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
-		BP_Groups_Member::delete_all( $this->id );
-
-		do_action_ref_array( 'bp_groups_delete_group', array( &$this, $user_ids ) );
-
-		wp_cache_delete( $this->id, 'bp_groups' );
-
-		// 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;
-
-		return true;
-	}
-
-	/** Static Methods ****************************************************/
-
-	/**
-	 * Get whether a group exists for a given slug.
-	 *
-	 * @param string $slug Slug to check.
-	 * @param string $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.
-	 */
-	public static function group_exists( $slug, $table_name = false ) {
-		global $wpdb, $bp;
-
-		if ( empty( $table_name ) )
-			$table_name = $bp->groups->table_name;
-
-		if ( empty( $slug ) )
-			return false;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE slug = %s", strtolower( $slug ) ) );
-	}
-
-	/**
-	 * Get the ID of a group by the group's slug.
-	 *
-	 * Alias of {@link BP_Groups_Group::group_exists()}.
-	 *
-	 * @param string $slug See {@link BP_Groups_Group::group_exists()}.
-	 * @return string|null See {@link BP_Groups_Group::group_exists()}.
-	 */
-	public static function get_id_from_slug( $slug ) {
-		return BP_Groups_Group::group_exists( $slug );
-	}
-
-	/**
-	 * Get IDs of users with outstanding invites to a given group from a specified user.
-	 *
-	 * @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.
-	 */
-	public static function get_invites( $user_id, $group_id ) {
-		global $wpdb, $bp;
-		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d and is_confirmed = 0 AND inviter_id = %d", $group_id, $user_id ) );
-	}
-
-	/**
-	 * Get a list of a user's groups, filtered by a search string.
-	 *
-	 * @param string $filter Search term. Matches against 'name' and
-	 *        'description' fields.
-	 * @param int $user_id ID of the user whose groups are being searched.
-	 *        Default: the displayed user.
-	 * @param mixed $order Not used.
-	 * @param int $limit Optional. The max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page offset of results to return.
-	 *        Default: null (no limit).
-	 * @return array {
-	 *     @type array $groups Array of matched and paginated group objects.
-	 *     @type int $total Total count of groups matching the query.
-	 * }
-	 */
-	public static function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			$user_id = bp_displayed_user_id();
-
-		$search_terms_like = bp_esc_like( $filter ) . '%';
-
-		$pag_sql = $order_sql = $hidden_sql = '';
-
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		// Get all the group ids for the current user's groups.
-		$gids = BP_Groups_Member::get_group_ids( $user_id );
-
-		if ( empty( $gids['groups'] ) )
-			return false;
-
-		$gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
-
-		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids}) {$pag_sql}", $search_terms_like, $search_terms_like ) );
-		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids})", $search_terms_like, $search_terms_like ) );
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get a list of groups, filtered by a search string.
-	 *
-	 * @param string $filter Search term. Matches against 'name' and
-	 *        'description' fields.
-	 * @param int $limit Optional. The max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page offset of results to return.
-	 *        Default: null (no limit).
-	 * @param string $sort_by Column to sort by. Default: false (default
-	 *        sort).
-	 * @param string $order ASC or DESC. Default: false (default sort).
-	 * @return array {
-	 *     @type array $groups Array of matched and paginated group objects.
-	 *     @type int $total Total count of groups matching the query.
-	 * }
-	 */
-	public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
-		global $wpdb, $bp;
-
-		$search_terms_like = '%' . bp_esc_like( $filter ) . '%';
-
-		$pag_sql = $order_sql = $hidden_sql = '';
-
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		if ( !empty( $sort_by ) && !empty( $order ) ) {
-			$sort_by   = esc_sql( $sort_by );
-			$order     = esc_sql( $order );
-			$order_sql = "ORDER BY {$sort_by} {$order}";
-		}
-
-		if ( !bp_current_user_can( 'bp_moderate' ) )
-			$hidden_sql = "AND status != 'hidden'";
-
-		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) {$hidden_sql} {$order_sql} {$pag_sql}", $search_terms_like, $search_terms_like ) );
-		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) {$hidden_sql}", $search_terms_like, $search_terms_like ) );
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Check for the existence of a slug.
-	 *
-	 * @param string $slug Slug to check.
-	 * @return string|null The slug, if found. Otherwise null.
-	 */
-	public static function check_slug( $slug ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE slug = %s", $slug ) );
-	}
-
-	/**
-	 * Get the slug for a given group ID.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return string|null The slug, if found. Otherwise null.
-	 */
-	public static function get_slug( $group_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE id = %d", $group_id ) );
-	}
-
-	/**
-	 * Check whether a given group has any members.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return bool True if the group has members, otherwise false.
-	 */
-	public static function has_members( $group_id ) {
-		global $wpdb, $bp;
-
-		$members = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
-
-		if ( empty( $members ) )
-			return false;
-
-		return true;
-	}
-
-	/**
-	 * Check whether a group has outstanding membership requests.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return int|null The number of outstanding requests, or null if
-	 *         none are found.
-	 */
-	public static function has_membership_requests( $group_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
-	}
-
-	/**
-	 * Get outstanding membership requests for a group.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @param int $limit Optional. Max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. Page offset of results returned. Default:
-	 *        null (no limit).
-	 * @return array {
-	 *     @type array $requests The requested page of located requests.
-	 *     @type int $total Total number of requests outstanding for the
-	 *           group.
-	 * }
-	 */
-	public static function get_membership_requests( $group_id, $limit = null, $page = null ) {
-		global $wpdb, $bp;
-
-		if ( !empty( $limit ) && !empty( $page ) ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		$paged_requests = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0{$pag_sql}", $group_id ) );
-		$total_requests = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
-
-		return array( 'requests' => $paged_requests, 'total' => $total_requests );
-	}
-
-	/**
-	 * Query for groups.
-	 *
-	 * @see WP_Meta_Query::queries for a description of the 'meta_query'
-	 *      parameter format.
-	 *
-	 * @param array {
-	 *     Array of parameters. All items are optional.
-	 *     @type string $type Optional. Shorthand for certain orderby/
-	 *           order combinations. 'newest', 'active', 'popular',
-	 *           'alphabetical', 'random'. When present, will override
-	 *           orderby and order params. Default: null.
-	 *     @type string $orderby Optional. Property to sort by.
-	 *           'date_created', 'last_activity', 'total_member_count',
-	 *           'name', 'random'. Default: 'date_created'.
-	 *     @type string $order Optional. Sort order. 'ASC' or 'DESC'.
-	 *           Default: 'DESC'.
-	 *     @type int $per_page Optional. Number of items to return per page
-	 *           of results. Default: null (no limit).
-	 *     @type int $page Optional. Page offset of results to return.
-	 *           Default: null (no limit).
-	 *     @type int $user_id Optional. If provided, results will be limited
-	 *           to groups of which the specified user is a member. Default:
-	 *           null.
-	 *     @type string $search_terms Optional. If provided, only groups
-	 *           whose names or descriptions match the search terms will be
-	 *           returned. Default: false.
-	 *     @type array $meta_query Optional. An array of meta_query
-	 *           conditions. See {@link WP_Meta_Query::queries} for
-	 *           description.
-	 *     @type array|string Optional. Array or comma-separated list of
-	 *           group IDs. Results will be limited to groups within the
-	 *           list. Default: false.
-	 *     @type bool $populate_extras Whether to fetch additional
-	 *           information (such as member count) about groups. Default:
-	 *           true.
-	 *     @type array|string $exclude Optional. Array or comma-separated
-	 *           list of group IDs. Results will exclude the listed groups.
-	 *           Default: false.
-	 *     @type bool $update_meta_cache Whether to pre-fetch groupmeta for
-	 *           the returned groups. Default: true.
-	 *     @type bool $show_hidden Whether to include hidden groups in
-	 *           results. Default: false.
-	 * }
-	 * @return array {
-	 *     @type array $groups Array of group objects returned by the
-	 *           paginated query.
-	 *     @type int $total Total count of all groups matching non-
-	 *           paginated query params.
-	 * }
-	 */
-	public static function get( $args = array() ) {
-		global $wpdb, $bp;
-
-		// 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__ ) );
-
-			$old_args_keys = array(
-				0 => 'type',
-				1 => 'per_page',
-				2 => 'page',
-				3 => 'user_id',
-				4 => 'search_terms',
-				5 => 'include',
-				6 => 'populate_extras',
-				7 => 'exclude',
-				8 => 'show_hidden',
-			);
-
-			$func_args = func_get_args();
-			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
-		}
-
-		$defaults = array(
-			'type'              => null,
-			'orderby'           => 'date_created',
-			'order'             => 'DESC',
-			'per_page'          => null,
-			'page'              => null,
-			'user_id'           => 0,
-			'search_terms'      => false,
-			'meta_query'        => false,
-			'include'           => false,
-			'populate_extras'   => true,
-			'update_meta_cache' => true,
-			'exclude'           => false,
-			'show_hidden'       => false,
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-
-		$sql       = array();
-		$total_sql = array();
-
-		$sql['select'] = "SELECT DISTINCT g.id, g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
-		$sql['from']   = " FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2,";
-
-		if ( ! empty( $r['user_id'] ) ) {
-			$sql['members_from'] = " {$bp->groups->table_name_members} m,";
-		}
-
-		$sql['group_from'] = " {$bp->groups->table_name} g WHERE";
-
-		if ( ! empty( $r['user_id'] ) ) {
-			$sql['user_where'] = " g.id = m.group_id AND";
-		}
-
-		$sql['where'] = " g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'";
-
-		if ( empty( $r['show_hidden'] ) ) {
-			$sql['hidden'] = " AND g.status != 'hidden'";
-		}
-
-		if ( ! empty( $r['search_terms'] ) ) {
-			$search_terms_like = '%' . bp_esc_like( $r['search_terms'] ) . '%';
-			$sql['search'] = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
-		}
-
-		$meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
-
-		if ( ! empty( $meta_query_sql['join'] ) ) {
-			$sql['from'] .= $meta_query_sql['join'];
-		}
-
-		if ( ! empty( $meta_query_sql['where'] ) ) {
-			$sql['meta'] = $meta_query_sql['where'];
-		}
-
-		if ( ! empty( $r['user_id'] ) ) {
-			$sql['user'] = $wpdb->prepare( " AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $r['user_id'] );
-		}
-
-		if ( ! empty( $r['include'] ) ) {
-			$include        = implode( ',', wp_parse_id_list( $r['include'] ) );
-			$sql['include'] = " AND g.id IN ({$include})";
-		}
-
-		if ( ! empty( $r['exclude'] ) ) {
-			$exclude        = implode( ',', wp_parse_id_list( $r['exclude'] ) );
-			$sql['exclude'] = " AND g.id NOT IN ({$exclude})";
-		}
-
-		/** Order/orderby ********************************************/
-
-		$order   = $r['order'];
-		$orderby = $r['orderby'];
-
-		// If a 'type' parameter was passed, parse it and overwrite
-		// 'order' and 'orderby' params passed to the function
-		if (  ! empty( $r['type'] ) ) {
-			$order_orderby = apply_filters( 'bp_groups_get_orderby', self::convert_type_to_order_orderby( $r['type'] ), $r['type'] );
-
-			// 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
-			if ( ! empty( $order_orderby['order'] ) ) {
-				$order = $order_orderby['order'];
-			}
-
-			if ( ! empty( $order_orderby['orderby'] ) ) {
-				$orderby = $order_orderby['orderby'];
-			}
-		}
-
-		// Sanitize 'order'
-		$order = bp_esc_sql_order( $order );
-
-		// Convert 'orderby' into the proper ORDER BY term
-		$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
-		if ( 'rand()' === $orderby ) {
-			$sql[] = "ORDER BY rand()";
-		} else {
-			$sql[] = "ORDER BY {$orderby} {$order}";
-		}
-
-		if ( ! empty( $r['per_page'] ) && ! empty( $r['page'] ) && $r['per_page'] != -1 ) {
-			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['per_page']), intval( $r['per_page'] ) );
-		}
-
-		// Get paginated results
-		$paged_groups_sql = apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array) $sql ), $sql, $r );
-		$paged_groups     = $wpdb->get_results( $paged_groups_sql );
-
-		$total_sql['select'] = "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name} g, {$bp->groups->table_name_members} gm1, {$bp->groups->table_name_groupmeta} gm2";
-
-		if ( ! empty( $r['user_id'] ) ) {
-			$total_sql['select'] .= ", {$bp->groups->table_name_members} m";
-		}
-
-		if ( ! empty( $sql['hidden'] ) ) {
-			$total_sql['where'][] = "g.status != 'hidden'";
-		}
-
-		if ( ! empty( $sql['search'] ) ) {
-			$total_sql['where'][] = $wpdb->prepare( "( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
-		}
-
-		if ( ! empty( $r['user_id'] ) ) {
-			$total_sql['where'][] = $wpdb->prepare( "m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $r['user_id'] );
-		}
-
-		// Temporary implementation of meta_query for total count
-		// See #5099
-		if ( ! empty( $meta_query_sql['where'] ) ) {
-			// 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
-			$meta_query_clause = preg_replace( '/^\s*AND/', '', $meta_query_sql['where'] );
-			$total_sql['where'][] = $meta_query_clause;
-		}
-
-		// Already escaped in the paginated results block
-		if ( ! empty( $include ) ) {
-			$total_sql['where'][] = "g.id IN ({$include})";
-		}
-
-		// Already escaped in the paginated results block
-		if ( ! empty( $exclude ) ) {
-			$total_sql['where'][] = "g.id NOT IN ({$exclude})";
-		}
-
-		$total_sql['where'][] = "g.id = gm1.group_id";
-		$total_sql['where'][] = "g.id = gm2.group_id";
-		$total_sql['where'][] = "gm2.meta_key = 'last_activity'";
-
-		$t_sql = $total_sql['select'];
-
-		if ( ! empty( $total_sql['where'] ) ) {
-			$t_sql .= " WHERE " . join( ' AND ', (array) $total_sql['where'] );
-		}
-
-		// Get total group results
-		$total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', $t_sql, $total_sql, $r );
-		$total_groups     = $wpdb->get_var( $total_groups_sql );
-
-		$group_ids = array();
-		foreach ( (array) $paged_groups as $group ) {
-			$group_ids[] = $group->id;
-		}
-
-		// 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
-		if ( ! empty( $r['update_meta_cache'] ) ) {
-			bp_groups_update_meta_cache( $group_ids );
-		}
-
-		unset( $sql, $total_sql );
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get the SQL for the 'meta_query' param in BP_Activity_Activity::get()
-	 *
-	 * We use WP_Meta_Query to do the heavy lifting of parsing the
-	 * meta_query array and creating the necessary SQL clauses. However,
-	 * since BP_Activity_Activity::get() builds its SQL differently than
-	 * WP_Query, we have to alter the return value (stripping the leading
-	 * AND keyword from the 'where' clause).
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 *
-	 * @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.
-	 */
-	protected static function get_meta_query_sql( $meta_query = array() ) {
-		global $wpdb;
-
-		$sql_array = array(
-			'join'  => '',
-			'where' => '',
-		);
-
-		if ( ! empty( $meta_query ) ) {
-			$groups_meta_query = new WP_Meta_Query( $meta_query );
-
-			// WP_Meta_Query expects the table name at
-			// $wpdb->group
-			$wpdb->groupmeta = buddypress()->groups->table_name_groupmeta;
-
-			$meta_sql = $groups_meta_query->get_sql( 'group', 'g', 'id' );
-
-			// BP_Groups_Group::get uses the comma syntax for table
-			// joins, which means that we have to do some regex to
-			// convert the INNER JOIN and move the ON clause to a
-			// WHERE condition
-			//
-			// @todo It may be better in the long run to refactor
-			// the more general query syntax to accord better with
-			// BP/WP convention
-			preg_match_all( '/INNER JOIN (.*) ON/', $meta_sql['join'], $matches_a );
-			preg_match_all( '/ON \((.*)\)/', $meta_sql['join'], $matches_b );
-
-			if ( ! empty( $matches_a[1] ) && ! empty( $matches_b[1] ) ) {
-				$sql_array['join']  = implode( ',', $matches_a[1] ) . ', ';
-				$sql_array['where'] = $meta_sql['where'] . ' AND ' . implode ( ' AND ', $matches_b[1] );
-			}
-		}
-
-		return $sql_array;
-	}
-
-	/**
-	 * Convert the 'type' parameter to 'order' and 'orderby'.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 *
-	 * @param string $type The 'type' shorthand param.
-	 * @return array {
-	 *	@type string $order SQL-friendly order string.
-	 *	@type string $orderby SQL-friendly orderby column name.
-	 * }
-	 */
-	protected static function convert_type_to_order_orderby( $type = '' ) {
-		$order = $orderby = '';
-
-		switch ( $type ) {
-			case 'newest' :
-				$order   = 'DESC';
-				$orderby = 'date_created';
-				break;
-
-			case 'active' :
-				$order   = 'DESC';
-				$orderby = 'last_activity';
-				break;
-
-			case 'popular' :
-				$order   = 'DESC';
-				$orderby = 'total_member_count';
-				break;
-
-			case 'alphabetical' :
-				$order   = 'ASC';
-				$orderby = 'name';
-				break;
-
-			case 'random' :
-				$order   = '';
-				$orderby = 'random';
-				break;
-		}
-
-		return array( 'order' => $order, 'orderby' => $orderby );
-	}
-
-	/**
-	 * Convert the 'orderby' param into a proper SQL term/column.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 *
-	 * @param string $orderby Orderby term as passed to get().
-	 * @return string $order_by_term SQL-friendly orderby term.
-	 */
-	protected static function convert_orderby_to_order_by_term( $orderby ) {
-		$order_by_term = '';
-
-		switch ( $orderby ) {
-			case 'date_created' :
-			default :
-				$order_by_term = 'g.date_created';
-				break;
-
-			case 'last_activity' :
-				$order_by_term = 'last_activity';
-				break;
-
-			case 'total_member_count' :
-				$order_by_term = 'CONVERT(gm1.meta_value, SIGNED)';
-				break;
-
-			case 'name' :
-				$order_by_term = 'g.name';
-				break;
-
-			case 'random' :
-				$order_by_term = 'rand()';
-				break;
-		}
-
-		return $order_by_term;
-	}
-
-	/**
-	 * Get a list of groups, sorted by those that have the most legacy forum topics.
-	 *
-	 * @param int $limit Optional. The max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page offset of results to return.
-	 *        Default: null (no limit).
-	 * @param int $user_id Optional. If present, groups will be limited to
-	 *        those of which the specified user is a member.
-	 * @param string $search_terms Optional. Limit groups to those whose
-	 *        name or description field contain the search string.
-	 * @param bool $populate_extras Optional. Whether to fetch extra
-	 *        information about the groups. Default: true.
-	 * @param string|array 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
-	 *           paginated query.
-	 *     @type int $total Total count of all groups matching non-
-	 *           paginated query params.
-	 * }
-	 */
-	public static function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
-		global $wpdb, $bp, $bbdb;
-
-		if ( empty( $bbdb ) )
-			do_action( 'bbpress_init' );
-
-		if ( !empty( $limit ) && !empty( $page ) ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
-			$hidden_sql = " AND g.status != 'hidden'";
-
-		if ( !empty( $search_terms ) ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$search_sql        = $wpdb->prepare( ' AND ( g.name LIKE %s OR g.description LIKE %s ) ', $search_terms_like, $search_terms_like );
-		}
-
-		if ( !empty( $exclude ) ) {
-			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
-			$exclude_sql = " AND g.id NOT IN ({$exclude})";
-		}
-
-		if ( !empty( $user_id ) ) {
-			$user_id      = absint( esc_sql( $user_id ) );
-			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY f.topics DESC {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql}" );
-		} else {
-			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY f.topics DESC {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} {$exclude_sql}" );
-		}
-
-		if ( !empty( $populate_extras ) ) {
-			foreach ( (array) $paged_groups as $group ) {
-				$group_ids[] = $group->id;
-			}
-			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
-		}
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get a list of groups, sorted by those that have the most legacy forum posts.
-	 *
-	 * @param int $limit Optional. The max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page offset of results to return.
-	 *        Default: null (no limit).
-	 * @param int $user_id Optional. If present, groups will be limited to
-	 *        those of which the specified user is a member.
-	 * @param string $search_terms Optional. Limit groups to those whose
-	 *        name or description field contain the search string.
-	 * @param bool $populate_extras Optional. Whether to fetch extra
-	 *        information about the groups. Default: true.
-	 * @param string|array 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
-	 *           paginated query.
-	 *     @type int $total Total count of all groups matching non-
-	 *           paginated query params.
-	 * }
-	 */
-	public static function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
-		global $wpdb, $bp, $bbdb;
-
-		if ( empty( $bbdb ) )
-			do_action( 'bbpress_init' );
-
-		if ( !empty( $limit ) && !empty( $page ) ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
-			$hidden_sql = " AND g.status != 'hidden'";
-
-		if ( !empty( $search_terms ) ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$search_sql        = $wpdb->prepare( ' AND ( g.name LIKE %s OR g.description LIKE %s ) ', $search_terms_like, $search_terms_like );
-		}
-
-		if ( !empty( $exclude ) ) {
-			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
-			$exclude_sql = " AND g.id NOT IN ({$exclude})";
-		}
-
-		if ( !empty( $user_id ) ) {
-			$user_id = esc_sql( $user_id );
-			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY f.posts ASC {$pag_sql}" );
-			$total_groups = $wpdb->get_results( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} " );
-		} else {
-			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY f.posts ASC {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} {$exclude_sql}" );
-		}
-
-		if ( !empty( $populate_extras ) ) {
-			foreach ( (array) $paged_groups as $group ) {
-				$group_ids[] = $group->id;
-			}
-			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
-		}
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get a list of groups whose names start with a given letter.
-	 *
-	 * @param string $letter The letter.
-	 * @param int $limit Optional. The max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page offset of results to return.
-	 *        Default: null (no limit).
-	 * @param bool $populate_extras Optional. Whether to fetch extra
-	 *        information about the groups. Default: true.
-	 * @param string|array 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
-	 *           paginated query.
-	 *     @type int $total Total count of all groups matching non-
-	 *           paginated query params.
-	 * }
-	 */
-	public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
-		global $wpdb, $bp;
-
-		$pag_sql = $hidden_sql = $exclude_sql = '';
-
-		// Multibyte compliance
-		if ( function_exists( 'mb_strlen' ) ) {
-			if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) {
-				return false;
-			}
-		} else {
-			if ( strlen( $letter ) > 1 || is_numeric( $letter ) || !$letter ) {
-				return false;
-			}
-		}
-
-		if ( !empty( $exclude ) ) {
-			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
-			$exclude_sql = " AND g.id NOT IN ({$exclude})";
-		}
-
-		if ( !bp_current_user_can( 'bp_moderate' ) )
-			$hidden_sql = " AND status != 'hidden'";
-
-		$letter_like = bp_esc_like( $letter ) . '%';
-
-		if ( !empty( $limit ) && !empty( $page ) ) {
-			$pag_sql      = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE %s {$hidden_sql} {$exclude_sql}", $letter_like ) );
-
-		$paged_groups = $wpdb->get_results( $wpdb->prepare( "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} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE %s {$hidden_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}", $letter_like ) );
-
-		if ( !empty( $populate_extras ) ) {
-			foreach ( (array) $paged_groups as $group ) {
-				$group_ids[] = $group->id;
-			}
-			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
-		}
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get a list of random groups.
-	 *
-	 * Use BP_Groups_Group::get() with 'type' = 'random' instead.
-	 *
-	 * @param int $limit Optional. The max number of results to return.
-	 *        Default: null (no limit).
-	 * @param int $page Optional. The page offset of results to return.
-	 *        Default: null (no limit).
-	 * @param int $user_id Optional. If present, groups will be limited to
-	 *        those of which the specified user is a member.
-	 * @param string $search_terms Optional. Limit groups to those whose
-	 *        name or description field contain the search string.
-	 * @param bool $populate_extras Optional. Whether to fetch extra
-	 *        information about the groups. Default: true.
-	 * @param string|array 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
-	 *           paginated query.
-	 *     @type int $total Total count of all groups matching non-
-	 *           paginated query params.
-	 * }
-	 */
-	public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
-		global $wpdb, $bp;
-
-		$pag_sql = $hidden_sql = $search_sql = $exclude_sql = '';
-
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
-			$hidden_sql = "AND g.status != 'hidden'";
-
-		if ( !empty( $search_terms ) ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$search_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
-		}
-
-		if ( !empty( $exclude ) ) {
-			$exclude     = wp_parse_id_list( $exclude );
-			$exclude     = esc_sql( implode( ',', $exclude ) );
-			$exclude_sql = " AND g.id NOT IN ({$exclude})";
-		}
-
-		if ( !empty( $user_id ) ) {
-			$user_id = esc_sql( $user_id );
-			$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} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY rand() {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql}" );
-		} else {
-			$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} g WHERE 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} {$search_sql} {$exclude_sql} ORDER BY rand() {$pag_sql}" );
-			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} {$exclude_sql}" );
-		}
-
-		if ( !empty( $populate_extras ) ) {
-			foreach ( (array) $paged_groups as $group ) {
-				$group_ids[] = $group->id;
-			}
-			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
-		}
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Fetch extra data for a list of groups.
-	 *
-	 * This method is used throughout the class, by methods that take a
-	 * $populate_extras parameter.
-	 *
-	 * Data fetched:
-	 *
-	 *     - Logged-in user's status within each group (is_member,
-	 *       is_confirmed, is_pending, is_banned)
-	 *
-	 * @param array $paged_groups Array of groups.
-	 * @param string|array Array or comma-separated list of IDs matching
-	 *        $paged_groups.
-	 * @param string $type Not used.
-	 * @return array $paged_groups
-	 */
-	public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
-		global $bp, $wpdb;
-
-		if ( empty( $group_ids ) )
-			return $paged_groups;
-
-		// Sanitize group IDs
-		$group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
-
-		// 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() ) );
-		} else {
-			$user_status_results = array();
-		}
-
-		// Reindex
-		$user_status = array();
-		foreach ( $user_status_results as $user_status_result ) {
-			$user_status[ $user_status_result->group_id ] = $user_status_result;
-		}
-
-		for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
-			$is_member = $is_invited = $is_pending = '0';
-			$gid = $paged_groups[ $i ]->id;
-
-			if ( isset( $user_status[ $gid ] ) ) {
-
-				// 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
-				} else if ( $user_status[ $gid ]->invite_sent ) {
-					$is_invited = '1';
-
-				// User has sent request, but has not been confirmed
-				} else {
-					$is_pending = '1';
-				}
-			}
-
-			$paged_groups[ $i ]->is_member = $is_member;
-			$paged_groups[ $i ]->is_invited = $is_invited;
-			$paged_groups[ $i ]->is_pending = $is_pending;
-		}
-
-		if ( is_user_logged_in() ) {
-			$user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", bp_loggedin_user_id() ) );
-		} else {
-			$user_banned = array();
-		}
-
-		for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
-			$paged_groups[$i]->is_banned = false;
-
-			foreach ( (array) $user_banned as $group_id ) {
-				if ( $group_id == $paged_groups[$i]->id ) {
-					$paged_groups[$i]->is_banned = true;
-				}
-			}
-		}
-
-		return $paged_groups;
-	}
-
-	/**
-	 * Delete all invitations to a given group.
-	 *
-	 * @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.
-	 */
-	public static function delete_all_invites( $group_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d AND invite_sent = 1", $group_id ) );
-	}
-
-	/**
-	 * Get a total group count for the site.
-	 *
-	 * Will include hidden groups in the count only if
-	 * current_user_can( 'bp_moderate' ).
-	 *
-	 * @return int Group count.
-	 */
-	public static function get_total_group_count() {
-		global $wpdb, $bp;
-
-		$hidden_sql = '';
-		if ( !bp_current_user_can( 'bp_moderate' ) )
-			$hidden_sql = "WHERE status != 'hidden'";
-
-		return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" );
-	}
-
-	/**
-	 * Get global count of forum topics in public groups (legacy forums).
-	 *
-	 * @param $type Optional. If 'unreplied', count will be limited to
-	 *        those topics that have received no replies.
-	 * @return int Forum topic count.
-	 */
-	public static function get_global_forum_topic_count( $type ) {
-		global $bbdb, $wpdb, $bp;
-
-		if ( 'unreplied' == $type )
-			$bp->groups->filter_sql = ' AND t.topic_posts = 1';
-
-		// https://buddypress.trac.wordpress.org/ticket/4306
-		$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
-		if ( 'AND' != substr( trim( strtoupper( $extra_sql ) ), 0, 3 ) )
-			$extra_sql = ' AND ' . $extra_sql;
-
-		return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
-	}
-
-	/**
-	 * Get the member count for a group.
-	 *
-	 * @param int $group_id Group ID.
-	 * @return int Count of confirmed members for the group.
-	 */
-	public static function get_total_member_count( $group_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
-	}
-
-	/**
-	 * Get a total count of all topics of a given status, across groups/forums
-	 *
-	 * @since BuddyPress (1.5.0)
-	 *
-	 * @param string $status Which group type to count. 'public', 'private',
-	 *        'hidden', or 'all'. Default: 'public'.
-	 * @return int The topic count
-	 */
-	public static function get_global_topic_count( $status = 'public', $search_terms = false ) {
-		global $bbdb, $wpdb, $bp;
-
-		switch ( $status ) {
-			case 'all' :
-				$status_sql = '';
-				break;
-
-			case 'hidden' :
-				$status_sql = "AND g.status = 'hidden'";
-				break;
-
-			case 'private' :
-				$status_sql = "AND g.status = 'private'";
-				break;
-
-			case 'public' :
-			default :
-				$status_sql = "AND g.status = 'public'";
-				break;
-		}
-
-		$sql = array();
-
-		$sql['select'] = "SELECT COUNT(t.topic_id)";
-		$sql['from']   = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
-		$sql['where']  = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
-
-		if ( !empty( $search_terms ) ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$sql['where'] .= $wpdb->prepare( " AND ( t.topic_title LIKE %s )", $search_terms_like );
-		}
-
-		return $wpdb->get_var( implode( ' ', $sql ) );
-	}
-
-	/**
-	 * Get an array containing ids for each group type.
-	 *
-	 * A bit of a kludge workaround for some issues
-	 * with bp_has_groups().
-	 *
-	 * @since BuddyPress (1.7.0)
-	 *
-	 * @return array
-	 */
-	public static function get_group_type_ids() {
-		global $wpdb, $bp;
-
-		$ids = array();
-
-		$ids['all']     = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name}" );
-		$ids['public']  = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'public'" );
-		$ids['private'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'private'" );
-		$ids['hidden']  = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'hidden'" );
-
-		return $ids;
-	}
-}
-
-/**
- * Query for the members of a group.
- *
- * Special notes about the group members data schema:
- * - *Members* are entries with is_confirmed = 1
- * - *Pending requests* are entries with is_confirmed = 0 and inviter_id = 0
- * - *Pending and sent invitations* are entries with is_confirmed = 0 and
- *   inviter_id != 0 and invite_sent = 1
- * - *Pending and unsent invitations* are entries with is_confirmed = 0 and
- *   inviter_id != 0 and invite_sent = 0
- * - *Membership requests* are entries with is_confirmed = 0 and
- *   inviter_id = 0 (and invite_sent = 0)
- *
- * @since BuddyPress (1.8.0)
- *
- * @param array $args {
- *     Array of arguments. Accepts all arguments from
- *     {@link BP_User_Query}, with the following additions:
- *     @type int $group_id ID of the group to limit results to.
- *     @type array $group_role Array of group roles to match ('member',
- *           'mod', 'admin', 'banned'). Default: array( 'member' ).
- *     @type bool $is_confirmed Whether to limit to confirmed members.
- *           Default: true.
- *     @type string $type Sort order. Accepts any value supported by
- *           {@link BP_User_Query}, in addition to 'last_joined' and
- *           'first_joined'. Default: 'last_joined'.
- * }
- */
-class BP_Group_Member_Query extends BP_User_Query {
-
-	/**
-	 * Array of group member ids, cached to prevent redundant lookups.
-	 *
-	 * @since BuddyPress (1.8.1)
-	 * @access protected
-	 * @var null|array Null if not yet defined, otherwise an array of ints.
-	 */
-	protected $group_member_ids;
-
-	/**
-	 * Set up action hooks.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function setup_hooks() {
-		// 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
-		if ( empty( $this->query_vars_raw['type'] ) ) {
-			$this->query_vars_raw['type'] = 'last_joined';
-		}
-
-		// Set the sort order
-		add_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) );
-
-		// Set up our populate_extras method
-		add_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
-	}
-
-	/**
-	 * Get a list of user_ids to include in the IN clause of the main query.
-	 *
-	 * Overrides BP_User_Query::get_include_ids(), adding our additional
-	 * group-member logic.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param array $include Existing group IDs in the $include parameter,
-	 *        as calculated in BP_User_Query.
-	 * @return array
-	 */
-	public function get_include_ids( $include = array() ) {
-		// The following args are specific to group member queries, and
-		// are not present in the query_vars of a normal BP_User_Query.
-		// We loop through to make sure that defaults are set (though
-		// values passed to the constructor will, as usual, override
-		// these defaults).
-		$this->query_vars = wp_parse_args( $this->query_vars, array(
-			'group_id'     => 0,
-			'group_role'   => array( 'member' ),
-			'is_confirmed' => true,
-			'invite_sent'  => null,
-			'inviter_id'   => null,
-			'type'         => 'last_joined',
-		) );
-
-		$group_member_ids = $this->get_group_member_ids();
-
-		// If the group member query returned no users, bail with an
-		// array that will guarantee no matches for BP_User_Query
-		if ( empty( $group_member_ids ) ) {
-			return array( 0 );
-		}
-
-		if ( ! empty( $include ) ) {
-			$group_member_ids = array_intersect( $include, $group_member_ids );
-		}
-
-		return $group_member_ids;
-	}
-
-	/**
-	 * Get the members of the queried group.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @return array $ids User IDs of relevant group member ids.
-	 */
-	protected function get_group_member_ids() {
-		global $wpdb;
-
-		if ( is_array( $this->group_member_ids ) ) {
-			return $this->group_member_ids;
-		}
-
-		$bp  = buddypress();
-		$sql = array(
-			'select'  => "SELECT user_id FROM {$bp->groups->table_name_members}",
-			'where'   => array(),
-			'orderby' => '',
-			'order'   => '',
-		);
-
-		/** WHERE clauses *****************************************************/
-
-		// Group id
-		$sql['where'][] = $wpdb->prepare( "group_id = %d", $this->query_vars['group_id'] );
-
-		// is_confirmed
-		$is_confirmed = ! empty( $this->query_vars['is_confirmed'] ) ? 1 : 0;
-		$sql['where'][] = $wpdb->prepare( "is_confirmed = %d", $is_confirmed );
-
-		// invite_sent
-		if ( ! is_null( $this->query_vars['invite_sent'] ) ) {
-			$invite_sent = ! empty( $this->query_vars['invite_sent'] ) ? 1 : 0;
-			$sql['where'][] = $wpdb->prepare( "invite_sent = %d", $invite_sent );
-		}
-
-		// 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)
-			if ( empty( $inviter_id ) ) {
-				$sql['where'][] = "inviter_id = 0";
-
-			// The string 'any' matches any non-zero value (inviter_id != 0)
-			} else if ( 'any' === $inviter_id ) {
-				$sql['where'][] = "inviter_id != 0";
-
-			// Assume that a list of inviter IDs has been passed
-			} else {
-				// Parse and sanitize
-				$inviter_ids = wp_parse_id_list( $inviter_id );
-				if ( ! empty( $inviter_ids ) ) {
-					$inviter_ids_sql = implode( ',', $inviter_ids );
-					$sql['where'][] = "inviter_id IN ({$inviter_ids_sql})";
-				}
-			}
-		}
-
-		// Role information is stored as follows: admins have
-		// is_admin = 1, mods have is_mod = 1, banned have is_banned =
-		// 1, and members have all three set to 0.
-		$roles = !empty( $this->query_vars['group_role'] ) ? $this->query_vars['group_role'] : array();
-		if ( is_string( $roles ) ) {
-			$roles = explode( ',', $roles );
-		}
-
-		// Sanitize: Only 'admin', 'mod', 'member', and 'banned' are valid
-		$allowed_roles = array( 'admin', 'mod', 'member', 'banned' );
-		foreach ( $roles as $role_key => $role_value ) {
-			if ( ! in_array( $role_value, $allowed_roles ) ) {
-				unset( $roles[ $role_key ] );
-			}
-		}
-
-		$roles = array_unique( $roles );
-
-		// 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
-		$roles_sql = '';
-		if ( in_array( 'member', $roles ) ) {
-			$role_columns = array();
-			foreach ( array_diff( $allowed_roles, $roles ) as $excluded_role ) {
-				$role_columns[] = 'is_' . $excluded_role . ' = 0';
-			}
-
-			if ( ! empty( $role_columns ) ) {
-				$roles_sql = '(' . implode( ' AND ', $role_columns ) . ')';
-			}
-
-		// When querying for a set of roles *not* containing 'member',
-		// simply construct a list of is_* = 1 clauses
-		} else {
-			$role_columns = array();
-			foreach ( $roles as $role ) {
-				$role_columns[] = 'is_' . $role . ' = 1';
-			}
-
-			if ( ! empty( $role_columns ) ) {
-				$roles_sql = '(' . implode( ' OR ', $role_columns ) . ')';
-			}
-		}
-
-		if ( ! empty( $roles_sql ) ) {
-			$sql['where'][] = $roles_sql;
-		}
-
-		$sql['where'] = ! empty( $sql['where'] ) ? 'WHERE ' . implode( ' AND ', $sql['where'] ) : '';
-
-		// We fetch group members in order of last_joined, regardless
-		// 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()
-		$sql['orderby'] = "ORDER BY date_modified";
-		$sql['order']   = 'first_joined' === $this->query_vars['type'] ? 'ASC' : 'DESC';
-
-		$this->group_member_ids = $wpdb->get_col( "{$sql['select']} {$sql['where']} {$sql['orderby']} {$sql['order']}" );
-
-		/**
-		 * Use this filter to build a custom query (such as when you've
-		 * defined a custom 'type').
-		 */
-		$this->group_member_ids = apply_filters( 'bp_group_member_query_group_member_ids', $this->group_member_ids, $this );
-
-		return $this->group_member_ids;
-	}
-
-	/**
-	 * Tell BP_User_Query to order by the order of our query results.
-	 *
-	 * We only override BP_User_Query's native ordering in case of the
-	 * 'last_joined' and 'first_joined' $type parameters.
-	 *
-	 * @param BP_User_Query $query BP_User_Query object.
-	 */
-	public function set_orderby( $query ) {
-		$gm_ids = $this->get_group_member_ids();
-		if ( empty( $gm_ids ) ) {
-			$gm_ids = array( 0 );
-		}
-
-		// For 'last_joined', 'first_joined', and 'group_activity'
-		// types, we override the default orderby clause of
-		// BP_User_Query. In the case of 'group_activity', we perform
-		// a separate query to get the necessary order. In the case of
-		// 'last_joined' and 'first_joined', we can trust the order of
-		// results from  BP_Group_Member_Query::get_group_members().
-		// In all other cases, we fall through and let BP_User_Query
-		// do its own (non-group-specific) ordering.
-		if ( in_array( $query->query_vars['type'], array( 'last_joined', 'first_joined', 'group_activity' ) ) ) {
-
-			// 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
-			$gm_ids = array_merge( array( 'u.id' ), wp_parse_id_list( $gm_ids ) );
-			$gm_ids_sql = implode( ',', $gm_ids );
-
-			$query->uid_clauses['orderby'] = "ORDER BY FIELD(" . $gm_ids_sql . ")";
-		}
-
-		// Prevent this filter from running on future BP_User_Query
-		// instances on the same page
-		remove_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) );
-	}
-
-	/**
-	 * Fetch additional data required in bp_group_has_members() loops.
-	 *
-	 * Additional data fetched:
-	 *
-	 *      - is_banned
-	 *      - date_modified
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param BP_User_Query $query BP_User_Query object. Because we're
-	 *        filtering the current object, we use $this inside of the
-	 *        method instead.
-	 * @param string $user_ids_sql Sanitized, comma-separated string of
-	 *        the user ids returned by the main query.
-	 */
-	public function populate_group_member_extras( $query, $user_ids_sql ) {
-		global $wpdb;
-
-		$bp     = buddypress();
-		$extras = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_modified, is_admin, is_mod, comments, user_title, invite_sent, is_confirmed, inviter_id, is_banned FROM {$bp->groups->table_name_members} WHERE user_id IN ({$user_ids_sql}) AND group_id = %d", $this->query_vars['group_id'] ) );
-
-		foreach ( (array) $extras as $extra ) {
-			if ( isset( $this->results[ $extra->user_id ] ) ) {
-				// 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;
-				$this->results[ $extra->user_id ]->is_mod        = (int) $extra->is_mod;
-				$this->results[ $extra->user_id ]->is_banned     = (int) $extra->is_banned;
-				$this->results[ $extra->user_id ]->date_modified = $extra->date_modified;
-				$this->results[ $extra->user_id ]->user_title    = $extra->user_title;
-				$this->results[ $extra->user_id ]->comments      = $extra->comments;
-				$this->results[ $extra->user_id ]->invite_sent   = (int) $extra->invite_sent;
-				$this->results[ $extra->user_id ]->inviter_id    = (int) $extra->inviter_id;
-				$this->results[ $extra->user_id ]->is_confirmed  = (int) $extra->is_confirmed;
-				$this->results[ $extra->user_id ]->membership_id = (int) $extra->id;
-			}
-		}
-
-		// 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 );
-	}
-
-	/**
-	 * Sort user IDs by how recently they have generated activity within a given group.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param BP_User_Query $query BP_User_Query object.
-	 * @param array $gm_ids array of group member ids.
-	 * @return array
-	 */
-	public function get_gm_ids_ordered_by_activity( $query, $gm_ids = array() ) {
-		global $wpdb;
-
-		if ( empty( $gm_ids ) ) {
-			return $gm_ids;
-		}
-
-		if ( ! bp_is_active( 'activity' ) ) {
-			return $gm_ids;
-		}
-
-		$activity_table = buddypress()->activity->table_name;
-
-		$sql = array(
-			'select'  => "SELECT user_id, max( date_recorded ) as date_recorded FROM {$activity_table}",
-			'where'   => array(),
-			'groupby' => 'GROUP BY user_id',
-			'orderby' => 'ORDER BY date_recorded',
-			'order'   => 'DESC',
-		);
-
-		$sql['where'] = array(
-			'user_id IN (' . implode( ',', wp_parse_id_list( $gm_ids ) ) . ')',
-			'item_id = ' . absint( $query->query_vars['group_id'] ),
-			$wpdb->prepare( "component = %s", buddypress()->groups->id ),
-		);
-
-		$sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] );
-
-		$group_user_ids = $wpdb->get_results( "{$sql['select']} {$sql['where']} {$sql['groupby']} {$sql['orderby']} {$sql['order']}" );
-
-		return wp_list_pluck( $group_user_ids, 'user_id' );
-	}
-}
-
-/**
- * BuddyPress Group Membership object.
- */
-class BP_Groups_Member {
-
-	/**
-	 * ID of the membership.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $id;
-
-	/**
-	 * ID of the group associated with the membership.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $group_id;
-
-	/**
-	 * ID of the user associated with the membership.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $user_id;
-
-	/**
-	 * ID of the user whose invitation initiated the membership.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $inviter_id;
-
-	/**
-	 * Whether the member is an admin of the group.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $is_admin;
-
-	/**
-	 * Whether the member is a mod of the group.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $is_mod;
-
-	/**
-	 * Whether the member is banned from the group.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $is_banned;
-
-	/**
-	 * Title used to describe the group member's role in the group.
-	 *
-	 * Eg, 'Group Admin'.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $user_title;
-
-	/**
-	 * Last modified date of the membership.
-	 *
-	 * This value is updated when, eg, invitations are accepted.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	var $date_modified;
-
-	/**
-	 * Whether the membership has been confirmed.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $is_confirmed;
-
-	/**
-	 * Comments associated with the membership.
-	 *
-	 * In BP core, these are limited to the optional message users can
-	 * include when requesting membership to a private group.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	var $comments;
-
-	/**
-	 * Whether an invitation has been sent for this membership.
-	 *
-	 * The purpose of this flag is to mark when an invitation has been
-	 * "drafted" (the user has been added via the interface at Send
-	 * Invites), but the Send button has not been pressed, so the
-	 * invitee has not yet been notified.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	var $invite_sent;
-
-	/**
-	 * WP_User object representing the membership's user.
-	 *
-	 * @access public
-	 * @var WP_User
-	 */
-	var $user;
-
-	/**
-	 * Constructor method.
-	 *
-	 * @param int $user_id Optional. Along with $group_id, can be used to
-	 *        look up a membership.
-	 * @param int $group_id Optional. Along with $user_id, can be used to
-	 *        look up a membership.
-	 * @param int $id Optional. The unique ID of the membership object.
-	 * @param bool $populate Whether to populate the properties of the
-	 *        located membership. Default: true.
-	 */
-	public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
-
-		// User and group are not empty, and ID is
-		if ( !empty( $user_id ) && !empty( $group_id ) && empty( $id ) ) {
-			$this->user_id  = $user_id;
-			$this->group_id = $group_id;
-
-			if ( !empty( $populate ) ) {
-				$this->populate();
-			}
-		}
-
-		// ID is not empty
-		if ( !empty( $id ) ) {
-			$this->id = $id;
-
-			if ( !empty( $populate ) ) {
-				$this->populate();
-			}
-		}
-	}
-
-	/**
-	 * Populate the object's properties.
-	 */
-	public function populate() {
-		global $wpdb, $bp;
-
-		if ( $this->user_id && $this->group_id && !$this->id )
-			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
-
-		if ( !empty( $this->id ) )
-			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE id = %d", $this->id );
-
-		$member = $wpdb->get_row($sql);
-
-		if ( !empty( $member ) ) {
-			$this->id            = $member->id;
-			$this->group_id      = $member->group_id;
-			$this->user_id       = $member->user_id;
-			$this->inviter_id    = $member->inviter_id;
-			$this->is_admin      = $member->is_admin;
-			$this->is_mod        = $member->is_mod;
-			$this->is_banned     = $member->is_banned;
-			$this->user_title    = $member->user_title;
-			$this->date_modified = $member->date_modified;
-			$this->is_confirmed  = $member->is_confirmed;
-			$this->comments      = $member->comments;
-			$this->invite_sent   = $member->invite_sent;
-
-			$this->user = new BP_Core_User( $this->user_id );
-		}
-	}
-
-	/**
-	 * Save the membership data to the database.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->user_id       = apply_filters( 'groups_member_user_id_before_save',       $this->user_id,       $this->id );
-		$this->group_id      = apply_filters( 'groups_member_group_id_before_save',      $this->group_id,      $this->id );
-		$this->inviter_id    = apply_filters( 'groups_member_inviter_id_before_save',    $this->inviter_id,    $this->id );
-		$this->is_admin      = apply_filters( 'groups_member_is_admin_before_save',      $this->is_admin,      $this->id );
-		$this->is_mod        = apply_filters( 'groups_member_is_mod_before_save',        $this->is_mod,        $this->id );
-		$this->is_banned     = apply_filters( 'groups_member_is_banned_before_save',     $this->is_banned,     $this->id );
-		$this->user_title    = apply_filters( 'groups_member_user_title_before_save',    $this->user_title,    $this->id );
-		$this->date_modified = apply_filters( 'groups_member_date_modified_before_save', $this->date_modified, $this->id );
-		$this->is_confirmed  = apply_filters( 'groups_member_is_confirmed_before_save',  $this->is_confirmed,  $this->id );
-		$this->comments      = apply_filters( 'groups_member_comments_before_save',      $this->comments,      $this->id );
-		$this->invite_sent   = apply_filters( 'groups_member_invite_sent_before_save',   $this->invite_sent,   $this->id );
-
-		do_action_ref_array( 'groups_member_before_save', array( &$this ) );
-
-		if ( !empty( $this->id ) ) {
-			$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
-			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;
-			}
-
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_members} ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d )", $this->user_id, $this->group_id, $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 );
-		}
-
-		if ( !$wpdb->query( $sql ) )
-			return false;
-
-		$this->id = $wpdb->insert_id;
-
-		// Update the user's group count
-		self::refresh_total_group_count_for_user( $this->user_id );
-
-		// Update the group's member count
-		self::refresh_total_member_count_for_group( $this->group_id );
-
-		do_action_ref_array( 'groups_member_after_save', array( &$this ) );
-
-		return true;
-	}
-
-	/**
-	 * Promote a member to a new status.
-	 *
-	 * @param string $status The new status. 'mod' or 'admin'.
-	 * @return bool True on success, false on failure.
-	 */
-	public function promote( $status = 'mod' ) {
-		if ( 'mod' == $status ) {
-			$this->is_admin   = 0;
-			$this->is_mod     = 1;
-			$this->user_title = __( 'Group Mod', 'buddypress' );
-		}
-
-		if ( 'admin' == $status ) {
-			$this->is_admin   = 1;
-			$this->is_mod     = 0;
-			$this->user_title = __( 'Group Admin', 'buddypress' );
-		}
-
-		return $this->save();
-	}
-
-	/**
-	 * Demote membership to Member status (non-admin, non-mod).
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function demote() {
-		$this->is_mod     = 0;
-		$this->is_admin   = 0;
-		$this->user_title = false;
-
-		return $this->save();
-	}
-
-	/**
-	 * Ban the user from the group.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function ban() {
-		if ( !empty( $this->is_admin ) )
-			return false;
-
-		$this->is_mod = 0;
-		$this->is_banned = 1;
-
-		return $this->save();
-	}
-
-	/**
-	 * Unban the user from the group.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function unban() {
-		if ( !empty( $this->is_admin ) )
-			return false;
-
-		$this->is_banned = 0;
-
-		return $this->save();
-	}
-
-	/**
-	 * Mark a pending invitation as accepted.
-	 */
-	public function accept_invite() {
-		$this->inviter_id    = 0;
-		$this->is_confirmed  = 1;
-		$this->date_modified = bp_core_current_time();
-	}
-
-	/**
-	 * Confirm a membership request.
-	 */
-	public function accept_request() {
-		$this->is_confirmed = 1;
-		$this->date_modified = bp_core_current_time();
-	}
-
-	/**
-	 * Remove the current membership.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function remove() {
-		global $wpdb, $bp;
-
-		$sql = $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
-
-		if ( !$result = $wpdb->query( $sql ) )
-			return false;
-
-		// Update the user's group count
-		self::refresh_total_group_count_for_user( $this->user_id );
-
-		// Update the group's member count
-		self::refresh_total_member_count_for_group( $this->group_id );
-
-		return $result;
-	}
-
-	/** Static Methods ****************************************************/
-
-	/**
-	 * Refresh the total_group_count for a user.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param int $user_id ID of the user.
-	 * @return bool True on success, false on failure.
-	 */
-	public static function refresh_total_group_count_for_user( $user_id ) {
-		return bp_update_user_meta( $user_id, 'total_group_count', (int) self::total_group_count( $user_id ) );
-	}
-
-	/**
-	 * Refresh the total_member_count for a group.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return bool True on success, false on failure.
-	 */
-	public static function refresh_total_member_count_for_group( $group_id ) {
-		return groups_update_groupmeta( $group_id, 'total_member_count', (int) BP_Groups_Group::get_total_member_count( $group_id ) );
-	}
-
-	/**
-	 * Delete a membership, based on user + group IDs.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @return True on success, false on failure.
-	 */
-	public static function delete( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		$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
-		self::refresh_total_group_count_for_user( $user_id );
-
-		// Update the group's member count
-		self::refresh_total_member_count_for_group( $group_id );
-
-		return $remove;
-	}
-
-	/**
-	 * Get the IDs of the groups of which a specified user is a member.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $limit Optional. Max number of results to return.
-	 *        Default: false (no limit).
-	 * @param int $page Optional. Page offset of results to return.
-	 *        Default: false (no limit).
-	 * @return array {
-	 *     @type array $groups Array of groups returned by paginated query.
-	 *     @type int $total Count of groups matching query.
-	 * }
-	 */
-	public static function get_group_ids( $user_id, $limit = false, $page = false ) {
-		global $wpdb, $bp;
-
-		$pag_sql = '';
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		// 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 );
-			$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(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", $user_id ) );
-		} else {
-			$group_sql = $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0{$pag_sql}", $user_id );
-			$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id ) );
-		}
-
-		$groups = $wpdb->get_col( $group_sql );
-
-		return array( 'groups' => $groups, 'total' => (int) $total_groups );
-	}
-
-	/**
-	 * Get the IDs of the groups of which a specified user is a member, sorted by the date joined.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $limit Optional. Max number of results to return.
-	 *        Default: false (no limit).
-	 * @param int $page Optional. Page offset of results to return.
-	 *        Default: false (no limit).
-	 * @param string $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_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
-		global $wpdb, $bp;
-
-		$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'";
-
-		$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 ORDER BY m.date_modified DESC {$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_banned = 0 AND m.is_confirmed = 1 ORDER BY m.date_modified DESC" );
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get the IDs of the groups of which a specified user is an admin.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $limit Optional. Max number of results to return.
-	 *        Default: false (no limit).
-	 * @param int $page Optional. Page offset of results to return.
-	 *        Default: false (no limit).
-	 * @param string $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_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
-		global $wpdb, $bp;
-
-		$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'";
-
-		$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_admin = 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_admin = 1 ORDER BY date_modified ASC" );
-
-		return array( 'groups' => $paged_groups, 'total' => $total_groups );
-	}
-
-	/**
-	 * Get the IDs of the groups of which a specified user is a moderator.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $limit Optional. Max number of results to return.
-	 *        Default: false (no limit).
-	 * @param int $page Optional. Page offset of results to return.
-	 *        Default: false (no limit).
-	 * @param string $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, $bp;
-
-		$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'";
-
-		$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 count of groups of which the specified user is a member.
-	 *
-	 * @param int $user_id Optional. Default: ID of the displayed user.
-	 * @return int Group count.
-	 */
-	public static function total_group_count( $user_id = 0 ) {
-		global $bp, $wpdb;
-
-		if ( empty( $user_id ) )
-			$user_id = bp_displayed_user_id();
-
-		if ( $user_id != bp_loggedin_user_id() && !bp_current_user_can( 'bp_moderate' ) ) {
-			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
-		} else {
-			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
-		}
-	}
-
-	/**
-	 * Get a user's outstanding group invitations.
-	 *
-	 * @param int $user_id ID of the invitee.
-	 * @param int $limit Optional. Max number of results to return.
-	 *        Default: false (no limit).
-	 * @param int $page Optional. Page offset of results to return.
-	 *        Default: false (no limit).
-	 * @param string|array $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.
-	 *     @type int $total Count of groups matching query.
-	 * }
-	 */
-	public static function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) {
-		global $wpdb, $bp;
-
-		$pag_sql = ( !empty( $limit ) && !empty( $page ) ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
-
-		if ( !empty( $exclude ) ) {
-			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
-			$exclude_sql = " AND g.id NOT IN ({$exclude})";
-		} else {
-			$exclude_sql = '';
-		}
-
-		$paged_groups = $wpdb->get_results( $wpdb->prepare( "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' AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d {$exclude_sql} ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
-
-		return array( 'groups' => $paged_groups, 'total' => self::get_invite_count_for_user( $user_id ) );
-	}
-
-	/**
-	 * Gets the total group invite count for a user.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param int $user_id The user ID
-	 * @return int
-	 */
-	public static function get_invite_count_for_user( $user_id = 0 ) {
-		global $wpdb;
-
-		$bp = buddypress();
-
-		$count = wp_cache_get( $user_id, 'bp_group_invite_count' );
-
-		if ( false === $count ) {
-			$count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d", $user_id ) );
-			wp_cache_set( $user_id, $count, 'bp_group_invite_count' );
-		}
-
-		return $count;
-	}
-
-	/**
-	 * Check whether a user has an outstanding invitation to a given group.
-	 *
-	 * @param int $user_id ID of the potential invitee.
-	 * @param int $group_id ID of the group.
-	 * @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.
-	 */
-	public static function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		$sql = "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0";
-
-		if ( 'sent' == $type )
-			$sql .= " AND invite_sent = 1";
-
-		return $wpdb->get_var( $wpdb->prepare( $sql, $user_id, $group_id ) );
-	}
-
-	/**
-	 * Delete an invitation, by specifying user ID and group ID.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @return int Number of records deleted.
-	 */
-	public static function delete_invite( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0 AND invite_sent = 1", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Delete an unconfirmed membership request, by user ID and group ID.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @return int Number of records deleted.
-	 */
-	public static function delete_request( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
- 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id = 0 AND invite_sent = 0", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Check whether a user is an admin of a given group.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @param int|null ID of the membership if the user is an admin,
-	 *        otherwise null.
-	 */
-	public static function check_is_admin( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_admin = 1 AND is_banned = 0", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Check whether a user is a mod of a given group.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @param int|null ID of the membership if the user is a mod,
-	 *        otherwise null.
-	 */
-	public static function check_is_mod( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_mod = 1 AND is_banned = 0", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Check whether a user is a member of a given group.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @param int|null ID of the membership if the user is a member,
-	 *        otherwise null.
-	 */
-	public static function check_is_member( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Check whether a user is banned from a given group.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $group_id ID of the group.
-	 * @param int|null ID of the membership if the user is banned,
-	 *        otherwise null.
-	 */
-	public static function check_is_banned( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT is_banned FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Is the specified user the creator of the group?
-	 *
-	 * @since BuddyPress (1.2.6)
-	 *
-	 * @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.
-	 */
-	public static function check_is_creator( $user_id, $group_id ) {
-		global $bp, $wpdb;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name} WHERE creator_id = %d AND id = %d", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Check whether a user has an outstanding membership request for a given group.
-	 *
-	 * @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.
-	 */
-	public static function check_for_membership_request( $user_id, $group_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			return false;
-
-		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND is_banned = 0 AND inviter_id = 0", $user_id, $group_id ) );
-	}
-
-	/**
-	 * Get a list of randomly selected IDs of groups that the member belongs to.
-	 *
-	 * @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.
-	 */
-	public static function get_random_groups( $user_id = 0, $total_groups = 5 ) {
-		global $wpdb, $bp;
-
-		// 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 ) );
-		} else {
-			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT %d", $user_id, $total_groups ) );
-		}
-	}
-
-	/**
-	 * Get the IDs of all a given group's members.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return array IDs of all group members.
-	 */
-	public static function get_group_member_ids( $group_id ) {
-		global $bp, $wpdb;
-
-		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
-	}
-
-	/**
-	 * Get a list of all a given group's admins.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return array Info about group admins (user_id + date_modified).
-	 */
-	public static function get_group_administrator_ids( $group_id ) {
-		global $bp, $wpdb;
-
-		$group_admins = wp_cache_get( $group_id, 'bp_group_admins' );
-
-		if ( false === $group_admins ) {
-			$group_admins = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) );
-
-			wp_cache_set( $group_id, $group_admins, 'bp_group_admins' );
-		}
-
-		return $group_admins;
-	}
-
-	/**
-	 * Get a list of all a given group's moderators.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return array Info about group mods (user_id + date_modified).
-	 */
-	public static function get_group_moderator_ids( $group_id ) {
-		global $bp, $wpdb;
-
-		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_mod = 1 AND is_banned = 0", $group_id ) );
-	}
-
-	/**
-	 * Get the IDs users with outstanding membership requests to the group.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return array IDs of users with outstanding membership requests.
-	 */
-	public static function get_all_membership_request_user_ids( $group_id ) {
-		global $bp, $wpdb;
-
-		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
-	}
-
-	/**
-	 * Get members of a group.
-	 *
-	 * @deprecated BuddyPress (1.8.0)
-	 */
-	public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
-		global $bp, $wpdb;
-
-		_deprecated_function( __METHOD__, '1.8', 'BP_Group_Member_Query' );
-
-		$pag_sql = '';
-		if ( !empty( $limit ) && !empty( $page ) )
-			$pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
-		$exclude_admins_sql = '';
-		if ( !empty( $exclude_admins_mods ) )
-			$exclude_admins_sql = "AND is_admin = 0 AND is_mod = 0";
-
-		$banned_sql = '';
-		if ( !empty( $exclude_banned ) )
-			$banned_sql = " AND is_banned = 0";
-
-		$exclude_sql = '';
-		if ( !empty( $exclude ) ) {
-			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
-			$exclude_sql = " AND m.user_id NOT IN ({$exclude})";
-		}
-
-		if ( bp_is_active( 'xprofile' ) ) {
-			$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
-		} else {
-			$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u WHERE u.ID = m.user_id AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
-		}
-
-		if ( empty( $members ) ) {
-			return false;
-		}
-
-		if ( empty( $pag_sql ) ) {
-			$total_member_count = count( $members );
-		} else {
-			$total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} m WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) );
-		}
-
-		// Fetch whether or not the user is a friend
-		foreach ( (array) $members as $user )
-			$user_ids[] = $user->user_id;
-
-		$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
-
-		if ( bp_is_active( 'friends' ) ) {
-			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
-			for ( $i = 0, $count = count( $members ); $i < $count; ++$i ) {
-				foreach ( (array) $friend_status as $status ) {
-					if ( $status->initiator_user_id == $members[$i]->user_id || $status->friend_user_id == $members[$i]->user_id ) {
-						$members[$i]->is_friend = $status->is_confirmed;
-					}
-				}
-			}
-		}
-
-		return array( 'members' => $members, 'count' => $total_member_count );
-	}
-
-	/**
-	 * Delete all memberships for a given group.
-	 *
-	 * @param int $group_id ID of the group.
-	 * @return int Number of records deleted.
-	 */
-	public static function delete_all( $group_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
-	}
-
-	/**
-	 * Delete all group membership information for the specified user.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $user_id ID of the user.
-	 */
-	public static function delete_all_for_user( $user_id ) {
-		global $bp, $wpdb;
-
-		// 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 ( 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 );
-		}
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d", $user_id ) );
-	}
-}
-
-/**
- * API for creating group extensions without having to hardcode the content into
- * the theme.
- *
- * To implement, extend this class. In your constructor, pass an optional array
- * of arguments to parent::init() to configure your widget. The config array
- * supports the following values:
- *   - 'slug' A unique identifier for your extension. This value will be used
- *     to build URLs, so make it URL-safe
- *   - 'name' A translatable name for your extension. This value is used to
-       populate the navigation tab, as well as the default titles for admin/
-       edit/create tabs.
- *   - 'visibility' Set to 'public' (default) for your extension (the main tab
- *     as well as the widget) to be available to anyone who can access the
- *     group, 'private' otherwise.
- *   - 'nav_item_position' An integer explaining where the nav item should
- *     appear in the tab list
- *   - 'enable_nav_item' Set to true for your extension's main tab to be
- *     available to anyone who can access the group.
- *   - 'nav_item_name' The translatable text you want to appear in the nav tab.
- *     Defaults to the value of 'name'.
- *   - 'display_hook' The WordPress action that the widget_display() method is
- *     hooked to
- *   - 'template_file' The template file that will be used to load the content
- *     of your main extension tab. Defaults to 'groups/single/plugins.php'.
- *   - 'screens' A multi-dimensional array, described below
- *
- * BP_Group_Extension uses the concept of "settings screens". There are three
- * contexts for settings screens:
- *   - 'create', which inserts a new step into the group creation process
- *   - 'edit', which adds a tab for your extension into the Admin section of
- *     a group
- *   - 'admin', which adds a metabox to the Groups administration panel in the
- *     WordPress Dashboard
- * Each of these settings screens is populated by a pair of methods: one that
- * creates the markup for the screen, and one that processes form data
- * submitted from the screen. If your plugin needs screens in all three
- * contexts, and if the markup and form processing logic will be the same in
- * each case, you can define two methods to handle all of the screens:
- *   function settings_screen() {}
- *   function settings_screen_save() {}
- * If one or more of your settings screen needs separate logic, you may define
- * context-specific methods, for example:
- *   function edit_screen() {}
- *   function edit_screen_save() {}
- * BP_Group_Extension will use the more specific methods if they are available.
- *
- * You can further customize the settings screens (tab names, etc) by passing
- * an optional 'screens' parameter to the init array. The format is as follows:
- *   '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( // ...
- *   ),
- * Only provide those arguments that you actually want to change from the
- * default configuration. BP_Group_Extension will do the rest.
- *
- * Note that the 'edit' screen accepts an additional parameter: 'submit_text',
- * which defines the text of the Submit button automatically added to the Edit
- * screen of the extension (defaults to 'Save Changes'). Also, the 'admin'
- * screen accepts two additional parameters: 'metabox_priority' and
- * 'metabox_context'. See the docs for add_meta_box() for more details on these
- * arguments.
- *
- * Prior to BuddyPress 1.7, group extension configurations were set slightly
- * differently. The legacy method is still supported, though deprecated.
- *
- * @package BuddyPress
- * @subpackage Groups
- * @since BuddyPress (1.1.0)
- */
-class BP_Group_Extension {
-
-	/** Public ************************************************************/
-
-	/**
-	 * Information about this extension's screens.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access public
-	 * @var array
-	 */
-	public $screens = array();
-
-	/**
-	 * The name of the extending class.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access public
-	 * @var string
-	 */
-	public $class_name = '';
-
-	/**
-	 * A ReflectionClass object of the current extension.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access public
-	 * @var ReflectionClass
-	 */
-	public $class_reflection = null;
-
-	/**
-	 * Parsed configuration paramaters for the extension.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access public
-	 * @var array
-	 */
-	public $params = array();
-
-	/**
-	 * Raw config params, as passed by the extending class.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @access public
-	 * @var array
-	 */
-	public $params_raw = array();
-
-	/**
-	 * The ID of the current group.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access public
-	 * @var int
-	 */
-	public $group_id = 0;
-
-	/**
-	 * The slug of the current extension.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $slug = '';
-
-	/**
-	 * The translatable name of the current extension.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $name = '';
-
-	/**
-	 * The visibility of the extension tab. 'public' or 'private'.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $visibility = 'public';
-
-	/**
-	 * The numeric position of the main nav item.
-	 *
-	 * @access public
-	 * @var int
-	 */
-	public $nav_item_position = 81;
-
-	/**
-	 * Whether to show the nav item.
-	 *
-	 * @access public
-	 * @var bool
-	 */
-	public $enable_nav_item = true;
-
-	/**
-	 * Whether the current user should see the navigation item.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @access public
-	 * @var bool
-	 */
-	public $user_can_see_nav_item;
-
-	/**
-	 * Whether the current user can visit the tab.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @access public
-	 * @var bool
-	 */
-	public $user_can_visit;
-
-	/**
-	 * The text of the nav item. Defaults to self::name.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $nav_item_name = '';
-
-	/**
-	 * The WP action that self::widget_display() is attached to.
-	 *
-	 * Default: 'groups_custom_group_boxes'.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $display_hook = 'groups_custom_group_boxes';
-
-	/**
-	 * The template file used to load the plugin content.
-	 *
-	 * Default: 'groups/single/plugins'.
-	 *
-	 * @access public
-	 * @var string
-	 */
-	public $template_file = 'groups/single/plugins';
-
-	/** Protected *********************************************************/
-
-	/**
-	 * Has the extension been initialized?
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 * @var bool
-	 */
-	protected $initialized = false;
-
-	/**
-	 * Extension properties as set by legacy extensions.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 * @var array
-	 */
-	protected $legacy_properties = array();
-
-	/**
-	 * Converted legacy parameters.
-	 *
-	 * These are the extension properties as set by legacy extensions, but
-	 * then converted to match the new format for params.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 * @var array
-	 */
-	protected $legacy_properties_converted = array();
-
-	/**
-	 * Redirect location as defined by post-edit save callback.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @access protected
-	 * @var string
-	 */
-	protected $post_save_redirect;
-
-	/**
-	 * Miscellaneous data as set by the __set() magic method.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access protected
-	 * @var array
-	 */
-	protected $data = array();
-
-	/** Screen Overrides **************************************************/
-
-	/*
-	 * Screen override methods are how your extension will display content
-	 * and handle form submits. Your extension should only override those
-	 * methods that it needs for its purposes.
-	 */
-
-	// The content of the group tab
-	public function display() {}
-
-	// Content displayed in a widget sidebar, if applicable
-	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.
-	public function settings_screen( $group_id = null ) {}
-	public function settings_screen_save( $group_id = null ) {}
-	public function edit_screen( $group_id = null ) {}
-	public function edit_screen_save( $group_id = null ) {}
-	public function create_screen( $group_id = null ) {}
-	public function create_screen_save( $group_id = null ) {}
-	public function admin_screen( $group_id = null ) {}
-	public function admin_screen_save( $group_id = null ) {}
-
-	/** Setup *************************************************************/
-
-	/**
-	 * Initialize the extension, using your config settings
-	 *
-	 * Your plugin should call this method at the very end of its
-	 * constructor, like so:
-	 *
-	 *   public function __construct() {
-	 *       $args = array(
-	 *           'slug' => 'my-group-extension',
-	 *           'name' => 'My Group Extension',
-	 *           // ...
-	 *       );
-	 *
-	 *       parent::init( $args );
-	 *   }
-	 *
-	 * @since BuddyPress (1.8)
-	 * @param array $args {
-	 *     Array of initialization arguments.
-	 *     @type string $slug Unique, URL-safe identifier for your
-	 *           extension.
-	 *     @type string $name Translatable name for your extension. Used to
-	 *           populate navigation items.
-	 *     @type string $visibility Optional. Set to 'public' for your
-	 *           extension (the main tab as well as the widget) to be
-	 *           available to anyone who can access the group; set to
-	 *           'private' otherwise. Default: 'public'.
-	 *     @type int $nav_item_position Optional. Location of the nav item
-	 *           in the tab list. Default: 81.
-	 *     @type bool $enable_nav_item Optional. Whether the extension's
-	 *           tab should be accessible to anyone who can view the group.
-	 *           Default: true.
-	 *     @type string $nav_item_name Optional. The translatable text you
-	 *           want to appear in the nav tab. Default: the value of $name.
-	 *     @type string $display_hook Optional. The WordPress action that
-	 *           the widget_display() method is hooked to.
-	 *           Default: 'groups_custom_group_boxes'.
-	 *     @type string $template_file Optional. Theme-relative path to the
-	 *           template file BP should use to load the content of your
-	 *           main extension tab. Default: 'groups/single/plugins.php'.
-	 *     @type array $screens A multi-dimensional array of configuration
-	 *           information for the extension screens. See docblock of
-	 *           {@link BP_Group_Extension} for more details.
-	 * }
-	 */
-	public function init( $args = array() ) {
-		// Store the raw arguments
-		$this->params_raw = $args;
-
-		// Before this init() method was introduced, plugins were
-		// encouraged to set their config directly. For backward
-		// compatibility with these plugins, we detect whether this is
-		// one of those legacy plugins, and parse any legacy arguments
-		// with those passed to init()
-		$this->parse_legacy_properties();
-		$args = $this->parse_args_r( $args, $this->legacy_properties_converted );
-
-		// Parse with defaults
-		$this->params = $this->parse_args_r( $args, array(
-			'slug'              => $this->slug,
-			'name'              => $this->name,
-			'visibility'        => $this->visibility,
-			'nav_item_position' => $this->nav_item_position,
-			'enable_nav_item'   => (bool) $this->enable_nav_item,
-			'nav_item_name'     => $this->nav_item_name,
-			'display_hook'      => $this->display_hook,
-			'template_file'     => $this->template_file,
-			'screens'           => $this->get_default_screens(),
-			'access'            => null,
-			'show_tab'          => null,
-		) );
-
-		$this->initialized = true;
-	}
-
-	/**
-	 * The main setup routine for the extension.
-	 *
-	 * This method contains the primary logic for setting up an extension's
-	 * configuration, setting up backward compatibility for legacy plugins,
-	 * and hooking the extension's screen functions into WP and BP.
-	 *
-	 * Marked 'public' because it must be accessible to add_action().
-	 * However, you should never need to invoke this method yourself - it
-	 * is called automatically at the right point in the load order by
-	 * bp_register_group_extension().
-	 *
-	 * @since BuddyPress (1.1.0)
-	 */
-	public function _register() {
-
-		// 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
-		if ( true !== $this->initialized ) {
-			$this->init();
-		}
-
-		// Set some config values, based on the parsed params
-		$this->group_id          = $this->get_group_id();
-		$this->slug              = $this->params['slug'];
-		$this->name              = $this->params['name'];
-		$this->visibility        = $this->params['visibility'];
-		$this->nav_item_position = $this->params['nav_item_position'];
-		$this->nav_item_name     = $this->params['nav_item_name'];
-		$this->display_hook      = $this->params['display_hook'];
-		$this->template_file     = $this->params['template_file'];
-
-		// Configure 'screens': create, admin, and edit contexts
-		$this->setup_screens();
-
-		// 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
-		$this->setup_legacy_properties();
-
-		// Hook the extension into BuddyPress
-		$this->setup_display_hooks();
-		$this->setup_create_hooks();
-		$this->setup_edit_hooks();
-		$this->setup_admin_hooks();
-	}
-
-	/**
-	 * Set up some basic info about the Extension.
-	 *
-	 * Here we collect the name of the extending class, as well as a
-	 * ReflectionClass that is used in get_screen_callback() to determine
-	 * whether your extension overrides certain callback methods.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function setup_class_info() {
-		if ( empty( $this->class_name ) ) {
-			$this->class_name = get_class( $this );
-		}
-
-		if ( is_null( $this->class_reflection ) ) {
-			$this->class_reflection = new ReflectionClass( $this->class_name );
-		}
-	}
-
-	/**
-	 * Get the current group ID.
-	 *
-	 * Check for:
-	 *   - current group
-	 *   - new group
-	 *   - group admin
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @return int
-	 */
-	public static function get_group_id() {
-
-		// Usually this will work
-		$group_id = bp_get_current_group_id();
-
-		// 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'];
-		}
-
-		// This fallback will only be hit when the create step is very
-		// early
-		if ( empty( $group_id ) && bp_get_new_group_id() ) {
-			$group_id = bp_get_new_group_id();
-		}
-
-		// 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
-		if ( empty( $group_id ) && isset( $_POST['group_id'] ) ) {
-			$group_id = (int) $_POST['group_id'];
-		}
-
-		return $group_id;
-	}
-
-	/**
-	 * Gather configuration data about your screens.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @return array
-	 */
-	protected function get_default_screens() {
-		$this->setup_class_info();
-
-		$screens = array(
-			'create' => array(
-				'position' => 81,
-			),
-			'edit'   => array(
-				'submit_text' => __( 'Save Changes', 'buddypress' ),
-			),
-			'admin'  => array(
-				'metabox_context'  => 'normal',
-				'metabox_priority' => 'core',
-			),
-		);
-
-		foreach ( $screens as $context => &$screen ) {
-			$screen['enabled']     = true;
-			$screen['name']        = $this->name;
-			$screen['slug']        = $this->slug;
-
-			$screen['screen_callback']      = $this->get_screen_callback( $context, 'screen'      );
-			$screen['screen_save_callback'] = $this->get_screen_callback( $context, 'screen_save' );
-		}
-
-		return $screens;
-	}
-
-	/**
-	 * Set up screens array based on params.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function setup_screens() {
-		foreach ( (array) $this->params['screens'] as $context => $screen ) {
-			if ( empty( $screen['slug'] ) ) {
-				$screen['slug'] = $this->slug;
-			}
-
-			if ( empty( $screen['name'] ) ) {
-				$screen['name'] = $this->name;
-			}
-
-			$this->screens[ $context ] = $screen;
-		}
-	}
-
-	/**
-	 * Set up access-related settings for this extension.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 */
-	protected function setup_access_settings() {
-		// Bail if no gruop ID is available
-		if ( empty( $this->group_id ) ) {
-			return;
-		}
-
-		// Backward compatibility
-		if ( isset( $this->params['enable_nav_item'] ) ) {
-			$this->enable_nav_item = (bool) $this->params['enable_nav_item'];
-		}
-
-		// Tab Access
-		$this->user_can_visit = false;
-
-		// Backward compatibility for components that do not provide
-		// explicit 'access' parameter
-		if ( empty( $this->params['access'] ) ) {
-			if ( false === $this->enable_nav_item ) {
-				$this->params['access'] = 'noone';
-			} else {
-				$group = groups_get_group( array(
-					'group_id' => $this->group_id,
-				) );
-
-				if ( ! empty( $group->status ) && 'public' === $group->status ) {
-					// Tabs in public groups are accessible to anyone by default
-					$this->params['access'] = 'anyone';
-				} else {
-					// All other groups have members-only as the default
-					$this->params['access'] = 'member';
-				}
-			}
-		}
-
-		// Parse multiple access conditions into an array
-		$access_conditions = $this->params['access'];
-		if ( ! is_array( $access_conditions ) ) {
-			$access_conditions = explode( ',', $access_conditions );
-		}
-
-		// If the current user meets at least one condition, the
-		// get access
-		foreach ( $access_conditions as $access_condition ) {
-			if ( $this->user_meets_access_condition( $access_condition ) ) {
-				$this->user_can_visit = true;
-				break;
-			}
-		}
-
-		// Tab Visibility
-		$this->user_can_see_nav_item = false;
-
-		// Backward compatibility for components that do not provide
-		// 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
-				// defined explicitly as such in the
-				// constructor. So we always trust this value
-				$this->params['show_tab'] = 'noone';
-
-			} else if ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) {
-				// If enable_nav_item or visibility is passed,
-				// we assume this  is a legacy extension.
-				// Legacy behavior is that enable_nav_item=true +
-				// visibility=private implies members-only
-				if ( 'public' !== $this->visibility ) {
-					$this->params['show_tab'] = 'member';
-				} else {
-					$this->params['show_tab'] = 'anyone';
-				}
-
-			} else {
-				// No show_tab or enable_nav_item value is
-				// available, so match the value of 'access'
-				$this->params['show_tab'] = $this->params['access'];
-			}
-		}
-
-		// Parse multiple access conditions into an array
-		$access_conditions = $this->params['show_tab'];
-		if ( ! is_array( $access_conditions ) ) {
-			$access_conditions = explode( ',', $access_conditions );
-		}
-
-		// If the current user meets at least one condition, the
-		// get access
-		foreach ( $access_conditions as $access_condition ) {
-			if ( $this->user_meets_access_condition( $access_condition ) ) {
-				$this->user_can_see_nav_item = true;
-				break;
-			}
-		}
-	}
-
-	/**
-	 * Check whether the current user meets an access condition.
-	 *
-	 * @param string $access_condition 'anyone', 'loggedin', 'member',
-	 *        'mod', 'admin' or 'noone'.
-	 * @return bool
-	 */
-	protected function user_meets_access_condition( $access_condition ) {
-		$group = groups_get_group( array(
-			'group_id' => $this->group_id,
-		) );
-
-		switch ( $access_condition ) {
-			case 'admin' :
-				$meets_condition = groups_is_user_admin( bp_loggedin_user_id(), $this->group_id );
-				break;
-
-			case 'mod' :
-				$meets_condition = groups_is_user_mod( bp_loggedin_user_id(), $this->group_id );
-				break;
-
-			case 'member' :
-				$meets_condition = groups_is_user_member( bp_loggedin_user_id(), $this->group_id );
-				break;
-
-			case 'loggedin' :
-				$meets_condition = is_user_logged_in();
-				break;
-
-			case 'noone' :
-				$meets_condition = false;
-				break;
-
-			case 'anyone' :
-			default :
-				$meets_condition = true;
-				break;
-		}
-
-		return $meets_condition;
-	}
-
-	/** Display ***********************************************************/
-
-	/**
-	 * Hook this extension's group tab into BuddyPress, if necessary.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function setup_display_hooks() {
-
-		// Bail if not a group
-		if ( ! bp_is_group() ) {
-			return;
-		}
-
-		// Backward compatibility only
-		if ( ( 'public' !== $this->visibility ) && ! buddypress()->groups->current_group->user_has_access ) {
-			return;
-		}
-
-		$user_can_see_nav_item = $this->user_can_see_nav_item();
-
-		if ( $user_can_see_nav_item ) {
-			$group_permalink = bp_get_group_permalink( groups_get_current_group() );
-
-			bp_core_new_subnav_item( array(
-				'name'            => ! $this->nav_item_name ? $this->name : $this->nav_item_name,
-				'slug'            => $this->slug,
-				'parent_slug'     => bp_get_current_group_slug(),
-				'parent_url'      => $group_permalink,
-				'position'        => $this->nav_item_position,
-				'item_css_id'     => 'nav-' . $this->slug,
-				'screen_function' => array( &$this, '_display_hook' ),
-				'user_has_access' => $user_can_see_nav_item,
-				'no_access_url'   => $group_permalink,
-			) );
-
-			// 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 );
-				add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
-				add_action( 'bp_template_title',          create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
-			}
-		}
-
-		// Hook the group home widget
-		if ( ! bp_current_action() && bp_is_current_action( 'home' ) ) {
-			add_action( $this->display_hook, array( &$this, 'widget_display' ) );
-		}
-	}
-
-	/**
-	 * Hook the main display method, and loads the template file
-	 */
-	public function _display_hook() {
-		add_action( 'bp_template_content', array( &$this, 'display' ) );
-		bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) );
-	}
-
-	/**
-	 * Determine whether the current user should see this nav tab.
-	 *
-	 * Note that this controls only the display of the navigation item.
-	 * Access to the tab is controlled by the user_can_visit() check.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @return bool
-	 */
-	public function user_can_see_nav_item( $user_can_see_nav_item = false ) {
-		if ( 'noone' !== $this->params['show_tab'] && current_user_can( 'bp_moderate' ) ) {
-			return true;
-		}
-
-		return $this->user_can_see_nav_item;
-	}
-
-	/**
-	 * Determine whether the current user has access to visit this tab.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @return bool
-	 */
-	public function user_can_visit( $user_can_visit = false ) {
-		if ( 'noone' !== $this->params['access'] && current_user_can( 'bp_moderate' ) ) {
-			return true;
-		}
-
-		return $this->user_can_visit;
-	}
-
-	/**
-	 * Filter the access check in bp_groups_group_access_protection() for this extension.
-	 *
-	 * Note that $no_access_args is passed by reference, as there are some
-	 * circumstances where the bp_core_no_access() arguments need to be
-	 * modified before the redirect takes place.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param bool $user_can_visit
-	 * @param array $no_access_args
-	 * @return bool
-	 */
-	public function group_access_protection( $user_can_visit, &$no_access_args ) {
-		$user_can_visit = $this->user_can_visit();
-
-		if ( ! $user_can_visit && is_user_logged_in() ) {
-			$current_group = groups_get_group( array(
-				'group_id' => $this->group_id,
-			) );
-
-			$no_access_args['message'] = __( 'You do not have access to this content.', 'buddypress' );
-			$no_access_args['root'] = bp_get_group_permalink( $current_group ) . 'home/';
-			$no_access_args['redirect'] = false;
-		}
-
-		return $user_can_visit;
-	}
-
-
-	/** Create ************************************************************/
-
-	/**
-	 * Hook this extension's Create step into BuddyPress, if necessary.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function setup_create_hooks() {
-		if ( ! $this->is_screen_enabled( 'create' ) ) {
-			return;
-		}
-
-		$screen = $this->screens['create'];
-
-		// Insert the group creation step for the new group extension
-		buddypress()->groups->group_creation_steps[ $screen['slug'] ] = array(
-			'name'     => $screen['name'],
-			'slug'     => $screen['slug'],
-			'position' => $screen['position'],
-		);
-
-		// The maybe_ methods check to see whether the create_*
-		// callbacks should be invoked (ie, are we on the
-		// correct group creation step). Hooked in separate
-		// methods because current creation step info not yet
-		// 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' ) );
-	}
-
-	/**
-	 * Call the create_screen() method, if we're on the right page.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function maybe_create_screen() {
-		if ( ! bp_is_group_creation_step( $this->screens['create']['slug'] ) ) {
-			return;
-		}
-
-		call_user_func( $this->screens['create']['screen_callback'], $this->group_id );
-		$this->nonce_field( 'create' );
-
-		// The create screen requires an additional nonce field
-		// 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 );
-	}
-
-	/**
-	 * Call the create_screen_save() method, if we're on the right page.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function maybe_create_screen_save() {
-		if ( ! bp_is_group_creation_step( $this->screens['create']['slug'] ) ) {
-			return;
-		}
-
-		$this->check_nonce( 'create' );
-		call_user_func( $this->screens['create']['screen_save_callback'], $this->group_id );
-	}
-
-	/** Edit **************************************************************/
-
-	/**
-	 * Hook this extension's Edit panel into BuddyPress, if necessary.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function setup_edit_hooks() {
-
-		// Bail if not an edit screen
-		if ( ! $this->is_screen_enabled( 'edit' ) || ! bp_is_item_admin() ) {
-			return;
-		}
-
-		$screen = $this->screens['edit'];
-
-		$position = isset( $screen['position'] ) ? (int) $screen['position'] : 10;
-
-		// Add the tab
-		// @todo BP should be using bp_core_new_subnav_item()
-		add_action( 'groups_admin_tabs', create_function( '$current, $group_slug',
-			'$selected = "";
-			if ( "' . esc_attr( $screen['slug'] ) . '" == $current )
-				$selected = " class=\"current\"";
-			echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $screen['slug'] ) ) . '\">' . esc_attr( $screen['name'] ) . '</a></li>";'
-		), $position, 2 );
-
-		// 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 );
-
-			add_action( 'groups_custom_edit_steps', array( &$this, 'call_edit_screen' ) );
-
-			// Determine the proper template and save for later
-			// loading
-			if ( '' !== bp_locate_template( array( 'groups/single/home.php' ), false ) ) {
-				$this->edit_screen_template = '/groups/single/home';
-			} else {
-				add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
-				add_action( 'bp_template_content', array( &$this, 'call_edit_screen' ) );
-				$this->edit_screen_template = '/groups/single/plugins';
-			}
-
-			// We load the template at bp_screens, to give all
-			// extensions a chance to load
-			add_action( 'bp_screens', array( $this, 'call_edit_screen_template_loader' ) );
-		}
-	}
-
-	/**
-	 * Call the edit_screen() method.
-	 *
-	 * Previous versions of BP_Group_Extension required plugins to provide
-	 * their own Submit button and nonce fields when building markup. In
-	 * BP 1.8, this requirement was lifted - BP_Group_Extension now handles
-	 * all required submit buttons and nonces.
-	 *
-	 * We put the edit screen markup into an output buffer before echoing.
-	 * This is so that we can check for the presence of a hardcoded submit
-	 * button, as would be present in legacy plugins; if one is found, we
-	 * do not auto-add our own button.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function call_edit_screen() {
-		ob_start();
-		call_user_func( $this->screens['edit']['screen_callback'], $this->group_id );
-		$screen = ob_get_contents();
-		ob_end_clean();
-
-		echo $this->maybe_add_submit_button( $screen );
-
-		$this->nonce_field( 'edit' );
-	}
-
-	/**
-	 * Check the nonce, and call the edit_screen_save() method.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function call_edit_screen_save() {
-		if ( empty( $_POST ) ) {
-			return;
-		}
-
-		// When DOING_AJAX, the POST global will be populated, but we
-		// should assume it's a save
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
-			return;
-		}
-
-		$this->check_nonce( 'edit' );
-
-		// Detect whether the screen_save_callback is performing a
-		// 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_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id );
-
-		// 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
-		if ( empty( $this->post_save_redirect ) ) {
-			$redirect_to = apply_filters( 'bp_group_extension_edit_screen_save_redirect', bp_get_requested_url( ) );
-
-			bp_core_redirect( $redirect_to );
-			die();
-		}
-	}
-
-	/**
-	 * Load the template that houses the Edit screen.
-	 *
-	 * Separated out into a callback so that it can run after all other
-	 * Group Extensions have had a chance to register their navigation, to
-	 * avoid missing tabs.
-	 *
-	 * Hooked to 'bp_screens'.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 * @access public So that do_action() has access. Do not call directly.
-	 *
-	 * @see BP_Group_Extension::setup_edit_hooks()
-	 */
-	public function call_edit_screen_template_loader() {
-		bp_core_load_template( $this->edit_screen_template );
-	}
-
-	/**
-	 * Add a submit button to the edit form, if it needs one.
-	 *
-	 * There's an inconsistency in the way that the group Edit and Create
-	 * screens are rendered: the Create screen has a submit button built
-	 * in, but the Edit screen does not. This function allows plugin
-	 * authors to write markup that does not contain the submit button for
-	 * use on both the Create and Edit screens - BP will provide the button
-	 * if one is not found.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $screen The screen markup, captured in the output
-	 *        buffer.
-	 * @param string $screen The same markup, with a submit button added.
-	 */
-	protected function maybe_add_submit_button( $screen = '' ) {
-		if ( $this->has_submit_button( $screen ) ) {
-			return $screen;
-		}
-
-		return $screen . sprintf(
-			'<div id="%s"><input type="submit" name="save" value="%s" id="%s"></div>',
-			'bp-group-edit-' . $this->slug . '-submit-wrapper',
-			$this->screens['edit']['submit_text'],
-			'bp-group-edit-' . $this->slug . '-submit'
-		);
-	}
-
-	/**
-	 * Does the given markup have a submit button?
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $screen The markup to check.
-	 * @return bool True if a Submit button is found, otherwise false.
-	 */
-	public static function has_submit_button( $screen = '' ) {
-		$pattern = "/<input[^>]+type=[\'\"]submit[\'\"]/";
-		preg_match( $pattern, $screen, $matches );
-		return ! empty( $matches[0] );
-	}
-
-	/**
-	 * Detect redirects hardcoded into edit_screen_save() callbacks.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param string $location
-	 * @return string
-	 */
-	public function detect_post_save_redirect( $redirect = '' ) {
-		if ( ! empty( $redirect ) ) {
-			$this->post_save_redirect = $redirect;
-		}
-
-		return $redirect;
-	}
-
-	/** Admin *************************************************************/
-
-	/**
-	 * Hook this extension's Admin metabox into BuddyPress, if necessary.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function setup_admin_hooks() {
-		if ( ! $this->is_screen_enabled( 'admin' ) || ! is_admin() ) {
-			return;
-		}
-
-		// 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
-		add_action( 'bp_groups_admin_meta_boxes', array( $this, '_meta_box_display_callback' ) );
-
-		// Catch the metabox save
-		add_action( 'bp_group_admin_edit_after', array( $this, 'call_admin_screen_save' ), 10 );
-	}
-
-	/**
-	 * Call the admin_screen() method, and add a nonce field.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function call_admin_screen() {
-		call_user_func( $this->screens['admin']['screen_callback'], $this->group_id );
-		$this->nonce_field( 'admin' );
-	}
-
-	/**
-	 * Check the nonce, and call the admin_screen_save() method
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	public function call_admin_screen_save() {
-		$this->check_nonce( 'admin' );
-		call_user_func( $this->screens['admin']['screen_save_callback'], $this->group_id );
-	}
-
-	/**
-	 * Create the Dashboard meta box for this extension.
-	 *
-	 * @since BuddyPress (1.7.0)
-	 */
-	public function _meta_box_display_callback() {
-		$group_id = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : 0;
-		$screen   = $this->screens['admin'];
-
-		add_meta_box(
-			$screen['slug'],
-			$screen['name'],
-			create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' . $this->slug . '", ' . $group_id . ' );' ),
-			get_current_screen()->id,
-			$screen['metabox_context'],
-			$screen['metabox_priority']
-		);
-	}
-
-
-	/** Utilities *********************************************************/
-
-	/**
-	 * Generate the nonce fields for a settings form.
-	 *
-	 * The nonce field name (the second param passed to wp_nonce_field)
-	 * contains this extension's slug and is thus unique to this extension.
-	 * This is necessary because in some cases (namely, the Dashboard),
-	 * more than one extension may generate nonces on the same page, and we
-	 * must avoid name clashes.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
-	 */
-	public function nonce_field( $context = '' ) {
-		wp_nonce_field( 'bp_group_extension_' . $this->slug . '_' . $context, '_bp_group_' . $context . '_nonce_' . $this->slug );
-	}
-
-	/**
-	 * Check the nonce on a submitted settings form.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
-	 */
-	public function check_nonce( $context = '' ) {
-		check_admin_referer( 'bp_group_extension_' . $this->slug . '_' . $context, '_bp_group_' . $context . '_nonce_' . $this->slug );
-	}
-
-	/**
-	 * Is the specified screen enabled?
-	 *
-	 * To be enabled, a screen must both have the 'enabled' key set to true
-	 * (legacy: $this->enable_create_step, etc), and its screen_callback
-	 * must also exist and be callable.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
-	 * @return bool True if the screen is enabled, otherwise false.
-	 */
-	public function is_screen_enabled( $context = '' ) {
-		$enabled = false;
-
-		if ( isset( $this->screens[ $context ] ) ) {
-			$enabled = $this->screens[ $context ]['enabled'] && is_callable( $this->screens[ $context ]['screen_callback'] );
-		}
-
-		return (bool) $enabled;
-	}
-
-	/**
-	 * Get the appropriate screen callback for the specified context/type.
-	 *
-	 * BP Group Extensions have three special "screen contexts": create,
-	 * admin, and edit. Each of these contexts has a corresponding
-	 * _screen() and _screen_save() method, which allow group extension
-	 * plugins to define different markup and logic for each context.
-	 *
-	 * BP also supports fallback settings_screen() and
-	 * settings_screen_save() methods, which can be used to define markup
-	 * and logic that is shared between context. For each context, you may
-	 * either provide context-specific methods, or you can let BP fall back
-	 * on the shared settings_* callbacks.
-	 *
-	 * For example, consider a BP_Group_Extension implementation that looks
-	 * like this:
-	 *
-	 *   // ...
-	 *   function create_screen( $group_id ) { ... }
-	 *   function create_screen_save( $group_id ) { ... }
-	 *   function settings_screen( $group_id ) { ... }
-	 *   function settings_screen_save( $group_id ) { ... }
-	 *   // ...
-	 *
-	 * BP_Group_Extension will use your create_* methods for the Create
-	 * steps, and will use your generic settings_* methods for the Edit
-	 * and Admin contexts. This schema allows plugin authors maximum
-	 * flexibility without having to repeat themselves.
-	 *
-	 * The get_screen_callback() method uses a ReflectionClass object to
-	 * determine whether your extension has provided a given callback.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
-	 * @param string $type Screen type. 'screen' or 'screen_save'. Default:
-	 *        'screen'.
-	 * @return callable A callable function handle.
-	 */
-	public function get_screen_callback( $context = '', $type = 'screen' ) {
-		$callback = '';
-
-		// Try the context-specific callback first
-		$method  = $context . '_' . $type;
-		$rmethod = $this->class_reflection->getMethod( $method );
-		if ( isset( $rmethod->class ) && $this->class_name === $rmethod->class ) {
-			$callback = array( $this, $method );
-		}
-
-		if ( empty( $callback ) ) {
-			$fallback_method  = 'settings_' . $type;
-			$rfallback_method = $this->class_reflection->getMethod( $fallback_method );
-			if ( isset( $rfallback_method->class ) && $this->class_name === $rfallback_method->class ) {
-				$callback = array( $this, $fallback_method );
-			}
-		}
-
-		return $callback;
-	}
-
-	/**
-	 * Recursive argument parsing.
-	 *
-	 * This acts like a multi-dimensional version of wp_parse_args() (minus
-	 * the querystring parsing - you must pass arrays).
-	 *
-	 * Values from $a override those from $b; keys in $b that don't exist
-	 * in $a are passed through.
-	 *
-	 * This is different from array_merge_recursive(), both because of the
-	 * order of preference ($a overrides $b) and because of the fact that
-	 * array_merge_recursive() combines arrays deep in the tree, rather
-	 * than overwriting the b array with the a array.
-	 *
-	 * The implementation of this function is specific to the needs of
-	 * BP_Group_Extension, where we know that arrays will always be
-	 * associative, and that an argument under a given key in one array
-	 * will be matched by a value of identical depth in the other one. The
-	 * function is NOT designed for general use, and will probably result
-	 * in unexpected results when used with data in the wild. See, eg,
-	 * http://core.trac.wordpress.org/ticket/19888
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param array $a First set of arguments.
-	 * @param array $b Second set of arguments.
-	 * @return array Parsed arguments.
-	 */
-	public static function parse_args_r( &$a, $b ) {
-		$a = (array) $a;
-		$b = (array) $b;
-		$r = $b;
-
-		foreach ( $a as $k => &$v ) {
-			if ( is_array( $v ) && isset( $r[ $k ] ) ) {
-				$r[ $k ] = self::parse_args_r( $v, $r[ $k ] );
-			} else {
-				$r[ $k ] = $v;
-			}
-		}
-
-		return $r;
-	}
-
-	/** Legacy Support ********************************************************/
-
-	/*
-	 * In BuddyPress 1.8, the recommended technique for configuring
-	 * extensions changed from directly setting various object properties
-	 * in the class constructor, to passing a configuration array to
-	 * parent::init(). The following methods ensure that extensions created
-	 * in the old way continue to work, by converting legacy configuration
-	 * data to the new format.
-	 */
-
-	/**
-	 * Provide access to otherwise unavailable object properties.
-	 *
-	 * This magic method is here for backward compatibility with plugins
-	 * that refer to config properties that have moved to a different
-	 * location (such as enable_create_step, which is now at
-	 * $this->screens['create']['enabled']
-	 *
-	 * The legacy_properties array is set up in
-	 * self::setup_legacy_properties().
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $key Property name.
-	 * @return mixed The value if found, otherwise null.
-	 */
-	public function __get( $key ) {
-		if ( isset( $this->legacy_properties[ $key ] ) ) {
-			return $this->legacy_properties[ $key ];
-		} elseif ( isset( $this->data[ $key ] ) ) {
-			return $this->data[ $key ];
-		} else {
-			return null;
-		}
-	}
-
-	/**
-	 * Provide a fallback for isset( $this->foo ) when foo is unavailable.
-	 *
-	 * This magic method is here for backward compatibility with plugins
-	 * that have set their class config options directly in the class
-	 * constructor. The parse_legacy_properties() method of the current
-	 * class needs to check whether any legacy keys have been put into the
-	 * $this->data array.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $key Property name.
-	 * @return bool True if the value is set, otherwise false.
-	 */
-	public function __isset( $key ) {
-		if ( isset( $this->legacy_properties[ $key ] ) ) {
-			return true;
-		} elseif ( isset( $this->data[ $key ] ) ) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/**
-	 * Allow plugins to set otherwise unavailable object properties.
-	 *
-	 * This magic method is here for backward compatibility with plugins
-	 * that may attempt to modify the group extension by manually assigning
-	 * a value to an object property that no longer exists, such as
-	 * $this->enable_create_step.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @param string $key Property name.
-	 * @param mixed $value Property value.
-	 */
-	public function __set( $key, $value ) {
-
-		if ( empty( $this->initialized ) ) {
-			$this->data[ $key ] = $value;
-		}
-
-		switch ( $key ) {
-			case 'enable_create_step' :
-				$this->screens['create']['enabled'] = $value;
-				break;
-
-			case 'enable_edit_item' :
-				$this->screens['edit']['enabled'] = $value;
-				break;
-
-			case 'enable_admin_item' :
-				$this->screens['admin']['enabled'] = $value;
-				break;
-
-			case 'create_step_position' :
-				$this->screens['create']['position'] = $value;
-				break;
-
-			// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
-			case 'admin_name' :
-				$this->screens['edit']['name'] = $value;
-				break;
-
-			case 'admin_slug' :
-				$this->screens['edit']['slug'] = $value;
-				break;
-
-			case 'create_name' :
-				$this->screens['create']['name'] = $value;
-				break;
-
-			case 'create_slug' :
-				$this->screens['create']['slug'] = $value;
-				break;
-
-			case 'admin_metabox_context' :
-				$this->screens['admin']['metabox_context'] = $value;
-				break;
-
-			case 'admin_metabox_priority' :
-				$this->screens['admin']['metabox_priority'] = $value;
-				break;
-
-			default :
-				$this->data[ $key ] = $value;
-				break;
-		}
-	}
-
-	/**
-	 * Return a list of legacy properties.
-	 *
-	 * The legacy implementation of BP_Group_Extension used all of these
-	 * object properties for configuration. Some have been moved.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @return array List of legacy property keys.
-	 */
-	protected function get_legacy_property_list() {
-		return array(
-			'name',
-			'slug',
-			'admin_name',
-			'admin_slug',
-			'create_name',
-			'create_slug',
-			'visibility',
-			'create_step_position',
-			'nav_item_position',
-			'admin_metabox_context',
-			'admin_metabox_priority',
-			'enable_create_step',
-			'enable_nav_item',
-			'enable_edit_item',
-			'enable_admin_item',
-			'nav_item_name',
-			'display_hook',
-			'template_file',
-		);
-	}
-
-	/**
-	 * Parse legacy properties.
-	 *
-	 * The old standard for BP_Group_Extension was for plugins to register
-	 * their settings as properties in their constructor. The new method is
-	 * to pass a config array to the init() method. In order to support
-	 * legacy plugins, we slurp up legacy properties, and later on we'll
-	 * parse them into the new init() array.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 */
-	protected function parse_legacy_properties() {
-
-		// Only run this one time
-		if ( ! empty( $this->legacy_properties_converted ) ) {
-			return;
-		}
-
-		$properties = $this->get_legacy_property_list();
-
-		// By-reference variable for convenience
-		$lpc =& $this->legacy_properties_converted;
-
-		foreach ( $properties as $property ) {
-
-			// No legacy config exists for this key
-			if ( ! isset( $this->{$property} ) ) {
-				continue;
-			}
-
-			// Grab the value and record it as appropriate
-			$value = $this->{$property};
-
-			switch ( $property ) {
-				case 'enable_create_step' :
-					$lpc['screens']['create']['enabled'] = (bool) $value;
-					break;
-
-				case 'enable_edit_item' :
-					$lpc['screens']['edit']['enabled'] = (bool) $value;
-					break;
-
-				case 'enable_admin_item' :
-					$lpc['screens']['admin']['enabled'] = (bool) $value;
-					break;
-
-				case 'create_step_position' :
-					$lpc['screens']['create']['position'] = $value;
-					break;
-
-				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
-				case 'admin_name' :
-					$lpc['screens']['edit']['name'] = $value;
-					break;
-
-				case 'admin_slug' :
-					$lpc['screens']['edit']['slug'] = $value;
-					break;
-
-				case 'create_name' :
-					$lpc['screens']['create']['name'] = $value;
-					break;
-
-				case 'create_slug' :
-					$lpc['screens']['create']['slug'] = $value;
-					break;
-
-				case 'admin_metabox_context' :
-					$lpc['screens']['admin']['metabox_context'] = $value;
-					break;
-
-				case 'admin_metabox_priority' :
-					$lpc['screens']['admin']['metabox_priority'] = $value;
-					break;
-
-				default :
-					$lpc[ $property ] = $value;
-					break;
-			}
-		}
-	}
-
-	/**
-	 * Set up legacy properties.
-	 *
-	 * This method is responsible for ensuring that all legacy config
-	 * properties are stored in an array $this->legacy_properties, so that
-	 * they remain available to plugins that reference the variables at
-	 * their old locations.
-	 *
-	 * @since BuddyPress (1.8.0)
-	 *
-	 * @see BP_Group_Extension::__get()
-	 */
-	protected function setup_legacy_properties() {
-
-		// Only run this one time
-		if ( ! empty( $this->legacy_properties ) ) {
-			return;
-		}
-
-		$properties = $this->get_legacy_property_list();
-		$params     = $this->params;
-		$lp         =& $this->legacy_properties;
-
-		foreach ( $properties as $property ) {
-			switch ( $property ) {
-				case 'enable_create_step' :
-					$lp['enable_create_step'] = $params['screens']['create']['enabled'];
-					break;
-
-				case 'enable_edit_item' :
-					$lp['enable_edit_item'] = $params['screens']['edit']['enabled'];
-					break;
-
-				case 'enable_admin_item' :
-					$lp['enable_admin_item'] = $params['screens']['admin']['enabled'];
-					break;
-
-				case 'create_step_position' :
-					$lp['create_step_position'] = $params['screens']['create']['position'];
-					break;
-
-				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
-				case 'admin_name' :
-					$lp['admin_name'] = $params['screens']['edit']['name'];
-					break;
-
-				case 'admin_slug' :
-					$lp['admin_slug'] = $params['screens']['edit']['slug'];
-					break;
-
-				case 'create_name' :
-					$lp['create_name'] = $params['screens']['create']['name'];
-					break;
-
-				case 'create_slug' :
-					$lp['create_slug'] = $params['screens']['create']['slug'];
-					break;
-
-				case 'admin_metabox_context' :
-					$lp['admin_metabox_context'] = $params['screens']['admin']['metabox_context'];
-					break;
-
-				case 'admin_metabox_priority' :
-					$lp['admin_metabox_priority'] = $params['screens']['admin']['metabox_priority'];
-					break;
-
-				default :
-					// All other items get moved over
-					$lp[ $property ] = $params[ $property ];
-
-					// Also reapply to the object, for backpat
-					$this->{$property} = $params[ $property ];
-
-					break;
-			}
-		}
-	}
-}
-
-/**
- * Register a new Group Extension.
- *
- * @param string Name of the Extension class.
- * @return bool|null Returns false on failure, otherwise null.
- */
-function bp_register_group_extension( $group_extension_class = '' ) {
-
-	if ( ! class_exists( $group_extension_class ) ) {
-		return false;
-	}
-
-	// Register the group extension on the bp_init action so we have access
-	// to all plugins.
-	add_action( 'bp_init', create_function( '', '
-		$extension = new ' . $group_extension_class . ';
-		add_action( "bp_actions", array( &$extension, "_register" ), 8 );
-		add_action( "admin_init", array( &$extension, "_register" ) );
-	' ), 11 );
-}
-
-/**
- * Adds support for user at-mentions (for users in a specific Group) to the Suggestions API.
- *
- * @since BuddyPress (2.1.0)
- */
-class BP_Groups_Member_Suggestions extends BP_Members_Suggestions {
-
-	/**
-	 * Default arguments for this suggestions service.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 * @access protected
-	 * @var array $args {
-	 *     @type int $group_id Positive integers will restrict the search to members in that group.
-	 *           Negative integers will restrict the search to members in every other group.
-	 *     @type int $limit Maximum number of results to display. Default: 16.
-	 *     @type bool $only_friends If true, only match the current user's friends. Default: false.
-	 *     @type string $term The suggestion service will try to find results that contain this string.
-	 *           Mandatory.
-	 * }
-	 */
-	protected $default_args = array(
-		'group_id'     => 0,
-		'limit'        => 16,
-		'only_friends' => false,
-		'term'         => '',
-		'type'         => '',
-	);
-
-
-	/**
-	 * Validate and sanitise the parameters for the suggestion service query.
-	 *
-	 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function validate() {
-		$this->args['group_id'] = (int) $this->args['group_id'];
-		$this->args             = apply_filters( 'bp_groups_member_suggestions_args', $this->args, $this );
-
-		// Check for invalid or missing mandatory parameters.
-		if ( ! $this->args['group_id'] || ! bp_is_active( 'groups' ) ) {
-			return new WP_Error( 'missing_requirement' );
-		}
-
-		// Check that the specified group_id exists, and that the current user can access it.
-		$the_group = groups_get_group( array(
-			'group_id'        => absint( $this->args['group_id'] ),
-			'populate_extras' => true,
-		) );
-
-		if ( $the_group->id === 0 || ! $the_group->user_has_access ) {
-			return new WP_Error( 'access_denied' );
-		}
-
-		return apply_filters( 'bp_groups_member_suggestions_validate_args', parent::validate(), $this );
-	}
-
-	/**
-	 * Find and return a list of username suggestions that match the query.
-	 *
-	 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function get_suggestions() {
-		$user_query = array(
-			'count_total'     => '',  // Prevents total count
-			'populate_extras' => false,
-			'type'            => 'alphabetical',
-
-			'group_role'      => array( 'admin', 'member', 'mod' ),
-			'page'            => 1,
-			'per_page'        => $this->args['limit'],
-			'search_terms'    => $this->args['term'],
-			'search_wildcard' => 'right',
-		);
-
-		// Only return matches of friends of this user.
-		if ( $this->args['only_friends'] && is_user_logged_in() ) {
-			$user_query['user_id'] = get_current_user_id();
-		}
-
-		// Positive Group IDs will restrict the search to members in that group.
-		if ( $this->args['group_id'] > 0 ) {
-			$user_query['group_id'] = $this->args['group_id'];
-
-		// Negative Group IDs will restrict the search to members in every other group.
-		} else {
-			$group_query = array(
-				'count_total'     => '',  // Prevents total count
-				'populate_extras' => false,
-				'type'            => 'alphabetical',
-
-				'group_id'        => absint( $this->args['group_id'] ),
-				'group_role'      => array( 'admin', 'member', 'mod' ),
-				'page'            => 1,
-			);
-			$group_users = new BP_Group_Member_Query( $group_query );
-
-			if ( $group_users->results ) {
-				$user_query['exclude'] = wp_list_pluck( $group_users->results, 'ID' );
-			} else {
-				$user_query['include'] = array( 0 );
-			}
-		}
-
-		$user_query = apply_filters( 'bp_groups_member_suggestions_query_args', $user_query, $this );
-		if ( is_wp_error( $user_query ) ) {
-			return $user_query;
-		}
-
-
-		if ( isset( $user_query['group_id'] ) ) {
-			$user_query = new BP_Group_Member_Query( $user_query );
-		} else {
-			$user_query = new BP_User_Query( $user_query );
-		}
-
-		$results = array();
-		foreach ( $user_query->results as $user ) {
-			$result        = new stdClass();
-			$result->ID    = $user->user_nicename;
-			$result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
-			$result->name  = bp_core_get_user_displayname( $user->ID );
-
-			$results[] = $result;
-		}
+defined( 'ABSPATH' ) || exit;
 
-		return apply_filters( 'bp_groups_member_suggestions_get_suggestions', $results, $this );
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-group-extension.php';
+require dirname( __FILE__ ) . '/classes/class-bp-group-member-query.php';
+require dirname( __FILE__ ) . '/classes/class-bp-groups-group.php';
+require dirname( __FILE__ ) . '/classes/class-bp-groups-member-suggestions.php';
+require dirname( __FILE__ ) . '/classes/class-bp-groups-member.php';
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
index 9e66f3d5123e96e8b47127a50283036b23ecc0ff..d3972f84d27b1eeb644c2cbfb01768418ff282bf 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php
@@ -1,14 +1,14 @@
 <?php
 
 /**
- * BuddyPress Groups Filters
+ * BuddyPress Groups Filters.
  *
  * @package BuddyPress
  * @subpackage GroupsFilters
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 // Filter bbPress template locations
 
@@ -61,9 +61,10 @@ add_filter( 'bp_get_new_group_name',        'esc_attr'     );
 add_filter( 'bp_get_new_group_description', 'esc_textarea' );
 
 // 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' );
-add_filter( 'bp_get_group_total_members',    'bp_core_number_format' );
+add_filter( 'bp_get_total_group_count',          'bp_core_number_format' );
+add_filter( 'bp_get_group_total_for_member',     'bp_core_number_format' );
+add_filter( 'bp_get_group_total_members',        'bp_core_number_format' );
+add_filter( 'bp_get_total_group_count_for_user', 'bp_core_number_format' );
 
 /**
  * Filter output of Group Description through WordPress's KSES API.
@@ -71,6 +72,7 @@ add_filter( 'bp_get_group_total_members',    'bp_core_number_format' );
  * @since BuddyPress (1.1.0)
  *
  * @param string $content
+ *
  * @return string
  */
 function bp_groups_filter_kses( $content = '' ) {
@@ -98,9 +100,9 @@ function bp_groups_filter_kses( $content = '' ) {
 	$allowed_tags['code']          = array();
 
 	/**
-	 * Filter HTML elements allowed for a given context.
+	 * Filters the HTML elements allowed for a given context.
 	 *
-	 * @since BuddyPress (1.1.0)
+	 * @since BuddyPress (1.2.0)
 	 *
 	 * @param string $allowed_tags Allowed tags, attributes, and/or entities.
 	 */
@@ -126,6 +128,7 @@ add_filter( 'bbpress_init', 'groups_add_forum_privacy_sql' );
  * Add fields to bbPress query for group-specific data.
  *
  * @param string $sql
+ *
  * @return string
  */
 function groups_add_forum_fields_sql( $sql = '' ) {
@@ -137,10 +140,11 @@ function groups_add_forum_fields_sql( $sql = '' ) {
  * Add JOINed tables to bbPress query for group-specific data.
  *
  * @param string $sql
+ *
  * @return string
  */
 function groups_add_forum_tables_sql( $sql = '' ) {
-	global $bp;
+	$bp = buddypress();
 
 	$sql .= 'JOIN ' . $bp->groups->table_name . ' AS g LEFT JOIN ' . $bp->groups->table_name_groupmeta . ' AS gm ON g.id = gm.group_id ';
 
@@ -151,10 +155,10 @@ function groups_add_forum_tables_sql( $sql = '' ) {
  * Add WHERE clauses to bbPress query for group-specific data and access protection.
  *
  * @param string $sql
+ *
  * @return string
  */
 function groups_add_forum_where_sql( $sql = '' ) {
-	global $bp;
 
 	// Define locale variable
 	$parts = array();
@@ -189,6 +193,8 @@ function groups_add_forum_where_sql( $sql = '' ) {
 	// Assemble Voltron
 	$parts_string = implode( ' AND ', $parts );
 
+	$bp = buddypress();
+
 	// Set it to the global filter
 	$bp->groups->filter_sql = $parts_string;
 
@@ -202,16 +208,21 @@ function groups_add_forum_where_sql( $sql = '' ) {
  * @param bool $value
  * @param string $cap
  * @param array $args
+ *
  * @return bool
  */
 function groups_filter_bbpress_caps( $value, $cap, $args ) {
-	global $bp;
 
 	if ( bp_current_user_can( 'bp_moderate' ) )
 		return true;
 
-	if ( 'add_tag_to' == $cap )
-		if ( $bp->groups->current_group->user_has_access ) return true;
+	if ( 'add_tag_to' === $cap ) {
+		$bp = buddypress();
+
+		if ( $bp->groups->current_group->user_has_access ) {
+			return true;
+		}
+	}
 
 	if ( 'manage_forums' == $cap && is_user_logged_in() )
 		return true;
@@ -230,6 +241,40 @@ add_filter( 'bb_current_user_can', 'groups_filter_bbpress_caps', 10, 3 );
  * @see BB_Query::_filter_sql()
  */
 function groups_filter_forums_root_page_sql( $sql ) {
+
+	/**
+	 * Filters the forum directory's "last active" bbPress SQL query.
+	 *
+	 * This filter is used to prevent fetching information that is not used.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value SQL string to specify fetching just topic_id.
+	 */
 	return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' );
 }
 add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' );
+
+/**
+ * Should BuddyPress load the mentions scripts and related assets, including results to prime the
+ * mentions suggestions?
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @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.
+ */
+function bp_groups_maybe_load_mentions_scripts( $load_mentions, $mentions_enabled ) {
+	if ( ! $mentions_enabled ) {
+		return $load_mentions;
+	}
+
+	if ( $load_mentions || ( bp_is_group_activity() || bp_is_group_home() ) ) {
+		return true;
+	}
+
+	return $load_mentions;
+}
+add_filter( 'bp_activity_maybe_load_mentions_scripts', 'bp_groups_maybe_load_mentions_scripts', 10, 2 );
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
index 95a9f316b08a1b20453c780b8162567ae9efbd76..85a64cebe371009103a0c9a5ca34cff7b2720b8c 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Forums
+ * BuddyPress Groups Forums.
  *
  * Action functions are exactly the same as screen functions, however they do not
  * have a template screen associated with them. Usually they will send the user
@@ -15,7 +15,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Creates a new forum inside a specific BuddyPress group.
@@ -24,7 +24,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @since BuddyPress (1.0.0)
  *
- * @param int $group_id The group ID that the new forum should be attached to.
+ * @param int    $group_id   The group ID that the new forum should be attached to.
  * @param string $group_name The group name.
  * @param string $group_desc The group description.
  */
@@ -49,6 +49,14 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc =
 
 	groups_update_groupmeta( $group_id, 'forum_id', $forum_id );
 
+	/**
+	 * Fires after the creation of a new forum inside a specific BuddyPress group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $forum_id ID of the newly created forum.
+	 * @param int $group_id ID of the associated group.
+	 */
 	do_action( 'groups_new_group_forum', $forum_id, $group_id );
 }
 
@@ -58,6 +66,8 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc =
  * @since BuddyPress (1.1.0)
  *
  * @param int $group_id Group id, passed from groups_details_updated.
+ *
+ * @return mixed
  */
 function groups_update_group_forum( $group_id ) {
 
@@ -74,6 +84,13 @@ function groups_update_group_forum( $group_id ) {
 		return false;
 	}
 
+	/**
+	 * Filters the group forum metadata value argument.
+	 *
+	 * @since BuddyPress (1.2.5)
+	 *
+	 * @param array $value Array of metadata values to update the group forum with.
+	 */
 	bp_forums_update_forum( apply_filters( 'groups_update_group_forum', array(
 		'forum_id'   => groups_get_groupmeta( $group_id, 'forum_id' ),
 		'forum_name' => $group->name,
@@ -91,10 +108,11 @@ add_action( 'groups_details_updated', 'groups_update_group_forum' );
  * @since BuddyPress (1.0.0)
  *
  * @param string $post_text The text for the forum post.
- * @param int $topic_id The topic ID used so we can identify where the new
- *        forum post should reside.
- * @param mixed $page The page number where the new forum post should reside.
- *        Default: false.
+ * @param int    $topic_id  The topic ID used so we can identify where the new
+ *                          forum post should reside.
+ * @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.
  */
 function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
@@ -102,7 +120,22 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
 		return false;
 	}
 
+	/**
+	 * Filters the text for the forum post before save.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $post_text Text for the forum post.
+	 */
 	$post_text = apply_filters( 'group_forum_post_text_before_save',     $post_text );
+
+	/**
+	 * Filters the ID for the forum post before save.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param int $topic_id ID of the topic the post will be associated with.
+	 */
 	$topic_id  = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id  );
 	$post_id   = bp_forums_insert_post( array(
 		'post_text' => $post_text,
@@ -122,16 +155,56 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
 		$primary_link .= "?topic_page=" . $page;
 	}
 
-	// Record this in activity streams
+	/**
+	 * Filters the new groups activity forum post action.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_action Formatted action related to group activity posting.
+	 * @param int    $post_id         ID of the newly created group forum post.
+	 * @param string $post_text       The text for the forum post.
+	 * @param object $topic           Object holding current topic details. Passed by reference.
+	 */
+	$action = apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_id, $post_text, &$topic ) );
+
+	/**
+	 * Filters the new groups activity forum post content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_content Excerpt-length activity content to be posted.
+	 * @param int    $post_id          ID of the newly created group forum post.
+	 * @param string $post_text        The text for the forum post.
+	 * @param object $topic            Object holding current topic details. Passed by reference.
+	 */
+	$content = apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_id, $post_text, &$topic ) );
+
+	/**
+	 * Filters the new groups activity forum post primary link.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value URL to the newly posted forum post.
+	 */
+	$filtered_primary_link = apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" );
+
 	groups_record_activity( array(
-		'action'            => apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_id, $post_text, &$topic ) ),
-		'content'           => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_id, $post_text, &$topic ) ),
-		'primary_link'      => apply_filters( 'groups_activity_new_forum_post_primary_link', "{$primary_link}#post-{$post_id}" ),
+		'action'            => $action,
+		'content'           => $content,
+		'primary_link'      => $filtered_primary_link,
 		'type'              => 'new_forum_post',
 		'item_id'           => bp_get_current_group_id(),
 		'secondary_item_id' => $post_id
 	) );
 
+	/**
+	 * Fires after the creation of a new group forum topic post.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $value   ID of the current group.
+	 * @param int $post_id ID of the new created forum topic post.
+	 */
 	do_action( 'groups_new_forum_topic_post', bp_get_current_group_id(), $post_id );
 
 	return $post_id;
@@ -145,18 +218,50 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
  * @since BuddyPress (1.0.0)
  *
  * @param string $topic_title The title for the forum topic.
- * @param string $topic_text The text for the forum topic.
- * @param string $topic_tags A comma-delimited string of topic tags.
- * @param int $forum_id The forum ID this forum topic resides in.
+ * @param string $topic_text  The text for the forum topic.
+ * @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.
  */
 function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) {
 	if ( empty( $topic_title ) || empty( $topic_text ) )
 		return false;
 
+	/**
+	 * Filters the new groups forum topic title before saving.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $topic_title The title for the forum topic.
+	 */
 	$topic_title = apply_filters( 'group_forum_topic_title_before_save',    $topic_title );
+
+	/**
+	 * Filters the new groups forum topic text before saving.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $topic_text The text for the forum topic.
+	 */
 	$topic_text  = apply_filters( 'group_forum_topic_text_before_save',     $topic_text  );
+
+	/**
+	 * Filters the new groups forum topic tags before saving.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $topic_tags A comma-delimited string of topic tags.
+	 */
 	$topic_tags  = apply_filters( 'group_forum_topic_tags_before_save',     $topic_tags  );
+
+	/**
+	 * Filters the forum ID this forum topic resides in.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $forum_id The forum ID this forum topic resides in.
+	 */
 	$forum_id    = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id    );
 	$topic_id    = bp_forums_new_topic( array(
 		'topic_title' => $topic_title,
@@ -173,16 +278,54 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
 	$activity_action  = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
 	$activity_content = bp_create_excerpt( $topic_text );
 
-	// Record this in activity streams
+	/**
+	 * Filters the new groups activity forum topic action.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_action Formatted action related to forum topic.
+	 * @param string $topic_text      New topic text.
+	 * @param object $topic           Object holding current topic details. Passed by reference.
+	 */
+	$action = apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) );
+
+	/**
+	 * Filters the new groups activity forum topic content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_content Excerpt-length activity content to be posted.
+	 * @param string $topic_text       New topic text.
+	 * @param object $topic            Object holding current topic details. Passed by reference.
+	 */
+	$content = apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) );
+
+	/**
+	 * Filters the new groups activity forum topic primary link.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value Concatenated primary link.
+	 */
+	$primary_link = apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' );
+
 	groups_record_activity( array(
-		'action'            => apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) ),
-		'content'           => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
-		'primary_link'      => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
+		'action'            => $action,
+		'content'           => $content,
+		'primary_link'      => $primary_link,
 		'type'              => 'new_forum_topic',
 		'item_id'           => bp_get_current_group_id(),
 		'secondary_item_id' => $topic->topic_id
 	) );
 
+	/**
+	 * Fires after the creation of a new group forum topic.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int    $value ID of the current group.
+	 * @param object $topic Object holding current topic details. Passed by reference.
+	 */
 	do_action_ref_array( 'groups_new_forum_topic', array( bp_get_current_group_id(), &$topic ) );
 
 	return $topic;
@@ -195,16 +338,20 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $
  *
  * @since BuddyPress (1.1.0)
  *
- * @param int $topic_id The topic ID of the existing forum topic.
+ * @param int    $topic_id    The topic ID of the existing forum topic.
  * @param string $topic_title The title for the forum topic.
- * @param string $topic_text The text for the forum topic.
- * @param mixed $topic_tags A comma-delimited string of topic tags. Optional.
+ * @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.
  */
 function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
 	$bp = buddypress();
 
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
 	$topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
+
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
 	$topic_text  = apply_filters( 'group_forum_topic_text_before_save',  $topic_text  );
 	$topic       = bp_forums_update_topic( array(
 		'topic_title' => $topic_title,
@@ -230,12 +377,20 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
 	$activity_action  = sprintf( __( '%1$s edited the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' );
 	$activity_content = bp_create_excerpt( $topic_text );
 
-	// Record this in activity streams
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
+	$action = apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) );
+
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
+	$content = apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) );
+
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
+	$primary_link = apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' );
+
 	groups_record_activity( array(
 		'id'                => $id,
-		'action'            => apply_filters_ref_array( 'groups_activity_new_forum_topic_action',  array( $activity_action,  $topic_text, &$topic ) ),
-		'content'           => apply_filters_ref_array( 'groups_activity_new_forum_topic_content', array( $activity_content, $topic_text, &$topic ) ),
-		'primary_link'      => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug . '/' ),
+		'action'            => $action,
+		'content'           => $content,
+		'primary_link'      => $primary_link,
 		'type'              => 'new_forum_topic',
 		'item_id'           => (int) bp_get_current_group_id(),
 		'user_id'           => (int) $topic->topic_poster,
@@ -243,6 +398,13 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
 		'recorded_time '    => $topic->topic_time
 	) );
 
+	/**
+	 * Fires after the update of a group forum topic.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param object $topic Object holding current topic being updated. Passed by reference.
+	 */
 	do_action_ref_array( 'groups_update_group_forum_topic', array( &$topic ) );
 
 	return $topic;
@@ -255,17 +417,20 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text,
  *
  * @since BuddyPress (1.1.0)
  *
- * @param int $post_id The post ID of the existing forum post.
+ * @param int    $post_id   The post ID of the existing forum post.
  * @param string $post_text The text for the forum post.
- * @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.
+ * @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.
  */
 function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
 	$bp = buddypress();
 
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
 	$post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
+
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
 	$topic_id  = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
 	$post      = bp_forums_get_post( $post_id );
 	$post_id   = bp_forums_insert_post( array(
@@ -300,12 +465,20 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
 		 ) );
 	}
 
-	// Update the entry in activity streams
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
+	$action = apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_text, &$topic, &$topic ) );
+
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
+	$content = apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_text, &$topic, &$topic ) );
+
+	/** This filter is documented in bp-groups/bp-groups-forums.php */
+	$filtered_primary_link = apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id );
+
 	groups_record_activity( array(
 		'id'                => $id,
-		'action'            => apply_filters_ref_array( 'groups_activity_new_forum_post_action',  array( $activity_action,  $post_text, &$topic, &$topic ) ),
-		'content'           => apply_filters_ref_array( 'groups_activity_new_forum_post_content', array( $activity_content, $post_text, &$topic, &$topic ) ),
-		'primary_link'      => apply_filters( 'groups_activity_new_forum_post_primary_link', $primary_link . "#post-" . $post_id ),
+		'action'            => $action,
+		'content'           => $content,
+		'primary_link'      => $filtered_primary_link,
 		'type'              => 'new_forum_post',
 		'item_id'           => (int) bp_get_current_group_id(),
 		'user_id'           => (int) $post->poster_id,
@@ -313,6 +486,14 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
 		'recorded_time'     => $post->post_time
 	) );
 
+	/**
+	 * Fires after the update of a group forum post.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param object $post  Object holding current post being updated.
+	 * @param object $topic Object holding current topic details. Passed by reference.
+	 */
 	do_action_ref_array( 'groups_update_group_forum_post', array( $post, &$topic ) );
 
 	return $post_id;
@@ -326,6 +507,7 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page
  * @since BuddyPress (1.1.0)
  *
  * @param int $topic_id The ID of the topic to be deleted.
+ *
  * @return bool True if the delete routine went through properly.
  */
 function groups_delete_group_forum_topic( $topic_id ) {
@@ -336,6 +518,14 @@ function groups_delete_group_forum_topic( $topic_id ) {
 	$action = bp_forums_delete_topic( array( 'topic_id' => $topic_id ) );
 
 	if ( !empty( $action ) ) {
+
+		/**
+		 * Fires before the deletion of a group forum topic.
+		 *
+		 * @since BuddyPress (1.2.9)
+		 *
+		 * @param int $topic_id ID of the topic to be deleted.
+		 */
 		do_action( 'groups_before_delete_group_forum_topic', $topic_id );
 
 		// Delete the corresponding activity stream items
@@ -360,6 +550,13 @@ function groups_delete_group_forum_topic( $topic_id ) {
 			}
 		}
 
+		/**
+		 * Fires after the deletion of a group forum topic.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $topic_id ID of the topic that was deleted.
+		 */
 		do_action( 'groups_delete_group_forum_topic', $topic_id );
 	}
 
@@ -373,10 +570,11 @@ function groups_delete_group_forum_topic( $topic_id ) {
  *
  * @since BuddyPress (1.1.0)
  *
- * @param int $post_id The ID of the post you want to delete.
- * @param int $topic_id Optional. The topic to which the post belongs. This
- *        value isn't used in the function but is passed along to do_action()
- *        hooks.
+ * @param int      $post_id  The ID of the post you want to delete.
+ * @param int|bool $topic_id Optional. The topic to which the post belongs. This
+ *                           value isn't used in the function but is passed along
+ *                           to do_action() hooks.
+ *
  * @return bool True on success.
  */
 function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
@@ -384,6 +582,15 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
 	$action = bp_forums_delete_post( array( 'post_id' => $post_id ) );
 
 	if ( !empty( $action ) ) {
+
+		/**
+		 * Fires before the deletion of a group forum post.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $post_id  ID of the post to be deleted.
+		 * @param int $topic_id ID of the associated topic.
+		 */
 		do_action( 'groups_before_delete_group_forum_post', $post_id, $topic_id );
 
 		// Delete the corresponding activity stream item
@@ -396,6 +603,14 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
 			) );
 		}
 
+		/**
+		 * Fires after the deletion of a group forum post.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $post_id  ID of the post that was deleted.
+		 * @param int $topic_id ID of the associated topic.
+		 */
 		do_action( 'groups_delete_group_forum_post', $post_id, $topic_id );
 	}
 
@@ -408,10 +623,19 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
  * @since BuddyPress (1.5.0)
  *
  * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'.
- *        Default: 'newest'.
+ *                     Default: 'newest'.
+ *
  * @return int The topic count.
  */
 function groups_total_public_forum_topic_count( $type = 'newest' ) {
+
+	/**
+	 * Filters the total count of all public topics of a given type, across groups/forums.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param int $value Total count of all public topics.
+	 */
 	return apply_filters( 'groups_total_public_forum_topic_count', BP_Groups_Group::get_global_forum_topic_count( $type ) );
 }
 
@@ -420,11 +644,20 @@ function groups_total_public_forum_topic_count( $type = 'newest' ) {
  *
  * @since BuddyPress (1.5.0)
  *
- * @param string $status Which groups to count. 'public', 'private', 'hidden',
- *        'all'. Default: 'public'.
- * @param string $search_terms Optional. Limit by a search term.
+ * @param string      $status       Which groups to count. 'public', 'private', 'hidden',
+ *                                  'all'. Default: 'public'.
+ * @param string|bool $search_terms Optional. Limit by a search term.
+ *
  * @return int The topic count.
  */
 function groups_total_forum_topic_count( $status = 'public', $search_terms = false ) {
+
+	/**
+	 * Filters the total count of all topics of a given status, across groups/forums.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Total count of all topics.
+	 */
 	return apply_filters( 'groups_total_forum_topic_count', BP_Groups_Group::get_global_topic_count( $status, $search_terms ) );
 }
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
index c83e74307cd4fc9e35e48dc01eaf46c24f4fb89a..a65f82dc407230701f9c75518eb49bc41e7f2edd 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Functions
+ * BuddyPress Groups Functions.
  *
  * Functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
@@ -13,18 +13,17 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Check whether there is a Groups directory page in the $bp global.
  *
  * @since BuddyPress (1.5.0)
  *
- * @global BuddyPress $bp The one true BuddyPress instance
- * @return bool True if set, False if empty
+ * @return bool True if set, False if empty.
  */
 function bp_groups_has_directory() {
-	global $bp;
+	$bp = buddypress();
 
 	return (bool) !empty( $bp->pages->groups->id );
 }
@@ -36,12 +35,14 @@ function bp_groups_has_directory() {
  * of instantiating BP_Groups_Group directly, so that you will inherit cache
  * support and pass through the groups_get_group filter.
  *
- * @param array $args {
+ * @param array|string $args {
  *	Array of al arguments.
- *	@type int $group_id ID of the group.
- *	@type bool $load_users No longer used.
+ *	@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.
+ *	                            extra information about the group.
+ *                              Default: false.
+ * }
  * @return BP_Groups_Group $group The group object.
  */
 function groups_get_group( $args = '' ) {
@@ -57,6 +58,13 @@ function groups_get_group( $args = '' ) {
 
 	$group = new BP_Groups_Group( $r['group_id'], $group_args );
 
+	/**
+	 * Filters a single group object.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param BP_Groups_Group $group Single group object.
+	 */
 	return apply_filters( 'groups_get_group', $group );
 }
 
@@ -67,21 +75,22 @@ function groups_get_group( $args = '' ) {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param array $args {
+ * @param array|string $args {
  *     An array of arguments.
- *     @type int|bool $group_id Pass a group ID to update an existing item, or
- *           0 / false to create a new group. Default: 0.
- *     @type int $creator_id The user ID that creates the group.
- *     @type string $name The group name.
- *     @type string $description Optional. The group's description.
- *     @type string $slug The group slug.
- *     @type string $status The group's status. Accepts 'public', 'private' or
-             '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 or if a bbPress
- *           forum is enabled for the group, set this to 1. Default: 0.
- *     @type string $date_created The GMT time, in Y-m-d h:i:s format,
- *           when the group was created. Defaults to the current time.
+ *     @type int|bool $group_id     Pass a group ID to update an existing item, or
+ *                                  0 / false to create a new group. Default: 0.
+ *     @type int      $creator_id   The user ID that creates the group.
+ *     @type string   $name         The group name.
+ *     @type string   $description  Optional. The group's description.
+ *     @type string   $slug         The group slug.
+ *     @type string   $status       The group's status. Accepts 'public', 'private' or
+                                    '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
+ *                                  or if a bbPress forum is enabled for the group,
+ *                                  set this to 1. Default: 0.
+ *     @type string   $date_created The GMT time, in Y-m-d h:i:s format, when the group
+ *                                  was created. Defaults to the current time.
  * }
  * @return int|bool The ID of the group on success. False on error.
  */
@@ -120,12 +129,16 @@ function groups_create_group( $args = '' ) {
 	}
 
 	// Set creator ID
-	if ( ! empty( $creator_id ) ) {
+	if ( $creator_id ) {
 		$group->creator_id = (int) $creator_id;
-	} else {
+	} elseif ( is_user_logged_in() ) {
 		$group->creator_id = bp_loggedin_user_id();
 	}
 
+	if ( ! $group->creator_id ) {
+		return false;
+	}
+
 	// Validate status
 	if ( ! groups_is_valid_status( $status ) ) {
 		return false;
@@ -155,14 +168,39 @@ function groups_create_group( $args = '' ) {
 		$member->date_modified = bp_core_current_time();
 		$member->save();
 
-		groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() );
-
+		/**
+		 * Fires after the creation of a new group and a group creator needs to be made.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int              $id     ID of the newly created group.
+		 * @param BP_Groups_Member $member Instance of the member who is assigned
+		 *                                 as group creator.
+		 * @param BP_Groups_Group  $group  Instance of the group being created.
+		 */
 		do_action( 'groups_create_group', $group->id, $member, $group );
 
 	} else {
+
+		/**
+		 * Fires after the update of a group.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int             $id    ID of the updated group.
+		 * @param BP_Groups_Group $group Instance of the group being updated.
+		 */
 		do_action( 'groups_update_group', $group->id, $group );
 	}
 
+	/**
+	 * Fires after the creation or update of a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int             $id    ID of the newly created group.
+	 * @param BP_Groups_Group $group Instance of the group being updated.
+	 */
 	do_action( 'groups_created_group', $group->id, $group );
 
 	return $group->id;
@@ -174,11 +212,12 @@ function groups_create_group( $args = '' ) {
  * These are the settings that appear on the first page of the group's Admin
  * section (Name, Description, and "Notify members...").
  *
- * @param int $group_id ID of the group.
- * @param string $group_name Name of the group.
- * @param string $group_desc Description of the group.
- * @param bool $notify_members Whether to send an email notification to group
- *        members about changes in these details.
+ * @param int    $group_id       ID of the group.
+ * @param string $group_name     Name of the group.
+ * @param string $group_desc     Description of the group.
+ * @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.
  */
 function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $notify_members ) {
@@ -186,7 +225,9 @@ function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n
 	if ( empty( $group_name ) || empty( $group_desc ) )
 		return false;
 
-	$group              = groups_get_group( array( 'group_id' => $group_id ) );
+	$group     = groups_get_group( array( 'group_id' => $group_id ) );
+	$old_group = clone $group;
+
 	$group->name        = $group_name;
 	$group->description = $group_desc;
 
@@ -194,10 +235,19 @@ function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n
 		return false;
 
 	if ( $notify_members ) {
-		groups_notification_group_updated( $group->id );
+		groups_notification_group_updated( $group->id, $old_group );
 	}
 
-	do_action( 'groups_details_updated', $group->id );
+	/**
+	 * Fired after a group's details are updated.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param int             $value          ID of the group.
+	 * @param BP_Groups_Group $old_group      Group object, before being modified.
+	 * @param bool            $notify_members Whether to send an email notification to members about the change.
+	 */
+	do_action( 'groups_details_updated', $group->id, $old_group, $notify_members );
 
 	return true;
 }
@@ -208,11 +258,12 @@ function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n
  * These are the settings that appear on the Settings page of the group's Admin
  * section (privacy settings, "enable forum", invitation status).
  *
- * @param int $group_id ID of the group.
- * @param bool $enable_forum Whether to enable a forum for the group.
- * @param string $status Group status. 'public', 'private', 'hidden'.
- * @param string $invite_status Optional. Who is allowed to send invitations
- *        to the group. 'members', 'mods', or 'admins'.
+ * @param int         $group_id      ID of the group.
+ * @param bool        $enable_forum  Whether to enable a forum for the group.
+ * @param string      $status        Group status. 'public', 'private', 'hidden'.
+ * @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.
  */
 function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status = false ) {
@@ -245,6 +296,14 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_
 		groups_update_groupmeta( $group->id, 'invite_status', $invite_status );
 
 	groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() );
+
+	/**
+	 * Fires after the update of a groups settings.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group that was updated.
+	 */
 	do_action( 'groups_settings_updated', $group->id );
 
 	return true;
@@ -256,10 +315,18 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_
  * @since BuddyPress (1.0.0)
  *
  * @param int $group_id ID of the group to delete.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_delete_group( $group_id ) {
 
+	/**
+	 * Fires before the deletion of a group.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $group_id ID of the group to be deleted.
+	 */
 	do_action( 'groups_before_delete_group', $group_id );
 
 	// Get the group object
@@ -273,6 +340,13 @@ function groups_delete_group( $group_id ) {
 	// Remove all outstanding invites for this group
 	groups_delete_all_group_invites( $group_id );
 
+	/**
+	 * Fires after the deletion of a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group that was deleted.
+	 */
 	do_action( 'groups_delete_group', $group_id );
 
 	return true;
@@ -282,10 +356,11 @@ function groups_delete_group( $group_id ) {
  * Check a group status (eg 'private') against the whitelist of registered statuses.
  *
  * @param string $status Status to check.
+ *
  * @return bool True if status is allowed, otherwise false.
  */
 function groups_is_valid_status( $status ) {
-	global $bp;
+	$bp = buddypress();
 
 	return in_array( $status, (array) $bp->groups->valid_status );
 }
@@ -294,10 +369,11 @@ function groups_is_valid_status( $status ) {
  * Provide a unique, sanitized version of a group slug.
  *
  * @param string $slug Group slug to check.
- * @return A unique and sanitized slug.
+ *
+ * @return string $slug A unique and sanitized slug.
  */
 function groups_check_slug( $slug ) {
-	global $bp;
+	$bp = buddypress();
 
 	if ( 'wp' == substr( $slug, 0, 2 ) )
 		$slug = substr( $slug, 2, strlen( $slug ) - 2 );
@@ -319,6 +395,7 @@ function groups_check_slug( $slug ) {
  * Get a group slug by its ID.
  *
  * @param int $group_id The numeric ID of the group.
+ *
  * @return string The group's slug.
  */
 function groups_get_slug( $group_id ) {
@@ -332,6 +409,7 @@ function groups_get_slug( $group_id ) {
  * @since BuddyPress (1.6.0)
  *
  * @param string $group_slug The group's slug.
+ *
  * @return int The ID.
  */
 function groups_get_id( $group_slug ) {
@@ -344,12 +422,12 @@ function groups_get_id( $group_slug ) {
  * Remove a user from a group.
  *
  * @param int $group_id ID of the group.
- * @param int $user_id Optional. ID of the user. Defaults to the currently
- *        logged-in user.
+ * @param int $user_id  Optional. ID of the user. Defaults to the currently
+ *                      logged-in user.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_leave_group( $group_id, $user_id = 0 ) {
-	global $bp;
 
 	if ( empty( $user_id ) )
 		$user_id = bp_loggedin_user_id();
@@ -362,13 +440,20 @@ function groups_leave_group( $group_id, $user_id = 0 ) {
 		}
 	}
 
-	// This is exactly the same as deleting an invite, just is_confirmed = 1 NOT 0.
-	if ( !groups_uninvite_user( $user_id, $group_id ) ) {
+	if ( ! groups_remove_member( $user_id, $group_id ) ) {
 		return false;
 	}
 
 	bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) );
 
+	/**
+	 * Fires after a user leaves a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group.
+	 * @param int $user_id  ID of the user leaving the group.
+	 */
 	do_action( 'groups_leave_group', $group_id, $user_id );
 
 	return true;
@@ -378,12 +463,12 @@ function groups_leave_group( $group_id, $user_id = 0 ) {
  * Add a user to a group.
  *
  * @param int $group_id ID of the group.
- * @param int $user_id Optional. ID of the user. Defaults to the currently
- *        logged-in user.
+ * @param int $user_id  Optional. ID of the user. Defaults to the currently
+ *                      logged-in user.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_join_group( $group_id, $user_id = 0 ) {
-	global $bp;
 
 	if ( empty( $user_id ) )
 		$user_id = bp_loggedin_user_id();
@@ -394,7 +479,7 @@ function groups_join_group( $group_id, $user_id = 0 ) {
 
 	// Check if the user has an outstanding request. If so, delete it.
 	if ( groups_check_for_membership_request( $user_id, $group_id ) )
-		groups_delete_membership_request( $user_id, $group_id );
+		groups_delete_membership_request( null, $user_id, $group_id );
 
 	// User is already a member, just return true
 	if ( groups_is_user_member( $user_id, $group_id ) )
@@ -412,6 +497,8 @@ function groups_join_group( $group_id, $user_id = 0 ) {
 	if ( !$new_member->save() )
 		return false;
 
+	$bp = buddypress();
+
 	if ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group || $group_id != $bp->groups->current_group->id )
 		$group = groups_get_group( array( 'group_id' => $group_id ) );
 	else
@@ -424,9 +511,14 @@ function groups_join_group( $group_id, $user_id = 0 ) {
 		'user_id' => $user_id,
 	) );
 
-	// Modify group meta
-	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
-
+	/**
+	 * Fires after a user joins a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group.
+	 * @param int $user_id  ID of the user joining the group.
+	 */
 	do_action( 'groups_join_group', $group_id, $user_id );
 
 	return true;
@@ -438,6 +530,7 @@ function groups_join_group( $group_id, $user_id = 0 ) {
  * Get a list of group administrators.
  *
  * @param int $group_id ID of the group.
+ *
  * @return array Info about group admins (user_id + date_modified).
  */
 function groups_get_group_admins( $group_id ) {
@@ -448,6 +541,7 @@ function groups_get_group_admins( $group_id ) {
  * Get a list of group moderators.
  *
  * @param int $group_id ID of the group.
+ *
  * @return array Info about group admins (user_id + date_modified).
  */
 function groups_get_group_mods( $group_id ) {
@@ -465,22 +559,22 @@ function groups_get_group_mods( $group_id ) {
  *
  * @param array $args {
  *     An array of optional arguments.
- *     @type int $group_id ID of the group whose members are being 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 results.
- *           Default: 20.
- *     @type int $max Optional. Max number of items to return.
- *     @type array $exclude Optional. Array of user IDs to exclude.
- *     @type bool|int True (or 1) to exclude admins and mods from results.
- *           Default: 1.
- *     @type bool|int True (or 1) to exclude banned users from results.
- *           Default: 1.
- *     @type array $group_role Optional. Array of group roles to include.
- *     @type string $search_terms Optional. Filter results by a search string.
- *     @type string $type Optional. Sort the order of results. 'last_joined',
- *           'first_joined', or any of the $type params available in
- *           {@link BP_User_Query}. Default: 'last_joined'.
+ *     @type int      $group_id     ID of the group whose members are being 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 results.
+ *                                  Default: 20.
+ *     @type int      $max          Optional. Max number of items to return.
+ *     @type array    $exclude      Optional. Array of user IDs to exclude.
+ *     @type bool|int $value        True (or 1) to exclude admins and mods from results.
+ *                                  Default: 1.
+ *     @type bool|int $value        True (or 1) to exclude banned users from results.
+ *                                  Default: 1.
+ *     @type array    $group_role   Optional. Array of group roles to include.
+ *     @type string   $search_terms Optional. Filter results by a search string.
+ *     @type string   $type         Optional. Sort the order of results. 'last_joined',
+ *                                  'first_joined', or any of the $type params available
+ *                                  in {@link BP_User_Query}. Default: 'last_joined'.
  * }
  * @return array Multi-d array of 'members' list and 'count'.
  */
@@ -564,6 +658,7 @@ function groups_get_group_members( $args = array() ) {
  * Get the member count for a group.
  *
  * @param int $group_id Group ID.
+ *
  * @return int Count of confirmed members for the group.
  */
 function groups_get_total_member_count( $group_id ) {
@@ -575,7 +670,7 @@ function groups_get_total_member_count( $group_id ) {
 /**
  * Get a collection of groups, based on the parameters passed.
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of arguments. Supports all arguments of
  *     {@link BP_Groups_Group::get()}. Where the default values differ, they
  *     have been described here.
@@ -620,6 +715,16 @@ function groups_get_groups( $args = '' ) {
 		'orderby'           => $r['orderby'],
 	) );
 
+	/**
+	 * Filters the collection of groups based on parsed parameters.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param BP_Groups_Group $groups Object of found groups based on parameters.
+	 *                                Passed by reference.
+	 * @param array           $r      Array of parsed arguments used for group query.
+	 *                                Passed by reference.
+	 */
 	return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$r ) );
 }
 
@@ -629,7 +734,9 @@ function groups_get_groups( $args = '' ) {
  * @return int
  */
 function groups_get_total_group_count() {
-	if ( !$count = wp_cache_get( 'bp_total_group_count', 'bp' ) ) {
+	$count = wp_cache_get( 'bp_total_group_count', 'bp' );
+
+	if ( false === $count ) {
 		$count = BP_Groups_Group::get_total_group_count();
 		wp_cache_set( 'bp_total_group_count', $count, 'bp' );
 	}
@@ -640,14 +747,14 @@ function groups_get_total_group_count() {
 /**
  * Get the IDs of the groups of which a specified user is a member.
  *
- * @param int $user_id ID of the user.
- * @param int $limit Optional. Max number of results to return.
- *        Default: false (no limit).
- * @param int $page Optional. Page offset of results to return.
- *        Default: false (no limit).
+ * @param int $user_id  ID of the user.
+ * @param int $pag_num  Optional. Max number of results to return.
+ *                      Default: false (no limit).
+ * @param int $pag_page Optional. Page offset of results to return.
+ *                      Default: false (no limit).
  * @return array {
  *     @type array $groups Array of groups returned by paginated query.
- *     @type int $total Count of groups matching query.
+ *     @type int   $total Count of groups matching query.
  * }
  */
 function groups_get_user_groups( $user_id = 0, $pag_num = 0, $pag_page = 0 ) {
@@ -662,6 +769,7 @@ function groups_get_user_groups( $user_id = 0, $pag_num = 0, $pag_page = 0 ) {
  * Get the count of groups of which the specified user is a member.
  *
  * @param int $user_id Optional. Default: ID of the displayed user.
+ *
  * @return int Group count.
  */
 function groups_total_groups_for_user( $user_id = 0 ) {
@@ -669,7 +777,9 @@ function groups_total_groups_for_user( $user_id = 0 ) {
 	if ( empty( $user_id ) )
 		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
 
-	if ( !$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' ) ) {
+	$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' );
+
+	if ( false === $count ) {
 		$count = BP_Groups_Member::total_group_count( $user_id );
 		wp_cache_set( 'bp_total_groups_for_user_' . $user_id, $count, 'bp' );
 	}
@@ -685,10 +795,19 @@ function groups_total_groups_for_user( $user_id = 0 ) {
  * @return BP_Groups_Group The current group object.
  */
 function groups_get_current_group() {
-	global $bp;
-
-	$current_group = isset( $bp->groups->current_group ) ? $bp->groups->current_group : false;
-
+	$bp = buddypress();
+
+	$current_group = isset( $bp->groups->current_group )
+		? $bp->groups->current_group
+		: false;
+
+	/**
+	 * Filters the BP_Groups_Group object corresponding to the current group.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param BP_Groups_Group $current_group Current BP_Groups_Group object.
+	 */
 	return apply_filters( 'groups_get_current_group', $current_group );
 }
 
@@ -698,26 +817,37 @@ function groups_get_current_group() {
  * 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.
+ *                      current group.
  * @return string
  */
 function groups_avatar_upload_dir( $group_id = 0 ) {
-	global $bp;
-
-	if ( !$group_id )
-		$group_id = $bp->groups->current_group->id;
-
-	$path    = bp_core_avatar_upload_path() . '/group-avatars/' . $group_id;
-	$newbdir = $path;
 
-	if ( !file_exists( $path ) )
-		@wp_mkdir_p( $path );
+	if ( empty( $group_id ) ) {
+		$group_id = bp_get_current_group_id();
+	}
 
-	$newurl    = bp_core_avatar_url() . '/group-avatars/' . $group_id;
+	$directory = 'group-avatars';
+	$path      = bp_core_avatar_upload_path() . '/' . $directory . '/' . $group_id;
+	$newbdir   = $path;
+	$newurl    = bp_core_avatar_url() . '/' . $directory . '/' . $group_id;
 	$newburl   = $newurl;
-	$newsubdir = '/group-avatars/' . $group_id;
-
-	return apply_filters( 'groups_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
+	$newsubdir = '/' . $directory . '/' . $group_id;
+
+	/**
+	 * Filters the avatar upload directory path for a given group.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array $value Array of parts related to the groups avatar upload directory.
+	 */
+	return apply_filters( 'groups_avatar_upload_dir', array(
+		'path'    => $path,
+		'url'     => $newurl,
+		'subdir'  => $newsubdir,
+		'basedir' => $newbdir,
+		'baseurl' => $newburl,
+		'error'   => false
+	) );
 }
 
 /** Group Member Status Checks ************************************************/
@@ -727,7 +857,8 @@ function groups_avatar_upload_dir( $group_id = 0 ) {
  *
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- * @param int|null ID of the membership if the user is an admin, otherwise null.
+ *
+ * @return bool
  */
 function groups_is_user_admin( $user_id, $group_id ) {
 	return BP_Groups_Member::check_is_admin( $user_id, $group_id );
@@ -738,7 +869,8 @@ function groups_is_user_admin( $user_id, $group_id ) {
  *
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- * @param int|null ID of the membership if the user is a mod, otherwise null.
+ *
+ * @return bool
  */
 function groups_is_user_mod( $user_id, $group_id ) {
 	return BP_Groups_Member::check_is_mod( $user_id, $group_id );
@@ -749,7 +881,8 @@ function groups_is_user_mod( $user_id, $group_id ) {
  *
  * @param int $user_id ID of the user.
  * @param int $group_id ID of the group.
- * @param int|null ID of the membership if the user is a member, otherwise null.
+ *
+ * @return bool
  */
 function groups_is_user_member( $user_id, $group_id ) {
 	return BP_Groups_Member::check_is_member( $user_id, $group_id );
@@ -766,7 +899,8 @@ function groups_is_user_banned( $user_id, $group_id ) {
  *
  * @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.
+ *
+ * @return bool
  */
 function groups_is_user_creator( $user_id, $group_id ) {
 	return BP_Groups_Member::check_is_creator( $user_id, $group_id );
@@ -779,18 +913,18 @@ function groups_is_user_creator( $user_id, $group_id ) {
  *
  * @todo Should bail out when the Activity component is not active.
  *
- * @param array {
+ * @param array|string $args {
  *     Array of arguments.
- *     @type string $content The content of the update.
- *     @type int $user_id Optional. ID of the user posting the update. Default:
- *           ID of the logged-in user.
- *     @type int $group_id Optional. ID of the group to be affiliated with the
- *           update. Default: ID of the current group.
+ *     @type string $content  The content of the update.
+ *     @type int    $user_id  Optional. ID of the user posting the update. Default:
+ *                            ID of the logged-in user.
+ *     @type int    $group_id Optional. ID of the group to be affiliated with the
+ *                            update. Default: ID of the current group.
  * }
  * @return int
  */
 function groups_post_update( $args = '' ) {
-	global $bp;
+	$bp = buddypress();
 
 	$defaults = array(
 		'content'  => false,
@@ -817,15 +951,44 @@ function groups_post_update( $args = '' ) {
 	$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;
 
+	/**
+	 * Filters the action for the new group activity update.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_action The new group activity update.
+	 */
+	$action = apply_filters( 'groups_activity_new_update_action',  $activity_action  );
+
+	/**
+	 * Filters the content for the new group activity update.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $activity_content The content of the update.
+	 */
+	$content_filtered = apply_filters( 'groups_activity_new_update_content', $activity_content );
+
 	$activity_id = groups_record_activity( array(
 		'user_id' => $user_id,
-		'action'  => apply_filters( 'groups_activity_new_update_action',  $activity_action  ),
-		'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ),
+		'action'  => $action,
+		'content' => $content_filtered,
 		'type'    => 'activity_update',
 		'item_id' => $group_id
 	) );
 
 	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
+
+	/**
+	 * Fires after posting of an Activity status update affiliated with a group.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $content     The content of the update.
+	 * @param int    $user_id     ID of the user posting the update.
+	 * @param int    $group_id    ID of the group being posted to.
+	 * @param bool   $activity_id Whether or not the activity recording succeeded.
+	 */
 	do_action( 'bp_groups_posted_update', $content, $user_id, $group_id, $activity_id );
 
 	return $activity_id;
@@ -836,10 +999,13 @@ function groups_post_update( $args = '' ) {
 /**
  * Get IDs of users with outstanding invites to a given group from a specified user.
  *
- * @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.
+ * @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
+ *
+ * @return array $value IDs of users who have been invited to the group by the
+ *                      user but have not yet accepted.
  */
 function groups_get_invites_for_user( $user_id = 0, $limit = false, $page = false, $exclude = false ) {
 
@@ -855,6 +1021,7 @@ function groups_get_invites_for_user( $user_id = 0, $limit = false, $page = fals
  * @since BuddyPress (2.0.0)
  *
  * @param int $user_id The user ID.
+ *
  * @return int
  */
 function groups_get_invite_count_for_user( $user_id = 0 ) {
@@ -868,16 +1035,16 @@ function groups_get_invite_count_for_user( $user_id = 0 ) {
 /**
  * Invite a user to a group.
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of arguments.
- *     @type int $user_id ID of the user being invited.
- *     @type int $group_id ID of the group to which the user is being invited.
- *     @type int $inviter_id Optional. ID of the inviting user. Default:
- *           ID of the logged-in user.
+ *     @type int    $user_id       ID of the user being invited.
+ *     @type int    $group_id      ID of the group to which the user is being invited.
+ *     @type int    $inviter_id    Optional. ID of the inviting user. Default:
+ *                                 ID of the logged-in user.
  *     @type string $date_modified Optional. Modified date for the invitation.
- *           Default: current date/time.
- *     @type bool $is_confirmed. Optional. Whether the invitation should be
- *           marked confirmed. Default: false.
+ *                                 Default: current date/time.
+ *     @type bool   $is_confirmed  Optional. Whether the invitation should be
+ *                                 marked confirmed. Default: false.
  * }
  * @return bool True on success, false on failure.
  */
@@ -902,7 +1069,7 @@ function groups_invite_user( $args = '' ) {
 		groups_accept_membership_request( $membership_id, $user_id, $group_id );
 
 	// Otherwise, create a new invitation
-	} else if ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
+	} elseif ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {
 		$invite                = new BP_Groups_Member;
 		$invite->group_id      = $group_id;
 		$invite->user_id       = $user_id;
@@ -913,6 +1080,13 @@ function groups_invite_user( $args = '' ) {
 		if ( !$invite->save() )
 			return false;
 
+		/**
+		 * Fires after the creation of a new group invite.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param array $args Array of parsed arguments for the group invite.
+		 */
 		do_action( 'groups_invite_user', $args );
 	}
 
@@ -924,15 +1098,24 @@ function groups_invite_user( $args = '' ) {
  *
  * Functionally, this is equivalent to removing a user from a group.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_uninvite_user( $user_id, $group_id ) {
 
-	if ( !BP_Groups_Member::delete( $user_id, $group_id ) )
+	if ( ! BP_Groups_Member::delete_invite( $user_id, $group_id ) )
 		return false;
 
+	/**
+	 * Fires after uninviting a user from a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group being uninvited from.
+	 * @param int $user_id  ID of the user being uninvited.
+	 */
 	do_action( 'groups_uninvite_user', $group_id, $user_id );
 
 	return true;
@@ -943,8 +1126,9 @@ function groups_uninvite_user( $user_id, $group_id ) {
  *
  * Returns true if a user is already a member of the group.
  *
- * @param int $user_id ID of the user.
+ * @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.
  */
 function groups_accept_invite( $user_id, $group_id ) {
@@ -957,7 +1141,7 @@ function groups_accept_invite( $user_id, $group_id ) {
 		}
 
 		if ( groups_check_for_membership_request( $user_id, $group_id ) ) {
-			groups_delete_membership_request( $user_id, $group_id );
+			groups_delete_membership_request( null, $user_id, $group_id );
 		}
 
 		return true;
@@ -978,6 +1162,14 @@ function groups_accept_invite( $user_id, $group_id ) {
 	// Modify group meta
 	groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
 
+	/**
+	 * Fires after a user has accepted a group invite.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id  ID of the user who accepted the group invite.
+	 * @param int $group_id ID of the group being accepted to.
+	 */
 	do_action( 'groups_accept_invite', $user_id, $group_id );
 
 	return true;
@@ -986,14 +1178,23 @@ function groups_accept_invite( $user_id, $group_id ) {
 /**
  * Reject a group invitation.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_reject_invite( $user_id, $group_id ) {
-	if ( ! BP_Groups_Member::delete( $user_id, $group_id ) )
+	if ( ! BP_Groups_Member::delete_invite( $user_id, $group_id ) )
 		return false;
 
+	/**
+	 * Fires after a user rejects a group invitation.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id  ID of the user rejecting the invite.
+	 * @param int $group_id ID of the group being rejected.
+	 */
 	do_action( 'groups_reject_invite', $user_id, $group_id );
 
 	return true;
@@ -1002,14 +1203,23 @@ function groups_reject_invite( $user_id, $group_id ) {
 /**
  * Delete a group invitation.
  *
- * @param int $user_id ID of the invited user.
+ * @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.
  */
 function groups_delete_invite( $user_id, $group_id ) {
 	if ( ! BP_Groups_Member::delete_invite( $user_id, $group_id ) )
 		return false;
 
+	/**
+	 * Fires after the deletion of a group invitation.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id  ID of the user whose invitation is being deleted.
+	 * @param int $group_id ID of the group whose invitation is being deleted.
+	 */
 	do_action( 'groups_delete_invite', $user_id, $group_id );
 
 	return true;
@@ -1018,7 +1228,7 @@ function groups_delete_invite( $user_id, $group_id ) {
 /**
  * Send all pending invites by a single user to a specific group.
  *
- * @param int $user_id ID of the inviting user.
+ * @param int $user_id  ID of the inviting user.
  * @param int $group_id ID of the group.
  */
 function groups_send_invites( $user_id, $group_id ) {
@@ -1040,9 +1250,26 @@ function groups_send_invites( $user_id, $group_id ) {
 		$member->save();
 	}
 
+	/**
+	 * Fires after the sending of invites for a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int   $group_id      ID of the group who's being invited to.
+	 * @param array $invited_users Array of users being invited to the group.
+	 */
 	do_action( 'groups_send_invites', $group_id, $invited_users );
 }
 
+/**
+ * Get IDs of users with outstanding invites to a given group from a specified user.
+ *
+ * @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.
+ */
 function groups_get_invites_for_group( $user_id, $group_id ) {
 	return BP_Groups_Group::get_invites( $user_id, $group_id );
 }
@@ -1054,10 +1281,11 @@ function groups_get_invites_for_group( $user_id, $group_id ) {
  * Entering 'all' as the $type parameter will return unsent invitations as
  * well (useful to make sure AJAX requests are not duplicated).
  *
- * @param int $user_id ID of potential group member.
- * @param int $group_id ID of potential group.
- * @param string $type Optional. Use 'sent' to check for sent invites, 'all' to
- *        check for all. Default: 'sent'.
+ * @param int    $user_id  ID of potential group member.
+ * @param int    $group_id ID of potential group.
+ * @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.
  */
 function groups_check_user_has_invite( $user_id, $group_id, $type = 'sent' ) {
@@ -1068,6 +1296,7 @@ function groups_check_user_has_invite( $user_id, $group_id, $type = 'sent' ) {
  * Delete all invitations to a given group.
  *
  * @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.
  */
 function groups_delete_all_group_invites( $group_id ) {
@@ -1079,9 +1308,10 @@ function groups_delete_all_group_invites( $group_id ) {
 /**
  * Promote a member to a new status within a group.
  *
- * @param int $user_id ID of the user.
- * @param int $group_id ID of the group.
- * @param string $status The new status. 'mod' or 'admin'.
+ * @param int    $user_id  ID of the user.
+ * @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.
  */
 function groups_promote_member( $user_id, $group_id, $status ) {
@@ -1094,17 +1324,26 @@ function groups_promote_member( $user_id, $group_id, $status ) {
 	// Don't use this action. It's deprecated as of BuddyPress 1.6.
 	do_action( 'groups_premote_member', $group_id, $user_id, $status );
 
-	// Use this action instead.
+	/**
+	 * Fires before the promotion of a user to a new status.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int    $group_id ID of the group being promoted in.
+	 * @param int    $user_id  ID of the user being promoted.
+	 * @param string $status   New status being promoted to.
+	 */
 	do_action( 'groups_promote_member', $group_id, $user_id, $status );
 
 	return $member->promote( $status );
 }
 
 /**
- * Demone a user to 'member' status within a group.
+ * Demote a user to 'member' status within a group.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_demote_member( $user_id, $group_id ) {
@@ -1114,6 +1353,14 @@ function groups_demote_member( $user_id, $group_id ) {
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 
+	/**
+	 * Fires before the demotion of a user to 'member'.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group being demoted in.
+	 * @param int $user_id  ID of the user being demoted.
+	 */
 	do_action( 'groups_demote_member', $group_id, $user_id );
 
 	return $member->demote();
@@ -1122,8 +1369,9 @@ function groups_demote_member( $user_id, $group_id ) {
 /**
  * Ban a member from a group.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_ban_member( $user_id, $group_id ) {
@@ -1133,6 +1381,14 @@ function groups_ban_member( $user_id, $group_id ) {
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 
+	/**
+	 * Fires before the banning of a member from a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group being banned from.
+	 * @param int $user_id  ID of the user being banned.
+	 */
 	do_action( 'groups_ban_member', $group_id, $user_id );
 
 	return $member->ban();
@@ -1141,8 +1397,9 @@ function groups_ban_member( $user_id, $group_id ) {
 /**
  * Unban a member from a group.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_unban_member( $user_id, $group_id ) {
@@ -1152,6 +1409,14 @@ function groups_unban_member( $user_id, $group_id ) {
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 
+	/**
+	 * Fires before the unbanning of a member from a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group being unbanned from.
+	 * @param int $user_id  ID of the user being unbanned.
+	 */
 	do_action( 'groups_unban_member', $group_id, $user_id );
 
 	return $member->unban();
@@ -1162,17 +1427,34 @@ function groups_unban_member( $user_id, $group_id ) {
 /**
  * Remove a member from a group.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_remove_member( $user_id, $group_id ) {
 
-	if ( ! bp_is_item_admin() )
-		return false;
+	if ( ! bp_is_item_admin() ) {
+ 		// bp_is_item_admin may not be set if this function is called outside of group context.
+ 		// Site admins and group admins can remove a member from a group.
+ 		// A member may also request to remove herself from a group.
+ 		if ( ! current_user_can( 'bp_moderate' )
+ 			&& ! groups_is_user_admin( bp_loggedin_user_id(), $group_id )
+ 			&& $user_id != bp_loggedin_user_id() ) {
+ 				return false;
+ 			}
+ 	}
 
 	$member = new BP_Groups_Member( $user_id, $group_id );
 
+	/**
+	 * Fires before the removal of a member from a group.
+	 *
+	 * @since BuddyPress (1.2.6)
+	 *
+	 * @param int $group_id ID of the group being removed from.
+	 * @param int $user_id  ID of the user being removed.
+	 */
 	do_action( 'groups_remove_member', $group_id, $user_id );
 
 	return $member->remove();
@@ -1184,7 +1466,8 @@ function groups_remove_member( $user_id, $group_id ) {
  * Create a group membership request.
  *
  * @param int $requesting_user_id ID of the user requesting membership.
- * @param int $group_id ID of the group.
+ * @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 ) {
@@ -1220,6 +1503,16 @@ function groups_send_membership_request( $requesting_user_id, $group_id ) {
 		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 );
 
+		/**
+		 * Fires after the creation of a new membership request.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int   $requesting_user_id  ID of the user requesting membership.
+		 * @param array $admins              Array of group admins.
+		 * @param int   $group_id            ID of the group being requested to.
+		 * @param int   $requesting_user->id ID of the user requesting membership.
+		 */
 		do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id );
 
 		return true;
@@ -1232,11 +1525,13 @@ function groups_send_membership_request( $requesting_user_id, $group_id ) {
  * Accept a pending group membership request.
  *
  * @param int $membership_id ID of the membership object.
- * @param int $user_id Optional. ID of the user who requested membership.
- *        Provide this value along with $group_id to override $membership_id.
- * @param int $group_id Optional. ID of the group to which membership is being
- *        requested. Provide this value along with $user_id to override
- *        $membership_id.
+ * @param int $user_id       Optional. ID of the user who requested membership.
+ *                           Provide this value along with $group_id to override
+ *                           $membership_id.
+ * @param int $group_id      Optional. ID of the group to which membership is being
+ *                           requested. Provide this value along with $user_id to
+ *                           override $membership_id.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_accept_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
@@ -1258,6 +1553,15 @@ function groups_accept_membership_request( $membership_id, $user_id = 0, $group_
 		groups_delete_invite( $membership->user_id, $membership->group_id );
 	}
 
+	/**
+	 * Fires after a group membership request has been accepted.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int  $user_id  ID of the user who accepted membership.
+	 * @param int  $group_id ID of the group that was accepted membership to.
+	 * @param bool $value    If membership was accepted.
+	 */
 	do_action( 'groups_membership_accepted', $membership->user_id, $membership->group_id, true );
 
 	return true;
@@ -1267,11 +1571,13 @@ function groups_accept_membership_request( $membership_id, $user_id = 0, $group_
  * Reject a pending group membership request.
  *
  * @param int $membership_id ID of the membership object.
- * @param int $user_id Optional. ID of the user who requested membership.
- *        Provide this value along with $group_id to override $membership_id.
- * @param int $group_id Optional. ID of the group to which membership is being
- *        requested. Provide this value along with $user_id to override
- *        $membership_id.
+ * @param int $user_id       Optional. ID of the user who requested membership.
+ *                           Provide this value along with $group_id to override
+ *                           $membership_id.
+ * @param int $group_id      Optional. ID of the group to which membership is being
+ *                           requested. Provide this value along with $user_id to
+ *                           override $membership_id.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_reject_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
@@ -1279,6 +1585,15 @@ function groups_reject_membership_request( $membership_id, $user_id = 0, $group_
 		return false;
 	}
 
+	/**
+	 * Fires after a group membership request has been rejected.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int  $user_id  ID of the user who rejected membership.
+	 * @param int  $group_id ID of the group that was rejected membership to.
+	 * @param bool $value    If membership was accepted.
+	 */
 	do_action( 'groups_membership_rejected', $membership->user_id, $membership->group_id, false );
 
 	return true;
@@ -1288,11 +1603,13 @@ function groups_reject_membership_request( $membership_id, $user_id = 0, $group_
  * Delete a pending group membership request.
  *
  * @param int $membership_id ID of the membership object.
- * @param int $user_id Optional. ID of the user who requested membership.
- *        Provide this value along with $group_id to override $membership_id.
- * @param int $group_id Optional. ID of the group to which membership is being
- *        requested. Provide this value along with $user_id to override
- *        $membership_id.
+ * @param int $user_id       Optional. ID of the user who requested membership.
+ *                           Provide this value along with $group_id to override
+ *                           $membership_id.
+ * @param int $group_id      Optional. ID of the group to which membership is being
+ *                           requested. Provide this value along with $user_id to
+ *                           override $membership_id.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_delete_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
@@ -1301,7 +1618,7 @@ function groups_delete_membership_request( $membership_id, $user_id = 0, $group_
 	else
 		$membership = new BP_Groups_Member( false, false, $membership_id );
 
-	if ( !BP_Groups_Member::delete( $membership->user_id, $membership->group_id ) )
+	if ( ! BP_Groups_Member::delete_request( $membership->user_id, $membership->group_id ) )
 		return false;
 
 	return $membership;
@@ -1310,8 +1627,9 @@ function groups_delete_membership_request( $membership_id, $user_id = 0, $group_
 /**
  * Check whether a user has an outstanding membership request for a given group.
  *
- * @param int $user_id ID of the user.
+ * @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.
  */
 function groups_check_for_membership_request( $user_id, $group_id ) {
@@ -1322,6 +1640,7 @@ function groups_check_for_membership_request( $user_id, $group_id ) {
  * Accept all pending membership requests to a group.
  *
  * @param int $group_id ID of the group.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_accept_all_pending_membership_requests( $group_id ) {
@@ -1333,6 +1652,13 @@ function groups_accept_all_pending_membership_requests( $group_id ) {
 	foreach ( (array) $user_ids as $user_id )
 		groups_accept_membership_request( false, $user_id, $group_id );
 
+	/**
+	 * Fires after the acceptance of all pending membership requests to a group.
+	 *
+	 * @since BuddyPress (1.0.2)
+	 *
+	 * @param int $group_id ID of the group whose pending memberships were accepted.
+	 */
 	do_action( 'groups_accept_all_pending_membership_requests', $group_id );
 
 	return true;
@@ -1343,16 +1669,15 @@ function groups_accept_all_pending_membership_requests( $group_id ) {
 /**
  * Delete metadata for a group.
  *
- * @param int $group_id ID of the group.
- * @param string $meta_key The key of the row to delete.
- * @param string $meta_value Optional. Metadata value. If specified, only delete
- *        metadata entries with this value.
- * @param bool $delete_all Optional. If true, delete matching metadata entries
- *        for all groups. Default: false.
- * @param bool $delete_all Optional. If true, delete matching metadata entries
- * 	  for all objects, ignoring the specified group_id. Otherwise, only
- * 	  delete matching metadata entries for the specified group.
- * 	  Default: false.
+ * @param int         $group_id   ID of the group.
+ * @param string|bool $meta_key   The key of the row to delete.
+ * @param string|bool $meta_value Optional. Metadata value. If specified, only delete
+ *                                metadata entries with this value.
+ * @param bool        $delete_all Optional. If true, delete matching metadata entries
+ *                                for all groups. Otherwise, only delete matching
+ *                                metadata entries for the specified group.
+ *                                Default: false.
+ *
  * @return bool True on success, false on failure.
  */
 function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = false, $delete_all = false ) {
@@ -1370,6 +1695,7 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa
 
 	add_filter( 'query', 'bp_filter_metaid_column_name' );
 
+	$retval = true;
 	foreach ( $keys as $key ) {
 		$retval = delete_metadata( 'group', $group_id, $key, $meta_value, $delete_all );
 	}
@@ -1382,11 +1708,12 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa
 /**
  * Get a piece of group metadata.
  *
- * @param int $group_id ID of the group.
+ * @param int    $group_id ID of the group.
  * @param string $meta_key Metadata key.
- * @param bool $single Optional. If true, return only the first value of the
- *        specified meta_key. This parameter has no effect if meta_key is
- *        empty.
+ * @param bool   $single   Optional. If true, return only the first value of the
+ *                         specified meta_key. This parameter has no effect if
+ *                         meta_key is empty.
+ *
  * @return mixed Metadata value.
  */
 function groups_get_groupmeta( $group_id, $meta_key = '', $single = true ) {
@@ -1400,15 +1727,16 @@ function groups_get_groupmeta( $group_id, $meta_key = '', $single = true ) {
 /**
  * Update a piece of group metadata.
  *
- * @param int $group_id ID of the group.
- * @param string $meta_key Metadata key.
- * @param mixed $meta_value Value to store.
- * @param mixed $prev_value Optional. If specified, only update existing
- *        metadata entries with the specified value. Otherwise, update all
- *        entries.
- * @return bool|int Returns false on failure. On successful update of existing
- *         metadata, returns true. On successful creation of new metadata,
- *         returns the integer ID of the new metadata row.
+ * @param int    $group_id   ID of the group.
+ * @param string $meta_key   Metadata key.
+ * @param mixed  $meta_value Value to store.
+ * @param mixed  $prev_value Optional. If specified, only update existing
+ *                           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,
+ *                          returns the integer ID of the new metadata row.
  */
 function groups_update_groupmeta( $group_id, $meta_key, $meta_value, $prev_value = '' ) {
 	add_filter( 'query', 'bp_filter_metaid_column_name' );
@@ -1423,12 +1751,14 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value, $prev_value
  *
  * @since BuddyPress (2.0.0)
  *
- * @param int $group_id ID of the group.
- * @param string $meta_key Metadata key.
- * @param mixed $meta_value Metadata value.
- * @param bool $unique. Optional. Whether to enforce a single metadata value
- *        for the given key. If true, and the object already has a value for
- *        the key, no change will be made. Default: false.
+ * @param int    $group_id   ID of the group.
+ * @param string $meta_key   Metadata key.
+ * @param mixed  $meta_value Metadata value.
+ * @param bool   $unique.    Optional. Whether to enforce a single metadata value
+ *                           for the given key. If true, and the object already
+ *                           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.
  */
 function groups_add_groupmeta( $group_id, $meta_key, $meta_value, $unique = false ) {
@@ -1451,6 +1781,13 @@ function groups_add_groupmeta( $group_id, $meta_key, $meta_value, $unique = fals
 function groups_remove_data_for_user( $user_id ) {
 	BP_Groups_Member::delete_all_for_user( $user_id );
 
+	/**
+	 * Fires after the deletion of all data for a user.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param int $user_id ID of the user whose data is being deleted.
+	 */
 	do_action( 'groups_remove_data_for_user', $user_id );
 }
 add_action( 'wpmu_delete_user',  'groups_remove_data_for_user' );
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
index e07dd26f38be2bf95c4f6b07f53489eeb96b1d6f..674448cacd6fe9436e66986f7e1a9da985faf91e 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Loader
+ * BuddyPress Groups Loader.
  *
  * A groups component, for users to group themselves together. Includes a
  * robust sub-component API that allows Groups to be extended.
@@ -12,12 +12,12 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Groups_Component extends BP_Component {
 
 	/**
-	 * Auto-join group when non group member performs group activity
+	 * Auto-join group when non group member performs group activity.
 	 *
 	 * @since BuddyPress (1.5.0)
 	 * @access public
@@ -178,6 +178,14 @@ class BP_Groups_Component extends BP_Component {
 		if ( bp_is_groups_component() && $group_id = BP_Groups_Group::group_exists( bp_current_action() ) ) {
 
 			$bp->is_single_item  = true;
+
+			/**
+			 * Filters the current PHP Class being used.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $value Name of the class being used.
+			 */
 			$current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' );
 
 			if ( $current_group_class == 'BP_Groups_Group' ) {
@@ -187,6 +195,14 @@ class BP_Groups_Component extends BP_Component {
 				) );
 
 			} else {
+
+				/**
+				 * Filters the current group object being instantiated from previous filter.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param object $value Newly instantiated object for the group.
+				 */
 				$this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) );
 			}
 
@@ -233,7 +249,13 @@ class BP_Groups_Component extends BP_Component {
 			$this->current_group = 0;
 		}
 
-		// Illegal group names/slugs
+		/**
+		 * Filters the list of illegal groups names/slugs.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param array $value Array of illegal group names/slugs.
+		 */
 		$this->forbidden_names = apply_filters( 'groups_forbidden_names', array(
 			'my-groups',
 			'create',
@@ -257,7 +279,13 @@ class BP_Groups_Component extends BP_Component {
 			return;
 		}
 
-		// Preconfigured group creation steps
+		/**
+		 * Filters the preconfigured groups creation steps.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param array $value Array of preconfigured group creation steps.
+		 */
 		$this->group_creation_steps = apply_filters( 'groups_create_group_steps', array(
 			'group-details'  => array(
 				'name'       => _x( 'Details', 'Group screen nav', 'buddypress' ),
@@ -270,7 +298,8 @@ class BP_Groups_Component extends BP_Component {
 		) );
 
 		// If avatar uploads are not disabled, add avatar option
-		if ( ! (int) $bp->site_options['bp-disable-avatar-uploads'] && $bp->avatar->show_avatars ) {
+		$disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads();
+		if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) {
 			$this->group_creation_steps['group-avatar'] = array(
 				'name'     => _x( 'Photo', 'Group screen nav', 'buddypress' ),
 				'position' => 20
@@ -285,7 +314,13 @@ class BP_Groups_Component extends BP_Component {
 			);
 		}
 
-		// Groups statuses
+		/**
+		 * Filters the list of valid groups statuses.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param array $value Array of valid group statuses.
+		 */
 		$this->valid_status = apply_filters( 'groups_valid_status', array(
 			'public',
 			'private',
@@ -311,6 +346,14 @@ class BP_Groups_Component extends BP_Component {
 		}
 
 
+		/**
+		 * Filters the default groups extension.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $value BP_GROUPS_DEFAULT_EXTENSION constant if defined,
+		 *                      else 'home'.
+		 */
 		$this->default_extension = apply_filters( 'bp_groups_default_extension', defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'home' );
 
 		if ( !bp_current_action() ) {
@@ -343,10 +386,8 @@ class BP_Groups_Component extends BP_Component {
 	 *
 	 * @see BP_Component::setup_nav() for a description of arguments.
 	 *
-	 * @param array $main_nav Optional. See BP_Component::setup_nav() for
-	 *        description.
-	 * @param array $sub_nav Optional. See BP_Component::setup_nav() for
-	 *        description.
+	 * @param array $main_nav Optional. See BP_Component::setup_nav() for description.
+	 * @param array $sub_nav  Optional. See BP_Component::setup_nav() for description.
 	 */
 	public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
 
@@ -507,14 +548,75 @@ class BP_Groups_Component extends BP_Component {
 					'item_css_id'     => 'admin',
 					'no_access_url'   => $group_link,
 				);
+
+				$admin_link = trailingslashit( $group_link . 'admin' );
+
+				// Common params to all nav items
+				$default_params = array(
+					'parent_url'        => $admin_link,
+					'parent_slug'       => $this->current_group->slug . '_manage',
+					'screen_function'   => 'groups_screen_group_admin',
+					'user_has_access'   => bp_is_item_admin(),
+					'show_in_admin_bar' => true,
+				);
+
+				$sub_nav[] = array_merge( array(
+					'name'            => __( 'Details', 'buddypress' ),
+					'slug'            => 'edit-details',
+					'position'        => 0,
+				), $default_params );
+
+				$sub_nav[] = array_merge( array(
+					'name'            => __( 'Settings', 'buddypress' ),
+					'slug'            => 'group-settings',
+					'position'        => 10,
+				), $default_params );
+
+				if ( ! bp_disable_group_avatar_uploads() && buddypress()->avatar->show_avatars ) {
+					$sub_nav[] = array_merge( array(
+						'name'        => __( 'Photo', 'buddypress' ),
+						'slug'        => 'group-avatar',
+						'position'    => 20,
+					), $default_params );
+				}
+
+				$sub_nav[] = array_merge( array(
+					'name'            => __( 'Members', 'buddypress' ),
+					'slug'            => 'manage-members',
+					'position'        => 30,
+				), $default_params );
+
+				if ( 'private' == $this->current_group->status ) {
+					$sub_nav[] = array_merge( array(
+						'name'            => __( 'Requests', 'buddypress' ),
+						'slug'            => 'membership-requests',
+						'position'        => 40,
+					), $default_params );
+				}
+
+				$sub_nav[] = array_merge( array(
+					'name'            => __( 'Delete', 'buddypress' ),
+					'slug'            => 'delete-group',
+					'position'        => 1000,
+				), $default_params );
 			}
 
 			parent::setup_nav( $main_nav, $sub_nav );
 		}
 
 		if ( isset( $this->current_group->user_has_access ) ) {
+
+			/**
+			 * Fires at the end of the groups navigation setup if user has access.
+			 *
+			 * @since BuddyPress (1.0.2)
+			 *
+			 * @param bool $user_has_access Whether or not user has access.
+			 */
 			do_action( 'groups_setup_nav', $this->current_group->user_has_access );
 		} else {
+
+			/** This action is documented in bp-groups/bp-groups-loader.php */
 			do_action( 'groups_setup_nav');
 		}
 	}
@@ -525,8 +627,7 @@ class BP_Groups_Component extends BP_Component {
 	 * @see BP_Component::setup_nav() for a description of the $wp_admin_nav
 	 *      parameter array.
 	 *
-	 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a
-	 *        description.
+	 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a description.
 	 */
 	public function setup_admin_bar( $wp_admin_nav = array() ) {
 		$bp = buddypress();
@@ -597,7 +698,7 @@ class BP_Groups_Component extends BP_Component {
 			if ( bp_is_my_profile() && !bp_is_single_item() ) {
 				$bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' );
 
-			} else if ( !bp_is_my_profile() && !bp_is_single_item() ) {
+			} elseif ( !bp_is_my_profile() && !bp_is_single_item() ) {
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
 					'item_id' => bp_displayed_user_id(),
 					'type'    => 'thumb',
@@ -607,7 +708,7 @@ class BP_Groups_Component extends BP_Component {
 
 			// We are viewing a single group, so set up the
 			// group navigation menu using the $this->current_group global.
-			} else if ( bp_is_single_item() ) {
+			} elseif ( bp_is_single_item() ) {
 				$bp->bp_options_title  = $this->current_group->name;
 				$bp->bp_options_avatar = bp_core_fetch_avatar( array(
 					'item_id'    => $this->current_group->id,
@@ -625,6 +726,24 @@ class BP_Groups_Component extends BP_Component {
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_groups',
+			'bp_group_admins',
+			'bp_group_invite_count',
+			'group_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
index c4b1a485b764b5a84b29011bbebc7e62d5629838..3bd75d7574251a9ba2fffa09c01e9e6a0df64313 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Groups Notification Functions
+ * BuddyPress Groups Notification Functions.
  *
  * These functions handle the recording, deleting and formatting of notifications
  * for the user and for this specific component.
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Emails ********************************************************************/
 
@@ -20,11 +20,47 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @since BuddyPress (1.0.0)
  *
- * @param int $group_id ID of the group.
+ * @param int                  $group_id  ID of the group.
+ * @param BP_Groups_Group|null $old_group Group before new details were saved.
  */
-function groups_notification_group_updated( $group_id = 0 ) {
+function groups_notification_group_updated( $group_id = 0, $old_group = null ) {
+
+	$group = groups_get_group( array( 'group_id' => $group_id ) );
+
+	if ( $old_group instanceof BP_Groups_Group ) {
+		$changed = array();
+
+		if ( $group->name !== $old_group->name ) {
+			$changed[] = sprintf(
+				_x( '* Name changed from "%s" to "%s"', 'Group update email text', 'buddypress' ),
+				esc_html( $old_group->name ),
+				esc_html( $group->name )
+			);
+		}
+
+		if ( $group->description !== $old_group->description ) {
+			$changed[] = sprintf(
+				_x( '* Description changed from "%s" to "%s"', 'Group update email text', 'buddypress' ),
+				esc_html( $old_group->description ),
+				esc_html( $group->description )
+			);
+		}
+	}
+
+	/**
+	 * Filters the bullet points listing updated items in the email notification after a group is updated.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $changed Array of bullet points.
+	 */
+	$changed = apply_filters( 'groups_notification_group_update_updated_items', $changed );
+
+	$changed_text = '';
+	if ( ! empty( $changed ) ) {
+		$changed_text = "\n\n" . implode( "\n", $changed );
+	}
 
-	$group    = groups_get_group( array( 'group_id' => $group_id ) );
 	$subject  = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) );
 	$user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
 
@@ -45,18 +81,44 @@ function groups_notification_group_updated( $group_id = 0 ) {
 		$settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/';
 
 		$message = sprintf( __(
-'Group details for the group "%1$s" were updated:
+'Group details for the group "%1$s" were updated: %2$s
 
-To view the group: %2$s
+To view the group: %3$s
 
 ---------------------
-', 'buddypress' ), $group->name, $group_link );
+', 'buddypress' ), $group->name, $changed_text, $group_link );
 
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 
-		/* Send the message */
+		/**
+		 * Filters the user email that the group update notification will be sent to.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $to User email the notification is being sent to.
+		 */
 		$to      = apply_filters( 'groups_notification_group_updated_to', $to );
+
+		/**
+		 * Filters the group update notification subject that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string          $subject Email notification subject text.
+		 * @param BP_Groups_Group $group   Object holding the current group instance. Passed by reference.
+		 */
 		$subject = apply_filters_ref_array( 'groups_notification_group_updated_subject', array( $subject, &$group ) );
+
+		/**
+		 * Filters the group update notification message that will be sent to user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string          $message       Email notification message text.
+		 * @param BP_Groups_Group $group         Object holding the current group instance. Passed by reference.
+		 * @param string          $group_link    URL permalink to the group that was updated.
+		 * @param string          $settings_link URL permalink for the user's notification settings area.
+		 */
 		$message = apply_filters_ref_array( 'groups_notification_group_updated_message', array( $message, &$group, $group_link, $settings_link ) );
 
 		wp_mail( $to, $subject, $message );
@@ -64,6 +126,18 @@ To view the group: %2$s
 		unset( $message, $to );
 	}
 
+	/**
+	 * Fires after the notification is sent that a group has been updated.
+	 *
+	 * See https://buddypress.trac.wordpress.org/ticket/3644 for blank message parameter.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array  $user_ids Array of user IDs to notify about the update.
+	 * @param string $subject  Email notification subject text.
+	 * @param string $value    Empty string preventing PHP error.
+	 * @param int    $group_id ID of the group that was updated.
+	 */
 	do_action( 'bp_groups_sent_updated_email', $user_ids, $subject, '', $group_id );
 }
 
@@ -73,10 +147,11 @@ To view the group: %2$s
  * @since BuddyPress (1.0.0)
  *
  * @param int $requesting_user_id ID of the user requesting group membership.
- * @param int $admin_id ID of the group admin.
- * @param int $group_id ID of the group.
- * @param int $membership_id ID of the group membership object.
- * @return bool|null False on failure.
+ * @param int $admin_id           ID of the group admin.
+ * @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 ) {
 
@@ -111,11 +186,32 @@ function groups_notification_new_membership_request( $requesting_user_id = 0, $a
 	// 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/';
 
+	// Fetch the message, if there's one to fetch.
+	$membership = new BP_Groups_Member( false, false, $membership_id );
+
 	// 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 ) ) );
 
-$message = sprintf( __(
+	if ( ! empty( $membership->comments ) ) {
+		$message = sprintf( __(
+'%1$s wants to join the group "%2$s".
+
+Message from %1$s: "%3$s"
+
+Because you are the administrator of this group, you must either accept or reject the membership request.
+
+To view all pending membership requests for this group, please visit:
+%4$s
+
+To view %5$s\'s profile: %6$s
+
+---------------------
+', 'buddypress' ), $requesting_user_name, $group->name, esc_html( $membership->comments ), $group_requests, $requesting_user_name, $profile_link );
+
+	} else {
+
+		$message = sprintf( __(
 '%1$s wants to join the group "%2$s".
 
 Because you are the administrator of this group, you must either accept or reject the membership request.
@@ -127,19 +223,60 @@ To view %4$s\'s profile: %5$s
 
 ---------------------
 ', 'buddypress' ), $requesting_user_name, $group->name, $group_requests, $requesting_user_name, $profile_link );
+	}
 
 	// 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 );
 	}
 
-	// Send the message
+	/**
+	 * Filters the user email that the group membership request will be sent to.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $to User email the request is being sent to.
+	 */
 	$to      = apply_filters( 'groups_notification_new_membership_request_to', $to );
+
+	/**
+	 * Filters the group membership request subject that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $subject Membership request email subject text.
+	 * @param BP_Groups_Group $group   Object holding the current group instance. Passed by reference.
+	 */
 	$subject = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $subject, &$group ) );
+
+	/**
+	 * Filters the group membership request message that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $message              Membership request email message text.
+	 * @param BP_Groups_Group $group                Object holding the current group instance. Passed by reference.
+	 * @param string          $requesting_user_name Username of who is requesting membership.
+	 * @param string          $profile_link         URL permalink for the profile for the user requesting membership.
+	 * @param string          $group_requests       URL permalink for the group requests screen for group being requested membership to.
+	 * @param string          $settings_link        URL permalink for the user's notification settings area.
+	 */
 	$message = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $message, &$group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the notification is sent that a member has requested group membership.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int    $admin_id           ID of the group administrator.
+	 * @param string $subject            Email notification subject text.
+	 * @param string $message            Email notification message text.
+	 * @param int    $requesting_user_id ID of the user requesting membership.
+	 * @param int    $group_id           ID of the group receiving membership request.
+	 * @param int    $membership_id      ID of the group membership object.
+	 */
 	do_action( 'bp_groups_sent_membership_request_email', $admin_id, $subject, $message, $requesting_user_id, $group_id, $membership_id );
 }
 
@@ -148,11 +285,12 @@ To view %4$s\'s profile: %5$s
  *
  * @since BuddyPress (1.0.0)
  *
- * @param int $requesting_user_id ID of the user requesting group membership.
- * @param int $group_id ID of the group.
- * @param bool $accepted Optional. Whether the membership request was accepted.
- *        Default: true.
- * @return boolean
+ * @param int  $requesting_user_id ID of the user requesting group membership.
+ * @param int  $group_id           ID of the group.
+ * @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 ) {
 
@@ -211,13 +349,49 @@ To submit another request please log in and visit: %2$s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 	}
 
-	// Send the message
+	/**
+	 * Filters the user email that the group membership request result will be sent to.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $to User email the request result is being sent to.
+	 */
 	$to      = apply_filters( 'groups_notification_membership_request_completed_to', $to );
+
+	/**
+	 * Filters the group membership request result subject that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $subject Membership request result email subject text.
+	 * @param BP_Groups_Group $group   Object holding the current group instance. Passed by reference.
+	 */
 	$subject = apply_filters_ref_array( 'groups_notification_membership_request_completed_subject', array( $subject, &$group ) );
+
+	/**
+	 * Filters the group membership request result message that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $message       Membership request result email message text.
+	 * @param BP_Groups_Group $group         Object holding the current group instance. Passed by reference.
+	 * @param string          $group_link    URL permalink for the group that was requested membership for.
+	 * @param string          $settings_link URL permalink for the user's notification settings area.
+	 */
 	$message = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $message, &$group, $group_link, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the notification is sent that a membership has been approved.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int    $requesting_user_id ID of the user whose membership was approved.
+	 * @param string $subject            Email notification subject text.
+	 * @param string $message            Email notification message text.
+	 * @param int    $group_id           ID of the group that was joined.
+	 */
 	do_action( 'bp_groups_sent_membership_approved_email', $requesting_user_id, $subject, $message, $group_id );
 }
 add_action( 'groups_membership_accepted', 'groups_notification_membership_request_completed', 10, 3 );
@@ -228,9 +402,10 @@ add_action( 'groups_membership_rejected', 'groups_notification_membership_reques
  *
  * @since BuddyPress (1.0.0)
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
- * @return bool|null False on failure.
+ *
+ * @return false|null False on failure.
  */
 function groups_notification_promoted_member( $user_id = 0, $group_id = 0 ) {
 
@@ -280,13 +455,50 @@ To view the group please visit: %3$s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 	}
 
-	// Send the message
+	/**
+	 * Filters the user email that the group promotion notification will be sent to.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $to User email the promotion notification is being sent to.
+	 */
 	$to      = apply_filters( 'groups_notification_promoted_member_to', $to );
+
+	/**
+	 * Filters the group promotion notification subject that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $subject Promotion notification email subject text.
+	 * @param BP_Groups_Group $group   Object holding the current group instance. Passed by reference.
+	 */
 	$subject = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $subject, &$group ) );
+
+	/**
+	 * Filters the group promotion notification message that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $message       Promotion notification email message text.
+	 * @param BP_Groups_Group $group         Object holding the current group instance. Passed by reference.
+	 * @param string          $promoted_to   Role that the user was promoted to within the group.
+	 * @param string          $group_link    URL permalink for the group that the promotion was related to.
+	 * @param string          $settings_link URL permalink for the user's notification settings area.
+	 */
 	$message = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $message, &$group, $promoted_to, $group_link, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the notification is sent that a member has been promoted.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int    $user_id  ID of the user who was promoted.
+	 * @param string $subject  Email notification subject text.
+	 * @param string $message  Email notification message text.
+	 * @param int    $group_id ID of the group that the user is a member of.
+	 */
 	do_action( 'bp_groups_sent_promoted_email', $user_id, $subject, $message, $group_id );
 }
 add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10, 2 );
@@ -296,10 +508,11 @@ add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10,
  *
  * @since BuddyPress (1.0.0)
  *
- * @param BP_Groups_Group $group Group object.
- * @param BP_Groups_Member $member Member object.
- * @param int $inviter_user_id ID of the user who sent the invite.
- * @return bool|null False on failure.
+ * @param BP_Groups_Group  $group           Group object.
+ * @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 ) {
 
@@ -358,13 +571,52 @@ To view %5$s\'s profile visit: %6$s
 		$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
 	}
 
-	// Send the message
+	/**
+	 * Filters the user email that the group invite notification will be sent to.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $to User email the invite notification is being sent to.
+	 */
 	$to      = apply_filters( 'groups_notification_group_invites_to', $to );
+
+	/**
+	 * Filters the group invite notification subject that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $subject Invite notification email subject text.
+	 * @param BP_Groups_Group $group   Object holding the current group instance. Passed by reference.
+	 */
 	$subject = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $subject, &$group ) );
+
+	/**
+	 * Filters the group invite notification message that will be sent to user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string          $message       Invite notification email message text.
+	 * @param BP_Groups_Group $group         Object holding the current group instance. Passed by reference.
+	 * @param string          $inviter_name  Username for the person doing the inviting.
+	 * @param string          $inviter_link  Profile link for the person doing the inviting.
+	 * @param string          $invites_link  URL permalink for the invited user's invite management screen.
+	 * @param string          $group_link    URL permalink for the group that the invite was related to.
+	 * @param string          $settings_link URL permalink for the user's notification settings area.
+	 */
 	$message = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $message, &$group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link ) );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the notification is sent that a member has been invited to a group.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int             $invited_user_id  ID of the user who was invited.
+	 * @param string          $subject          Email notification subject text.
+	 * @param string          $message          Email notification message text.
+	 * @param BP_Groups_Group $group            Group object.
+	 */
 	do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group );
 }
 
@@ -375,13 +627,14 @@ To view %5$s\'s profile visit: %6$s
  *
  * @since BuddyPress (1.0.0)
  *
- * @param string $action The kind of notification being rendered.
- * @param int $item_id The primary item ID.
- * @param int $secondary_item_id The secondary item ID.
- * @param int $total_items The total number of messaging-related notifications
- *        waiting for the user.
- * @param string $format 'string' for BuddyBar-compatible notifications; 'array'
- *        for WP Toolbar. Default: 'string'.
+ * @param string $action            The kind of notification being rendered.
+ * @param int    $item_id           The primary item ID.
+ * @param int    $secondary_item_id The secondary item ID.
+ * @param int    $total_items       The total number of messaging-related notifications
+ *                                  waiting for the user.
+ * @param string $format            'string' for BuddyBar-compatible notifications; 'array'
+ *                                  for WP Toolbar. Default: 'string'.
+ *
  * @return string
  */
 function groups_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
@@ -393,19 +646,52 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
+			$amount = 'single';
 
 			// Set up the string and the filter
 			// Because different values are passed to the filters, we'll return the
 			// 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 );
-				$filter = 'bp_groups_multiple_new_membership_requests_notification';
+				$amount = 'multiple';
 				$notification_link = $group_link . 'admin/membership-requests/?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link );
+
+					/**
+					 * Filters groups multiple new membership request notification for string format.
+					 *
+					 * This is a dynamic filter that is dependent on item count and action.
+					 * Complete filter - bp_groups_multiple_new_membership_requests_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for request.
+					 * @param string $group_link        The permalink for the group.
+					 * @param int    $total_items       Total number of membership requests.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . 's_notification', '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+
+					/**
+					 * Filters groups multiple new membership request notification for any non-string format.
+					 *
+					 * This is a dynamic filter that is dependent on item count and action.
+					 * Complete filter - bp_groups_multiple_new_membership_requests_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param string $group_link        The permalink for the group.
+					 * @param int    $total_items       Total number of membership requests.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . 's_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $group_link, $total_items, $group->name, $text, $notification_link );
@@ -413,13 +699,44 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 			} else {
 				$user_fullname = bp_core_get_user_displayname( $requesting_user_id );
 				$text = sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname );
-				$filter = 'bp_groups_single_new_membership_request_notification';
 				$notification_link = $group_link . 'admin/membership-requests/?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link );
+
+					/**
+					 * Filters groups single new membership request notification for string format.
+					 *
+					 * This is a dynamic filter that is dependent on item count and action.
+					 * Complete filter - bp_groups_single_new_membership_request_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for request.
+					 * @param string $group_link        The permalink for the group.
+					 * @param string $user_fullname     Full name of requesting user.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+
+					/**
+					 * Filters groups single new membership request notification for any non-string format.
+					 *
+					 * This is a dynamic filter that is dependent on item count and action.
+					 * Complete filter - bp_groups_single_new_membership_request_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param string $group_link        The permalink for the group.
+					 * @param string $user_fullname     Full name of requesting user.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $group_link, $user_fullname, $group->name, $text, $notification_link );
@@ -433,16 +750,43 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
+			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int) $total_items, $group->name );
-				$filter = 'bp_groups_multiple_membership_request_accepted_notification';
+				$amount = 'multiple';
 				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link );
+
+					/**
+					 * Filters multiple accepted group membership requests notification for string format.
+					 * Complete filter - bp_groups_multiple_membership_request_accepted_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $total_items       Total number of accepted requests.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+
+					/**
+					 * Filters multiple accepted group membership requests notification for non-string format.
+					 * Complete filter - bp_groups_multiple_membership_request_accepted_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification
+					 * @param int    $total_items       Total number of accepted requests.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $total_items, $group->name, $text, $notification_link );
@@ -453,8 +797,34 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 				$notification_link = $group_link . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+
+					/**
+					 * Filters single accepted group membership request notification for string format.
+					 * Complete filter - bp_groups_single_membership_request_accepted_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param string $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
 				} else {
+
+					/**
+					 * Filters single accepted group membership request notification for non-string format.
+					 * Complete filter - bp_groups_single_membership_request_accepted_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param string $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
 					return apply_filters( $filter, array(
 						'link' => $notification_link,
 						'text' => $text
@@ -469,29 +839,81 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
+			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int) $total_items, $group->name );
-				$filter = 'bp_groups_multiple_membership_request_rejected_notification';
+				$amount = 'multiple';
 				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name );
+
+					/**
+					 * Filters multiple rejected group membership requests notification for string format.
+					 * Complete filter - bp_groups_multiple_membership_request_rejected_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name );
 				} else {
-					return apply_filters( $filter, array(
+
+					/**
+					 * Filters multiple rejected group membership requests notification for non-string format.
+					 * Complete filter - bp_groups_multiple_membership_request_rejected_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $total_items, $group->name, $text, $notification_link );
 				}
 			} else {
 				$text = sprintf( __( 'Membership for group "%s" rejected', 'buddypress' ), $group->name );
-				$filter = 'bp_groups_single_membership_request_rejected_notification';
 				$notification_link = $group_link . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+
+					/**
+					 * Filters single rejected group membership requests notification for string format.
+					 * Complete filter - bp_groups_single_membership_request_rejected_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+
+					/**
+					 * Filters single rejected group membership requests notification for non-string format.
+					 * Complete filter - bp_groups_single_membership_request_rejected_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $group_link, $group->name, $text, $notification_link );
@@ -505,29 +927,75 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
+			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( 'You were promoted to an admin in %d groups', 'buddypress' ), (int) $total_items );
-				$filter = 'bp_groups_multiple_member_promoted_to_admin_notification';
+				$amount = 'multiple';
 				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
+					/**
+					 * Filters multiple promoted to group admin notification for string format.
+					 * Complete filter - bp_groups_multiple_member_promoted_to_admin_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+					/**
+					 * Filters multiple promoted to group admin notification for non-string format.
+					 * Complete filter - bp_groups_multiple_member_promoted_to_admin_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $total_items, $text, $notification_link );
 				}
 			} else {
 				$text = sprintf( __( 'You were promoted to an admin in the group "%s"', 'buddypress' ), $group->name );
-				$filter = 'bp_groups_single_member_promoted_to_admin_notification';
 				$notification_link = $group_link . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+					/**
+					 * Filters single promoted to group admin notification for non-string format.
+					 * Complete filter - bp_groups_single_member_promoted_to_admin_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+					/**
+					 * Filters single promoted to group admin notification for non-string format.
+					 * Complete filter - bp_groups_single_member_promoted_to_admin_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $group_link, $group->name, $text, $notification_link );
@@ -541,29 +1009,75 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
+			$amount = 'single';
 
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( 'You were promoted to a mod in %d groups', 'buddypress' ), (int) $total_items );
-				$filter = 'bp_groups_multiple_member_promoted_to_mod_notification';
+				$amount = 'multiple';
 				$notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
+					/**
+					 * Filters multiple promoted to group mod notification for string format.
+					 * Complete filter - bp_groups_multiple_member_promoted_to_mod_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+					/**
+					 * Filters multiple promoted to group mod notification for non-string format.
+					 * Complete filter - bp_groups_multiple_member_promoted_to_mod_notification.
+					 *
+					 * @since 1.0.0
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $total_items, $text, $notification_link );
 				}
 			} else {
 				$text = sprintf( __( 'You were promoted to a mod in the group "%s"', 'buddypress' ), $group->name );
-				$filter = 'bp_groups_single_member_promoted_to_mod_notification';
 				$notification_link = $group_link . '?n=1';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+					/**
+					 * Filters single promoted to group mod notification for string format.
+					 * Complete filter - bp_groups_single_member_promoted_to_mod_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+					/**
+					 * Filters single promoted to group admin notification for non-string format.
+					 * Complete filter - bp_groups_single_member_promoted_to_mod_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $group_link, $group->name, $text, $notification_link );
@@ -576,17 +1090,40 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 			$group_id = $item_id;
 			$group = groups_get_group( array( 'group_id' => $group_id ) );
 			$group_link = bp_get_group_permalink( $group );
+			$amount = 'single';
 
 			$notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/?n=1';
 
 			if ( (int) $total_items > 1 ) {
 				$text = sprintf( __( 'You have %d new group invitations', 'buddypress' ), (int) $total_items );
-				$filter = 'bp_groups_multiple_group_invite_notification';
+				$amount = 'multiple';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
+					/**
+					 * Filters multiple group invitation notification for string format.
+					 * Complete filter - bp_groups_multiple_group_invite_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+					/**
+					 * Filters multiple group invitation notification for non-string format.
+					 * Complete filter - bp_groups_multiple_group_invite_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $total_items       Total number of rejected requests.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $total_items, $text, $notification_link );
@@ -596,9 +1133,33 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 				$filter = 'bp_groups_single_group_invite_notification';
 
 				if ( 'string' == $format ) {
-					return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
+					/**
+					 * Filters single group invitation notification for string format.
+					 * Complete filter - bp_groups_single_group_invite_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param string $string            HTML anchor tag for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link );
 				} else {
-					return apply_filters( $filter, array(
+					/**
+					 * Filters single group invitation notification for non-string format.
+					 * Complete filter - bp_groups_single_group_invite_notification.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 *
+					 * @param array  $array             Array holding permalink and content for notification.
+					 * @param int    $group_link        The permalink for the group.
+					 * @param string $group->name       Name of the group.
+					 * @param string $text              Notification content.
+					 * @param string $notification_link The permalink for notification.
+					 */
+					return apply_filters( 'bp_groups_' . $amount . '_' . $action . '_notification', array(
 						'link' => $notification_link,
 						'text' => $text
 					), $group_link, $group->name, $text, $notification_link );
@@ -608,6 +1169,16 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to
 			break;
 	}
 
+	/**
+	 * Fires right before returning the formatted group notifications.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $action            The type of notification being rendered.
+	 * @param int    $item_id           The primary item ID.
+	 * @param int    $secondary_item_id The secondary item ID.
+	 * @param int    $total_items       Total amount of items to format.
+	 */
 	do_action( 'groups_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
 
 	return false;
@@ -632,7 +1203,7 @@ add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_notificati
  *
  * @since BuddyPress (2.0.0)
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
  */
 function bp_groups_delete_promotion_notifications( $user_id = 0, $group_id = 0 ) {
@@ -648,7 +1219,7 @@ add_action( 'groups_demoted_member', 'bp_groups_delete_promotion_notifications',
  *
  * @since BuddyPress (1.9.0)
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id  ID of the user.
  * @param int $group_id ID of the group.
  */
 function bp_groups_accept_invite_mark_notifications( $user_id, $group_id ) {
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
index e89c72b06e0fecea4ce72f151f73735c26e2f151..61a9ed6030c34fd9d13d0521159762de096908fb 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Handle the display of the Groups directory index.
@@ -21,8 +21,20 @@ function groups_directory_groups_setup() {
 	if ( bp_is_groups_directory() ) {
 		bp_update_is_directory( true, 'groups' );
 
+		/**
+		 * Fires before the loading of the Groups directory index.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'groups_directory_groups_setup' );
 
+		/**
+		 * Filters the template to load for the Groups directory index.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Path to the groups directory index template to load.
+		 */
 		bp_core_load_template( apply_filters( 'groups_template_directory_groups', 'groups/index' ) );
 	}
 }
@@ -33,8 +45,20 @@ add_action( 'bp_screens', 'groups_directory_groups_setup', 2 );
  */
 function groups_screen_my_groups() {
 
+	/**
+	 * Fires before the loading of the My Groups page.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'groups_screen_my_groups' );
 
+	/**
+	 * Filters the template to load for the My Groups page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to the My Groups page template to load.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) );
 }
 
@@ -71,7 +95,7 @@ function groups_screen_group_invites() {
 
 		bp_core_redirect( $redirect_to );
 
-	} else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
+	} elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
 		// Check the nonce
 		if ( !check_admin_referer( 'groups_reject_invite' ) )
 			return false;
@@ -91,8 +115,22 @@ function groups_screen_group_invites() {
 		bp_core_redirect( $redirect_to );
 	}
 
+	/**
+	 * Fires before the loading of a users Groups > Invites template.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $group_id ID of the group being displayed
+	 */
 	do_action( 'groups_screen_group_invites', $group_id );
 
+	/**
+	 * Filters the template to load for a users Groups > Invites page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a users Groups > Invites page template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) );
 }
 
@@ -105,8 +143,20 @@ function groups_screen_group_home() {
 		return false;
 	}
 
+	/**
+	 * Fires before the loading of a single group's page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'groups_screen_group_home' );
 
+	/**
+	 * Filters the template to load for a single group's page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a single group's template to load.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
 }
 
@@ -179,7 +229,7 @@ function groups_screen_group_forum() {
 		}
 
 		// Sticky a topic
-		else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_stick_topic' );
 
@@ -189,12 +239,19 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( 'The topic was made sticky successfully', 'buddypress' ) );
 			}
 
+			/**
+			 * Fires after a group forum topic has been stickied.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param int $topic_id ID of the topic being stickied.
+			 */
 			do_action( 'groups_stick_forum_topic', $topic_id );
 			bp_core_redirect( wp_get_referer() );
 		}
 
 		// Un-Sticky a topic
-		else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_unstick_topic' );
 
@@ -204,12 +261,19 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( 'The topic was unstuck successfully', 'buddypress') );
 			}
 
+			/**
+			 * Fires after a group forum topic has been un-stickied.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param int $topic_id ID of the topic being un-stickied.
+			 */
 			do_action( 'groups_unstick_forum_topic', $topic_id );
 			bp_core_redirect( wp_get_referer() );
 		}
 
 		// Close a topic
-		else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_close_topic' );
 
@@ -219,12 +283,19 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( 'The topic was closed successfully', 'buddypress') );
 			}
 
+			/**
+			 * Fires after a group forum topic has been closed.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param int $topic_id ID of the topic being closed.
+			 */
 			do_action( 'groups_close_forum_topic', $topic_id );
 			bp_core_redirect( wp_get_referer() );
 		}
 
 		// Open a topic
-		else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
+		elseif ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_open_topic' );
 
@@ -234,12 +305,19 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( 'The topic was opened successfully', 'buddypress') );
 			}
 
+			/**
+			 * Fires after a group forum topic has been opened.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param int $topic_id ID of the topic being opened.
+			 */
 			do_action( 'groups_open_forum_topic', $topic_id );
 			bp_core_redirect( wp_get_referer() );
 		}
 
 		// Delete a topic
-		else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
+		elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {
 			// Fetch the topic
 			$topic = bp_forums_get_topic_details( $topic_id );
 
@@ -251,6 +329,13 @@ function groups_screen_group_forum() {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_delete_topic' );
 
+			/**
+			 * Fires before a group forum topic is deleted.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param int $topic_id ID of the topic being deleted.
+			 */
 			do_action( 'groups_before_delete_forum_topic', $topic_id );
 
 			if ( !groups_delete_group_forum_topic( $topic_id ) ) {
@@ -259,12 +344,19 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( 'The topic was deleted successfully', 'buddypress' ) );
 			}
 
+			/**
+			 * Fires after a group forum topic has been deleted.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param int $topic_id ID of the topic being deleted.
+			 */
 			do_action( 'groups_delete_forum_topic', $topic_id );
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' );
 		}
 
 		// Editing a topic
-		else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
+		elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {
 			// Fetch the topic
 			$topic = bp_forums_get_topic_details( $topic_id );
 
@@ -285,14 +377,28 @@ function groups_screen_group_forum() {
 					bp_core_add_message( __( 'The topic was edited successfully', 'buddypress') );
 				}
 
+				/**
+				 * Fires after a group forum topic has been edited.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 *
+				 * @param int $topic_id ID of the topic being edited.
+				 */
 				do_action( 'groups_edit_forum_topic', $topic_id );
 				bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' );
 			}
 
+			/**
+			 * Filters the template to load for a topic edit page.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param string $value Path to a topic edit template.
+			 */
 			bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
 		// Delete a post
-		} else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
+		} elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {
 			// Fetch the post
 			$post = bp_forums_get_post( $post_id );
 
@@ -304,6 +410,13 @@ function groups_screen_group_forum() {
 			// Check the nonce
 			check_admin_referer( 'bp_forums_delete_post' );
 
+			/**
+			 * Fires before the deletion of a group forum post.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param int $post_id ID of the forum post being deleted.
+			 */
 			do_action( 'groups_before_delete_forum_post', $post_id );
 
 			if ( !groups_delete_group_forum_post( $post_id ) ) {
@@ -312,11 +425,18 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( 'The post was deleted successfully', 'buddypress') );
 			}
 
+			/**
+			 * Fires after the deletion of a group forum post.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param int $post_id ID of the forum post being deleted.
+			 */
 			do_action( 'groups_delete_forum_post', $post_id );
 			bp_core_redirect( wp_get_referer() );
 
 		// Editing a post
-		} else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
+		} elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {
 
 			// Fetch the post
 			$post = bp_forums_get_post( $post_id );
@@ -342,10 +462,18 @@ function groups_screen_group_forum() {
 					$query_vars = '?' . $_SERVER['QUERY_STRING'];
 				}
 
+				/**
+				 * Fires after the editing of a group forum post.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 *
+				 * @param int $post_id ID of the forum post being edited.
+				 */
 				do_action( 'groups_edit_forum_post', $post_id );
 				bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );
 			}
 
+			/** This filter is documented in bp-groups/bp-groups-screens.php */
 			bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) );
 
 		// Standard topic display
@@ -354,6 +482,13 @@ function groups_screen_group_forum() {
 				bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) );
 			}
 
+			/**
+			 * Filters the template to load for a topic page.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param string $value Path to a topic template.
+			 */
 			bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) );
 		}
 
@@ -379,7 +514,7 @@ function groups_screen_group_forum() {
 
 			if ( empty( $_POST['topic_title'] ) ) {
 				$error_message = __( 'Please provide a title for your forum topic.', 'buddypress' );
-			} else if ( empty( $_POST['topic_text'] ) ) {
+			} elseif ( empty( $_POST['topic_text'] ) ) {
 				$error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' );
 			}
 
@@ -403,8 +538,23 @@ function groups_screen_group_forum() {
 			bp_core_redirect( $redirect );
 		}
 
+		/**
+		 * Fires at the end of the group forum screen loading process.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $topic_id ID of the topic being displayed.
+		 * @param int $forum_id ID of the forum being displayed.
+		 */
 		do_action( 'groups_screen_group_forum', $topic_id, $forum_id );
 
+		/**
+		 * Filters the template to load for a group forum page.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Path to a group forum template.
+		 */
 		bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) );
 	}
 }
@@ -422,7 +572,22 @@ function groups_screen_group_members() {
 	// 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 ) );
 
+	/**
+	 * Fires before the loading of a group's Members page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group whose members are being displayed.
+	 */
 	do_action( 'groups_screen_group_members', $bp->groups->current_group->id );
+
+	/**
+	 * Filters the template to load for a group's Members page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a group's Members template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) );
 }
 
@@ -450,11 +615,26 @@ function groups_screen_group_invite() {
 		// Send the invites.
 		groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id );
 		bp_core_add_message( __('Group invites sent.', 'buddypress') );
+
+		/**
+		 * Fires after the sending of a group invite inside the group's Send Invites page.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $id ID of the group whose members are being displayed.
+		 */
 		do_action( 'groups_screen_group_invite', $bp->groups->current_group->id );
 		bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
 
 	} elseif ( !bp_action_variable( 0 ) ) {
-		// Show send invite page
+
+		/**
+		 * Filters the template to load for a group's Send Invites page.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Path to a group's Send Invites template.
+		 */
 		bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) );
 
 	} else {
@@ -492,10 +672,10 @@ function groups_remove_group_invite() {
 	if ( ! bp_groups_user_can_send_invites( $group_id ) ) {
 		$message = __( 'You are not allowed to send or remove invites', 'buddypress' );
 		$error = 'error';
-	} else if ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) {
+	} elseif ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) {
 		$message = __( 'The member requested to join the group', 'buddypress' );
 		$error = 'error';
-	} else if ( ! groups_uninvite_user( $friend_id, $group_id ) ) {
+	} elseif ( ! groups_uninvite_user( $friend_id, $group_id ) ) {
 		$message = __( 'There was an error removing the invite', 'buddypress' );
 		$error = 'error';
 	}
@@ -509,7 +689,6 @@ add_action( 'bp_screens', 'groups_remove_group_invite' );
  * Handle the display of a group's Request Membership page.
  */
 function groups_screen_group_request_membership() {
-	global $bp;
 
 	if ( !is_user_logged_in() )
 		return false;
@@ -524,7 +703,7 @@ function groups_screen_group_request_membership() {
 		if ( groups_accept_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) )
 			bp_core_add_message( __( 'Group invite accepted', 'buddypress' ) );
 		else
-			bp_core_add_message( __( 'There was an error accepting the group invitation; please try again.', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was an error accepting the group invitation. Please try again.', 'buddypress' ), 'error' );
 		bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
 	}
 
@@ -536,15 +715,29 @@ function groups_screen_group_request_membership() {
 			return false;
 
 		if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {
-			bp_core_add_message( __( 'There was an error sending your group membership request; please try again.', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was an error sending your group membership request. Please try again.', 'buddypress' ), 'error' );
 		} else {
 			bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
 		}
 		bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
 	}
 
+	/**
+	 * Fires before the loading of a group's Request Memebership page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group currently being displayed.
+	 */
 	do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );
 
+	/**
+	 * Filters the template to load for a group's Request Membership page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a group's Request Membership template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );
 }
 
@@ -558,6 +751,7 @@ function groups_screen_group_activity_permalink() {
 
 	buddypress()->is_single_item = true;
 
+	/** This filter is documented in bp-groups/bp-groups-screens.php */
 	bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
 }
 add_action( 'bp_screens', 'groups_screen_group_activity_permalink' );
@@ -596,18 +790,39 @@ function groups_screen_group_admin_edit_details() {
 			$group_notify_members = isset( $_POST['group-notify-members'] ) ? (int) $_POST['group-notify-members'] : 0;
 
 			if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $group_notify_members ) ) {
-				bp_core_add_message( __( 'There was an error updating group details; please try again.', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was an error updating group details. Please try again.', 'buddypress' ), 'error' );
 			} else {
 				bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
 			}
 
+			/**
+			 * Fires before the redirect if a group details has been edited and saved.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int $id ID of the group that was edited.
+			 */
 			do_action( 'groups_group_details_edited', $bp->groups->current_group->id );
 
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' );
 		}
 
+		/**
+		 * Fires before the loading of the group admin/edit-details page template.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $id ID of the group that is being displayed.
+		 */
 		do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id );
 
+		/**
+		 * Filters the template to load for a group's admin/edit-details page.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Path to a group's admin/edit-details template.
+		 */
 		bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) );
 	}
 }
@@ -631,10 +846,12 @@ function groups_screen_group_admin_settings() {
 		$enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
 
 		// 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
+		/** 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';
 
@@ -643,18 +860,39 @@ function groups_screen_group_admin_settings() {
 			return false;
 
 		if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
-			bp_core_add_message( __( 'There was an error updating group settings; please try again.', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was an error updating group settings. Please try again.', 'buddypress' ), 'error' );
 		} else {
 			bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) );
 		}
 
+		/**
+		 * Fires before the redirect if a group settings has been edited and saved.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $id ID of the group that was edited.
+		 */
 		do_action( 'groups_group_settings_edited', $bp->groups->current_group->id );
 
 		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' );
 	}
 
+	/**
+	 * Fires before the loading of the group admin/group-settings page template.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group that is being displayed.
+	 */
 	do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id );
 
+	/**
+	 * Filters the template to load for a group's admin/group-settings page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a group's admin/group-settings template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) );
 }
 add_action( 'bp_screens', 'groups_screen_group_admin_settings' );
@@ -668,7 +906,7 @@ function groups_screen_group_admin_avatar() {
 		return false;
 
 	// If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
-	if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars )
+	if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars )
 		return false;
 
 	$bp = buddypress();
@@ -682,7 +920,7 @@ function groups_screen_group_admin_avatar() {
 		if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) {
 			bp_core_add_message( __( 'The group profile photo was deleted successfully!', 'buddypress' ) );
 		} else {
-			bp_core_add_message( __( 'There was a problem deleting the group profile photo; please try again.', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was a problem deleting the group profile photo. Please try again.', 'buddypress' ), 'error' );
 		}
 	}
 
@@ -731,8 +969,22 @@ function groups_screen_group_admin_avatar() {
 		}
 	}
 
+	/**
+	 * Fires before the loading of the group Change Avatar page template.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group that is being displayed.
+	 */
 	do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id );
 
+	/**
+	 * Filters the template to load for a group's Change Avatar page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a group's Change Avatar template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) );
 }
 add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
@@ -761,10 +1013,18 @@ function groups_screen_group_admin_manage_members() {
 
 			// Promote a user.
 			if ( !groups_promote_member( $user_id, $bp->groups->current_group->id, $status ) )
-				bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was an error when promoting that user. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) );
 
+			/**
+			 * Fires before the redirect after a group member has been promoted.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int $user_id ID of the user being promoted.
+			 * @param int $id      ID of the group user is promoted within.
+			 */
 			do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id );
 
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
@@ -786,10 +1046,18 @@ function groups_screen_group_admin_manage_members() {
 
 			// Demote a user.
 			elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) )
-				bp_core_add_message( __( 'There was an error when demoting that user; please try again', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was an error when demoting that user. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) );
 
+			/**
+			 * Fires before the redirect after a group member has been demoted.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int $user_id ID of the user being demoted.
+			 * @param int $id      ID of the group user is demoted within.
+			 */
 			do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id );
 
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
@@ -804,10 +1072,18 @@ function groups_screen_group_admin_manage_members() {
 
 			// Ban a user.
 			if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) )
-				bp_core_add_message( __( 'There was an error when banning that user; please try again', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was an error when banning that user. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'User banned successfully', 'buddypress' ) );
 
+			/**
+			 * Fires before the redirect after a group member has been banned.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int $user_id ID of the user being banned.
+			 * @param int $id      ID of the group user is banned from.
+			 */
 			do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id );
 
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
@@ -822,10 +1098,18 @@ function groups_screen_group_admin_manage_members() {
 
 			// Remove a ban for user.
 			if ( !groups_unban_member( $user_id, $bp->groups->current_group->id ) )
-				bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was an error when unbanning that user. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) );
 
+			/**
+			 * Fires before the redirect after a group member has been unbanned.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int $user_id ID of the user being unbanned.
+			 * @param int $id      ID of the group user is unbanned from.
+			 */
 			do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id );
 
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
@@ -840,18 +1124,40 @@ function groups_screen_group_admin_manage_members() {
 
 			// Remove a user.
 			if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
-				bp_core_add_message( __( 'There was an error removing that user from the group; please try again', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was an error removing that user from the group. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'User removed successfully', 'buddypress' ) );
 
+			/**
+			 * Fires before the redirect after a group member has been removed.
+			 *
+			 * @since BuddyPress (1.2.6)
+			 *
+			 * @param int $user_id ID of the user being removed.
+			 * @param int $id      ID of the group the user is removed from.
+			 */
 			do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id );
 
 			bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' );
 		}
 	}
 
+	/**
+	 * Fires before the loading of a group's manage members template.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group whose manage members page is being displayed.
+	 */
 	do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id );
 
+	/**
+	 * Filters the template to load for a group's manage members page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a group's manage members template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) );
 }
 add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' );
@@ -882,7 +1188,7 @@ function groups_screen_group_admin_requests() {
 
 			// 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' );
+				bp_core_add_message( __( 'There was an error accepting the membership request. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) );
 
@@ -893,16 +1199,40 @@ function groups_screen_group_admin_requests() {
 
 			// 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' );
+				bp_core_add_message( __( 'There was an error rejecting the membership request. Please try again.', 'buddypress' ), 'error' );
 			else
 				bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) );
 		}
 
+		/**
+		 * Fires before the redirect if a group membership request has been handled.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int    $id             ID of the group that was edited.
+		 * @param string $request_action Membership request action being performed.
+		 * @param int    $membership_id  The key of the action_variables array that you want.
+		 */
 		do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id );
 		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' );
 	}
 
+	/**
+	 * Fires before the loading of the group membership request page template.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group that is being displayed.
+	 */
 	do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id );
+
+	/**
+	 * Filters the template to load for a group's membership request page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to a group's membership request template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) );
 }
 add_action( 'bp_screens', 'groups_screen_group_admin_requests' );
@@ -911,7 +1241,6 @@ add_action( 'bp_screens', 'groups_screen_group_admin_requests' );
  * Handle the display of the Delete Group page.
  */
 function groups_screen_group_admin_delete_group() {
-	global $bp;
 
 	if ( 'delete-group' != bp_get_group_current_admin_tab() )
 		return false;
@@ -919,6 +1248,8 @@ function groups_screen_group_admin_delete_group() {
 	if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) )
 		return false;
 
+	$bp = buddypress();
+
 	if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) {
 
 		// Check the nonce first.
@@ -926,14 +1257,28 @@ function groups_screen_group_admin_delete_group() {
 			return false;
 		}
 
+		/**
+		 * Fires before the deletion of a group from the Delete Group page.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $id ID of the group being deleted.
+		 */
 		do_action( 'groups_before_group_deleted', $bp->groups->current_group->id );
 
 		// Group admin has deleted the group, now do it.
 		if ( !groups_delete_group( $bp->groups->current_group->id ) ) {
-			bp_core_add_message( __( 'There was an error deleting the group; please try again.', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was an error deleting the group. Please try again.', 'buddypress' ), 'error' );
 		} else {
 			bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) );
 
+			/**
+			 * Fires after the deletion of a group from the Delete Group page.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int $id ID of the group being deleted.
+			 */
 			do_action( 'groups_group_deleted', $bp->groups->current_group->id );
 
 			bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
@@ -942,8 +1287,22 @@ function groups_screen_group_admin_delete_group() {
 		bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
 	}
 
+	/**
+	 * Fires before the loading of the Delete Group page template.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $id ID of the group that is being displayed.
+	 */
 	do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id );
 
+	/**
+	 * Filters the template to load for the Delete Group page.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Path to the Delete Group template.
+	 */
 	bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) );
 }
 add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' );
@@ -1001,7 +1360,14 @@ function groups_screen_notification_settings() {
 				<td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php checked( $group_request, 'no', true ) ?>/></td>
 			</tr>
 
-			<?php do_action( 'groups_screen_notification_settings' ); ?>
+			<?php
+
+			/**
+			 * Fires at the end of the available group settings fields on Notification Settings page.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 */
+			do_action( 'groups_screen_notification_settings' ); ?>
 
 		</tbody>
 	</table>
@@ -1010,12 +1376,12 @@ function groups_screen_notification_settings() {
 }
 add_action( 'bp_notification_settings', 'groups_screen_notification_settings' );
 
-/** Theme Compatability *******************************************************/
+/** Theme Compatibility *******************************************************/
 
 /**
  * The main theme compat class for BuddyPress Groups.
  *
- * This class sets up the necessary theme compatability actions to safely output
+ * This class sets up the necessary theme compatibility actions to safely output
  * group template parts to the_title and the_content areas of a theme.
  *
  * @since BuddyPress (1.7.0)
@@ -1032,7 +1398,7 @@ class BP_Groups_Theme_Compat {
 	}
 
 	/**
-	 * Are we looking at something that needs group theme compatability?
+	 * Are we looking at something that needs group theme compatibility?
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
@@ -1046,6 +1412,11 @@ class BP_Groups_Theme_Compat {
 		if ( ! bp_current_action() && ! bp_current_item() ) {
 			bp_update_is_directory( true, 'groups' );
 
+			/**
+			 * Fires at the start of the group theme compatibility setup.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'groups_directory_groups_setup' );
 
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'directory_template_hierarchy' ) );
@@ -1081,7 +1452,14 @@ class BP_Groups_Theme_Compat {
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function directory_template_hierarchy( $templates ) {
-		// Setup our templates based on priority
+
+		/**
+		 * Filters the Groups directory page template hierarchy based on priority.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of default template files to use.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_groups_directory', array(
 			'groups/index-directory.php'
 		) );
@@ -1099,12 +1477,9 @@ class BP_Groups_Theme_Compat {
 	 * @since BuddyPress (1.7.0)
 	 */
 	public function directory_dummy_post() {
-
-		$title = apply_filters( 'bp_groups_directory_header', bp_get_directory_title( 'groups' ) );
-
 		bp_theme_compat_reset_post( array(
 			'ID'             => 0,
-			'post_title'     => $title,
+			'post_title'     => bp_get_directory_title( 'groups' ),
 			'post_author'    => 0,
 			'post_date'      => 0,
 			'post_content'   => '',
@@ -1135,10 +1510,18 @@ class BP_Groups_Theme_Compat {
 	 * @since BuddyPress (1.8.0)
 	 *
 	 * @param string $templates The templates from bp_get_theme_compat_templates().
+	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function create_template_hierarchy( $templates ) {
-		// Setup our templates based on priority
+
+		/**
+		 * Filters the Groups create page template hierarchy based on priority.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of default template files to use.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_groups_create', array(
 			'groups/index-create.php'
 		) );
@@ -1198,7 +1581,13 @@ class BP_Groups_Theme_Compat {
 		// Setup some variables we're going to reference in our custom templates
 		$group = groups_get_current_group();
 
-		// Setup our templates based on priority
+		/**
+		 * Filters the Groups single pages template hierarchy based on priority.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of default template files to use.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array(
 			'groups/single/index-id-'     . sanitize_file_name( bp_get_current_group_id() )   . '.php',
 			'groups/single/index-slug-'   . sanitize_file_name( bp_get_current_group_slug() ) . '.php',
@@ -1222,7 +1611,7 @@ class BP_Groups_Theme_Compat {
 	public function single_dummy_post() {
 		bp_theme_compat_reset_post( array(
 			'ID'             => 0,
-			'post_title'     => '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . bp_get_current_group_name() . '</a>',
+			'post_title'     => bp_get_current_group_name(),
 			'post_author'    => 0,
 			'post_date'      => 0,
 			'post_content'   => '',
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
index 38b9de46bf4d9df14c3f49223e0ca1fa060b5dc4..fee9b984060bbd81a3455e6ba63d61772a451652 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php
@@ -5,7 +5,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the groups component slug.
@@ -23,11 +23,19 @@ function bp_groups_slug() {
 	 * @return string
 	 */
 	function bp_get_groups_slug() {
+
+		/**
+		 * Filters the groups component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Groups component slug.
+		 */
 		return apply_filters( 'bp_get_groups_slug', buddypress()->groups->slug );
 	}
 
 /**
- * Output the groups component root slug
+ * Output the groups component root slug.
  *
  * @since BuddyPress (1.5.0)
  */
@@ -35,32 +43,48 @@ function bp_groups_root_slug() {
 	echo bp_get_groups_root_slug();
 }
 	/**
-	 * Return the groups component root slug
+	 * Return the groups component root slug.
 	 *
 	 * @since BuddyPress (1.5.0)
 	 *
 	 * @return string
 	 */
 	function bp_get_groups_root_slug() {
+
+		/**
+		 * Filters the groups component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $root_slug Groups component root slug.
+		 */
 		return apply_filters( 'bp_get_groups_root_slug', buddypress()->groups->root_slug );
 	}
 
 /**
- * Output group directory permalink
+ * Output group directory permalink.
  *
  * @since BuddyPress (1.5.0)
  */
 function bp_groups_directory_permalink() {
-	echo bp_get_groups_directory_permalink();
+	echo esc_url( bp_get_groups_directory_permalink() );
 }
 	/**
-	 * Return group directory permalink
+	 * Return group directory permalink.
 	 *
 	 * @since BuddyPress (1.5.0)
 	 *
 	 * @return string
 	 */
 	function bp_get_groups_directory_permalink() {
+
+		/**
+		 * Filters the group directory permalink.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Permalink for the group directory.
+		 */
 		return apply_filters( 'bp_get_groups_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) );
 	}
 
@@ -77,7 +101,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var int
 	 */
-	var $current_group = -1;
+	public $current_group = -1;
 
 	/**
 	 * The number of groups returned by the paged query.
@@ -85,7 +109,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var int
 	 */
-	var $group_count;
+	public $group_count;
 
 	/**
 	 * Array of groups located by the query.
@@ -93,7 +117,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var array
 	 */
-	var $groups;
+	public $groups;
 
 	/**
 	 * The group object currently being iterated on.
@@ -101,7 +125,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var object
 	 */
-	var $group;
+	public $group;
 
 	/**
 	 * A flag for whether the loop is currently being iterated.
@@ -109,23 +133,23 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var bool
 	 */
-	var $in_the_loop;
+	public $in_the_loop;
 
 	/**
 	 * The page number being requested.
 	 *
 	 * @access public
-	 * @var public
+	 * @var string
 	 */
-	var $pag_page;
+	public $pag_page;
 
 	/**
 	 * The number of items being requested per page.
 	 *
 	 * @access public
-	 * @var public
+	 * @var string
 	 */
-	var $pag_num;
+	public $pag_num;
 
 	/**
 	 * An HTML string containing pagination links.
@@ -133,7 +157,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var string
 	 */
-	var $pag_links;
+	public $pag_links;
 
 	/**
 	 * The total number of groups matching the query parameters.
@@ -141,7 +165,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var int
 	 */
-	var $total_group_count;
+	public $total_group_count;
 
 	/**
 	 * Whether the template loop is for a single group page.
@@ -149,7 +173,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var bool
 	 */
-	var $single_group = false;
+	public $single_group = false;
 
 	/**
 	 * Field to sort by.
@@ -157,7 +181,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var string
 	 */
-	var $sort_by;
+	public $sort_by;
 
 	/**
 	 * Sort order.
@@ -165,7 +189,7 @@ class BP_Groups_Template {
 	 * @access public
 	 * @var string
 	 */
-	var $order;
+	public $order;
 
 	/**
 	 * Constructor method.
@@ -206,34 +230,37 @@ class BP_Groups_Template {
 		}
 
 		$defaults = array(
-			'type'            => 'active',
-			'page'            => 1,
-			'per_page'        => 20,
-			'max'             => false,
-			'show_hidden'     => false,
-			'page_arg'        => 'grpage',
-			'user_id'         => 0,
-			'slug'            => false,
-			'include'         => false,
-			'exclude'         => false,
-			'search_terms'    => '',
-			'meta_query'      => false,
-			'populate_extras' => true,
+			'page'              => 1,
+			'per_page'          => 20,
+			'page_arg'          => 'grpage',
+			'max'               => false,
+			'type'              => 'active',
+			'order'             => 'DESC',
+			'orderby'           => 'date_created',
+			'show_hidden'       => false,
+			'user_id'           => 0,
+			'slug'              => false,
+			'include'           => false,
+			'exclude'           => false,
+			'search_terms'      => '',
+			'meta_query'        => false,
+			'populate_extras'   => true,
 			'update_meta_cache' => true,
 		);
 
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r );
 
-		$this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page;
-		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
+		$this->pag_arg  = sanitize_key( $r['page_arg'] );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
 
 		if ( bp_current_user_can( 'bp_moderate' ) || ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) )
 			$show_hidden = true;
 
 		if ( 'invites' == $type ) {
 			$this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
-		} else if ( 'single-group' == $type ) {
+		} elseif ( 'single-group' == $type ) {
 			$this->single_group = true;
 
 			if ( groups_get_current_group() ) {
@@ -279,7 +306,7 @@ class BP_Groups_Template {
 			$this->total_group_count = (int) $this->groups['total'];
 			$this->group_count       = (int) $this->groups['total'];
 			$this->groups            = $this->groups['groups'];
-		} else if ( 'single-group' == $type ) {
+		} elseif ( 'single-group' == $type ) {
 			if ( empty( $group->id ) ) {
 				$this->total_group_count = 0;
 				$this->group_count       = 0;
@@ -310,10 +337,7 @@ class BP_Groups_Template {
 		// Build pagination links
 		if ( (int) $this->total_group_count && (int) $this->pag_num ) {
 			$pag_args = array(
-				$page_arg => '%#%',
-				'num'     => $this->pag_num,
-				'sortby'  => $this->sort_by,
-				'order'   => $this->order,
+				$this->pag_arg => '%#%'
 			);
 
 			if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) {
@@ -322,8 +346,14 @@ class BP_Groups_Template {
 				$base = '';
 			}
 
+			$add_args = array(
+				'num'     => $this->pag_num,
+				'sortby'  => $this->sort_by,
+				'order'   => $this->order,
+			);
+
 			if ( ! empty( $search_terms ) ) {
-				$pag_args['s'] = $search_terms;
+				$add_args['s'] = urlencode( $search_terms );
 			}
 
 			$this->pag_links = paginate_links( array(
@@ -333,7 +363,8 @@ class BP_Groups_Template {
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Group pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Group pagination next text', 'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => $add_args,
 			) );
 		}
 	}
@@ -389,6 +420,12 @@ class BP_Groups_Template {
 		if ( $this->current_group + 1 < $this->group_count ) {
 			return true;
 		} elseif ( $this->current_group + 1 == $this->group_count ) {
+
+			/**
+			 * Fires right before the rewinding of groups list.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action('group_loop_end');
 			// Do some cleaning up after the loop
 			$this->rewind_groups();
@@ -411,8 +448,15 @@ class BP_Groups_Template {
 		$this->in_the_loop = true;
 		$this->group       = $this->next_group();
 
-		if ( 0 == $this->current_group ) // loop has just started
-			do_action('group_loop_start');
+		if ( 0 == $this->current_group ) {
+
+			/**
+			 * Fires if the current group item is the first in the loop.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'group_loop_start' );
+		}
 	}
 }
 
@@ -421,41 +465,40 @@ class BP_Groups_Template {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of parameters. All items are optional.
- *     @type string $type Optional. Shorthand for certain orderby/
- *           order combinations. 'newest', 'active', 'popular',
- *           'alphabetical', 'random'. When present, will override
- *           orderby and order params. Default: null.
- *     @type string $orderby Optional. Property to sort by.
- *           'date_created', 'last_activity', 'total_member_count',
- *           'name', 'random'. Default: 'date_created'.
- *     @type string $order Optional. Sort order. 'ASC' or 'DESC'.
- *           Default: 'DESC'.
- *     @type int $per_page Optional. Number of items to return per page
- *           of results. Default: null (no limit).
- *     @type int $page Optional. Page offset of results to return.
- *           Default: null (no limit).
- *     @type int $user_id Optional. If provided, results will be limited
- *           to groups of which the specified user is a member. Default:
- *           null.
- *     @type string $search_terms Optional. If provided, only groups
- *           whose names or descriptions match the search terms will be
- *           returned. Default: false.
- *     @type array $meta_query Optional. An array of meta_query
- *           conditions. See {@link WP_Meta_Query::queries} for
- *           description.
- *     @type array|string Optional. Array or comma-separated list of
- *           group IDs. Results will be limited to groups within the
- *           list. Default: false.
- *     @type bool $populate_extras Whether to fetch additional
- *           information (such as member count) about groups. Default:
- *           true.
- *     @type array|string Optional. Array or comma-separated list of
- *           group IDs. Results will exclude the listed groups.
- *           Default: false.
- *     @type bool $show_hidden Whether to include hidden groups in
- *           results. Default: false.
+ *     @type string       $type            Shorthand for certain orderby/
+ *                                         order combinations. 'newest',
+ *                                         'active', 'popular', 'alphabetical',
+ *                                         'random'. When present, will override
+ *                                         orderby and order params. Default: null.
+ *     @type string       $orderby         Property to sort by.
+ *                                         'date_created', 'last_activity', 'total_member_count',
+ *                                         'name', 'random'. Default: 'date_created'.
+ *     @type string       $order           Sort order. 'ASC' or 'DESC'.
+ *                                         Default: 'DESC'.
+ *     @type int          $per_page        Number of items to return per page
+ *                                         of results. Default: null (no limit).
+ *     @type int          $page            Page offset of results to return.
+ *                                         Default: null (no limit).
+ *     @type int          $user_id         If provided, results will be limited
+ *                                         to groups of which the specified user
+ *                                         is a member. Default: null.
+ *     @type string       $search_terms    If provided, only groups whose names or descriptions
+ *                                         match the search terms will be returned. Default: false.
+ *     @type array        $meta_query      An array of meta_query conditions.
+ *                                         See {@link WP_Meta_Query::queries} for description.
+ *     @type array|string $include         Array or comma-separated list of
+ *                                         group IDs. Results will be limited
+ *                                         to groups within the list. Default: false.
+ *     @type bool         $populate_extras Whether to fetch additional information
+ *                                         (such as member count) about groups.
+ *                                         Default: true.
+ *     @type array|string $exclude         Array or comma-separated list of group IDs.
+ *                                         Results will exclude the listed groups.
+ *                                         Default: false.
+ *     @type bool         $show_hidden     Whether to include hidden groups in
+ *                                         results. Default: false.
  * }
  * @return bool True if there are groups to display that match the params
  */
@@ -534,7 +577,15 @@ function bp_has_groups( $args = '' ) {
 		'update_meta_cache' => (bool) $r['update_meta_cache'],
 	) );
 
-	// Filter and return whether or not the groups loop has groups in it
+	/**
+	 * Filters whether or not there are groups to iterate over for the groups loop.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool               $value           Whether or not there are groups to iterate over.
+	 * @param BP_Groups_Template $groups_template BP_Groups_Template object based on parsed arguments.
+	 * @param array              $r               Array of parsed arguments for the query.
+	 */
 	return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template, $r );
 }
 
@@ -561,7 +612,8 @@ function bp_the_group() {
 /**
  * Is the group visible to the currently logged-in user?
  *
- * @param object $group Optional. Group object. Default: current group in loop.
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
+ *
  * @return bool
  */
 function bp_group_is_visible( $group = false ) {
@@ -587,7 +639,7 @@ function bp_group_is_visible( $group = false ) {
 /**
  * Output the ID of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current group in loop.
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
  */
 function bp_group_id( $group = false ) {
 	echo bp_get_group_id( $group );
@@ -595,8 +647,9 @@ function bp_group_id( $group = false ) {
 	/**
 	 * Get the ID of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return int
 	 */
 	function bp_get_group_id( $group = false ) {
@@ -605,6 +658,13 @@ function bp_group_id( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the ID of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $id ID of the current group in the loop.
+		 */
 		return apply_filters( 'bp_get_group_id', $group->id );
 	}
 
@@ -612,44 +672,70 @@ function bp_group_id( $group = false ) {
  * Output the row class of the current group in the loop.
  *
  * @since BuddyPress (1.7.0)
+ *
+ * @param array $classes Array of custom classes.
  */
-function bp_group_class() {
-	echo bp_get_group_class();
+function bp_group_class( $classes = array() ) {
+	echo bp_get_group_class( $classes );
 }
 	/**
 	 * Get the row class of the current group in the loop.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
+	 * @param array $classes Array of custom classes.
+	 *
 	 * @return string Row class of the group.
 	 */
-	function bp_get_group_class() {
+	function bp_get_group_class( $classes = array() ) {
 		global $groups_template;
 
-		$classes      = array();
-		$pos_in_loop  = (int) $groups_template->current_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 both with odd and even.
-		if ( $groups_template->group_count > 1 )
-			$classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
-		else
+		// If we've only one group in the loop, don't bother with odd and even
+		} else {
 			$classes[] = 'bp-single-group';
+		}
 
 		// Group type - public, private, hidden.
-		$classes[] = esc_attr( $groups_template->group->status );
+		$classes[] = sanitize_key( $groups_template->group->status );
 
-		// User's group status
+		// User's group role
 		if ( bp_is_user_active() ) {
-			if ( bp_group_is_admin() )
+
+			// Admin
+			if ( bp_group_is_admin() ) {
 				$classes[] = 'is-admin';
+			}
+
+			// Moderator
+			if ( bp_group_is_mod() ) {
+				$classes[] = 'is-mod';
+			}
 
-			if ( bp_group_is_member() )
+			// Member
+			if ( bp_group_is_member() ) {
 				$classes[] = 'is-member';
+			}
+		}
 
-			if ( bp_group_is_mod() )
-				$classes[] = 'is-mod';
+		// Whether a group avatar will appear.
+		if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) {
+			$classes[] = 'group-no-avatar';
+		} else {
+			$classes[] = 'group-has-avatar';
 		}
 
+		/**
+		 * Filters classes that will be applied to row class of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param array $classes Array of determined classes for the row.
+		 */
 		$classes = apply_filters( 'bp_get_group_class', $classes );
 		$classes = array_merge( $classes, array() );
 		$retval = 'class="' . join( ' ', $classes ) . '"';
@@ -660,8 +746,8 @@ function bp_group_class() {
 /**
  * Output the name of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_name( $group = false ) {
 	echo bp_get_group_name( $group );
@@ -669,8 +755,9 @@ function bp_group_name( $group = false ) {
 	/**
 	 * Get the name of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_name( $group = false ) {
@@ -679,49 +766,64 @@ function bp_group_name( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the name of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $name Name of the current group in the loop.
+		 */
 		return apply_filters( 'bp_get_group_name', $group->name );
 	}
 
 /**
  * Output the type of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_type( $group = false ) {
 	echo bp_get_group_type( $group );
 }
-	/**
-	 * Get the type of the current group in the loop.
-	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
-	 * @return string
-	 */
-	function bp_get_group_type( $group = false ) {
-		global $groups_template;
 
-		if ( empty( $group ) )
-			$group =& $groups_template->group;
+/**
+ * Get the type of the current group in the loop.
+ *
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
+ *
+ * @return string
+ */
+function bp_get_group_type( $group = false ) {
+	global $groups_template;
 
-		if ( 'public' == $group->status ) {
-			$type = __( "Public Group", "buddypress" );
-		} else if ( 'hidden' == $group->status ) {
-			$type = __( "Hidden Group", "buddypress" );
-		} else if ( 'private' == $group->status ) {
-			$type = __( "Private Group", "buddypress" );
-		} else {
-			$type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
-		}
+	if ( empty( $group ) )
+		$group =& $groups_template->group;
 
-		return apply_filters( 'bp_get_group_type', $type );
+	if ( 'public' == $group->status ) {
+		$type = __( "Public Group", "buddypress" );
+	} elseif ( 'hidden' == $group->status ) {
+		$type = __( "Hidden Group", "buddypress" );
+	} elseif ( 'private' == $group->status ) {
+		$type = __( "Private Group", "buddypress" );
+	} else {
+		$type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
 	}
 
+	/**
+	 * Filters the type for the current group in the loop.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $type Type for the current group in the loop.
+	 */
+	return apply_filters( 'bp_get_group_type', $type );
+}
 /**
  * Output the status of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_status( $group = false ) {
 	echo bp_get_group_status( $group );
@@ -729,8 +831,9 @@ function bp_group_status( $group = false ) {
 	/**
 	 * Get the status of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_status( $group = false ) {
@@ -739,6 +842,13 @@ function bp_group_status( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the status of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $status Status of the current group in the loop.
+		 */
 		return apply_filters( 'bp_get_group_status', $group->status );
 	}
 
@@ -747,7 +857,7 @@ function bp_group_status( $group = false ) {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param array $args {
+ * @param array|string $args {
  *      See {@link bp_get_group_avatar()} for description of arguments.
  * }
  */
@@ -759,21 +869,21 @@ function bp_group_avatar( $args = '' ) {
 	 *
 	 * @since BuddyPress (1.0.0)
 	 *
-	 * @param array $args {
+	 * @param array|string $args {
 	 *     Array of arguments. See {@link bp_core_fetch_avatar()} for
 	 *     detailed description. Default values that differ from that
 	 *     function are described below.
+	 *
 	 *     @type string $type Default: 'full'.
-	 *     @type string $id Passed to $css_id parameter.
+	 *     @type string $id   Passed to $css_id parameter.
 	 * }
 	 * @return string
 	 */
 	function bp_get_group_avatar( $args = '' ) {
 		global $groups_template;
 
-		// Bail if avatars are turned off
-		// @todo Should we maybe still filter this?
-		if ( ! buddypress()->avatar->show_avatars ) {
+		// Bail if avatars are turned off.
+		if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) {
 			return false;
 		}
 
@@ -806,6 +916,14 @@ function bp_group_avatar( $args = '' ) {
 			$avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />';
 		}
 
+		/**
+		 * Filters the group avatar while in the groups loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $avatar HTML image element holding the group avatar.
+		 * @param array  $r      Array of parsed arguments for the group avatar.
+		 */
 		return apply_filters( 'bp_get_group_avatar', $avatar, $r );
 	}
 
@@ -814,8 +932,8 @@ function bp_group_avatar( $args = '' ) {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_avatar_thumb( $group = false ) {
 	echo bp_get_group_avatar_thumb( $group );
@@ -825,8 +943,9 @@ function bp_group_avatar_thumb( $group = false ) {
 	 *
 	 * @since BuddyPress (1.0.0)
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_avatar_thumb( $group = false ) {
@@ -841,8 +960,8 @@ function bp_group_avatar_thumb( $group = false ) {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_avatar_mini( $group = false ) {
 	echo bp_get_group_avatar_mini( $group );
@@ -852,8 +971,10 @@ function bp_group_avatar_mini( $group = false ) {
 	 *
 	 * @since BuddyPress (1.0.0)
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
+	 * @return string
 	 */
 	function bp_get_group_avatar_mini( $group = false ) {
 		return bp_get_group_avatar( array(
@@ -867,8 +988,8 @@ function bp_group_avatar_mini( $group = false ) {
 /**
  * Output the 'last active' string for the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_last_active( $group = false ) {
 	echo bp_get_group_last_active( $group );
@@ -876,8 +997,9 @@ function bp_group_last_active( $group = false ) {
 	/**
 	 * Return the 'last active' string for the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_last_active( $group = false ) {
@@ -894,6 +1016,14 @@ function bp_group_last_active( $group = false ) {
 		if ( empty( $last_active ) ) {
 			return __( 'not yet active', 'buddypress' );
 		} else {
+
+			/**
+			 * Filters the 'last active' string for the current gorup in the loop.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param string $value Determined last active value for the current group.
+			 */
 			return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ) );
 		}
 	}
@@ -901,8 +1031,8 @@ function bp_group_last_active( $group = false ) {
 /**
  * Output the permalink for the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_permalink( $group = false ) {
 	echo bp_get_group_permalink( $group );
@@ -910,24 +1040,33 @@ function bp_group_permalink( $group = false ) {
 	/**
 	 * Return the permalink for the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_permalink( $group = false ) {
 		global $groups_template;
 
-		if ( empty( $group ) )
+		if ( empty( $group ) ) {
 			$group =& $groups_template->group;
+		}
 
-		return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' ) );
+		/**
+		 * Filters the permalink for the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Permalink for the current group in the loop.
+		 */
+		return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ) );
 	}
 
 /**
  * Output the permalink for the admin section of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_admin_permalink( $group = false ) {
 	echo bp_get_group_admin_permalink( $group );
@@ -935,8 +1074,9 @@ function bp_group_admin_permalink( $group = false ) {
 	/**
 	 * Return the permalink for the admin section of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_admin_permalink( $group = false ) {
@@ -945,14 +1085,21 @@ function bp_group_admin_permalink( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the permalink for the admin section of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Permalink for the admin section of the current group in the loop.
+		 */
 		return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) );
 	}
 
 /**
  * Return the slug for the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_slug( $group = false ) {
 	echo bp_get_group_slug( $group );
@@ -960,8 +1107,9 @@ function bp_group_slug( $group = false ) {
 	/**
 	 * Return the slug for the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_slug( $group = false ) {
@@ -970,14 +1118,21 @@ function bp_group_slug( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the slug for the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $slug Slug for the current group in the loop.
+		 */
 		return apply_filters( 'bp_get_group_slug', $group->slug );
 	}
 
 /**
  * Output the description for the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_description( $group = false ) {
 	echo bp_get_group_description( $group );
@@ -985,8 +1140,9 @@ function bp_group_description( $group = false ) {
 	/**
 	 * Return the description for the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_description( $group = false ) {
@@ -995,14 +1151,21 @@ function bp_group_description( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the description for the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Description for the current group.
+		 */
 		return apply_filters( 'bp_get_group_description', stripslashes($group->description) );
 	}
 
 /**
  * Output the description for the current group in the loop, for use in a textarea.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_description_editable( $group = false ) {
 	echo bp_get_group_description_editable( $group );
@@ -1014,8 +1177,9 @@ function bp_group_description_editable( $group = false ) {
 	 * filters that 'bp_get_group_description' has, which makes it
 	 * appropriate for "raw" editing.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_description_editable( $group = false ) {
@@ -1024,14 +1188,26 @@ function bp_group_description_editable( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the permalink for the current group in the loop, for use in a textarea.
+		 *
+		 * 'bp_get_group_description_editable' does not have the formatting
+	     * filters that 'bp_get_group_description' has, which makes it
+	     * appropriate for "raw" editing.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $description Description for the current group in the loop.
+		 */
 		return apply_filters( 'bp_get_group_description_editable', $group->description );
 	}
 
 /**
  * Output an excerpt of the group description.
  *
- * @param object $group Optional. The group being referenced. Defaults to the
- *        group currently being iterated on in the groups loop.
+ * @param object|bool $group Optional. The group being referenced.
+ *                           Defaults to the group currently being
+ *                           iterated on in the groups loop.
  */
 function bp_group_description_excerpt( $group = false ) {
 	echo bp_get_group_description_excerpt( $group );
@@ -1039,8 +1215,10 @@ function bp_group_description_excerpt( $group = false ) {
 	/**
 	 * Get an excerpt of a group description.
 	 *
-	 * @param object $group Optional. The group being referenced. Defaults
-	 *        to the group currently being iterated on in the groups loop.
+	 * @param object|bool $group Optional. The group being referenced.
+	 *                           Defaults to the group currently being
+	 *                           iterated on in the groups loop.
+	 *
 	 * @return string Excerpt.
 	 */
 	function bp_get_group_description_excerpt( $group = false ) {
@@ -1050,6 +1228,14 @@ function bp_group_description_excerpt( $group = false ) {
 			$group =& $groups_template->group;
 		}
 
+		/**
+		 * Filters the excerpt of a group description.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Excerpt of a group description.
+		 * @param object $group Object for group whose description is made into an excerpt.
+		 */
 		return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ), $group );
 	}
 
@@ -1058,8 +1244,8 @@ function bp_group_description_excerpt( $group = false ) {
  *
  * Either 'Public' or 'Private'.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_public_status( $group = false ) {
 	echo bp_get_group_public_status( $group );
@@ -1069,8 +1255,9 @@ function bp_group_public_status( $group = false ) {
 	 *
 	 * Either 'Public' or 'Private'.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_public_status( $group = false ) {
@@ -1091,8 +1278,8 @@ function bp_group_public_status( $group = false ) {
  *
  * No longer used in BuddyPress.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_is_public( $group = false ) {
 	echo bp_get_group_is_public( $group );
@@ -1102,8 +1289,9 @@ function bp_group_is_public( $group = false ) {
 	 *
 	 * No longer used in BuddyPress.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return unknown
 	 */
 	function bp_get_group_is_public( $group = false ) {
@@ -1118,8 +1306,8 @@ function bp_group_is_public( $group = false ) {
 /**
  * Output the created date of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_date_created( $group = false ) {
 	echo bp_get_group_date_created( $group );
@@ -1127,8 +1315,9 @@ function bp_group_date_created( $group = false ) {
 	/**
 	 * Return the created date of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_date_created( $group = false ) {
@@ -1137,14 +1326,21 @@ function bp_group_date_created( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the created date of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Created date for the current group.
+		 */
 		return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) );
 	}
 
 /**
  * Output the username of the creator of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_creator_username( $group = false ) {
 	echo bp_get_group_creator_username( $group );
@@ -1152,8 +1348,9 @@ function bp_group_creator_username( $group = false ) {
 	/**
 	 * Return the username of the creator of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_creator_username( $group = false ) {
@@ -1162,14 +1359,21 @@ function bp_group_creator_username( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the username of the creator of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $value Username of the group creator.
+		 */
 		return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ) );
 	}
 
 /**
  * Output the user ID of the creator of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_creator_id( $group = false ) {
 	echo bp_get_group_creator_id( $group );
@@ -1177,8 +1381,9 @@ function bp_group_creator_id( $group = false ) {
 	/**
 	 * Return the user ID of the creator of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return int
 	 */
 	function bp_get_group_creator_id( $group = false ) {
@@ -1187,14 +1392,21 @@ function bp_group_creator_id( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the user ID of the creator of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param int $creator_id User ID of the group creator.
+		 */
 		return apply_filters( 'bp_get_group_creator_id', $group->creator_id );
 	}
 
 /**
  * Output the permalink of the creator of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_creator_permalink( $group = false ) {
 	echo bp_get_group_creator_permalink( $group );
@@ -1202,8 +1414,9 @@ function bp_group_creator_permalink( $group = false ) {
 	/**
 	 * Return the permalink of the creator of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_creator_permalink( $group = false ) {
@@ -1212,15 +1425,23 @@ function bp_group_creator_permalink( $group = false ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the permalink of the creator of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $value Permalink of the group creator.
+		 */
 		return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ) );
 	}
 
 /**
  * Determine whether a user is the creator of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
- * @param int $user_id ID of the user.
+ * @param object|bool $group   Optional. Group object.
+ *                             Default: current group in loop.
+ * @param int         $user_id ID of the user.
+ *
  * @return bool
  */
 function bp_is_group_creator( $group = false, $user_id = 0 ) {
@@ -1238,9 +1459,9 @@ function bp_is_group_creator( $group = false, $user_id = 0 ) {
 /**
  * Output the avatar of the creator of the current group in the loop.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
- * @param array $args {
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
+ * @param array       $args {
  *     Array of optional arguments. See {@link bp_get_group_creator_avatar()}
  *     for description.
  * }
@@ -1251,18 +1472,18 @@ function bp_group_creator_avatar( $group = false, $args = array() ) {
 	/**
 	 * Return the avatar of the creator of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
-	 * @param array $args {
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 * @param array       $args {
 	 *     Array of optional arguments. See {@link bp_core_fetch_avatar()}
 	 *     for detailed description of arguments.
-	 *     @type string $type Default: 'full'.
-	 *     @type int $width Default: false.
-	 *     @type int $height Default: false.
-	 *     @type int $class Default: 'avatar'.
-	 *     @type string $id Passed to 'css_id'. Default: false.
-	 *     @type string $alt Alt text. Default: 'Group creator profile
-	 *           photo of [user display name]'.
+	 *     @type string $type   Default: 'full'.
+	 *     @type int    $width  Default: false.
+	 *     @type int    $height Default: false.
+	 *     @type int    $class  Default: 'avatar'.
+	 *     @type string $id     Passed to 'css_id'. Default: false.
+	 *     @type string $alt    Alt text. Default: 'Group creator profile
+	 *                          photo of [user display name]'.
 	 * }
 	 * @return string
 	 */
@@ -1286,6 +1507,13 @@ function bp_group_creator_avatar( $group = false, $args = array() ) {
 
 		$avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) );
 
+		/**
+		 * Filters the avatar of the creator of the current group in the loop.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $avatar Avatar of the group creator.
+		 */
 		return apply_filters( 'bp_get_group_creator_avatar', $avatar );
 	}
 
@@ -1314,8 +1542,8 @@ function bp_group_is_mod() {
 /**
  * Output markup listing group admins.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_list_admins( $group = false ) {
 	global $groups_template;
@@ -1354,8 +1582,8 @@ function bp_group_list_admins( $group = false ) {
 /**
  * Output markup listing group mod.
  *
- * @param object $group Optional. Group object. Default: current
- *        group in loop.
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in loop.
  */
 function bp_group_list_mods( $group = false ) {
 	global $groups_template;
@@ -1404,11 +1632,11 @@ function bp_group_list_mods( $group = false ) {
  *
  * @since BuddyPress (1.5.0)
  *
- * @param BP_Groups_Group $group Optional. The group being queried. Defaults
- *        to the current group in the loop.
- * @param string $format Optional. 'string' to get a comma-separated string,
- *        'array' to get an array.
- * @return mixed $admin_ids A string or array of user IDs.
+ * @param BP_Groups_Group|bool $group     Optional. The group being queried. Defaults
+ *                                        to the current group in the loop.
+ * @param string               $format    Optional. 'string' to get a comma-separated string,
+ *                                        'array' to get an array.
+ * @return mixed               $admin_ids A string or array of user IDs.
  */
 function bp_group_admin_ids( $group = false, $format = 'string' ) {
 	global $groups_template;
@@ -1427,6 +1655,15 @@ function bp_group_admin_ids( $group = false, $format = 'string' ) {
 	if ( 'string' == $format )
 		$admin_ids = implode( ',', $admin_ids );
 
+	/**
+	 * Filters a list of user IDs for a group's admins.
+	 *
+	 * This filter may return either an array or a comma separated string.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array|string $admin_ids List of user IDs for a group's admins.
+	 */
 	return apply_filters( 'bp_group_admin_ids', $admin_ids );
 }
 
@@ -1435,11 +1672,11 @@ function bp_group_admin_ids( $group = false, $format = 'string' ) {
  *
  * @since BuddyPress (1.5.0)
  *
- * @param BP_Groups_Group $group Optional. The group being queried. Defaults
- *        to the current group in the loop.
- * @param string $format Optional. 'string' to get a comma-separated string,
- *        'array' to get an array.
- * @return mixed $mod_ids A string or array of user IDs.
+ * @param BP_Groups_Group|bool $group   Optional. The group being queried.
+ *                                      Defaults to the current group in the loop.
+ * @param string               $format  Optional. 'string' to get a comma-separated string,
+ *                                      'array' to get an array.
+ * @return mixed               $mod_ids A string or array of user IDs.
  */
 function bp_group_mod_ids( $group = false, $format = 'string' ) {
 	global $groups_template;
@@ -1458,6 +1695,15 @@ function bp_group_mod_ids( $group = false, $format = 'string' ) {
 	if ( 'string' == $format )
 		$mod_ids = implode( ',', $mod_ids );
 
+	/**
+	 * Filters a list of user IDs for a group's moderators.
+	 *
+	 * This filter may return either an array or a comma separated string.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array|string $admin_ids List of user IDs for a group's moderators.
+	 */
 	return apply_filters( 'bp_group_mod_ids', $mod_ids );
 }
 
@@ -1470,8 +1716,9 @@ function bp_group_all_members_permalink() {
 	/**
 	 * Return the permalink of the Members page of the current group in the loop.
 	 *
-	 * @param object $group Optional. Group object. Default: current
-	 *        group in loop.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
 	 * @return string
 	 */
 	function bp_get_group_all_members_permalink( $group = false ) {
@@ -1480,6 +1727,13 @@ function bp_group_all_members_permalink() {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the permalink of the Members page for the current group in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Permalink of the Members page for the current group.
+		 */
 		return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members' );
 	}
 
@@ -1491,7 +1745,6 @@ function bp_group_all_members_permalink() {
  * @todo Deprecate
  */
 function bp_group_search_form() {
-	global $bp;
 
 	$action = bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/search/';
 	$label = __('Filter Groups', 'buddypress');
@@ -1507,6 +1760,15 @@ function bp_group_search_form() {
 	echo apply_filters( 'bp_group_search_form', $search_form_html );
 }
 
+/**
+ * Determine whether the displayed user has no groups.
+ *
+ * No longer used in BuddyPress.
+ *
+ * @todo Deprecate
+ *
+ * @return bool True if the displayed user has no groups, otherwise false.
+ */
 function bp_group_show_no_groups_message() {
 	if ( !groups_total_groups_for_user( bp_displayed_user_id() ) )
 		return true;
@@ -1514,6 +1776,15 @@ function bp_group_show_no_groups_message() {
 	return false;
 }
 
+/**
+ * Determine whether the current page is a group activity permalink.
+ *
+ * No longer used in BuddyPress.
+ *
+ * @todo Deprecate.
+ *
+ * @return bool True if this is a group activity permalink, otherwise false.
+ */
 function bp_group_is_activity_permalink() {
 
 	if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) )
@@ -1522,18 +1793,41 @@ function bp_group_is_activity_permalink() {
 	return true;
 }
 
+/**
+ * Output the pagination HTML for a group loop.
+ */
 function bp_groups_pagination_links() {
 	echo bp_get_groups_pagination_links();
 }
+	/**
+	 * Get the pagination HTML for a group loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_groups_pagination_links() {
 		global $groups_template;
 
+		/**
+		 * Filters the pagination HTML for a group loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $pag_links HTML markup for the pagination links.
+		 */
 		return apply_filters( 'bp_get_groups_pagination_links', $groups_template->pag_links );
 	}
 
+/**
+ * Output the "Viewing x-y of z groups" pagination message.
+ */
 function bp_groups_pagination_count() {
 	echo bp_get_groups_pagination_count();
 }
+	/**
+	 * Generate the "Viewing x-y of z groups" pagination message.
+	 *
+	 * @return string
+	 */
 	function bp_get_groups_pagination_count() {
 		global $groups_template;
 
@@ -1542,54 +1836,158 @@ function bp_groups_pagination_count() {
 		$to_num    = bp_core_number_format( ( $start_num + ( $groups_template->pag_num - 1 ) > $groups_template->total_group_count ) ? $groups_template->total_group_count : $start_num + ( $groups_template->pag_num - 1 ) );
 		$total     = bp_core_number_format( $groups_template->total_group_count );
 
-		return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing 1', 'Viewing %1$s - %2$s of %3$s groups', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
+		if ( 1 == $groups_template->total_group_count ) {
+			$message = __( 'Viewing 1 group', 'buddypress' );
+		} else {
+			$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s group', 'Viewing %1$s - %2$s of %3$s groups', $groups_template->total_group_count, 'buddypress' ), $from_num, $to_num, $total );
+		}
+
+		/**
+		 * Filters the "Viewing x-y of z groups" pagination message.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $message  "Viewing x-y of z groups" text.
+		 * @param string $from_num Total amount for the low value in the range.
+		 * @param string $to_num   Total amount for the high value in the range.
+		 * @param string $total    Total amount of groups found.
+		 */
+		return apply_filters( 'bp_get_groups_pagination_count', $message, $from_num, $to_num, $total );
 	}
 
+/**
+ * Determine whether groups auto-join is enabled.
+ *
+ * "Auto-join" is the toggle that determines whether users are joined to a
+ * public group automatically when creating content in that group.
+ *
+ * @return bool
+ */
 function bp_groups_auto_join() {
-	global $bp;
 
-	return apply_filters( 'bp_groups_auto_join', (bool)$bp->groups->auto_join );
+	/**
+	 * Filters whether groups auto-join is enabled.
+	 *
+	 * @since BuddyPres (1.2.6)
+	 *
+	 * @param bool $value Enabled status.
+	 */
+	return apply_filters( 'bp_groups_auto_join', (bool) buddypress()->groups->auto_join );
 }
 
+/**
+ * Output the total member count for a group.
+ *
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
+ */
 function bp_group_total_members( $group = false ) {
 	echo bp_get_group_total_members( $group );
 }
+	/**
+	 * Get the total member count for a group.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
+	 * @return int
+	 */
 	function bp_get_group_total_members( $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the total member count for a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $total_member_count Total member count for a group.
+		 */
 		return apply_filters( 'bp_get_group_total_members', $group->total_member_count );
 	}
 
+/**
+ * Output the "x members" count string for a group.
+ */
 function bp_group_member_count() {
 	echo bp_get_group_member_count();
 }
+	/**
+	 * Generate the "x members" count string for a group.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_member_count() {
 		global $groups_template;
 
-		if ( 1 == (int) $groups_template->group->total_member_count )
-			return apply_filters( 'bp_get_group_member_count', sprintf( __( '%s member', 'buddypress' ), bp_core_number_format( $groups_template->group->total_member_count ) ) );
-		else
-			return apply_filters( 'bp_get_group_member_count', sprintf( __( '%s members', 'buddypress' ), bp_core_number_format( $groups_template->group->total_member_count ) ) );
+		if ( isset( $groups_template->group->total_member_count ) ) {
+			$count = (int) $groups_template->group->total_member_count;
+		} else {
+			$count = 0;
+		}
+
+		$count_string = sprintf( _n( '%s member', '%s members', $count, 'buddypress' ), bp_core_number_format( $count ) );
+
+		/**
+		 * Filters the "x members" count string for a group.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $count_string The "x members" count string for a group.
+		 */
+		return apply_filters( 'bp_get_group_member_count', $count_string );
 	}
 
+/**
+ * Output the URL of the Forum page of the current group in the loop.
+ */
 function bp_group_forum_permalink() {
 	echo bp_get_group_forum_permalink();
 }
+	/**
+	 * Generate the URL of the Forum page of a group.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_forum_permalink( $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the URL of the Forum page of a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL permalink for the Forum Page.
+		 */
 		return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum' );
 	}
 
+/**
+ * Output the topic count for a group forum.
+ *
+ * @param array|string $args See {@link bp_get_group_forum_topic_count()}.
+ */
 function bp_group_forum_topic_count( $args = '' ) {
 	echo bp_get_group_forum_topic_count( $args );
 }
+	/**
+	 * Generate the topic count string for a group forum.
+	 *
+	 * @param array|string $args {
+	 *     Array of arguments.
+	 *     @type bool $showtext Optional. If true, result will be formatted as "x topics".
+	 *                          If false, just a number will be returned.
+	 *                          Default: false.
+	 * }
+	 * @return string|int
+	 */
 	function bp_get_group_forum_topic_count( $args = '' ) {
 		global $groups_template;
 
@@ -1618,12 +2016,36 @@ function bp_group_forum_topic_count( $args = '' ) {
 			$total_topics = (int) $groups_template->group->forum_counts[0]->topics;
 		}
 
+		/**
+		 * Filters the topic count string for a group forum.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $total_topics Total topic count string.
+		 * @param bool   $showtext     Whether or not to return as formatted string.
+		 */
 		return apply_filters( 'bp_get_group_forum_topic_count', $total_topics, (bool)$showtext );
 	}
 
+/**
+ * Output the post count for a group forum.
+ *
+ * @param array|string $args See {@link bp_get_group_forum_post_count()}.
+ */
 function bp_group_forum_post_count( $args = '' ) {
 	echo bp_get_group_forum_post_count( $args );
 }
+	/**
+	 * Generate the post count string for a group forum.
+	 *
+	 * @param array|string $args {
+	 *     Array of arguments.
+	 *     @type bool $showtext Optional. If true, result will be formatted as "x posts".
+	 *                          If false, just a number will be returned.
+	 *                          Default: false.
+	 * }
+	 * @return string|int
+	 */
 	function bp_get_group_forum_post_count( $args = '' ) {
 		global $groups_template;
 
@@ -1652,9 +2074,24 @@ function bp_group_forum_post_count( $args = '' ) {
 			$total_posts = (int) $groups_template->group->forum_counts[0]->posts;
 		}
 
+		/**
+		 * Filters the post count string for a group forum.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $total_posts Total post count string.
+		 * @param bool   $showtext    Whether or not to return as formatted string.
+		 */
 		return apply_filters( 'bp_get_group_forum_post_count', $total_posts, (bool)$showtext );
 	}
 
+/**
+ * Determine whether forums are enabled for a group.
+ *
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
+ *
+ * @return bool
+ */
 function bp_group_is_forum_enabled( $group = false ) {
 	global $groups_template;
 
@@ -1667,6 +2104,11 @@ function bp_group_is_forum_enabled( $group = false ) {
 	return false;
 }
 
+/**
+ * Output the 'checked' attribute for the group forums settings UI.
+ *
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
+ */
 function bp_group_show_forum_setting( $group = false ) {
 	global $groups_template;
 
@@ -1677,6 +2119,12 @@ function bp_group_show_forum_setting( $group = false ) {
 		echo ' checked="checked"';
 }
 
+/**
+ * Output the 'checked' attribute for a given status in the settings UI.
+ *
+ * @param string      $setting Group status. 'public', 'private', 'hidden'.
+ * @param object|bool $group   Optional. Group object. Default: current group in loop.
+ */
 function bp_group_show_status_setting( $setting, $group = false ) {
 	global $groups_template;
 
@@ -1688,12 +2136,13 @@ function bp_group_show_status_setting( $setting, $group = false ) {
 }
 
 /**
- * Get the 'checked' value, if needed, for a given invite_status on the group create/admin screens
+ * Output the 'checked' value, if needed, for a given invite_status on the group create/admin screens
  *
  * @since BuddyPress (1.5.0)
  *
- * @param string $setting The setting you want to check against ('members', 'mods', or 'admins')
- * @param BP_Groups_Group $group (optional) The group whose status you want to check
+ * @param string      $setting The setting you want to check against ('members',
+ *	                           'mods', or 'admins').
+ * @param object|bool $group   Optional. Group object. Default: current group in loop.
  */
 function bp_group_show_invite_status_setting( $setting, $group = false ) {
 	$group_id = isset( $group->id ) ? $group->id : false;
@@ -1705,28 +2154,36 @@ function bp_group_show_invite_status_setting( $setting, $group = false ) {
 }
 
 /**
- * Get the invite status of a group
+ * Get the invite status of a group.
  *
- * 'invite_status' became part of BuddyPress in BP 1.5. In order to provide backward compatibility,
- * groups without a status set will default to 'members', ie all members in a group can send
- * invitations. Filter 'bp_group_invite_status_fallback' to change this fallback behavior.
+ * 'invite_status' became part of BuddyPress in BP 1.5. In order to provide
+ * backward compatibility with earlier installations, groups without a status
+ * set will default to 'members', ie all members in a group can send
+ * invitations. Filter 'bp_group_invite_status_fallback' to change this
+ * fallback behavior.
  *
  * This function can be used either in or out of the loop.
  *
  * @since BuddyPress (1.5.0)
  *
- * @param int $group_id (optional) The id of the group whose status you want to check
- * @return mixed Returns false when no group can be found. Otherwise returns the group invite
- *    status, from among 'members', 'mods', and 'admins'
+ * @param int|bool $group_id Optional. The ID of the group whose status you want to
+ *                           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',
+ *                     'mods', and 'admins'.
  */
 function bp_group_get_invite_status( $group_id = false ) {
-	global $bp, $groups_template;
+	global $groups_template;
 
 	if ( !$group_id ) {
+		$bp = buddypress();
+
 		if ( isset( $bp->groups->current_group->id ) ) {
 			// Default to the current group first
 			$group_id = $bp->groups->current_group->id;
-		} else if ( isset( $groups_template->group->id ) ) {
+		} elseif ( isset( $groups_template->group->id ) ) {
 			// Then see if we're in the loop
 			$group_id = $groups_template->group->id;
 		} else {
@@ -1741,61 +2198,84 @@ function bp_group_get_invite_status( $group_id = false ) {
 		$invite_status = apply_filters( 'bp_group_invite_status_fallback', 'members' );
 	}
 
+	/**
+	 * Filters the invite status of a group.
+	 *
+	 * Invite status in this case means who from the group can send invites.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $invite_status Membership level needed to send an invite.
+	 * @param int    $group_id      ID of the group whose status is being checked.
+	 */
 	return apply_filters( 'bp_group_get_invite_status', $invite_status, $group_id );
 }
 
 /**
- * Can the logged-in user send invitations in the specified group?
+ * Can a user send invitations in the specified group?
  *
  * @since BuddyPress (1.5.0)
+ * @since BuddyPress (2.2.0) Added the $user_id parameter.
  *
- * @param int $group_id (optional) The id of the group whose status you want to check
- * @return bool $can_send_invites
+ * @param int $group_id The group ID to check.
+ * @param int $user_id  The user ID to check.
+ * @return bool
  */
-function bp_groups_user_can_send_invites( $group_id = false ) {
-	global $bp;
-
+function bp_groups_user_can_send_invites( $group_id = 0, $user_id = 0 ) {
 	$can_send_invites = false;
 	$invite_status    = false;
 
-	if ( is_user_logged_in() ) {
-		if ( bp_current_user_can( 'bp_moderate' ) ) {
-			// Super admins can always send invitations
-			$can_send_invites = true;
+	// If $user_id isn't specified, we check against the logged-in user.
+	if ( ! $user_id ) {
+		$user_id = bp_loggedin_user_id();
+	}
 
-		} else {
-			// If no $group_id is provided, default to the current group id
-			if ( !$group_id )
-				$group_id = isset( $bp->groups->current_group->id ) ? $bp->groups->current_group->id : 0;
-
-			// If no group has been found, bail
-			if ( !$group_id )
-				return false;
+	// If $group_id isn't specified, use existing one if available.
+	if ( ! $group_id ) {
+		$group_id = bp_get_current_group_id();
+	}
 
+	if ( $user_id ) {
+		// Users with the 'bp_moderate' cap can always send invitations
+		if ( user_can( $user_id, 'bp_moderate' ) ) {
+			$can_send_invites = true;
+		} else {
 			$invite_status = bp_group_get_invite_status( $group_id );
-			if ( !$invite_status )
-				return false;
 
 			switch ( $invite_status ) {
 				case 'admins' :
-					if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) )
+					if ( groups_is_user_admin( $user_id, $group_id ) ) {
 						$can_send_invites = true;
+					}
 					break;
 
 				case 'mods' :
-					if ( groups_is_user_mod( bp_loggedin_user_id(), $group_id ) || groups_is_user_admin( bp_loggedin_user_id(), $group_id ) )
+					if ( groups_is_user_mod( $user_id, $group_id ) || groups_is_user_admin( $user_id, $group_id ) ) {
 						$can_send_invites = true;
+					}
 					break;
 
 				case 'members' :
-					if ( groups_is_user_member( bp_loggedin_user_id(), $group_id ) )
+					if ( groups_is_user_member( $user_id, $group_id ) ) {
 						$can_send_invites = true;
+					}
 					break;
 			}
 		}
 	}
 
-	return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status );
+	/**
+	 * Filters whether a user can send invites in a group.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @since BuddyPress (2.2.0) Added the $user_id parameter.
+	 *
+	 * @param bool $can_send_invites Whether the user can send invites
+	 * @param int  $group_id         The group ID being checked
+	 * @param bool $invite_status    The group's current invite status
+	 * @param int  $user_id          The user ID being checked
+	 */
+	return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status, $user_id );
 }
 
 /**
@@ -1806,6 +2286,9 @@ function bp_groups_user_can_send_invites( $group_id = false ) {
  * @deprecated No longer used.
  * @since BuddyPress (1.0.0)
  * @todo Remove in 1.4
+ *
+ * @param bool $admin_list
+ * @param bool $group
  */
 function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
 	global $groups_template;
@@ -1875,6 +2358,16 @@ function bp_group_admin_memberlist( $admin_list = false, $group = false ) {
 	<?php endif;
 }
 
+/**
+ * Generate the HTML for a list of group moderators.
+ *
+ * No longer used.
+ *
+ * @todo Deprecate.
+ *
+ * @param bool $admin_list
+ * @param bool $group
+ */
 function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
 	global $groups_template;
 
@@ -1937,18 +2430,47 @@ function bp_group_mod_memberlist( $admin_list = false, $group = false ) {
 	<?php }
 }
 
+/**
+ * Determine whether a group has moderators.
+ *
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
+ *
+ * @return array Info about group admins (user_id + date_modified).
+ */
 function bp_group_has_moderators( $group = false ) {
 	global $groups_template;
 
 	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
+	/**
+	 * Filters whether a group has moderators.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $value Array of user IDs who are a moderator of the provided group.
+	 */
 	return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ) );
 }
 
+/**
+ * Output a URL for promoting a user to moderator.
+ *
+ * @param array|string $args See {@link bp_get_group_member_promote_mod_link()}.
+ */
 function bp_group_member_promote_mod_link( $args = '' ) {
 	echo bp_get_group_member_promote_mod_link( $args );
 }
+	/**
+	 * Generate a URL for promoting a user to moderator.
+	 *
+	 * @param array|string $args {
+	 *     @type int    $user_id ID of the member to promote. Default:
+	 *                           current member in a group member loop.
+	 *     @type object $group   Group object. Default: current group.
+	 * }
+	 * @return string
+	 */
 	function bp_get_group_member_promote_mod_link( $args = '' ) {
 		global $members_template, $groups_template;
 
@@ -1960,12 +2482,34 @@ function bp_group_member_promote_mod_link( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters a URL for promoting a user to moderator.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value URL to use for promoting a user to moderator.
+		 */
 		return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) );
 	}
 
+/**
+ * Output a URL for promoting a user to admin.
+ *
+ * @param array|string $args See {@link bp_get_group_member_promote_admin_link()}.
+ */
 function bp_group_member_promote_admin_link( $args = '' ) {
 	echo bp_get_group_member_promote_admin_link( $args );
 }
+	/**
+	 * Generate a URL for promoting a user to admin.
+	 *
+	 * @param array|string $args {
+	 *     @type int    $user_id ID of the member to promote. Default:
+	 *                           current member in a group member loop.
+	 *     @type object $group   Group object. Default: current group.
+	 * }
+	 * @return string
+	 */
 	function bp_get_group_member_promote_admin_link( $args = '' ) {
 		global $members_template, $groups_template;
 
@@ -1977,9 +2521,22 @@ function bp_group_member_promote_admin_link( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters a URL for promoting a user to admin.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value URL to use for promoting a user to admin.
+		 */
 		return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/admin/' . $user_id, 'groups_promote_member' ) );
 	}
 
+/**
+ * Output a URL for demoting a user to member.
+ *
+ * @param int $user_id ID of the member to demote. Default: current member in
+ *                     a member loop.
+ */
 function bp_group_member_demote_link( $user_id = 0 ) {
 	global $members_template;
 
@@ -1988,6 +2545,15 @@ function bp_group_member_demote_link( $user_id = 0 ) {
 
 	echo bp_get_group_member_demote_link( $user_id );
 }
+	/**
+	 * Generate a URL for demoting a user to member.
+	 *
+	 * @param int         $user_id ID of the member to demote. Default: current
+	 *                             member in a member loop.
+	 * @param object|bool $group   Optional. Group object. Default: current group.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_member_demote_link( $user_id = 0, $group = false ) {
 		global $members_template, $groups_template;
 
@@ -1997,9 +2563,22 @@ function bp_group_member_demote_link( $user_id = 0 ) {
 		if ( !$user_id )
 			$user_id = $members_template->member->user_id;
 
+		/**
+		 * Filters a URL for demoting a user to member.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL to use for demoting a user to member.
+		 */
 		return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ) );
 	}
 
+/**
+ * Output a URL for banning a member from a group.
+ *
+ * @param int $user_id ID of the member to ban.
+ *                     Default: current member in a member loop.
+ */
 function bp_group_member_ban_link( $user_id = 0 ) {
 	global $members_template;
 
@@ -2008,15 +2587,37 @@ function bp_group_member_ban_link( $user_id = 0 ) {
 
 	echo bp_get_group_member_ban_link( $user_id );
 }
+	/**
+	 * Generate a URL for banning a member from a group.
+	 *
+	 * @param int         $user_id ID of the member to ban.
+	 *                             Default: current member in a member loop.
+	 * @param object|bool $group   Optional. Group object. Default: current group.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_member_ban_link( $user_id = 0, $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters a URL for banning a member from a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL to use for banning a member.
+		 */
 		return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id, 'groups_ban_member' ) );
 	}
 
+/**
+ * Output a URL for unbanning a member from a group.
+ *
+ * @param int $user_id ID of the member to unban.
+ *                     Default: current member in a member loop.
+ */
 function bp_group_member_unban_link( $user_id = 0 ) {
 	global $members_template;
 
@@ -2025,6 +2626,15 @@ function bp_group_member_unban_link( $user_id = 0 ) {
 
 	echo bp_get_group_member_unban_link( $user_id );
 }
+	/**
+	 * Generate a URL for unbanning a member from a group.
+	 *
+	 * @param int         $user_id ID of the member to unban.
+	 *                             Default: current member in a member loop.
+	 * @param object|bool $group   Optional. Group object. Default: current group.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_member_unban_link( $user_id = 0, $group = false ) {
 		global $members_template, $groups_template;
 
@@ -2034,10 +2644,22 @@ function bp_group_member_unban_link( $user_id = 0 ) {
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters a URL for unbanning a member from a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL to use for unbanning a member.
+		 */
 		return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/unban/' . $user_id, 'groups_unban_member' ) );
 	}
 
-
+/**
+ * Output a URL for removing a member from a group.
+ *
+ * @param int $user_id ID of the member to remove.
+ *                     Default: current member in a member loop.
+ */
 function bp_group_member_remove_link( $user_id = 0 ) {
 	global $members_template;
 
@@ -2046,15 +2668,37 @@ function bp_group_member_remove_link( $user_id = 0 ) {
 
 	echo bp_get_group_member_remove_link( $user_id );
 }
+	/**
+	 * Generate a URL for removing a member from a group.
+	 *
+	 * @param int         $user_id ID of the member to remove.
+	 *                             Default: current member in a member loop.
+	 * @param object|bool $group   Optional. Group object. Default: current group.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_member_remove_link( $user_id = 0, $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters a URL for removing a member from a group.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value URL to use for removing a member.
+		 */
 		return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ) );
 	}
 
+/**
+ * HTML admin subnav items for group pages.
+ *
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in the loop.
+ */
 function bp_group_admin_tabs( $group = false ) {
 	global $groups_template;
 
@@ -2062,62 +2706,124 @@ function bp_group_admin_tabs( $group = false ) {
 		$group = ( $groups_template->group ) ? $groups_template->group : groups_get_current_group();
 	}
 
-	$current_tab = bp_get_group_current_admin_tab();
+	$css_id = 'manage-members';
 
-	if ( bp_is_item_admin() ) : ?>
-
-		<li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
-
-	<?php endif; ?>
-
-	<?php if ( ! bp_is_item_admin() )
-			return false; ?>
-
-	<li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
+	if ( 'private' == $group->status ) {
+		$css_id = 'membership-requests';
+	}
 
-	<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) && buddypress()->avatar->show_avatars ) : ?>
+	add_filter( "bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3 );
 
-		<li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Photo', 'buddypress' ); ?></a></li>
+	bp_get_options_nav( $group->slug . '_manage' );
 
-	<?php endif; ?>
+	remove_filter( "bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3 );
+}
 
-	<li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members' ) ?>"><?php _e( 'Members', 'buddypress' ); ?></a></li>
+/**
+ * BackCompat for plugins/themes directly hooking groups_admin_tabs
+ * without using the Groups Extension API.
+ *
+ * @param  string $subnav_output Subnav item output.
+ * @param  string $subnav_item   subnav item params.
+ * @param  string $selected_item Surrent selected tab.
+ *
+ * @return string HTML output
+ */
+function bp_group_admin_tabs_backcompat( $subnav_output = '', $subnav_item = '', $selected_item = '' ) {
+	if ( ! has_action( 'groups_admin_tabs' ) ) {
+		return $subnav_output;
+	}
 
-	<?php if ( $groups_template->group->status == 'private' ) : ?>
+	$group = groups_get_current_group();
 
-		<li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
+	ob_start();
 
-	<?php endif; ?>
+	do_action( 'groups_admin_tabs', $selected_item, $group->slug );
 
-	<?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
+	$admin_tabs_backcompat = trim( ob_get_contents() );
+	ob_end_clean();
 
-	<li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
+	if ( ! empty( $admin_tabs_backcompat ) ) {
+		_doing_it_wrong( "do_action( 'groups_admin_tabs' )", __( 'This action should not be used directly. Please use the BuddyPress Group Extension API to generate Manage tabs.', 'buddypress' ), '2.2.0' );
+		$subnav_output .= $admin_tabs_backcompat;
+	}
 
-<?php
+	return $subnav_output;
 }
 
+/**
+ * Output the group count for the displayed user.
+ */
 function bp_group_total_for_member() {
 	echo bp_get_group_total_for_member();
 }
+	/**
+	 * Get the group count for the displayed user.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_total_for_member() {
+
+		/**
+		 * FIlters the group count for a displayed user.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $value Total group count for a displayed user.
+		 */
 		return apply_filters( 'bp_get_group_total_for_member', BP_Groups_Member::total_group_count() );
 	}
 
+/**
+ * Output the 'action' attribute for a group form.
+ *
+ * @param string $page Page slug.
+ */
 function bp_group_form_action( $page ) {
 	echo bp_get_group_form_action( $page );
 }
+	/**
+	 * Generate the 'action' attribute for a group form.
+	 *
+	 * @param string      $page  Page slug.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_form_action( $page, $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the 'action' attribute for a group form.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Action attribute for a group form.
+		 */
 		return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page );
 	}
 
+/**
+ * Output the 'action' attribute for a group admin form.
+ *
+ * @param string|bool $page Optional. Page slug.
+ */
 function bp_group_admin_form_action( $page = false ) {
 	echo bp_get_group_admin_form_action( $page );
 }
+	/**
+	 * Generate the 'action' attribute for a group admin form.
+	 *
+	 * @param string|bool $page  Optional. Page slug.
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_admin_form_action( $page = false, $group = false ) {
 		global $groups_template;
 
@@ -2127,9 +2833,24 @@ function bp_group_admin_form_action( $page = false ) {
 		if ( empty( $page ) )
 			$page = bp_action_variable( 0 );
 
+		/**
+		 * Filters the 'action' attribute for a group admin form.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Action attribute for a group admin form.
+		 */
 		return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page );
 	}
 
+/**
+ * Determine whether the logged-in user has requested membership to a group.
+ *
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in the loop.
+ *
+ * @return bool
+ */
 function bp_group_has_requested_membership( $group = false ) {
 	global $groups_template;
 
@@ -2143,16 +2864,14 @@ function bp_group_has_requested_membership( $group = false ) {
 }
 
 /**
- * bp_group_is_member()
+ * Check if current user is member of a group.
  *
- * Checks if current user is member of a group.
+ * @global object $groups_template
  *
- * @uses bp_current_user_can() Check if current user is super admin
- * @uses apply_filters Creates bp_group_is_member filter and passes $is_member
- * @usedby groups/activity.php, groups/single/forum/edit.php, groups/single/forum/topic.php to determine template part visibility
- * @global object $groups_template Current Group (usually in template loop)
- * @param object $group Group to check is_member
- * @return bool If user is member of group or not
+ * @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.
  */
 function bp_group_is_member( $group = false ) {
 	global $groups_template;
@@ -2164,14 +2883,22 @@ function bp_group_is_member( $group = false ) {
 	if ( empty( $group ) )
 		$group =& $groups_template->group;
 
+	/**
+	 * Filters whether current user is member of a group.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param bool $is_member If user is a member of group or not.
+	 */
 	return apply_filters( 'bp_group_is_member', !empty( $group->is_member ) );
 }
 
 /**
  * Check whether the current user has an outstanding invite to the current group in the loop.
  *
- * @param object $group Optional. Group data object. Defaults to the current
- *        group in the groups loop.
+ * @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.
  */
 function bp_group_is_invited( $group = false ) {
@@ -2181,6 +2908,13 @@ function bp_group_is_invited( $group = false ) {
 		$group =& $groups_template->group;
 	}
 
+	/**
+	 * Filters whether current user has an outstanding invite to current group in loop.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $is_invited If user has an outstanding group invite.
+	 */
 	return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ) );
 }
 
@@ -2199,9 +2933,11 @@ function bp_group_is_invited( $group = false ) {
  *
  * @since BuddyPress (1.5.0)
  *
- * @global BP_Groups_Template $groups_template Group template loop object
- * @param BP_Groups_Group $group Group to check if user is banned
- * @param int $user_id The user ID to check
+ * @global BP_Groups_Template $groups_template Group template loop object.
+ *
+ * @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.
  */
 function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
@@ -2235,69 +2971,178 @@ function bp_group_is_user_banned( $group = false, $user_id = 0 ) {
 		}
 	}
 
+	/**
+	 * Filters whether current user has been banned from current group in loop.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $is_invited If user has been from current group.
+	 */
 	return (bool) apply_filters( 'bp_group_is_user_banned', $retval );
 }
 
+/**
+ * Output the URL for accepting an invitation to the current group in the loop.
+ */
 function bp_group_accept_invite_link() {
 	echo bp_get_group_accept_invite_link();
 }
+	/**
+	 * Generate the URL for accepting an invitation to a group.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: Current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_accept_invite_link( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		$bp = buddypress();
+
+		/**
+		 * Filters the URL for accepting an invitation to a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for accepting an invitation to a group.
+		 */
 		return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/accept/' . $group->id ), 'groups_accept_invite' ) );
 	}
 
+/**
+ * Output the URL for accepting an invitation to the current group in the loop.
+ */
 function bp_group_reject_invite_link() {
 	echo bp_get_group_reject_invite_link();
 }
+	/**
+	 * Generate the URL for rejecting an invitation to a group.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: Current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_reject_invite_link( $group = false ) {
-		global $groups_template, $bp;
+		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		$bp = buddypress();
+
+		/**
+		 * Filters the URL for rejecting an invitation to a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for rejecting an invitation to a group.
+		 */
 		return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/reject/' . $group->id ), 'groups_reject_invite' ) );
 	}
 
+/**
+ * Output the URL for confirming a request to leave a group.
+ */
 function bp_group_leave_confirm_link() {
 	echo bp_get_group_leave_confirm_link();
 }
+	/**
+	 * Generate the URL for confirming a request to leave a group.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: Current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_leave_confirm_link( $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the URL for confirming a request to leave a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for confirming a request to leave a group.
+		 */
 		return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ) );
 	}
 
+/**
+ * Output the URL for rejecting a request to leave a group.
+ */
 function bp_group_leave_reject_link() {
 	echo bp_get_group_leave_reject_link();
 }
+	/**
+	 * Generate the URL for rejecting a request to leave a group.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: Current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_leave_reject_link( $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the URL for rejecting a request to leave a group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for rejecting a request to leave a group.
+		 */
 		return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ) );
 	}
 
+/**
+ * Output the 'action' attribute for a group send invite form.
+ */
 function bp_group_send_invite_form_action() {
 	echo bp_get_group_send_invite_form_action();
 }
+	/**
+	 * Output the 'action' attribute for a group send invite form.
+	 *
+	 * @param object|bool $group Optional. Group object.
+	 *                           Default: current group in the loop.
+	 *
+	 * @return string
+	 */
 	function bp_get_group_send_invite_form_action( $group = false ) {
 		global $groups_template;
 
 		if ( empty( $group ) )
 			$group =& $groups_template->group;
 
+		/**
+		 * Filters the 'action' attribute for a group send invite form.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Action attribute for a group send invite form.
+		 */
 		return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send' );
 	}
 
+/**
+ * Determine whether the current user has friends to invite to a group.
+ *
+ * @param object|bool $group Optional. Group object.
+ *                           Default: current group in the loop.
+ *
+ * @return bool
+ */
 function bp_has_friends_to_invite( $group = false ) {
 	global $groups_template;
 
@@ -2314,28 +3159,26 @@ function bp_has_friends_to_invite( $group = false ) {
 }
 
 /**
- * Outputs a 'New Topic' button for a group.
+ * Output a 'New Topic' button for a group.
  *
  * @since BuddyPress (1.2.7)
  *
- * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
- * @uses bp_get_group_new_topic_button() Returns the 'New Topic' button
+ * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed,
+ *                                    boolean false if not passed.
  */
 function bp_group_new_topic_button( $group = false ) {
 	echo bp_get_group_new_topic_button( $group );
 }
+
 	/**
 	 * Returns a 'New Topic' button for a group.
 	 *
 	 * @since BuddyPress (1.2.7)
 	 *
-	 * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
-	 * @uses is_user_logged_in() Is there a user logged in?
-	 * @uses bp_group_is_user_banned() Is the current user banned from the current group?
-	 * @uses bp_is_group_forum() Are we on a group forum page?
-	 * @uses bp_is_group_forum_topic() Are we on a group topic page?
-	 * @uses bp_get_button() Renders a button
-	 * @return string HTML code for the button
+	 * @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.
 	 */
 	function bp_get_group_new_topic_button( $group = false ) {
 		global $groups_template;
@@ -2359,34 +3202,63 @@ function bp_group_new_topic_button( $group = false ) {
 			'link_title'        => __( 'New Topic', 'buddypress' ),
 		);
 
-		// Filter and return the HTML button
+		/**
+		 * Filters the HTML button for creating a new topic in a group.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $button HTML button for a new topic.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) );
 	}
 
+/**
+ * Output button to join a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param object|bool $group Single group object.
+ */
 function bp_group_join_button( $group = false ) {
 	echo bp_get_group_join_button( $group );
 }
+	/**
+	 * Return button to join a group.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param object|bool $group Single group object.
+	 *
+	 * @return mixed
+	 */
 	function bp_get_group_join_button( $group = false ) {
 		global $groups_template;
 
-		if ( empty( $group ) )
+		// Set group to current loop group if none passed
+		if ( empty( $group ) ) {
 			$group =& $groups_template->group;
+		}
 
-		if ( !is_user_logged_in() || bp_group_is_user_banned( $group ) )
+		// 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
-		if ( !$group->status )
+		if ( empty( $group->status ) ) {
 			return false;
+		}
 
 		// Already a member
-		if ( isset( $group->is_member ) && $group->is_member ) {
+		if ( ! empty( $group->is_member ) ) {
 
 			// Stop sole admins from abandoning their group
 	 		$group_admins = groups_get_group_admins( $group->id );
-		 	if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == bp_loggedin_user_id() )
+		 	if ( ( 1 == count( $group_admins ) ) && ( bp_loggedin_user_id() === (int) $group_admins[0]->user_id ) ) {
 				return false;
+			}
 
+			// Setup button attributes
 			$button = array(
 				'id'                => 'leave_group',
 				'component'         => 'groups',
@@ -2407,7 +3279,6 @@ function bp_group_join_button( $group = false ) {
 			switch ( $group->status ) {
 				case 'hidden' :
 					return false;
-					break;
 
 				case 'public':
 					$button = array(
@@ -2479,7 +3350,13 @@ function bp_group_join_button( $group = false ) {
 			}
 		}
 
-		// Filter and return the HTML button
+		/**
+		 * Filters the HTML button for joining a group.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $button HTML button for joining a group.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_group_join_button', $button ) );
 	}
 
@@ -2512,49 +3389,154 @@ function bp_group_create_button() {
 			'component'  => 'groups',
 			'link_text'  => __( 'Create a Group', 'buddypress' ),
 			'link_title' => __( 'Create a Group', 'buddypress' ),
-			'link_class' => 'button group-create bp-title-button',
-			'link_href'  => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_groups_root_slug() ) . trailingslashit( 'create' ),
+			'link_class' => 'group-create no-ajax',
+			'link_href'  => trailingslashit( bp_get_groups_directory_permalink() . 'create' ),
 			'wrapper'    => false,
+			'block_self' => false,
 		);
 
+		/**
+		 * Filters the HTML button for creating a group.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $button HTML button for creating a group.
+		 */
 		return bp_get_button( apply_filters( 'bp_get_group_create_button', $button_args ) );
 	}
 
+/**
+ * Output the Create a Group nav item.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_group_create_nav_item() {
+	echo bp_get_group_create_nav_item();
+}
+
+	/**
+	 * Get the Create a Group nav item.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @return string
+	 */
+	function bp_get_group_create_nav_item() {
+		// Get the create a group button
+		$create_group_button = bp_get_group_create_button();
+
+		// Make sure the button is available
+		if ( empty( $create_group_button ) ) {
+			return;
+		}
+
+		$output = '<li id="group-create-nav">' . $create_group_button . '</li>';
+
+		/**
+		 * Filters the Create a Group nav item.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param string $output HTML output for nav item.
+		 */
+		return apply_filters( 'bp_get_group_create_nav_item', $output );
+	}
+
+/**
+ * Checks if a specific theme is still filtering the Groups directory title
+ * if so, transform the title button into a Groups directory nav item.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @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
+	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
+	if ( ! has_filter( 'bp_groups_directory_header' ) ) {
+		return;
+	}
+
+	bp_group_create_nav_item();
+}
+add_action( 'bp_groups_directory_group_filter', 'bp_group_backcompat_create_nav_item', 1000 );
+
 /**
  * Prints a message if the group is not visible to the current user (it is a
  * hidden or private group, and the user does not have access).
  *
- * @global BP_Groups_Template $groups_template Groups template object
- * @param object $group Group to get status message for. Optional; defaults to current group.
  * @since BuddyPress (1.0.0)
+ *
+ * @global BP_Groups_Template $groups_template Groups template object.
+ * @param object $group Group to get status message for. Optional; defaults to current group.
  */
 function bp_group_status_message( $group = null ) {
 	global $groups_template;
 
-	if ( ! $group )
+	// Group not passed so look for loop
+	if ( empty( $group ) ) {
 		$group =& $groups_template->group;
+	}
 
-	if ( 'private' == $group->status ) {
- 		if ( ! bp_group_has_requested_membership() ) {
-			if ( is_user_logged_in() && bp_group_is_invited() ) {
-				$message = __( 'You must accept your pending invitation before you can access this private group.', 'buddypress' );
-			} else if ( is_user_logged_in() ) {
-				$message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
-			} else {
-				$message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
-			}
-
-		} else {
-			$message = __( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
-		}
+	// 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
 	} else {
-		$message = __( 'This is a hidden group and only invited members can join.', 'buddypress' );
+		switch( $group->status ) {
+
+			// Private group
+			case 'private' :
+				if ( ! bp_group_has_requested_membership( $group ) ) {
+					if ( is_user_logged_in() ) {
+						if ( bp_group_is_invited( $group ) ) {
+							$message = __( 'You must accept your pending invitation before you can access this private group.', 'buddypress' );
+						} else {
+							$message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' );
+						}
+					} else {
+						$message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' );
+					}
+				} else {
+					$message = __( 'This is a private group. Your membership request is awaiting approval from the group administrator.', 'buddypress' );
+				}
+
+				break;
+
+			// Hidden group
+			case 'hidden' :
+			default :
+				$message = __( 'This is a hidden group and only invited members can join.', 'buddypress' );
+				break;
+		}
 	}
 
+	/**
+	 * Filters a message if the group is not visible to the current user.
+	 *
+	 * This will be true if it is a hidden or private group, and the user does not have access.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $message Message to display to the current user.
+	 * @param object $group   Group to get status message for.
+	 */
 	echo apply_filters( 'bp_group_status_message', $message, $group );
 }
 
+/**
+ * Output hidden form fields for group.
+ *
+ * This function is no longer used, but may still be used by older themes.
+ *
+ * @since BuddyPress (1.0.0)
+ */
 function bp_group_hidden_fields() {
 	if ( isset( $_REQUEST['s'] ) ) {
 		echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />';
@@ -2569,60 +3551,103 @@ function bp_group_hidden_fields() {
 	}
 }
 
+/**
+ * Output the total number of groups.
+ *
+ * @since BuddyPress (1.0.0)
+ */
 function bp_total_group_count() {
 	echo bp_get_total_group_count();
 }
+	/**
+	 * Return the total number of groups.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @return type
+	 */
 	function bp_get_total_group_count() {
+
+		/**
+		 * Filters the total number of groups.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $value Total number of groups found.
+		 */
 		return apply_filters( 'bp_get_total_group_count', groups_get_total_group_count() );
 	}
 
+/**
+ * Output the total number of groups a user belongs to.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $user_id User ID to get group membership count.
+ */
 function bp_total_group_count_for_user( $user_id = 0 ) {
 	echo bp_get_total_group_count_for_user( $user_id );
 }
+	/**
+	 * Return the total number of groups a user belongs to.
+	 *
+	 * Filtered by `bp_core_number_format()` by default
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id User ID to get group membership count.
+	 *
+	 * @return int
+	 */
 	function bp_get_total_group_count_for_user( $user_id = 0 ) {
-		return apply_filters( 'bp_get_total_group_count_for_user', groups_total_groups_for_user( $user_id ), $user_id );
-	}
-	add_filter( 'bp_get_total_group_count_for_user', 'bp_core_number_format' );
+		$count = groups_total_groups_for_user( $user_id );
 
+		/**
+		 * Filters the total number of groups a user belongs to.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $count   Total number of groups for the user.
+		 * @param int $user_id ID of the user being checked.
+		 */
+		return apply_filters( 'bp_get_total_group_count_for_user', $count, $user_id );
+	}
 
-/***************************************************************************
- * Group Members Template Tags
- **/
+/** Group Members *************************************************************/
 
 class BP_Groups_Group_Members_Template {
-	var $current_member = -1;
-	var $member_count;
-	var $members;
-	var $member;
+	public $current_member = -1;
+	public $member_count;
+	public $members;
+	public $member;
 
-	var $in_the_loop;
+	public $in_the_loop;
 
-	var $pag_page;
-	var $pag_num;
-	var $pag_links;
-	var $total_group_count;
+	public $pag_page;
+	public $pag_num;
+	public $pag_links;
+	public $total_group_count;
 
 	/**
 	 * Constructor.
 	 *
 	 * @param array $args {
 	 *     An array of optional arguments.
-	 *     @type int $group_id ID of the group whose members are being
-	 *	     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
-	 *           results. Default: 20.
-	 *     @type int $max Optional. Max number of items to return.
-	 *     @type array $exclude Optional. Array of user IDs to exclude.
-	 *     @type bool|int True (or 1) to exclude admins and mods from
-	 *           results. Default: 1.
-	 *     @type bool|int True (or 1) to exclude banned users from results.
-	 *           Default: 1.
-	 *     @type array $group_role Optional. Array of group roles to include.
-	 *     @type string $search_terms Optional. Search terms to match.
+	 *     @type int      $group_id           ID of the group whose members are being
+	 *	                                      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
+	 *                                        results. Default: 20.
+	 *     @type int      $max                Optional. Max number of items to return.
+	 *     @type array    $exclude            Optional. Array of user IDs to exclude.
+	 *     @type bool|int $exclude_admin_mods True (or 1) to exclude admins and mods from
+	 *                                        results. Default: 1.
+	 *     @type bool|int $exclude_banned     True (or 1) to exclude banned users from results.
+	 *                                        Default: 1.
+	 *     @type array    $group_role         Optional. Array of group roles to include.
+	 *     @type string   $search_terms       Optional. Search terms to match.
 	 * }
 	 */
-	function __construct( $args = array() ) {
+	public function __construct( $args = array() ) {
 
 		// Backward compatibility with old method of passing arguments
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
@@ -2646,6 +3671,7 @@ class BP_Groups_Group_Members_Template {
 			'group_id'            => bp_get_current_group_id(),
 			'page'                => 1,
 			'per_page'            => 20,
+			'page_arg'            => 'mlpage',
 			'max'                 => false,
 			'exclude'             => false,
 			'exclude_admins_mods' => 1,
@@ -2655,18 +3681,16 @@ class BP_Groups_Group_Members_Template {
 			'type'                => 'last_joined',
 		) );
 
-		// @todo No
-		extract( $r );
-
-		$this->pag_page = isset( $_REQUEST['mlpage'] ) ? intval( $_REQUEST['mlpage'] ) : $r['page'];
-		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
+		$this->pag_arg  = sanitize_key( $r['page_arg'] );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
 
 		/**
 		 * Check the current group is the same as the supplied group ID.
 		 * It can differ when using {@link bp_group_has_members()} outside the Groups screens.
 		 */
 		$current_group = groups_get_current_group();
-		if ( ! $current_group || $current_group && $current_group->id !== bp_get_current_group_id() ) {
+		if ( empty( $current_group ) || ( $current_group && $current_group->id !== bp_get_current_group_id() ) ) {
 			$current_group = groups_get_group( array( 'group_id' => $r['group_id'] ) );
 		}
 
@@ -2681,61 +3705,74 @@ class BP_Groups_Group_Members_Template {
 		$members_args['page']     = $this->pag_page;
 		$members_args['per_page'] = $this->pag_num;
 
+		// Get group members for this loop
 		$this->members = groups_get_group_members( $members_args );
 
-		if ( !$max || $max >= (int) $this->members['count'] )
+		if ( empty( $r['max'] ) || ( $r['max'] >= (int) $this->members['count'] ) ) {
 			$this->total_member_count = (int) $this->members['count'];
-		else
-			$this->total_member_count = (int) $max;
+		} else {
+			$this->total_member_count = (int) $r['max'];
+		}
 
+		// Reset members array for subsequent looping
 		$this->members = $this->members['members'];
 
-		if ( $max ) {
-			if ( $max >= count($this->members) )
-				$this->member_count = count($this->members);
-			else
-				$this->member_count = (int) $max;
+		if ( empty( $r['max'] ) || ( $r['max'] >= count( $this->members ) ) ) {
+			$this->member_count = (int) count( $this->members );
 		} else {
-			$this->member_count = count($this->members);
+			$this->member_count = (int) $r['max'];
 		}
 
 		$this->pag_links = paginate_links( array(
-			'base' => add_query_arg( array( 'mlpage' => '%#%' ), $base_url ),
-			'format' => '',
-			'total' => !empty( $this->pag_num ) ? ceil( $this->total_member_count / $this->pag_num ) : $this->total_member_count,
-			'current' => $this->pag_page,
+			'base'      => add_query_arg( array( $this->pag_arg => '%#%' ), $base_url ),
+			'format'    => '',
+			'total'     => ! empty( $this->pag_num ) ? ceil( $this->total_member_count / $this->pag_num ) : $this->total_member_count,
+			'current'   => $this->pag_page,
 			'prev_text' => '&larr;',
 			'next_text' => '&rarr;',
-			'mid_size' => 1
-		));
+			'mid_size'  => 1,
+			'add_args'  => array(),
+		) );
 	}
 
-	function has_members() {
-		if ( $this->member_count )
+	public function has_members() {
+		if ( ! empty( $this->member_count ) ) {
 			return true;
+		}
 
 		return false;
 	}
 
-	function next_member() {
+	public function next_member() {
 		$this->current_member++;
-		$this->member = $this->members[$this->current_member];
+		$this->member = $this->members[ $this->current_member ];
 
 		return $this->member;
 	}
 
-	function rewind_members() {
+	public function rewind_members() {
 		$this->current_member = -1;
 		if ( $this->member_count > 0 ) {
 			$this->member = $this->members[0];
 		}
 	}
 
-	function members() {
-		if ( $this->current_member + 1 < $this->member_count ) {
+	public function members() {
+		$tick = intval( $this->current_member + 1 );
+		if ( $tick < $this->member_count ) {
 			return true;
-		} elseif ( $this->current_member + 1 == $this->member_count ) {
-			do_action('loop_end');
+		} elseif ( $tick == $this->member_count ) {
+
+			/**
+			 * Fires right before the rewinding of members list.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 * @since BuddyPress (2.3.0) `$this` parameter added.
+			 *
+			 * @param BP_Groups_Group_Members_Template $this Instance of the current Members template.
+			 */
+			do_action( 'loop_end', $this );
+
 			// Do some cleaning up after the loop
 			$this->rewind_members();
 		}
@@ -2744,40 +3781,52 @@ class BP_Groups_Group_Members_Template {
 		return false;
 	}
 
-	function the_member() {
-
+	public function the_member() {
 		$this->in_the_loop = true;
 		$this->member      = $this->next_member();
 
-		if ( 0 == $this->current_member ) // loop has just started
-			do_action('loop_start');
+		// loop has just started
+		if ( 0 == $this->current_member ) {
+
+			/**
+			 * Fires if the current member item is the first in the members list.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 * @since BuddyPress (2.3.0) `$this` parameter added.
+			 *
+			 * @param BP_Groups_Group_Members_Template $this Instance of the current Members template.
+			 */
+			do_action( 'loop_start', $this );
+		}
 	}
 }
 
 /**
  * Initialize a group member query loop.
  *
- * @param array $args {
+ * @param array|string $args {
  *     An array of optional arguments.
- *     @type int $group_id ID of the group whose members are being 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 results.
- *           Default: 20.
- *     @type int $max Optional. Max number of items to return.
- *     @type array $exclude Optional. Array of user IDs to exclude.
- *     @type bool|int True (or 1) to exclude admins and mods from results.
- *           Default: 1.
- *     @type bool|int True (or 1) to exclude banned users from results.
- *           Default: 1.
- *     @type array $group_role Optional. Array of group roles to include.
- *     @type string $type Optional. Sort order of results. 'last_joined',
- *           'first_joined', or any of the $type params available in
- *           {@link BP_User_Query}. Default: 'last_joined'.
- *     @type string $search_terms Optional. Search terms to match. Pass an
- *           empty string to force-disable search, even in the presence of
- *           $_REQUEST['s']. Default: null.
+ *     @type int      $group_id           ID of the group whose members are being 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 results.
+ *                                        Default: 20.
+ *     @type int      $max                Optional. Max number of items to return.
+ *     @type array    $exclude            Optional. Array of user IDs to exclude.
+ *     @type bool|int $exclude_admin_mods True (or 1) to exclude admins and mods from results.
+ *                                        Default: 1.
+ *     @type bool|int $exclude_banned     True (or 1) to exclude banned users from results.
+ *                                        Default: 1.
+ *     @type array    $group_role         Optional. Array of group roles to include.
+ *     @type string   $type               Optional. Sort order of results. 'last_joined',
+ *                                        'first_joined', or any of the $type params available in
+ *                                        {@link BP_User_Query}. Default: 'last_joined'.
+ *     @type string   $search_terms       Optional. Search terms to match. Pass an
+ *                                        empty string to force-disable search, even in
+ *                                        the presence of $_REQUEST['s']. Default: null.
  * }
+ *
+ * @return bool
  */
 function bp_group_has_members( $args = '' ) {
 	global $members_template;
@@ -2806,6 +3855,15 @@ function bp_group_has_members( $args = '' ) {
 	}
 
 	$members_template = new BP_Groups_Group_Members_Template( $r );
+
+	/**
+	 * Filters whether or not a group member query has members to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool                             $value            Whether there are members to display.
+	 * @param BP_Groups_Group_Members_Template $members_template Object holding the member query results.
+	 */
 	return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template );
 }
 
@@ -2826,7 +3884,7 @@ function bp_group_the_member() {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param array $args {@see bp_core_fetch_avatar()}
+ * @param array|string $args {@see bp_core_fetch_avatar()}
  */
 function bp_group_member_avatar( $args = '' ) {
 	echo bp_get_group_member_avatar( $args );
@@ -2836,7 +3894,9 @@ function bp_group_member_avatar( $args = '' ) {
 	 *
 	 * @since BuddyPress (1.0.0)
 	 *
-	 * @param array $args {@see bp_core_fetch_avatar()}
+	 * @param array|string $args {@see bp_core_fetch_avatar()}
+	 *
+	 * @return string
 	 */
 	function bp_get_group_member_avatar( $args = '' ) {
 		global $members_template;
@@ -2848,6 +3908,14 @@ function bp_group_member_avatar( $args = '' ) {
 			'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
 		) );
 
+		/**
+		 * Filters the group member avatar while in the groups members loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML markup for group member avatar.
+		 * @param array  $r     Parsed args used for the avatar query.
+		 */
 		return apply_filters( 'bp_get_group_member_avatar', bp_core_fetch_avatar( $r ), $r );
 	}
 
@@ -2856,7 +3924,7 @@ function bp_group_member_avatar( $args = '' ) {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param array $args {@see bp_core_fetch_avatar()}
+ * @param array|string $args {@see bp_core_fetch_avatar()}
  */
 
 function bp_group_member_avatar_thumb( $args = '' ) {
@@ -2867,7 +3935,9 @@ function bp_group_member_avatar_thumb( $args = '' ) {
 	 *
 	 * @since BuddyPress (1.0.0)
 	 *
-	 * @param array $args {@see bp_core_fetch_avatar()}
+	 * @param array|string $args {@see bp_core_fetch_avatar()}
+	 *
+	 * @return string
 	 */
 	function bp_get_group_member_avatar_thumb( $args = '' ) {
 		global $members_template;
@@ -2879,6 +3949,14 @@ function bp_group_member_avatar_thumb( $args = '' ) {
 			'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
 		) );
 
+		/**
+		 * Filters the group member avatar thumb while in the groups members loop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value HTML markup for group member avatar thumb.
+		 * @param array  $r     Parsed args used for the avatar query.
+		 */
 		return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( $r ), $r );
 	}
 
@@ -2887,7 +3965,8 @@ function bp_group_member_avatar_thumb( $args = '' ) {
  *
  * @since BuddyPress (1.0.0)
  *
- * @param array $args {@see bp_core_fetch_avatar()}
+ * @param int $width  Width of avatar to fetch.
+ * @param int $height Height of avatar to fetch.
  */
 function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
 	echo bp_get_group_member_avatar_mini( $width, $height );
@@ -2897,7 +3976,10 @@ function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
 	 *
 	 * @since BuddyPress (1.0.0)
 	 *
-	 * @param array $args {@see bp_core_fetch_avatar()}
+	 * @param int $width  Width of avatar to fetch.
+	 * @param int $height Height of avatar to fetch.
+	 *
+	 * @return string
 	 */
 	function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) {
 		global $members_template;
@@ -2911,6 +3993,14 @@ function bp_group_member_avatar_mini( $width = 30, $height = 30 ) {
 			'height'  => absint( $height )
 		) );
 
+		/**
+		 * Filters the group member avatar mini while in the groups members loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML markup for group member avatar mini.
+		 * @param array  $r     Parsed args used for the avatar query.
+		 */
 		return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( $r ), $r );
 	}
 
@@ -2920,6 +4010,13 @@ function bp_group_member_name() {
 	function bp_get_group_member_name() {
 		global $members_template;
 
+		/**
+		 * Filters the group member display name of the current user in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $display_name Display name of the current user.
+		 */
 		return apply_filters( 'bp_get_group_member_name', $members_template->member->display_name );
 	}
 
@@ -2929,6 +4026,13 @@ function bp_group_member_url() {
 	function bp_get_group_member_url() {
 		global $members_template;
 
+		/**
+		 * Filters the group member url for the current user in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for the current user.
+		 */
 		return apply_filters( 'bp_get_group_member_url', bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) );
 	}
 
@@ -2938,6 +4042,13 @@ function bp_group_member_link() {
 	function bp_get_group_member_link() {
 		global $members_template;
 
+		/**
+		 * Filters the group member HTML link for the current user in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML link for the current user.
+		 */
 		return apply_filters( 'bp_get_group_member_link', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $members_template->member->display_name . '</a>' );
 	}
 
@@ -2947,6 +4058,13 @@ function bp_group_member_domain() {
 	function bp_get_group_member_domain() {
 		global $members_template;
 
+		/**
+		 * Filters the group member domain for the current user in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Domain for the current user.
+		 */
 		return apply_filters( 'bp_get_group_member_domain', bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) );
 	}
 
@@ -2956,11 +4074,21 @@ function bp_group_member_is_friend() {
 	function bp_get_group_member_is_friend() {
 		global $members_template;
 
-		if ( !isset( $members_template->member->is_friend ) )
+		if ( !isset( $members_template->member->is_friend ) ) {
 			$friend_status = 'not_friends';
-		else
-			$friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';
+		} else {
+			$friend_status = ( 0 == $members_template->member->is_friend )
+				? 'pending'
+				: 'is_friend';
+		}
 
+		/**
+		 * Filters the friendship status between current user and displayed user in group member loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $friend_status Current status of the friendship.
+		 */
 		return apply_filters( 'bp_get_group_member_is_friend', $friend_status );
 	}
 
@@ -2970,14 +4098,30 @@ function bp_group_member_is_banned() {
 	function bp_get_group_member_is_banned() {
 		global $members_template;
 
+		/**
+		 * Filters whether the member is banned from the current group.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param bool $is_banned Whether or not the member is banned.
+		 */
 		return apply_filters( 'bp_get_group_member_is_banned', $members_template->member->is_banned );
 	}
 
 function bp_group_member_css_class() {
 	global $members_template;
 
-	if ( $members_template->member->is_banned )
+	if ( $members_template->member->is_banned ) {
+
+		/**
+		 * Filters the class to add to the HTML if member is banned.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value HTML class to add.
+		 */
 		echo apply_filters( 'bp_group_member_css_class', 'banned-user' );
+	}
 }
 
 function bp_group_member_joined_since() {
@@ -2986,6 +4130,13 @@ function bp_group_member_joined_since() {
 	function bp_get_group_member_joined_since() {
 		global $members_template;
 
+		/**
+		 * Filters the joined since time for the current member in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Joined since time.
+		 */
 		return apply_filters( 'bp_get_group_member_joined_since', bp_core_get_last_activity( $members_template->member->date_modified, __( 'joined %s', 'buddypress') ) );
 	}
 
@@ -2995,14 +4146,22 @@ function bp_group_member_id() {
 	function bp_get_group_member_id() {
 		global $members_template;
 
+		/**
+		 * Filters the member's user ID for group members loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $user_id User ID of the member.
+		 */
 		return apply_filters( 'bp_get_group_member_id', $members_template->member->user_id );
 	}
 
 function bp_group_member_needs_pagination() {
 	global $members_template;
 
-	if ( $members_template->total_member_count > $members_template->pag_num )
+	if ( $members_template->total_member_count > $members_template->pag_num ) {
 		return true;
+	}
 
 	return false;
 }
@@ -3011,6 +4170,14 @@ function bp_group_pag_id() {
 	echo bp_get_group_pag_id();
 }
 	function bp_get_group_pag_id() {
+
+		/**
+		 * Filters the string to be used as the group pag id.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Value to use for the pag id.
+		 */
 		return apply_filters( 'bp_get_group_pag_id', 'pag' );
 	}
 
@@ -3020,6 +4187,14 @@ function bp_group_member_pagination() {
 }
 	function bp_get_group_member_pagination() {
 		global $members_template;
+
+		/**
+		 * Filters the HTML markup to be used for group member listing pagination.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $pag_links HTML markup for the pagination.
+		 */
 		return apply_filters( 'bp_get_group_member_pagination', $members_template->pag_links );
 	}
 
@@ -3030,11 +4205,27 @@ function bp_group_member_pagination_count() {
 		global $members_template;
 
 		$start_num = intval( ( $members_template->pag_page - 1 ) * $members_template->pag_num ) + 1;
-		$from_num = bp_core_number_format( $start_num );
-		$to_num = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
-		$total = bp_core_number_format( $members_template->total_member_count );
+		$from_num  = bp_core_number_format( $start_num );
+		$to_num    = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
+		$total     = bp_core_number_format( $members_template->total_member_count );
+
+		if ( 1 == $members_template->total_member_count ) {
+			$message = __( 'Viewing 1 member', 'buddypress' );
+		} else {
+			$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s member', 'Viewing %1$s - %2$s of %3$s groups', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
+		}
 
-		return apply_filters( 'bp_get_group_member_pagination_count', sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
+		/**
+		 * Filters the "Viewing x-y of z members" pagination message.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value    "Viewing x-y of z members" text.
+		 * @param string $from_num Total amount for the low value in the range.
+		 * @param string $to_num   Total amount for the high value in the range.
+		 * @param string $total    Total amount of members found.
+		 */
+		return apply_filters( 'bp_get_group_member_pagination_count', $message, $from_num, $to_num, $total );
 	}
 
 function bp_group_member_admin_pagination() {
@@ -3050,7 +4241,7 @@ function bp_group_member_admin_pagination() {
 /**
  * Output the Group members template
  *
- * @since BuddyPress (?)
+ * @since BuddyPress (2.0.0)
  *
  * @return string html output
  */
@@ -3063,7 +4254,16 @@ function bp_groups_members_template_part() {
 			</li>
 
 			<?php bp_groups_members_filter(); ?>
-			<?php do_action( 'bp_members_directory_member_sub_types' ); ?>
+			<?php
+
+			/**
+			 * Fires at the end of the group members search unordered list.
+			 *
+			 * Part of bp_groups_members_template_part().
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'bp_members_directory_member_sub_types' ); ?>
 
 		</ul>
 	</div>
@@ -3079,7 +4279,7 @@ function bp_groups_members_template_part() {
 /**
  * Output the Group members filters
  *
- * @since BuddyPress (?)
+ * @since BuddyPress (2.0.0)
  *
  * @return string html output
  */
@@ -3097,7 +4297,16 @@ function bp_groups_members_filter() {
 
 			<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-			<?php do_action( 'bp_groups_members_order_options' ); ?>
+			<?php
+
+			/**
+			 * Fires at the end of the Group members filters select input.
+			 *
+			 * Useful for plugins to add more filter options.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 */
+			do_action( 'bp_groups_members_order_options' ); ?>
 
 		</select>
 	</li>
@@ -3120,9 +4329,11 @@ function bp_groups_members_filter() {
  * @return bool True if user can create groups. False otherwise.
  */
 function bp_user_can_create_groups() {
+
 	// Super admin can always create groups
-	if ( bp_current_user_can( 'bp_moderate' ) )
+	if ( bp_current_user_can( 'bp_moderate' ) ) {
 		return true;
+	}
 
 	// Get group creation option, default to 0 (allowed)
 	$restricted = (int) bp_get_option( 'bp_restrict_group_creation', 0 );
@@ -3131,17 +4342,27 @@ function bp_user_can_create_groups() {
 	$can_create = true;
 
 	// Are regular users restricted?
-	if ( $restricted )
+	if ( $restricted ) {
 		$can_create = false;
+	}
 
+	/**
+	 * Filters if the current logged in user can create groups.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param bool $can_create Whether the person can create groups.
+	 * @param int  $restricted Whether or not group creation is restricted.
+	 */
 	return apply_filters( 'bp_user_can_create_groups', $can_create, $restricted );
 }
 
 function bp_group_creation_tabs() {
-	global $bp;
+	$bp = buddypress();
 
-	if ( !is_array( $bp->groups->group_creation_steps ) )
+	if ( !is_array( $bp->groups->group_creation_steps ) ) {
 		return false;
+	}
 
 	if ( !bp_get_groups_current_create_step() ) {
 		$keys = array_keys( $bp->groups->group_creation_steps );
@@ -3153,18 +4374,30 @@ function bp_group_creation_tabs() {
 	foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) {
 		$is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?>
 
-		<li<?php if ( bp_get_groups_current_create_step() == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() ?>/create/step/<?php echo $slug ?>/"><?php else: ?><span><?php endif; ?><?php echo $counter ?>. <?php echo $step['name'] ?><?php if ( $is_enabled ) : ?></a><?php else: ?></span><?php endif ?></li><?php
+		<li<?php if ( bp_get_groups_current_create_step() == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php bp_groups_directory_permalink(); ?>create/step/<?php echo $slug ?>/"><?php else: ?><span><?php endif; ?><?php echo $counter ?>. <?php echo $step['name'] ?><?php if ( $is_enabled ) : ?></a><?php else: ?></span><?php endif ?></li><?php
 		$counter++;
 	}
 
 	unset( $is_enabled );
 
+	/**
+	 * Fires at the end of the creation of the group tabs.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'groups_creation_tabs' );
 }
 
 function bp_group_creation_stage_title() {
-	global $bp;
+	$bp = buddypress();
 
+	/**
+	 * Filters the group creation stage title.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param string $value HTML markup for the group creation stage title.
+	 */
 	echo apply_filters( 'bp_group_creation_stage_title', '<span>&mdash; ' . $bp->groups->group_creation_steps[bp_get_groups_current_create_step()]['name'] . '</span>' );
 }
 
@@ -3172,53 +4405,68 @@ function bp_group_creation_form_action() {
 	echo bp_get_group_creation_form_action();
 }
 	function bp_get_group_creation_form_action() {
-		global $bp;
+		$bp = buddypress();
 
 		if ( !bp_action_variable( 1 ) ) {
 			$keys = array_keys( $bp->groups->group_creation_steps );
 			$bp->action_variables[1] = array_shift( $keys );
 		}
 
-		return apply_filters( 'bp_get_group_creation_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) ) );
+		/**
+		 * Filters the group creation form action.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Action to be used with group creation form.
+		 */
+		return apply_filters( 'bp_get_group_creation_form_action', trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . bp_action_variable( 1 ) ) );
 	}
 
 function bp_is_group_creation_step( $step_slug ) {
-	global $bp;
 
-	/* Make sure we are in the groups component */
-	if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) )
+	// Make sure we are in the groups component
+	if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) {
 		return false;
+	}
 
-	/* If this the first step, we can just accept and return true */
+	$bp = buddypress();
+
+	// 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 )
+	if ( !bp_action_variable( 1 ) && array_shift( $keys ) == $step_slug ) {
 		return true;
+	}
 
-	/* Before allowing a user to see a group creation step we must make sure previous steps are completed */
+	// Before allowing a user to see a group creation step we must make sure
+	// previous steps are completed
 	if ( !bp_is_first_group_creation_step() ) {
-		if ( !bp_are_previous_group_creation_steps_complete( $step_slug ) )
+		if ( !bp_are_previous_group_creation_steps_complete( $step_slug ) ) {
 			return false;
+		}
 	}
 
-	/* Check the current step against the step parameter */
-	if ( bp_is_action_variable( $step_slug ) )
+	// Check the current step against the step parameter
+	if ( bp_is_action_variable( $step_slug ) ) {
 		return true;
+	}
 
 	return false;
 }
 
 function bp_is_group_creation_step_complete( $step_slugs ) {
-	global $bp;
+	$bp = buddypress();
 
-	if ( !isset( $bp->groups->completed_create_steps ) )
+	if ( !isset( $bp->groups->completed_create_steps ) ) {
 		return false;
+	}
 
 	if ( is_array( $step_slugs ) ) {
 		$found = true;
 
 		foreach ( (array) $step_slugs as $step_slug ) {
-			if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) )
+			if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) ) {
 				$found = false;
+			}
 		}
 
 		return $found;
@@ -3230,20 +4478,23 @@ function bp_is_group_creation_step_complete( $step_slugs ) {
 }
 
 function bp_are_previous_group_creation_steps_complete( $step_slug ) {
-	global $bp;
+	$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 )
+	if ( array_shift( $keys ) == $step_slug ) {
 		return true;
+	}
 
 	reset( $bp->groups->group_creation_steps );
-	unset( $previous_steps );
 
-	/* Get previous steps */
+	$previous_steps = array();
+
+	// Get previous steps
 	foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
-		if ( $slug == $step_slug )
+		if ( $slug === $step_slug ) {
 			break;
+		}
 
 		$previous_steps[] = $slug;
 	}
@@ -3255,13 +4506,18 @@ function bp_new_group_id() {
 	echo bp_get_new_group_id();
 }
 	function bp_get_new_group_id() {
-		global $bp;
-
-		if ( isset( $bp->groups->new_group_id ) )
-			$new_group_id = $bp->groups->new_group_id;
-		else
-			$new_group_id = 0;
+		$bp           = buddypress();
+		$new_group_id = isset( $bp->groups->new_group_id )
+			? $bp->groups->new_group_id
+			: 0;
 
+		/**
+		 * Filters the new group ID.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $new_group_id ID of the new group.
+		 */
 		return apply_filters( 'bp_get_new_group_id', $new_group_id );
 	}
 
@@ -3269,13 +4525,18 @@ function bp_new_group_name() {
 	echo bp_get_new_group_name();
 }
 	function bp_get_new_group_name() {
-		global $bp;
-
-		if ( isset( $bp->groups->current_group->name ) )
-			$name = $bp->groups->current_group->name;
-		else
-			$name = '';
+		$bp   = buddypress();
+		$name = isset( $bp->groups->current_group->name )
+			? $bp->groups->current_group->name
+			: '';
 
+		/**
+		 * Filters the new group name.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $name Name of the new group.
+		 */
 		return apply_filters( 'bp_get_new_group_name', $name );
 	}
 
@@ -3283,13 +4544,18 @@ function bp_new_group_description() {
 	echo bp_get_new_group_description();
 }
 	function bp_get_new_group_description() {
-		global $bp;
-
-		if ( isset( $bp->groups->current_group->description ) )
-			$description = $bp->groups->current_group->description;
-		else
-			$description = '';
+		$bp          = buddypress();
+		$description = isset( $bp->groups->current_group->description )
+			? $bp->groups->current_group->description
+			: '';
 
+		/**
+		 * Filters the new group description.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $name Description of the new group.
+		 */
 		return apply_filters( 'bp_get_new_group_description', $description );
 	}
 
@@ -3297,58 +4563,102 @@ function bp_new_group_enable_forum() {
 	echo bp_get_new_group_enable_forum();
 }
 	function bp_get_new_group_enable_forum() {
-		global $bp;
-		return (int) apply_filters( 'bp_get_new_group_enable_forum', $bp->groups->current_group->enable_forum );
+		$bp    = buddypress();
+		$forum = isset( $bp->groups->current_group->enable_forum )
+			? $bp->groups->current_group->enable_forum
+			: false;
+
+		/**
+		 * Filters whether or not to enable forums for the new group.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $forum Whether or not to enable forums.
+		 */
+		return (int) apply_filters( 'bp_get_new_group_enable_forum', $forum );
 	}
 
 function bp_new_group_status() {
 	echo bp_get_new_group_status();
 }
 	function bp_get_new_group_status() {
-		global $bp;
-		return apply_filters( 'bp_get_new_group_status', $bp->groups->current_group->status );
+		$bp     = buddypress();
+		$status = isset( $bp->groups->current_group->status )
+			? $bp->groups->current_group->status
+			: 'public';
+
+		/**
+		 * Filters the new group status.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $status Status for the new group.
+		 */
+		return apply_filters( 'bp_get_new_group_status', $status );
 	}
 
 function bp_new_group_avatar( $args = '' ) {
 	echo bp_get_new_group_avatar( $args );
 }
 	function bp_get_new_group_avatar( $args = '' ) {
-		global $bp;
+		$bp = buddypress();
 
-		$defaults = array(
-			'type' => 'full',
-			'width' => false,
-			'height' => false,
-			'class' => 'avatar',
-			'id' => 'avatar-crop-preview',
-			'alt' => __( 'Group avatar', 'buddypress' ),
+		$r = wp_parse_args( $args, array(
+			'type'    => 'full',
+			'width'   => false,
+			'height'  => false,
+			'class'   => 'avatar',
+			'id'      => 'avatar-crop-preview',
+			'alt'     => __( 'Group avatar', 'buddypress' ),
 			'no_grav' => false
-		);
+		) );
 
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
+		$r = array_merge( $r, array(
+			'item_id'    => $bp->groups->current_group->id,
+			'object'     => 'group',
+			'avatar_dir' => 'group-avatars',
+		) );
+
+		$avatar = bp_core_fetch_avatar( $r );
 
-		return apply_filters( 'bp_get_new_group_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'no_grav' => $no_grav ) ) );
+		/**
+		 * Filters the new group avatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $avatar HTML markup for the new group avatar.
+		 * @param array  $r      Array of parsed arguments for the group avatar.
+		 * @param array  $args   Array of original arguments passed to the function.
+		 */
+		return apply_filters( 'bp_get_new_group_avatar', $avatar, $r, $args );
 	}
 
 function bp_group_creation_previous_link() {
 	echo bp_get_group_creation_previous_link();
 }
 	function bp_get_group_creation_previous_link() {
-		global $bp;
+		$bp = buddypress();
 
 		foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
-			if ( bp_is_action_variable( $slug ) )
+			if ( bp_is_action_variable( $slug ) ) {
 				break;
+			}
 
 			$previous_steps[] = $slug;
 		}
 
-		return apply_filters( 'bp_get_group_creation_previous_link', trailingslashit( bp_get_root_domain() ) . bp_get_groups_root_slug() . '/create/step/' . array_pop( $previous_steps ) );
+		/**
+		 * Filters the permalink for the previous step with the group creation process.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Permalink for the previous step.
+		 */
+		return apply_filters( 'bp_get_group_creation_previous_link', trailingslashit( bp_get_groups_directory_permalink() . 'create/step/' . array_pop( $previous_steps ) ) );
 	}
 
 /**
- * Echoes the current group creation step
+ * Echoes the current group creation step.
  *
  * @since BuddyPress (1.6.0)
  */
@@ -3356,15 +4666,16 @@ function bp_groups_current_create_step() {
 	echo bp_get_groups_current_create_step();
 }
 	/**
-	 * Returns the current group creation step. If none is found, returns an empty string
+	 * Returns the current group creation step. If none is found, returns an empty string.
 	 *
 	 * @since BuddyPress (1.6.0)
 	 *
-	 * @uses apply_filters() Filter bp_get_groups_current_create_step to modify
+	 * @uses apply_filters() Filter bp_get_groups_current_create_step to modify.
+	 *
 	 * @return string $current_create_step
 	 */
 	function bp_get_groups_current_create_step() {
-		global $bp;
+		$bp = buddypress();
 
 		if ( !empty( $bp->groups->current_create_step ) ) {
 			$current_create_step = $bp->groups->current_create_step;
@@ -3372,29 +4683,40 @@ function bp_groups_current_create_step() {
 			$current_create_step = '';
 		}
 
+		/**
+		 * Filters the current group creation step.
+		 *
+		 * If none is found, returns an empty string.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $current_create_step Current step in the group creation process.
+		 */
 		return apply_filters( 'bp_get_groups_current_create_step', $current_create_step );
 	}
 
 function bp_is_last_group_creation_step() {
-	global $bp;
+	$bp = buddypress();
 
 	$keys      = array_keys( $bp->groups->group_creation_steps );
 	$last_step = array_pop( $keys );
 
-	if ( $last_step == bp_get_groups_current_create_step() )
+	if ( $last_step == bp_get_groups_current_create_step() ) {
 		return true;
+	}
 
 	return false;
 }
 
 function bp_is_first_group_creation_step() {
-	global $bp;
+	$bp = buddypress();
 
 	$keys       = array_keys( $bp->groups->group_creation_steps );
 	$first_step = array_shift( $keys );
 
-	if ( $first_step == bp_get_groups_current_create_step() )
+	if ( $first_step == bp_get_groups_current_create_step() ) {
 		return true;
+	}
 
 	return false;
 }
@@ -3403,10 +4725,11 @@ function bp_new_group_invite_friend_list() {
 	echo bp_get_new_group_invite_friend_list();
 }
 	function bp_get_new_group_invite_friend_list( $args = '' ) {
-		global $bp;
+		$bp = buddypress();
 
-		if ( !bp_is_active( 'friends' ) )
+		if ( !bp_is_active( 'friends' ) ) {
 			return false;
+		}
 
 		$defaults = array(
 			'group_id'  => false,
@@ -3416,8 +4739,9 @@ function bp_new_group_invite_friend_list() {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
-		if ( empty( $group_id ) )
+		if ( empty( $group_id ) ) {
 			$group_id = !empty( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : $bp->groups->current_group->id;
+		}
 
 		if ( $friends = friends_get_friends_invite_list( bp_loggedin_user_id(), $group_id ) ) {
 			$invites = groups_get_invites_for_group( bp_loggedin_user_id(), $group_id );
@@ -3426,16 +4750,18 @@ function bp_new_group_invite_friend_list() {
 				$checked = '';
 
 				if ( !empty( $invites ) ) {
-					if ( in_array( $friends[$i]['id'], $invites ) )
+					if ( in_array( $friends[$i]['id'], $invites ) ) {
 						$checked = ' checked="checked"';
+					}
 				}
 
 				$items[] = '<' . $separator . '><input' . $checked . ' type="checkbox" name="friends[]" id="f-' . $friends[$i]['id'] . '" value="' . esc_attr( $friends[$i]['id'] ) . '" /> ' . $friends[$i]['full_name'] . '</' . $separator . '>';
 			}
 		}
 
-		if ( !empty( $items ) )
+		if ( !empty( $items ) ) {
 			return implode( "\n", (array) $items );
+		}
 
 		return false;
 	}
@@ -3450,31 +4776,38 @@ function bp_directory_groups_search_form() {
 		<input type="submit" id="groups_search_submit" name="groups_search_submit" value="'. __( 'Search', 'buddypress' ) .'" />
 	</form>';
 
+	/**
+	 * Filters the HTML markup for the groups search form.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $search_form_html HTML markup for the search form.
+	 */
 	echo apply_filters( 'bp_directory_groups_search_form', $search_form_html );
 
 }
 
 /**
- * Displays group header tabs
+ * Displays group header tabs.
  *
  * @todo Deprecate?
  */
 function bp_groups_header_tabs() {
-	global $bp;?>
+	$user_groups = bp_displayed_user_domain() . bp_get_groups_slug(); ?>
 
-	<li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-joined' ) ?>"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/most-popular' ) ?>"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/admin-of' ) ?>"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/mod-of' ) ?>"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
-	<li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
+	<li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/recently-active' ); ?>"><?php _e( 'Recently Active', 'buddypress' ); ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/recently-joined' ); ?>"><?php _e( 'Recently Joined',  'buddypress' ); ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'most-popular',    0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/most-popular'    ); ?>"><?php _e( 'Most Popular',     'buddypress' ); ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'admin-of',        0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/admin-of'        ); ?>"><?php _e( 'Administrator Of', 'buddypress' ); ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'mod-of',          0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/mod-of'          ); ?>"><?php _e( 'Moderator Of',     'buddypress' ); ?></a></li>
+	<li<?php if ( bp_is_action_variable( 'alphabetically'     ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $user_groups . '/my-groups/alphabetically'  ); ?>"><?php _e( 'Alphabetically',   'buddypress' ); ?></a></li>
 
 <?php
 	do_action( 'groups_header_tabs' );
 }
 
 /**
- * Displays group filter titles
+ * Displays group filter titles.
  *
  * @todo Deprecate?
  */
@@ -3510,6 +4843,7 @@ function bp_groups_filter_title() {
  * @since BuddyPress (1.1.0)
  *
  * @param string $slug
+ *
  * @return bool
  */
 function bp_is_group_admin_screen( $slug = '' ) {
@@ -3517,7 +4851,7 @@ function bp_is_group_admin_screen( $slug = '' ) {
 }
 
 /**
- * Echoes the current group admin tab slug
+ * Echoes the current group admin tab slug.
  *
  * @since BuddyPress (1.6.0)
  */
@@ -3525,12 +4859,13 @@ function bp_group_current_admin_tab() {
 	echo bp_get_group_current_admin_tab();
 }
 	/**
-	 * Returns the current group admin tab slug
+	 * Returns the current group admin tab slug.
 	 *
 	 * @since BuddyPress (1.6.0)
 	 *
-	 * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value
-	 * @return string $tab The current tab's slug
+	 * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value.
+	 *
+	 * @return string $tab The current tab's slug.
 	 */
 	function bp_get_group_current_admin_tab() {
 		if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) ) {
@@ -3539,25 +4874,30 @@ function bp_group_current_admin_tab() {
 			$tab = '';
 		}
 
+		/**
+		 * Filters the current group admin tab slug.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $tab Current group admin tab slug.
+		 */
 		return apply_filters( 'bp_get_current_group_admin_tab', $tab );
 	}
 
-/************************************************************************************
- * Group Avatar Template Tags
- **/
+/** Group Avatar Template Tags ************************************************/
 
 /**
- * Outputs the current group avatar
+ * Outputs the current group avatar.
  *
  * @since BuddyPress (1.0.0)
  * @param string $type thumb or full ?
- * @uses bp_get_group_current_avatar() to get the avatar of the current group
+ * @uses bp_get_group_current_avatar() to get the avatar of the current group.
  */
 function bp_group_current_avatar( $type = 'thumb' ) {
 	echo bp_get_group_current_avatar( $type );
 }
 	/**
-	 * Returns the current group avatar
+	 * Returns the current group avatar.
 	 *
 	 * @since BuddyPress (2.0.0)
 	 *
@@ -3575,26 +4915,36 @@ function bp_group_current_avatar( $type = 'thumb' ) {
 			'class'      => 'avatar'
 		) );
 
+		/**
+		 * Filters the current group avatar.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $group_avatar HTML markup for current group avatar.
+		 */
 		return apply_filters( 'bp_get_group_current_avatar', $group_avatar );
 	}
 
+/**
+ * Return whether a group has an avatar.
+ *
+ * @since BuddyPress (1.1.0)
+ *
+ * @param  int|bool $group_id
+ *
+ * @return boolean
+ */
 function bp_get_group_has_avatar( $group_id = false ) {
-	global $bp;
 
 	if ( false === $group_id ) {
 		$group_id = bp_get_current_group_id();
 	}
 
-	// Todo - this looks like an overgeneral check
-	if ( ! empty( $_FILES ) ) {
-		return false;
-	}
-
 	$group_avatar = bp_core_fetch_avatar( array(
 		'item_id' => $group_id,
-		'object' => 'group',
+		'object'  => 'group',
 		'no_grav' => true,
-		'html' => false,
+		'html'    => false,
 	) );
 
 	if ( bp_core_avatar_default( 'local' ) === $group_avatar ) {
@@ -3608,8 +4958,15 @@ function bp_group_avatar_delete_link() {
 	echo bp_get_group_avatar_delete_link();
 }
 	function bp_get_group_avatar_delete_link() {
-		global $bp;
+		$bp = buddypress();
 
+		/**
+		 * Filters the URL to delete the group avatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value URL to delete the group avatar.
+		 */
 		return apply_filters( 'bp_get_group_avatar_delete_link', wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/group-avatar/delete', 'bp_group_avatar_delete' ) );
 	}
 
@@ -3633,37 +4990,34 @@ function bp_custom_group_fields() {
 	do_action( 'groups_custom_group_fields' );
 }
 
-
-/************************************************************************************
- * Membership Requests Template Tags
- **/
+/** Group Membership Requests *************************************************/
 
 class BP_Groups_Membership_Requests_Template {
-	var $current_request = -1;
-	var $request_count;
-	var $requests;
-	var $request;
+	public $current_request = -1;
+	public $request_count;
+	public $requests;
+	public $request;
 
-	var $in_the_loop;
+	public $in_the_loop;
 
-	var $pag_page;
-	var $pag_num;
-	var $pag_links;
-	var $total_request_count;
+	public $pag_page;
+	public $pag_num;
+	public $pag_links;
+	public $total_request_count;
 
 	/**
 	 * Constructor method.
 	 *
 	 * @param array $args {
 	 *     @type int $group_id ID of the group whose membership requests
-	 *           are being queried. Default: current group id.
+	 *                         are being queried. Default: current group id.
 	 *     @type int $per_page Number of records to return per page of
-	 *           results. Default: 10.
-	 *     @type int $page Page of results to show. Default: 1.
-	 *     @type int $max Max items to return. Default: false (show all)
+	 *                         results. Default: 10.
+	 *     @type int $page     Page of results to show. Default: 1.
+	 *     @type int $max      Max items to return. Default: false (show all)
 	 * }
 	 */
-	function __construct( $args = array() ) {
+	public function __construct( $args = array() ) {
 
 		// Backward compatibility with old method of passing arguments
 		if ( ! is_array( $args ) || func_num_args() > 1 ) {
@@ -3680,15 +5034,17 @@ class BP_Groups_Membership_Requests_Template {
 		}
 
 		$r = wp_parse_args( $args, array(
-			'group_id' => bp_get_current_group_id(),
-			'per_page' => 10,
 			'page'     => 1,
+			'per_page' => 10,
+			'page_arg' => 'mrpage',
 			'max'      => false,
 			'type'     => 'first_joined',
+			'group_id' => bp_get_current_group_id(),
 		) );
 
-		$this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : $r['page'];
-		$this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $r['per_page'];
+		$this->pag_arg  = sanitize_key( $r['page_arg'] );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
 
 		$mquery = new BP_Group_Member_Query( array(
 			'group_id' => $r['group_id'],
@@ -3716,57 +5072,65 @@ class BP_Groups_Membership_Requests_Template {
 			$this->requests[ $rk ]->group_id   = $r['group_id'];
 		}
 
-		if ( !$r['max'] || $r['max'] >= (int) $mquery->total_users )
+		if ( empty( $r['max'] ) || ( $r['max'] >= (int) $mquery->total_users ) ) {
 			$this->total_request_count = (int) $mquery->total_users;
-		else
+		} else {
 			$this->total_request_count = (int) $r['max'];
+		}
 
-		if ( $r['max'] ) {
-			if ( $r['max'] >= count($this->requests) )
-				$this->request_count = count($this->requests);
-			else
-				$this->request_count = (int) $r['max'];
+		if ( empty( $r['max'] ) || ( $r['max'] >= count( $this->requests ) ) ) {
+			$this->request_count = count( $this->requests );
 		} else {
-			$this->request_count = count($this->requests);
+			$this->request_count = (int) $r['max'];
 		}
 
 		$this->pag_links = paginate_links( array(
-			'base' => add_query_arg( 'mrpage', '%#%' ),
-			'format' => '',
-			'total' => ceil( $this->total_request_count / $this->pag_num ),
-			'current' => $this->pag_page,
+			'base'      => add_query_arg( $this->pag_arg, '%#%' ),
+			'format'    => '',
+			'total'     => ceil( $this->total_request_count / $this->pag_num ),
+			'current'   => $this->pag_page,
 			'prev_text' => '&larr;',
 			'next_text' => '&rarr;',
-			'mid_size' => 1
+			'mid_size'  => 1,
+			'add_args'  => array(),
 		) );
 	}
 
-	function has_requests() {
-		if ( $this->request_count )
+	public function has_requests() {
+		if ( ! empty( $this->request_count ) ) {
 			return true;
+		}
 
 		return false;
 	}
 
-	function next_request() {
+	public function next_request() {
 		$this->current_request++;
-		$this->request = $this->requests[$this->current_request];
+		$this->request = $this->requests[ $this->current_request ];
 
 		return $this->request;
 	}
 
-	function rewind_requests() {
+	public function rewind_requests() {
 		$this->current_request = -1;
 
-		if ( $this->request_count > 0 )
+		if ( $this->request_count > 0 ) {
 			$this->request = $this->requests[0];
+		}
 	}
 
-	function requests() {
-		if ( $this->current_request + 1 < $this->request_count ) {
+	public function requests() {
+		$tick = intval( $this->current_request + 1 );
+		if ( $tick < $this->request_count ) {
 			return true;
-		} elseif ( $this->current_request + 1 == $this->request_count ) {
-			do_action('group_request_loop_end');
+		} elseif ( $tick == $this->request_count ) {
+
+			/**
+			 * Fires right before the rewinding of group membership requests list.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'group_request_loop_end' );
 			// Do some cleaning up after the loop
 			$this->rewind_requests();
 		}
@@ -3775,23 +5139,31 @@ class BP_Groups_Membership_Requests_Template {
 		return false;
 	}
 
-	function the_request() {
+	public function the_request() {
 		$this->in_the_loop = true;
 		$this->request     = $this->next_request();
 
-		if ( 0 == $this->current_request ) // loop has just started
-			do_action('group_request_loop_start');
+		// loop has just started
+		if ( 0 == $this->current_request ) {
+
+			/**
+			 * Fires if the current group membership request item is the first in the loop.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'group_request_loop_start' );
+		}
 	}
 }
 
 /**
  * Initialize a group membership request template loop.
  *
- * @param array $args {
+ * @param array|string $args {
  *     @type int $group_id ID of the group. Defaults to current group.
  *     @type int $per_page Number of records to return per page. Default: 10.
- *     @type int $page Page of results to return. Default: 1.
- *     @type int $max Max number of items to return. Default: false.
+ *     @type int $page     Page of results to return. Default: 1.
+ *     @type int $max      Max number of items to return. Default: false.
  * }
  * @return bool True if there are requests, otherwise false.
  */
@@ -3808,6 +5180,15 @@ function bp_group_has_membership_requests( $args = '' ) {
 	$r = wp_parse_args( $args, $defaults );
 
 	$requests_template = new BP_Groups_Membership_Requests_Template( $r );
+
+	/**
+	 * Filters whether or not a group membership query has requests to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool                                   $value             Whether there are requests to display.
+	 * @param BP_Groups_Membership_Requests_Template $requests_template Object holding the requests query results.
+	 */
 	return apply_filters( 'bp_group_has_membership_requests', $requests_template->has_requests(), $requests_template );
 }
 
@@ -3826,6 +5207,13 @@ function bp_group_the_membership_request() {
 function bp_group_request_user_avatar_thumb() {
 	global $requests_template;
 
+	/**
+	 * Filters the requesting user's avatar thumbnail.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value HTML markup for the user's avatar thumbnail.
+	 */
 	echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $requests_template->request->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $requests_template->request->user_id ) ) ) ) );
 }
 
@@ -3835,6 +5223,13 @@ function bp_group_request_reject_link() {
 	function bp_get_group_request_reject_link() {
 		global $requests_template;
 
+		/**
+		 * Filters the URL to use to reject a membership request.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value URL to use to reject a membership request.
+		 */
 		return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/reject/' . $requests_template->request->membership_id, 'groups_reject_membership_request' ) );
 	}
 
@@ -3844,6 +5239,13 @@ function bp_group_request_accept_link() {
 	function bp_get_group_request_accept_link() {
 		global $requests_template;
 
+		/**
+		 * Filters the URL to use to accept a membership request.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value URL to use to accept a membership request.
+		 */
 		return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/accept/' . $requests_template->request->membership_id, 'groups_accept_membership_request' ) );
 	}
 
@@ -3853,18 +5255,39 @@ function bp_group_request_user_link() {
 	function bp_get_group_request_user_link() {
 		global $requests_template;
 
+		/**
+		 * Filters the URL for the user requesting membership.
+		 *
+		 * @since BuddyPress (1.2.6)
+		 *
+		 * @param string $value URL for the user requestion membership.
+		 */
 		return apply_filters( 'bp_get_group_request_user_link', bp_core_get_userlink( $requests_template->request->user_id ) );
 	}
 
 function bp_group_request_time_since_requested() {
 	global $requests_template;
 
+	/**
+	 * Filters the formatted time since membership was requested.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Formatted time since membership was requested.
+	 */
 	echo apply_filters( 'bp_group_request_time_since_requested', sprintf( __( 'requested %s', 'buddypress' ), bp_core_time_since( strtotime( $requests_template->request->date_modified ) ) ) );
 }
 
 function bp_group_request_comment() {
 	global $requests_template;
 
+	/**
+	 * Filters the membership request comment left by user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Membership request comment left by user.
+	 */
 	echo apply_filters( 'bp_group_request_comment', strip_tags( stripslashes( $requests_template->request->comments ) ) );
 }
 
@@ -3885,6 +5308,14 @@ function bp_group_requests_pagination_links() {
 	 */
 	function bp_get_group_requests_pagination_links() {
 		global $requests_template;
+
+		/**
+		 * Filters pagination links for group membership requests.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $value Pagination links for group membership requests.
+		 */
 		return apply_filters( 'bp_get_group_requests_pagination_links', $requests_template->pag_links );
 	}
 
@@ -3911,25 +5342,39 @@ function bp_group_requests_pagination_count() {
 		$to_num    = bp_core_number_format( ( $start_num + ( $requests_template->pag_num - 1 ) > $requests_template->total_request_count ) ? $requests_template->total_request_count : $start_num + ( $requests_template->pag_num - 1 ) );
 		$total     = bp_core_number_format( $requests_template->total_request_count );
 
-		return apply_filters( 'bp_get_group_requests_pagination_count', sprintf( _n( 'Viewing 1 request', 'Viewing %1$s - %2$s of %3$s requests', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
+		if ( 1 == $requests_template->total_request_count ) {
+			$message = __( 'Viewing 1 request', 'buddypress' );
+		} else {
+			$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s request', 'Viewing %1$s - %2$s of %3$s requests', $requests_template->total_request_count, 'buddypress' ), $from_num, $to_num, $total );
+		}
+
+		/**
+		 * Filters pagination count text for group membership requests.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $message  Pagination count text for group membership requests.
+		 * @param string $from_num Total amount for the low value in the range.
+		 * @param string $to_num   Total amount for the high value in the range.
+		 * @param string $total    Total amount of members found.
+		 */
+		return apply_filters( 'bp_get_group_requests_pagination_count', $message, $from_num, $to_num, $total );
 	}
 
-/************************************************************************************
- * Invite Friends Template Tags
- **/
+/** Group Invitations *********************************************************/
 
 class BP_Groups_Invite_Template {
-	var $current_invite = -1;
-	var $invite_count;
-	var $invites;
-	var $invite;
+	public $current_invite = -1;
+	public $invite_count;
+	public $invites;
+	public $invite;
 
-	var $in_the_loop;
+	public $in_the_loop;
 
-	var $pag_page;
-	var $pag_num;
-	var $pag_links;
-	var $total_invite_count;
+	public $pag_page;
+	public $pag_num;
+	public $pag_links;
+	public $total_invite_count;
 
 	public function __construct( $args = array() ) {
 
@@ -3947,14 +5392,16 @@ class BP_Groups_Invite_Template {
 		}
 
 		$r = wp_parse_args( $args, array(
-			'user_id'  => bp_loggedin_user_id(),
-			'group_id' => bp_get_current_group_id(),
 			'page'     => 1,
 			'per_page' => 10,
+			'page_arg' => 'invitepage',
+			'user_id'  => bp_loggedin_user_id(),
+			'group_id' => bp_get_current_group_id(),
 		) );
 
-		$this->pag_num  = intval( $r['per_page'] );
-		$this->pag_page = isset( $_REQUEST['invitepage'] ) ? intval( $_REQUEST['invitepage'] ) : $r['page'];
+		$this->pag_arg  = sanitize_key( $r['page_arg'] );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
 
 		$iquery = new BP_Group_Member_Query( array(
 			'group_id' => $r['group_id'],
@@ -3966,54 +5413,68 @@ class BP_Groups_Invite_Template {
 			'is_confirmed' => false,
 			'inviter_id'   => $r['user_id'],
 		) );
-		$this->invite_data = $iquery->results;
 
+		$this->invite_data        = $iquery->results;
 		$this->total_invite_count = $iquery->total_users;
-		$this->invites		  = array_values( wp_list_pluck( $this->invite_data, 'ID' ) );
+		$this->invites            = array_values( wp_list_pluck( $this->invite_data, 'ID' ) );
 		$this->invite_count       = count( $this->invites );
 
 		// If per_page is set to 0 (show all results), don't generate
 		// pag_links
 		if ( ! empty( $this->pag_num ) ) {
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( 'invitepage', '%#%' ),
+				'base'      => add_query_arg( $this->pag_arg, '%#%' ),
 				'format'    => '',
 				'total'     => ceil( $this->total_invite_count / $this->pag_num ),
 				'current'   => $this->pag_page,
 				'prev_text' => '&larr;',
 				'next_text' => '&rarr;',
 				'mid_size'  => 1,
+				'add_args'  => array(),
 			) );
 		} else {
 			$this->pag_links = '';
 		}
 	}
 
-	function has_invites() {
-		if ( $this->invite_count )
+	public function has_invites() {
+		if ( ! empty( $this->invite_count ) ) {
 			return true;
+		}
 
 		return false;
 	}
 
-	function next_invite() {
+	public function next_invite() {
 		$this->current_invite++;
-		$this->invite = $this->invites[$this->current_invite];
+		$this->invite = $this->invites[ $this->current_invite ];
 
 		return $this->invite;
 	}
 
-	function rewind_invites() {
+	public function rewind_invites() {
 		$this->current_invite = -1;
-		if ( $this->invite_count > 0 )
+		if ( $this->invite_count > 0 ) {
 			$this->invite = $this->invites[0];
+		}
 	}
 
-	function invites() {
-		if ( $this->current_invite + 1 < $this->invite_count ) {
+	public function invites() {
+		$tick = intval( $this->current_invite + 1 );
+		if ( $tick < $this->invite_count ) {
 			return true;
-		} elseif ( $this->current_invite + 1 == $this->invite_count ) {
-			do_action('loop_end');
+		} elseif ( $tick == $this->invite_count ) {
+
+			/**
+			 * Fires right before the rewinding of invites list.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 * @since BuddyPress (2.3.0) `$this` parameter added.
+			 *
+			 * @param BP_Groups_Invite_Template $this Instance of the current Invites template.
+			 */
+			do_action( 'loop_end', $this );
+
 			// Do some cleaning up after the loop
 			$this->rewind_invites();
 		}
@@ -4022,13 +5483,14 @@ class BP_Groups_Invite_Template {
 		return false;
 	}
 
-	function the_invite() {
+	public function the_invite() {
 		global $group_id;
-		$this->in_the_loop      = true;
-		$user_id                = $this->next_invite();
 
-		$this->invite           = new stdClass;
-		$this->invite->user     = $this->invite_data[ $user_id ];
+		$this->in_the_loop  = true;
+		$user_id            = $this->next_invite();
+
+		$this->invite       = new stdClass;
+		$this->invite->user = $this->invite_data[ $user_id ];
 
 		// This method previously populated the user object with
 		// BP_Core_User. We manually configure BP_Core_User data for
@@ -4037,7 +5499,7 @@ class BP_Groups_Invite_Template {
 			$this->invite->user->profile_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
 		}
 
-		$this->invite->user->avatar       = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
+		$this->invite->user->avatar       = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full',  'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
 		$this->invite->user->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
 		$this->invite->user->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ), 'width' => 30, 'height' => 30 ) );
 		$this->invite->user->email        = $this->invite->user->user_email;
@@ -4054,16 +5516,24 @@ class BP_Groups_Invite_Template {
 			$this->invite->user->total_friends = BP_Friends_Friendship::total_friend_count( $user_id );
 		}
 
-		if ( bp_is_active( 'friends' ) ) {
-			$this->invite->user->total_friends = BP_Friends_Friendship::total_friend_count( $user_id );
-		}
-
 		$this->invite->user->total_blogs = null;
 
-		$this->invite->group_id = $group_id; // Globaled in bp_group_has_invites()
-
-		if ( 0 == $this->current_invite ) // loop has just started
-			do_action('loop_start');
+		// Global'ed in bp_group_has_invites()
+		$this->invite->group_id = $group_id;
+
+		// loop has just started
+		if ( 0 == $this->current_invite ) {
+
+			/**
+			 * Fires if the current invite item is the first in the loop.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 * @since BuddyPress (2.3.0) `$this` parameter added.
+			 *
+			 * @param BP_Groups_Invite_Template $this Instance of the current Invites template.
+			 */
+			do_action( 'loop_start', $this );
+		}
 	}
 }
 
@@ -4095,6 +5565,15 @@ function bp_group_has_invites( $args = '' ) {
 	}
 
 	$invites_template = new BP_Groups_Invite_Template( $r );
+
+	/**
+	 * Filters whether or not a group invites query has invites to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool                      $value            Whether there are requests to display.
+	 * @param BP_Groups_Invite_Template $invites_template Object holding the invites query results.
+	 */
 	return apply_filters( 'bp_group_has_invites', $invites_template->has_invites(), $invites_template );
 }
 
@@ -4116,6 +5595,13 @@ function bp_group_invite_item_id() {
 	function bp_get_group_invite_item_id() {
 		global $invites_template;
 
+		/**
+		 * Filters the group invite item ID.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Group invite item ID.
+		 */
 		return apply_filters( 'bp_get_group_invite_item_id', 'uid-' . $invites_template->invite->user->id );
 	}
 
@@ -4125,6 +5611,13 @@ function bp_group_invite_user_avatar() {
 	function bp_get_group_invite_user_avatar() {
 		global $invites_template;
 
+		/**
+		 * Filters the group invite user avatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Group invite user avatar.
+		 */
 		return apply_filters( 'bp_get_group_invite_user_avatar', $invites_template->invite->user->avatar_thumb );
 	}
 
@@ -4134,6 +5627,13 @@ function bp_group_invite_user_link() {
 	function bp_get_group_invite_user_link() {
 		global $invites_template;
 
+		/**
+		 * Filters the group invite user link.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Group invite user link.
+		 */
 		return apply_filters( 'bp_get_group_invite_user_link', bp_core_get_userlink( $invites_template->invite->user->id ) );
 	}
 
@@ -4143,6 +5643,13 @@ function bp_group_invite_user_last_active() {
 	function bp_get_group_invite_user_last_active() {
 		global $invites_template;
 
+		/**
+		 * Filters the group invite user's last active time.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Group invite user's last active time.
+		 */
 		return apply_filters( 'bp_get_group_invite_user_last_active', $invites_template->invite->user->last_active );
 	}
 
@@ -4155,7 +5662,7 @@ function bp_group_invite_user_remove_invite_url() {
 		$user_id = intval( $invites_template->invite->user->id );
 
 		if ( bp_is_current_action( 'create' ) ) {
-			$uninvite_url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-invites/?user_id=' . $user_id;
+			$uninvite_url = bp_get_groups_directory_permalink() . 'create/step/group-invites/?user_id=' . $user_id;
 		} else {
 			$uninvite_url = bp_get_group_permalink( groups_get_current_group() ) . 'send-invites/remove/' . $user_id;
 		}
@@ -4180,6 +5687,14 @@ function bp_group_invite_pagination_links() {
 	 */
 	function bp_get_group_invite_pagination_links() {
 		global $invites_template;
+
+		/**
+		 * Filters the pagination links for group invitations.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $value Pagination links for group invitations.
+		 */
 		return apply_filters( 'bp_get_group_invite_pagination_links', $invites_template->pag_links );
 	}
 
@@ -4206,21 +5721,29 @@ function bp_group_invite_pagination_count() {
 		$to_num    = bp_core_number_format( ( $start_num + ( $invites_template->pag_num - 1 ) > $invites_template->total_invite_count ) ? $invites_template->total_invite_count : $start_num + ( $invites_template->pag_num - 1 ) );
 		$total     = bp_core_number_format( $invites_template->total_invite_count );
 
-		return apply_filters( 'bp_get_groups_pagination_count', sprintf( _n( 'Viewing 1 invitation', 'Viewing %1$s - %2$s of %3$s invitations', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total );
+		if ( 1 == $invites_template->total_invite_count ) {
+			$message = __( 'Viewing 1 invitation', 'buddypress' );
+		} else {
+			$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'buddypress' ), $from_num, $to_num, $total );
+		}
+
+		/** This filter is documented in bp-groups/bp-groups-template.php */
+		return apply_filters( 'bp_get_groups_pagination_count', $message, $from_num, $to_num, $total );
 	}
 
-/***
- * Groups RSS Feed Template Tags
- */
+/** Group RSS *****************************************************************/
 
 /**
- * Hook group activity feed to <head>
+ * Hook group activity feed to <head>.
  *
  * @since BuddyPress (1.5.0)
  */
 function bp_groups_activity_feed() {
-	if ( !bp_is_active( 'groups' ) || !bp_is_active( 'activity' ) || !bp_is_group() )
-		return; ?>
+
+	// 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;
+	} ?>
 
 	<link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />
 
@@ -4228,15 +5751,39 @@ function bp_groups_activity_feed() {
 }
 add_action( 'bp_head', 'bp_groups_activity_feed' );
 
+/**
+ * Output the current group activity-stream RSS URL.
+ *
+ * @since BuddyPress (1.5.0)
+ */
 function bp_group_activity_feed_link() {
 	echo bp_get_group_activity_feed_link();
 }
+	/**
+	 * Return the current group activity-stream RSS URL.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @return string
+	 */
 	function bp_get_group_activity_feed_link() {
-		return apply_filters( 'bp_get_group_activity_feed_link', bp_get_group_permalink( groups_get_current_group() ) . 'feed/' );
+		$current_group = groups_get_current_group();
+		$group_link    = bp_get_group_permalink( $current_group ) . 'feed';
+		$feed_link     = trailingslashit( $group_link );
+
+		/**
+		 * Filters the current group activity-stream RSS URL.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $feed_link Current group activity-stream RSS URL.
+		 */
+		return apply_filters( 'bp_get_group_activity_feed_link', $feed_link );
 	}
 
+/** Current Group *************************************************************/
+
 /**
- * Echoes the output of bp_get_current_group_id()
+ * Echoes the output of bp_get_current_group_id().
  *
  * @since BuddyPress (1.5.0)
  */
@@ -4244,22 +5791,30 @@ function bp_current_group_id() {
 	echo bp_get_current_group_id();
 }
 	/**
-	 * Returns the ID of the current group
+	 * Returns the ID of the current group.
 	 *
 	 * @since BuddyPress (1.5.0)
-	 * @uses apply_filters() Filter bp_get_current_group_id to modify this output
+	 * @uses apply_filters() Filter bp_get_current_group_id to modify this output.
 	 *
-	 * @return int $current_group_id The id of the current group, if there is one
+	 * @return int $current_group_id The id of the current group, if there is one.
 	 */
 	function bp_get_current_group_id() {
 		$current_group    = groups_get_current_group();
 		$current_group_id = isset( $current_group->id ) ? (int) $current_group->id : 0;
 
+		/**
+		 * Filters the ID of the current group.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int    $current_group_id ID of the current group.
+		 * @param object $current_group    Instance holding the current group.
+		 */
 		return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
 	}
 
 /**
- * Echoes the output of bp_get_current_group_slug()
+ * Echoes the output of bp_get_current_group_slug().
  *
  * @since BuddyPress (1.5.0)
  */
@@ -4267,45 +5822,64 @@ function bp_current_group_slug() {
 	echo bp_get_current_group_slug();
 }
 	/**
-	 * Returns the slug of the current group
+	 * Returns the slug of the current group.
 	 *
 	 * @since BuddyPress (1.5.0)
-	 * @uses apply_filters() Filter bp_get_current_group_slug to modify this output
+	 * @uses apply_filters() Filter bp_get_current_group_slug to modify this output.
 	 *
-	 * @return string $current_group_slug The slug of the current group, if there is one
+	 * @return string $current_group_slug The slug of the current group, if there is one.
 	 */
 	function bp_get_current_group_slug() {
 		$current_group      = groups_get_current_group();
 		$current_group_slug = isset( $current_group->slug ) ? $current_group->slug : '';
 
+		/**
+		 * Filters the slug of the current group.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $current_group_slug Slug of the current group.
+		 * @param object $current_group      Instance holding the current group.
+		 */
 		return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group );
 	}
 
 /**
- * Echoes the output of bp_get_current_group_name()
+ * Echoes the output of bp_get_current_group_name().
  *
+ * @since BuddyPress (1.5.0)
  */
 function bp_current_group_name() {
 	echo bp_get_current_group_name();
 }
 	/**
-	 * Returns the name of the current group
+	 * Returns the name of the current group.
 	 *
 	 * @since BuddyPress (1.5.0)
-	 * @uses apply_filters() Filter bp_get_current_group_name to modify this output
+	 * @uses apply_filters() Filter bp_get_current_group_name to modify this output.
 	 *
-	 * @return string The name of the current group, if there is one
+	 * @return string The name of the current group, if there is one.
 	 */
 	function bp_get_current_group_name() {
 		$current_group      = groups_get_current_group();
 		$current_group_name = isset( $current_group->name ) ? $current_group->name : '';
+
+		/** This filter is documented in bp-groups/bp-groups-template.php */
 		$name               = apply_filters( 'bp_get_group_name', $current_group_name );
 
+		/**
+		 * Filters the name of the current group.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $name          Name of the current group.
+		 * @param object $current_group Instance holding the current group.
+		 */
 		return apply_filters( 'bp_get_current_group_name', $name, $current_group );
 	}
 
 /**
- * Echoes the output of bp_get_current_group_description()
+ * Echoes the output of bp_get_current_group_description().
  *
  * @since BuddyPress (2.1.0)
  */
@@ -4313,43 +5887,62 @@ function bp_current_group_description() {
 	echo bp_get_current_group_description();
 }
 	/**
-	 * Returns the description of the current group
+	 * Returns the description of the current group.
 	 *
 	 * @since BuddyPress (2.1.0)
 	 * @uses apply_filters() Filter bp_get_current_group_description to modify
-	 *                       this output
+	 *                       this output.
 	 *
-	 * @return string The description of the current group, if there is one
+	 * @return string The description of the current group, if there is one.
 	 */
 	function bp_get_current_group_description() {
 		$current_group      = groups_get_current_group();
 		$current_group_desc = isset( $current_group->description ) ? $current_group->description : '';
+
+		/**
+		 * Filters the description of the current group.
+		 *
+		 * This filter is used to apply extra filters related to formatting.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $current_group_desc Description of the current group.
+		 */
 		$desc               = apply_filters( 'bp_get_group_description', $current_group_desc );
 
+		/**
+		 * Filters the description of the current group.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $desc Description of the current group.
+		 */
 		return apply_filters( 'bp_get_current_group_description', $desc );
 	}
 
 /**
- * Output a URL for a group component action
+ * Output a URL for a group component action.
  *
  * @since BuddyPress (1.2.0)
  *
  * @param string $action
  * @param string $query_args
  * @param bool $nonce
+ *
  * @return string
  */
 function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
 	echo bp_get_groups_action_link( $action, $query_args, $nonce );
 }
 	/**
-	 * Get a URL for a group component action
+	 * Get a URL for a group component action.
 	 *
 	 * @since BuddyPress (1.2.0)
 	 *
 	 * @param string $action
 	 * @param string $query_args
 	 * @param bool $nonce
+	 *
 	 * @return string
 	 */
 	function bp_get_groups_action_link( $action = '', $query_args = '', $nonce = false ) {
@@ -4383,7 +5976,16 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false )
 			}
 		}
 
-		// Return the url
+		/**
+		 * Filters a URL for a group component action.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $url        URL for a group component action.
+		 * @param string $action     Action being taken for the group.
+		 * @param string $query_args Query arguments being passed.
+		 * @param bool   $nonce      Whether or not to add a nonce.
+		 */
 		return apply_filters( 'bp_get_groups_action_link', $url, $action, $query_args, $nonce );
 	}
 
@@ -4394,8 +5996,9 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false )
  *
  * @since BuddyPress (2.0.0)
  *
- * @param array $args before|after|user_id
- * @uses bp_groups_get_profile_stats() to get the stats
+ * @param array|string $args before|after|user_id
+ *
+ * @uses bp_groups_get_profile_stats() to get the stats.
  */
 function bp_groups_profile_stats( $args = '' ) {
 	echo bp_groups_get_profile_stats( $args );
@@ -4407,7 +6010,7 @@ add_action( 'bp_members_admin_user_stats', 'bp_groups_profile_stats', 8, 1 );
  *
  * @since BuddyPress (2.0.0)
  *
- * @param array $args before|after|user_id
+ * @param array|string $args before|after|user_id
  * @return string HTML for stats output.
  */
 function bp_groups_get_profile_stats( $args = '' ) {
@@ -4437,6 +6040,13 @@ function bp_groups_get_profile_stats( $args = '' ) {
 		}
 	}
 
-	// Filter and return
+	/**
+	 * Filters the number of groups in user's profile.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $value HTML for stats output.
+	 * @param array  $r     Array of parsed arguments for query.
+	 */
 	return apply_filters( 'bp_groups_get_profile_stats', $r['output'], $r );
 }
diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php
index 2406866f75ec84f1291dde69b9bf54f079acdd0b..2117aed26cd5a218bedc5d715af461944d039a83 100644
--- a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php
+++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /* Register widgets for groups component */
 function groups_register_widgets() {
@@ -42,6 +42,14 @@ class BP_Groups_Widget extends WP_Widget {
 	}
 
 	function widget( $args, $instance ) {
+
+		/**
+		 * Filters the user ID to use with the widget instance.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Empty user ID.
+		 */
 		$user_id = apply_filters( 'bp_group_widget_user_id', '0' );
 
 		extract( $args );
@@ -52,11 +60,21 @@ class BP_Groups_Widget extends WP_Widget {
 		if ( empty( $instance['title'] ) )
 			$instance['title'] = __( 'Groups', 'buddypress' );
 
-		$title = apply_filters( 'widget_title', $instance['title'] );
+		/**
+		 * Filters the title of the Groups widget.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $instance The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
 
 		echo $before_widget;
 
-		$title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $title . '</a>' : $title;
+		$title = !empty( $instance['link_title'] ) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title;
 
 		echo $before_title . $title . $after_title;
 
@@ -92,7 +110,7 @@ class BP_Groups_Widget extends WP_Widget {
 										printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
 									if ( 'active' == $instance['group_default'] )
 										printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
-									else if ( 'popular' == $instance['group_default'] )
+									elseif ( 'popular' == $instance['group_default'] )
 										bp_group_member_count();
 								?>
 								</span>
@@ -202,9 +220,9 @@ function groups_ajax_widget_groups_list() {
 							<?php
 							if ( 'newest-groups' == $_POST['filter'] ) {
 								printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
-							} else if ( 'recently-active-groups' == $_POST['filter'] ) {
+							} elseif ( 'recently-active-groups' == $_POST['filter'] ) {
 								printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
-							} else if ( 'popular-groups' == $_POST['filter'] ) {
+							} elseif ( 'popular-groups' == $_POST['filter'] ) {
 								bp_group_member_count();
 							}
 							?>
diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-extension.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-extension.php
new file mode 100644
index 0000000000000000000000000000000000000000..02374ddef4359c1393985ca9d5e439866d628513
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-extension.php
@@ -0,0 +1,1699 @@
+<?php
+/**
+ * BuddyPress Groups Classes
+ *
+ * @package BuddyPress
+ * @subpackage GroupsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * API for creating group extensions without having to hardcode the content into
+ * the theme.
+ *
+ * To implement, extend this class. In your constructor, pass an optional array
+ * of arguments to parent::init() to configure your widget. The config array
+ * supports the following values:
+ *   - 'slug' A unique identifier for your extension. This value will be used
+ *     to build URLs, so make it URL-safe.
+ *   - 'name' A translatable name for your extension. This value is used to
+ *     populate the navigation tab, as well as the default titles for admin/
+ *     edit/create tabs.
+ *   - 'visibility' Set to 'public' (default) for your extension (the main tab
+ *     as well as the widget) to be available to anyone who can access the
+ *     group, 'private' otherwise.
+ *   - 'nav_item_position' An integer explaining where the nav item should
+ *     appear in the tab list.
+ *   - 'enable_nav_item' Set to true for your extension's main tab to be
+ *     available to anyone who can access the group.
+ *   - 'nav_item_name' The translatable text you want to appear in the nav tab.
+ *     Defaults to the value of 'name'.
+ *   - 'display_hook' The WordPress action that the widget_display() method is
+ *     hooked to.
+ *   - 'template_file' The template file that will be used to load the content
+ *     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.
+ *
+ * BP_Group_Extension uses the concept of "settings screens". There are three
+ * contexts for settings screens:
+ *   - 'create', which inserts a new step into the group creation process
+ *   - 'edit', which adds a tab for your extension into the Admin section of
+ *     a group
+ *   - 'admin', which adds a metabox to the Groups administration panel in the
+ *     WordPress Dashboard
+ * Each of these settings screens is populated by a pair of methods: one that
+ * creates the markup for the screen, and one that processes form data
+ * submitted from the screen. If your plugin needs screens in all three
+ * contexts, and if the markup and form processing logic will be the same in
+ * each case, you can define two methods to handle all of the screens:
+ *   function settings_screen() {}
+ *   function settings_screen_save() {}
+ * If one or more of your settings screen needs separate logic, you may define
+ * context-specific methods, for example:
+ *   function edit_screen() {}
+ *   function edit_screen_save() {}
+ * BP_Group_Extension will use the more specific methods if they are available.
+ *
+ * You can further customize the settings screens (tab names, etc) by passing
+ * an optional 'screens' parameter to the init array. The format is as follows:
+ *   '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( // ...
+ *   ),
+ * Only provide those arguments that you actually want to change from the
+ * default configuration. BP_Group_Extension will do the rest.
+ *
+ * Note that the 'edit' screen accepts an additional parameter: 'submit_text',
+ * which defines the text of the Submit button automatically added to the Edit
+ * screen of the extension (defaults to 'Save Changes'). Also, the 'admin'
+ * screen accepts two additional parameters: 'metabox_priority' and
+ * 'metabox_context'. See the docs for add_meta_box() for more details on these
+ * arguments.
+ *
+ * Prior to BuddyPress 1.7, group extension configurations were set slightly
+ * differently. The legacy method is still supported, though deprecated.
+ *
+ * @package BuddyPress
+ * @subpackage Groups
+ * @since BuddyPress (1.1.0)
+ */
+class BP_Group_Extension {
+
+	/** Public ************************************************************/
+
+	/**
+	 * Information about this extension's screens.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access public
+	 * @var array
+	 */
+	public $screens = array();
+
+	/**
+	 * The name of the extending class.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access public
+	 * @var string
+	 */
+	public $class_name = '';
+
+	/**
+	 * A ReflectionClass object of the current extension.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access public
+	 * @var ReflectionClass
+	 */
+	public $class_reflection = null;
+
+	/**
+	 * Parsed configuration parameters for the extension.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access public
+	 * @var array
+	 */
+	public $params = array();
+
+	/**
+	 * Raw config params, as passed by the extending class.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @access public
+	 * @var array
+	 */
+	public $params_raw = array();
+
+	/**
+	 * The ID of the current group.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access public
+	 * @var int
+	 */
+	public $group_id = 0;
+
+	/**
+	 * The slug of the current extension.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $slug = '';
+
+	/**
+	 * The translatable name of the current extension.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $name = '';
+
+	/**
+	 * The visibility of the extension tab. 'public' or 'private'.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $visibility = 'public';
+
+	/**
+	 * The numeric position of the main nav item.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $nav_item_position = 81;
+
+	/**
+	 * Whether to show the nav item.
+	 *
+	 * @access public
+	 * @var bool
+	 */
+	public $enable_nav_item = true;
+
+	/**
+	 * Whether the current user should see the navigation item.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @access public
+	 * @var bool
+	 */
+	public $user_can_see_nav_item;
+
+	/**
+	 * Whether the current user can visit the tab.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @access public
+	 * @var bool
+	 */
+	public $user_can_visit;
+
+	/**
+	 * The text of the nav item. Defaults to self::name.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $nav_item_name = '';
+
+	/**
+	 * The WP action that self::widget_display() is attached to.
+	 *
+	 * Default: 'groups_custom_group_boxes'.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $display_hook = 'groups_custom_group_boxes';
+
+	/**
+	 * The template file used to load the plugin content.
+	 *
+	 * Default: 'groups/single/plugins'.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $template_file = 'groups/single/plugins';
+
+	/** Protected *********************************************************/
+
+	/**
+	 * Has the extension been initialized?
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 * @var bool
+	 */
+	protected $initialized = false;
+
+	/**
+	 * Extension properties as set by legacy extensions.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 * @var array
+	 */
+	protected $legacy_properties = array();
+
+	/**
+	 * Converted legacy parameters.
+	 *
+	 * These are the extension properties as set by legacy extensions, but
+	 * then converted to match the new format for params.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 * @var array
+	 */
+	protected $legacy_properties_converted = array();
+
+	/**
+	 * Redirect location as defined by post-edit save callback.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @access protected
+	 * @var string
+	 */
+	protected $post_save_redirect;
+
+	/**
+	 * Miscellaneous data as set by the __set() magic method.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 * @var array
+	 */
+	protected $data = array();
+
+	/** Screen Overrides **************************************************/
+
+	/*
+	 * Screen override methods are how your extension will display content
+	 * and handle form submits. Your extension should only override those
+	 * methods that it needs for its purposes.
+	 */
+
+	/**
+	 * The content of the group tab
+	 *
+	 * @param int|null $group_id
+	 */
+	public function display( $group_id = null ) {}
+
+	/**
+	 * Content displayed in a widget sidebar, if applicable
+	 */
+	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.
+	public function settings_screen( $group_id = null ) {}
+	public function settings_screen_save( $group_id = null ) {}
+	public function edit_screen( $group_id = null ) {}
+	public function edit_screen_save( $group_id = null ) {}
+	public function create_screen( $group_id = null ) {}
+	public function create_screen_save( $group_id = null ) {}
+	public function admin_screen( $group_id = null ) {}
+	public function admin_screen_save( $group_id = null ) {}
+
+	/** Setup *************************************************************/
+
+	/**
+	 * Initialize the extension, using your config settings
+	 *
+	 * Your plugin should call this method at the very end of its
+	 * constructor, like so:
+	 *
+	 *   public function __construct() {
+	 *       $args = array(
+	 *           'slug' => 'my-group-extension',
+	 *           'name' => 'My Group Extension',
+	 *           // ...
+	 *       );
+	 *
+	 *       parent::init( $args );
+	 *   }
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @since BuddyPress (2.1.0) Added 'access' and 'show_tab' arguments
+	 * 		  to $args.
+	 * @param array $args {
+	 *     Array of initialization arguments.
+	 *     @type string $slug Unique, URL-safe identifier for your
+	 *           extension.
+	 *     @type string $name Translatable name for your extension. Used to
+	 *           populate navigation items.
+	 *     @type string $visibility Optional. Set to 'public' for your
+	 *           extension (the main tab as well as the widget) to be
+	 *           available to anyone who can access the group; set to
+	 *           'private' otherwise. Default: 'public'.
+	 *     @type int $nav_item_position Optional. Location of the nav item
+	 *           in the tab list. Default: 81.
+	 *     @type bool $enable_nav_item Optional. Whether the extension's
+	 *           tab should be accessible to anyone who can view the group.
+	 *           Default: true.
+	 *     @type string $nav_item_name Optional. The translatable text you
+	 *           want to appear in the nav tab. Default: the value of $name.
+	 *     @type string $display_hook Optional. The WordPress action that
+	 *           the widget_display() method is hooked to.
+	 *           Default: 'groups_custom_group_boxes'.
+	 *     @type string $template_file Optional. Theme-relative path to the
+	 *           template file BP should use to load the content of your
+	 *           main extension tab. Default: 'groups/single/plugins.php'.
+	 *     @type array $screens A multi-dimensional array of configuration
+	 *           information for the extension screens. See docblock of
+	 *           {@link BP_Group_Extension} for more details.
+	 *     @type string|array $access Which users can visit the plugin's tab.
+	 *			 Possible values: 'anyone', 'loggedin', 'member',
+	 *        	 'mod', 'admin' or 'noone'. ('member', 'mod', 'admin'
+	 *           refer to user's role in group.) Note that 'mod' targets only
+	 *           group moderators. If you want to allow access to group
+	 *           moderators and admins, specify `array( 'mod', 'admin' )`.
+	 * 			 Defaults to 'anyone' for public groups and 'member' for
+	 *			 private groups.
+	 *     @type string|array $show_tab Which users can see the plugin's
+	 *           navigation tab.
+	 *			 Possible values: 'anyone', 'loggedin', 'member',
+	 *        	 'mod', 'admin' or 'noone'. ('member', 'mod', 'admin'
+	 *           refer to user's role in group.) Note that 'mod' targets only
+	 *           group moderators. If you want to show the tab to group
+	 *           moderators and admins, specify `array( 'mod', 'admin' )`.
+	 * 			 Defaults to 'anyone' for public groups and 'member' for
+	 *			 private groups.
+	 * }
+	 */
+	public function init( $args = array() ) {
+		// Store the raw arguments
+		$this->params_raw = $args;
+
+		// Before this init() method was introduced, plugins were
+		// encouraged to set their config directly. For backward
+		// compatibility with these plugins, we detect whether this is
+		// one of those legacy plugins, and parse any legacy arguments
+		// with those passed to init()
+		$this->parse_legacy_properties();
+		$args = $this->parse_args_r( $args, $this->legacy_properties_converted );
+
+		// Parse with defaults
+		$this->params = $this->parse_args_r( $args, array(
+			'slug'              => $this->slug,
+			'name'              => $this->name,
+			'visibility'        => $this->visibility,
+			'nav_item_position' => $this->nav_item_position,
+			'enable_nav_item'   => (bool) $this->enable_nav_item,
+			'nav_item_name'     => $this->nav_item_name,
+			'display_hook'      => $this->display_hook,
+			'template_file'     => $this->template_file,
+			'screens'           => $this->get_default_screens(),
+			'access'            => null,
+			'show_tab'          => null,
+		) );
+
+		$this->initialized = true;
+	}
+
+	/**
+	 * The main setup routine for the extension.
+	 *
+	 * This method contains the primary logic for setting up an extension's
+	 * configuration, setting up backward compatibility for legacy plugins,
+	 * and hooking the extension's screen functions into WP and BP.
+	 *
+	 * Marked 'public' because it must be accessible to add_action().
+	 * However, you should never need to invoke this method yourself - it
+	 * is called automatically at the right point in the load order by
+	 * bp_register_group_extension().
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	public function _register() {
+
+		// 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
+		if ( true !== $this->initialized ) {
+			$this->init();
+		}
+
+		// Set some config values, based on the parsed params
+		$this->group_id          = $this->get_group_id();
+		$this->slug              = $this->params['slug'];
+		$this->name              = $this->params['name'];
+		$this->visibility        = $this->params['visibility'];
+		$this->nav_item_position = $this->params['nav_item_position'];
+		$this->nav_item_name     = $this->params['nav_item_name'];
+		$this->display_hook      = $this->params['display_hook'];
+		$this->template_file     = $this->params['template_file'];
+
+		// Configure 'screens': create, admin, and edit contexts
+		$this->setup_screens();
+
+		// 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
+		$this->setup_legacy_properties();
+
+		// Hook the extension into BuddyPress
+		$this->setup_display_hooks();
+		$this->setup_create_hooks();
+		$this->setup_edit_hooks();
+		$this->setup_admin_hooks();
+	}
+
+	/**
+	 * Set up some basic info about the Extension.
+	 *
+	 * Here we collect the name of the extending class, as well as a
+	 * ReflectionClass that is used in get_screen_callback() to determine
+	 * whether your extension overrides certain callback methods.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function setup_class_info() {
+		if ( empty( $this->class_name ) ) {
+			$this->class_name = get_class( $this );
+		}
+
+		if ( is_null( $this->class_reflection ) ) {
+			$this->class_reflection = new ReflectionClass( $this->class_name );
+		}
+	}
+
+	/**
+	 * Get the current group ID.
+	 *
+	 * Check for:
+	 *   - current group
+	 *   - new group
+	 *   - group admin
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @return int
+	 */
+	public static function get_group_id() {
+
+		// Usually this will work
+		$group_id = bp_get_current_group_id();
+
+		// 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'];
+		}
+
+		// This fallback will only be hit when the create step is very
+		// early
+		if ( empty( $group_id ) && bp_get_new_group_id() ) {
+			$group_id = bp_get_new_group_id();
+		}
+
+		// 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
+		if ( empty( $group_id ) && isset( $_POST['group_id'] ) ) {
+			$group_id = (int) $_POST['group_id'];
+		}
+
+		return $group_id;
+	}
+
+	/**
+	 * Gather configuration data about your screens.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @return array
+	 */
+	protected function get_default_screens() {
+		$this->setup_class_info();
+
+		$screens = array(
+			'create' => array(
+				'position' => 81,
+			),
+			'edit'   => array(
+				'submit_text' => __( 'Save Changes', 'buddypress' ),
+			),
+			'admin'  => array(
+				'metabox_context'  => 'normal',
+				'metabox_priority' => 'core',
+			),
+		);
+
+		foreach ( $screens as $context => &$screen ) {
+			$screen['enabled']     = true;
+			$screen['name']        = $this->name;
+			$screen['slug']        = $this->slug;
+
+			$screen['screen_callback']      = $this->get_screen_callback( $context, 'screen'      );
+			$screen['screen_save_callback'] = $this->get_screen_callback( $context, 'screen_save' );
+		}
+
+		return $screens;
+	}
+
+	/**
+	 * Set up screens array based on params.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function setup_screens() {
+		foreach ( (array) $this->params['screens'] as $context => $screen ) {
+			if ( empty( $screen['slug'] ) ) {
+				$screen['slug'] = $this->slug;
+			}
+
+			if ( empty( $screen['name'] ) ) {
+				$screen['name'] = $this->name;
+			}
+
+			$this->screens[ $context ] = $screen;
+		}
+	}
+
+	/**
+	 * Set up access-related settings for this extension.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 */
+	protected function setup_access_settings() {
+		// Bail if no group ID is available
+		if ( empty( $this->group_id ) ) {
+			return;
+		}
+
+		// Backward compatibility
+		if ( isset( $this->params['enable_nav_item'] ) ) {
+			$this->enable_nav_item = (bool) $this->params['enable_nav_item'];
+		}
+
+		// Tab Access
+		$this->user_can_visit = false;
+
+		// Backward compatibility for components that do not provide
+		// explicit 'access' parameter
+		if ( empty( $this->params['access'] ) ) {
+			if ( false === $this->enable_nav_item ) {
+				$this->params['access'] = 'noone';
+			} else {
+				$group = groups_get_group( array(
+					'group_id' => $this->group_id,
+				) );
+
+				if ( ! empty( $group->status ) && 'public' === $group->status ) {
+					// Tabs in public groups are accessible to anyone by default
+					$this->params['access'] = 'anyone';
+				} else {
+					// All other groups have members-only as the default
+					$this->params['access'] = 'member';
+				}
+			}
+		}
+
+		// Parse multiple access conditions into an array
+		$access_conditions = $this->params['access'];
+		if ( ! is_array( $access_conditions ) ) {
+			$access_conditions = explode( ',', $access_conditions );
+		}
+
+		// If the current user meets at least one condition, the
+		// get access
+		foreach ( $access_conditions as $access_condition ) {
+			if ( $this->user_meets_access_condition( $access_condition ) ) {
+				$this->user_can_visit = true;
+				break;
+			}
+		}
+
+		// Tab Visibility
+		$this->user_can_see_nav_item = false;
+
+		// Backward compatibility for components that do not provide
+		// 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
+				// defined explicitly as such in the
+				// constructor. So we always trust this value
+				$this->params['show_tab'] = 'noone';
+
+			} elseif ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) {
+				// If enable_nav_item or visibility is passed,
+				// we assume this  is a legacy extension.
+				// Legacy behavior is that enable_nav_item=true +
+				// visibility=private implies members-only
+				if ( 'public' !== $this->visibility ) {
+					$this->params['show_tab'] = 'member';
+				} else {
+					$this->params['show_tab'] = 'anyone';
+				}
+
+			} else {
+				// No show_tab or enable_nav_item value is
+				// available, so match the value of 'access'
+				$this->params['show_tab'] = $this->params['access'];
+			}
+		}
+
+		// Parse multiple access conditions into an array
+		$access_conditions = $this->params['show_tab'];
+		if ( ! is_array( $access_conditions ) ) {
+			$access_conditions = explode( ',', $access_conditions );
+		}
+
+		// If the current user meets at least one condition, the
+		// get access
+		foreach ( $access_conditions as $access_condition ) {
+			if ( $this->user_meets_access_condition( $access_condition ) ) {
+				$this->user_can_see_nav_item = true;
+				break;
+			}
+		}
+	}
+
+	/**
+	 * Check whether the current user meets an access condition.
+	 *
+	 * @param string $access_condition 'anyone', 'loggedin', 'member',
+	 *        'mod', 'admin' or 'noone'.
+	 * @return bool
+	 */
+	protected function user_meets_access_condition( $access_condition ) {
+		$group = groups_get_group( array(
+			'group_id' => $this->group_id,
+		) );
+
+		switch ( $access_condition ) {
+			case 'admin' :
+				$meets_condition = groups_is_user_admin( bp_loggedin_user_id(), $this->group_id );
+				break;
+
+			case 'mod' :
+				$meets_condition = groups_is_user_mod( bp_loggedin_user_id(), $this->group_id );
+				break;
+
+			case 'member' :
+				$meets_condition = groups_is_user_member( bp_loggedin_user_id(), $this->group_id );
+				break;
+
+			case 'loggedin' :
+				$meets_condition = is_user_logged_in();
+				break;
+
+			case 'noone' :
+				$meets_condition = false;
+				break;
+
+			case 'anyone' :
+			default :
+				$meets_condition = true;
+				break;
+		}
+
+		return $meets_condition;
+	}
+
+	/** Display ***********************************************************/
+
+	/**
+	 * Hook this extension's group tab into BuddyPress, if necessary.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function setup_display_hooks() {
+
+		// Bail if not a group
+		if ( ! bp_is_group() ) {
+			return;
+		}
+
+		// Backward compatibility only
+		if ( ( 'public' !== $this->visibility ) && ! buddypress()->groups->current_group->user_has_access ) {
+			return;
+		}
+
+		$user_can_see_nav_item = $this->user_can_see_nav_item();
+
+		if ( $user_can_see_nav_item ) {
+			$group_permalink = bp_get_group_permalink( groups_get_current_group() );
+
+			bp_core_new_subnav_item( array(
+				'name'            => ! $this->nav_item_name ? $this->name : $this->nav_item_name,
+				'slug'            => $this->slug,
+				'parent_slug'     => bp_get_current_group_slug(),
+				'parent_url'      => $group_permalink,
+				'position'        => $this->nav_item_position,
+				'item_css_id'     => 'nav-' . $this->slug,
+				'screen_function' => array( &$this, '_display_hook' ),
+				'user_has_access' => $user_can_see_nav_item,
+				'no_access_url'   => $group_permalink,
+			) );
+
+			// 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 );
+				add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
+				add_action( 'bp_template_title',          create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
+			}
+		}
+
+		// Hook the group home widget
+		if ( ! bp_current_action() && bp_is_current_action( 'home' ) ) {
+			add_action( $this->display_hook, array( &$this, 'widget_display' ) );
+		}
+	}
+
+	/**
+	 * Hook the main display method, and loads the template file
+	 */
+	public function _display_hook() {
+		add_action( 'bp_template_content', array( &$this, 'call_display' ) );
+
+		/**
+		 * Filters the template to load for the main display method.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $template_file Path to the template to load.
+		 */
+		bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) );
+	}
+
+	/**
+	 * Call the display() method.
+	 *
+	 * We use this wrapper so that we can pass the group_id to the
+	 * display() callback.
+	 *
+	 * @since BuddyPress (2.1.1)
+	 */
+	public function call_display() {
+		$this->display( $this->group_id );
+	}
+
+	/**
+	 * Determine whether the current user should see this nav tab.
+	 *
+	 * Note that this controls only the display of the navigation item.
+	 * Access to the tab is controlled by the user_can_visit() check.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @return bool
+	 */
+	public function user_can_see_nav_item( $user_can_see_nav_item = false ) {
+		if ( 'noone' !== $this->params['show_tab'] && current_user_can( 'bp_moderate' ) ) {
+			return true;
+		}
+
+		return $this->user_can_see_nav_item;
+	}
+
+	/**
+	 * Determine whether the current user has access to visit this tab.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @return bool
+	 */
+	public function user_can_visit( $user_can_visit = false ) {
+		if ( 'noone' !== $this->params['access'] && current_user_can( 'bp_moderate' ) ) {
+			return true;
+		}
+
+		return $this->user_can_visit;
+	}
+
+	/**
+	 * Filter the access check in bp_groups_group_access_protection() for this extension.
+	 *
+	 * Note that $no_access_args is passed by reference, as there are some
+	 * circumstances where the bp_core_no_access() arguments need to be
+	 * modified before the redirect takes place.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $user_can_visit
+	 * @param array $no_access_args
+	 * @return bool
+	 */
+	public function group_access_protection( $user_can_visit, &$no_access_args ) {
+		$user_can_visit = $this->user_can_visit();
+
+		if ( ! $user_can_visit && is_user_logged_in() ) {
+			$current_group = groups_get_group( array(
+				'group_id' => $this->group_id,
+			) );
+
+			$no_access_args['message'] = __( 'You do not have access to this content.', 'buddypress' );
+			$no_access_args['root'] = bp_get_group_permalink( $current_group ) . 'home/';
+			$no_access_args['redirect'] = false;
+		}
+
+		return $user_can_visit;
+	}
+
+
+	/** Create ************************************************************/
+
+	/**
+	 * Hook this extension's Create step into BuddyPress, if necessary.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function setup_create_hooks() {
+		if ( ! $this->is_screen_enabled( 'create' ) ) {
+			return;
+		}
+
+		$screen = $this->screens['create'];
+
+		// Insert the group creation step for the new group extension
+		buddypress()->groups->group_creation_steps[ $screen['slug'] ] = array(
+			'name'     => $screen['name'],
+			'slug'     => $screen['slug'],
+			'position' => $screen['position'],
+		);
+
+		// The maybe_ methods check to see whether the create_*
+		// callbacks should be invoked (ie, are we on the
+		// correct group creation step). Hooked in separate
+		// methods because current creation step info not yet
+		// 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' ) );
+	}
+
+	/**
+	 * Call the create_screen() method, if we're on the right page.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function maybe_create_screen() {
+		if ( ! bp_is_group_creation_step( $this->screens['create']['slug'] ) ) {
+			return;
+		}
+
+		call_user_func( $this->screens['create']['screen_callback'], $this->group_id );
+		$this->nonce_field( 'create' );
+
+		// The create screen requires an additional nonce field
+		// 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 );
+	}
+
+	/**
+	 * Call the create_screen_save() method, if we're on the right page.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function maybe_create_screen_save() {
+		if ( ! bp_is_group_creation_step( $this->screens['create']['slug'] ) ) {
+			return;
+		}
+
+		$this->check_nonce( 'create' );
+		call_user_func( $this->screens['create']['screen_save_callback'], $this->group_id );
+	}
+
+	/** Edit **************************************************************/
+
+	/**
+	 * Hook this extension's Edit panel into BuddyPress, if necessary.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function setup_edit_hooks() {
+		// Bail if not in a group
+		if ( ! bp_is_group() ) {
+			return;
+		}
+
+		// Bail if not an edit screen
+		if ( ! $this->is_screen_enabled( 'edit' ) || ! bp_is_item_admin() ) {
+			return;
+		}
+
+		$screen = $this->screens['edit'];
+
+		$position = isset( $screen['position'] ) ? (int) $screen['position'] : 10;
+		$position += 40;
+
+		$current_group = groups_get_current_group();
+		$admin_link = trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' );
+
+		$subnav_args = array(
+			'name'            => $screen['name'],
+			'slug'            => $screen['slug'],
+			'parent_slug'     => $current_group->slug . '_manage',
+			'parent_url'      => trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' ),
+			'user_has_access' => bp_is_item_admin(),
+			'position'        => $position,
+			'screen_function' => 'groups_screen_group_admin',
+		);
+
+		// 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
+		bp_core_new_subnav_item( $subnav_args );
+
+		// 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 );
+
+			add_action( 'groups_custom_edit_steps', array( &$this, 'call_edit_screen' ) );
+
+			// Determine the proper template and save for later
+			// loading
+			if ( '' !== bp_locate_template( array( 'groups/single/home.php' ), false ) ) {
+				$this->edit_screen_template = '/groups/single/home';
+			} else {
+				add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
+				add_action( 'bp_template_content', array( &$this, 'call_edit_screen' ) );
+				$this->edit_screen_template = '/groups/single/plugins';
+			}
+
+			// We load the template at bp_screens, to give all
+			// extensions a chance to load
+			add_action( 'bp_screens', array( $this, 'call_edit_screen_template_loader' ) );
+		}
+	}
+
+	/**
+	 * Call the edit_screen() method.
+	 *
+	 * Previous versions of BP_Group_Extension required plugins to provide
+	 * their own Submit button and nonce fields when building markup. In
+	 * BP 1.8, this requirement was lifted - BP_Group_Extension now handles
+	 * all required submit buttons and nonces.
+	 *
+	 * We put the edit screen markup into an output buffer before echoing.
+	 * This is so that we can check for the presence of a hardcoded submit
+	 * button, as would be present in legacy plugins; if one is found, we
+	 * do not auto-add our own button.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function call_edit_screen() {
+		ob_start();
+		call_user_func( $this->screens['edit']['screen_callback'], $this->group_id );
+		$screen = ob_get_contents();
+		ob_end_clean();
+
+		echo $this->maybe_add_submit_button( $screen );
+
+		$this->nonce_field( 'edit' );
+	}
+
+	/**
+	 * Check the nonce, and call the edit_screen_save() method.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function call_edit_screen_save() {
+		if ( empty( $_POST ) ) {
+			return;
+		}
+
+		// When DOING_AJAX, the POST global will be populated, but we
+		// should assume it's a save
+		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
+			return;
+		}
+
+		$this->check_nonce( 'edit' );
+
+		// Detect whether the screen_save_callback is performing a
+		// 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_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id );
+
+		// 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
+		if ( empty( $this->post_save_redirect ) ) {
+
+			/**
+			 * Filters the URL to redirect to after group edit screen save.
+			 *
+			 * Only runs if a redirect has not already occurred.
+			 *
+			 * @since BuddyPress (2.1.0)
+			 *
+			 * @param string $value URL to redirect to.
+			 */
+			$redirect_to = apply_filters( 'bp_group_extension_edit_screen_save_redirect', bp_get_requested_url( ) );
+
+			bp_core_redirect( $redirect_to );
+			die();
+		}
+	}
+
+	/**
+	 * Load the template that houses the Edit screen.
+	 *
+	 * Separated out into a callback so that it can run after all other
+	 * Group Extensions have had a chance to register their navigation, to
+	 * avoid missing tabs.
+	 *
+	 * Hooked to 'bp_screens'.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access public So that do_action() has access. Do not call directly.
+	 *
+	 * @see BP_Group_Extension::setup_edit_hooks()
+	 */
+	public function call_edit_screen_template_loader() {
+		bp_core_load_template( $this->edit_screen_template );
+	}
+
+	/**
+	 * Add a submit button to the edit form, if it needs one.
+	 *
+	 * There's an inconsistency in the way that the group Edit and Create
+	 * screens are rendered: the Create screen has a submit button built
+	 * in, but the Edit screen does not. This function allows plugin
+	 * authors to write markup that does not contain the submit button for
+	 * use on both the Create and Edit screens - BP will provide the button
+	 * if one is not found.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $screen The screen markup, captured in the output
+	 *                       buffer.
+	 *
+	 * @return string $screen The same markup, with a submit button added.
+	 */
+	protected function maybe_add_submit_button( $screen = '' ) {
+		if ( $this->has_submit_button( $screen ) ) {
+			return $screen;
+		}
+
+		return $screen . sprintf(
+			'<div id="%s"><input type="submit" name="save" value="%s" id="%s"></div>',
+			'bp-group-edit-' . $this->slug . '-submit-wrapper',
+			$this->screens['edit']['submit_text'],
+			'bp-group-edit-' . $this->slug . '-submit'
+		);
+	}
+
+	/**
+	 * Does the given markup have a submit button?
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $screen The markup to check.
+	 * @return bool True if a Submit button is found, otherwise false.
+	 */
+	public static function has_submit_button( $screen = '' ) {
+		$pattern = "/<input[^>]+type=[\'\"]submit[\'\"]/";
+		preg_match( $pattern, $screen, $matches );
+		return ! empty( $matches[0] );
+	}
+
+	/**
+	 * Detect redirects hardcoded into edit_screen_save() callbacks.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param string $redirect
+	 *
+	 * @return string
+	 */
+	public function detect_post_save_redirect( $redirect = '' ) {
+		if ( ! empty( $redirect ) ) {
+			$this->post_save_redirect = $redirect;
+		}
+
+		return $redirect;
+	}
+
+	/** Admin *************************************************************/
+
+	/**
+	 * Hook this extension's Admin metabox into BuddyPress, if necessary.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function setup_admin_hooks() {
+		if ( ! $this->is_screen_enabled( 'admin' ) || ! is_admin() ) {
+			return;
+		}
+
+		// 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
+		add_action( 'bp_groups_admin_meta_boxes', array( $this, '_meta_box_display_callback' ) );
+
+		// Catch the metabox save
+		add_action( 'bp_group_admin_edit_after', array( $this, 'call_admin_screen_save' ), 10 );
+	}
+
+	/**
+	 * Call the admin_screen() method, and add a nonce field.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function call_admin_screen() {
+		call_user_func( $this->screens['admin']['screen_callback'], $this->group_id );
+		$this->nonce_field( 'admin' );
+	}
+
+	/**
+	 * Check the nonce, and call the admin_screen_save() method
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function call_admin_screen_save() {
+		$this->check_nonce( 'admin' );
+		call_user_func( $this->screens['admin']['screen_save_callback'], $this->group_id );
+	}
+
+	/**
+	 * Create the Dashboard meta box for this extension.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
+	public function _meta_box_display_callback() {
+		$group_id = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : 0;
+		$screen   = $this->screens['admin'];
+
+		add_meta_box(
+			$screen['slug'],
+			$screen['name'],
+			create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' . $this->slug . '", ' . $group_id . ' );' ),
+			get_current_screen()->id,
+			$screen['metabox_context'],
+			$screen['metabox_priority']
+		);
+	}
+
+
+	/** Utilities *********************************************************/
+
+	/**
+	 * Generate the nonce fields for a settings form.
+	 *
+	 * The nonce field name (the second param passed to wp_nonce_field)
+	 * contains this extension's slug and is thus unique to this extension.
+	 * This is necessary because in some cases (namely, the Dashboard),
+	 * more than one extension may generate nonces on the same page, and we
+	 * must avoid name clashes.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
+	 */
+	public function nonce_field( $context = '' ) {
+		wp_nonce_field( 'bp_group_extension_' . $this->slug . '_' . $context, '_bp_group_' . $context . '_nonce_' . $this->slug );
+	}
+
+	/**
+	 * Check the nonce on a submitted settings form.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
+	 */
+	public function check_nonce( $context = '' ) {
+		check_admin_referer( 'bp_group_extension_' . $this->slug . '_' . $context, '_bp_group_' . $context . '_nonce_' . $this->slug );
+	}
+
+	/**
+	 * Is the specified screen enabled?
+	 *
+	 * To be enabled, a screen must both have the 'enabled' key set to true
+	 * (legacy: $this->enable_create_step, etc), and its screen_callback
+	 * must also exist and be callable.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
+	 * @return bool True if the screen is enabled, otherwise false.
+	 */
+	public function is_screen_enabled( $context = '' ) {
+		$enabled = false;
+
+		if ( isset( $this->screens[ $context ] ) ) {
+			$enabled = $this->screens[ $context ]['enabled'] && is_callable( $this->screens[ $context ]['screen_callback'] );
+		}
+
+		return (bool) $enabled;
+	}
+
+	/**
+	 * Get the appropriate screen callback for the specified context/type.
+	 *
+	 * BP Group Extensions have three special "screen contexts": create,
+	 * admin, and edit. Each of these contexts has a corresponding
+	 * _screen() and _screen_save() method, which allow group extension
+	 * plugins to define different markup and logic for each context.
+	 *
+	 * BP also supports fallback settings_screen() and
+	 * settings_screen_save() methods, which can be used to define markup
+	 * and logic that is shared between context. For each context, you may
+	 * either provide context-specific methods, or you can let BP fall back
+	 * on the shared settings_* callbacks.
+	 *
+	 * For example, consider a BP_Group_Extension implementation that looks
+	 * like this:
+	 *
+	 *   // ...
+	 *   function create_screen( $group_id ) { ... }
+	 *   function create_screen_save( $group_id ) { ... }
+	 *   function settings_screen( $group_id ) { ... }
+	 *   function settings_screen_save( $group_id ) { ... }
+	 *   // ...
+	 *
+	 * BP_Group_Extension will use your create_* methods for the Create
+	 * steps, and will use your generic settings_* methods for the Edit
+	 * and Admin contexts. This schema allows plugin authors maximum
+	 * flexibility without having to repeat themselves.
+	 *
+	 * The get_screen_callback() method uses a ReflectionClass object to
+	 * determine whether your extension has provided a given callback.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $context Screen context. 'create', 'edit', or 'admin'.
+	 * @param string $type Screen type. 'screen' or 'screen_save'. Default:
+	 *        'screen'.
+	 * @return callable A callable function handle.
+	 */
+	public function get_screen_callback( $context = '', $type = 'screen' ) {
+		$callback = '';
+
+		// Try the context-specific callback first
+		$method  = $context . '_' . $type;
+		$rmethod = $this->class_reflection->getMethod( $method );
+		if ( isset( $rmethod->class ) && $this->class_name === $rmethod->class ) {
+			$callback = array( $this, $method );
+		}
+
+		if ( empty( $callback ) ) {
+			$fallback_method  = 'settings_' . $type;
+			$rfallback_method = $this->class_reflection->getMethod( $fallback_method );
+			if ( isset( $rfallback_method->class ) && $this->class_name === $rfallback_method->class ) {
+				$callback = array( $this, $fallback_method );
+			}
+		}
+
+		return $callback;
+	}
+
+	/**
+	 * Recursive argument parsing.
+	 *
+	 * This acts like a multi-dimensional version of wp_parse_args() (minus
+	 * the querystring parsing - you must pass arrays).
+	 *
+	 * Values from $a override those from $b; keys in $b that don't exist
+	 * in $a are passed through.
+	 *
+	 * This is different from array_merge_recursive(), both because of the
+	 * order of preference ($a overrides $b) and because of the fact that
+	 * array_merge_recursive() combines arrays deep in the tree, rather
+	 * than overwriting the b array with the a array.
+	 *
+	 * The implementation of this function is specific to the needs of
+	 * BP_Group_Extension, where we know that arrays will always be
+	 * associative, and that an argument under a given key in one array
+	 * will be matched by a value of identical depth in the other one. The
+	 * function is NOT designed for general use, and will probably result
+	 * in unexpected results when used with data in the wild. See, eg,
+	 * https://core.trac.wordpress.org/ticket/19888
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param array $a First set of arguments.
+	 * @param array $b Second set of arguments.
+	 * @return array Parsed arguments.
+	 */
+	public static function parse_args_r( &$a, $b ) {
+		$a = (array) $a;
+		$b = (array) $b;
+		$r = $b;
+
+		foreach ( $a as $k => &$v ) {
+			if ( is_array( $v ) && isset( $r[ $k ] ) ) {
+				$r[ $k ] = self::parse_args_r( $v, $r[ $k ] );
+			} else {
+				$r[ $k ] = $v;
+			}
+		}
+
+		return $r;
+	}
+
+	/** Legacy Support ********************************************************/
+
+	/*
+	 * In BuddyPress 1.8, the recommended technique for configuring
+	 * extensions changed from directly setting various object properties
+	 * in the class constructor, to passing a configuration array to
+	 * parent::init(). The following methods ensure that extensions created
+	 * in the old way continue to work, by converting legacy configuration
+	 * data to the new format.
+	 */
+
+	/**
+	 * Provide access to otherwise unavailable object properties.
+	 *
+	 * This magic method is here for backward compatibility with plugins
+	 * that refer to config properties that have moved to a different
+	 * location (such as enable_create_step, which is now at
+	 * $this->screens['create']['enabled']
+	 *
+	 * The legacy_properties array is set up in
+	 * self::setup_legacy_properties().
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $key Property name.
+	 * @return mixed The value if found, otherwise null.
+	 */
+	public function __get( $key ) {
+		if ( isset( $this->legacy_properties[ $key ] ) ) {
+			return $this->legacy_properties[ $key ];
+		} elseif ( isset( $this->data[ $key ] ) ) {
+			return $this->data[ $key ];
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Provide a fallback for isset( $this->foo ) when foo is unavailable.
+	 *
+	 * This magic method is here for backward compatibility with plugins
+	 * that have set their class config options directly in the class
+	 * constructor. The parse_legacy_properties() method of the current
+	 * class needs to check whether any legacy keys have been put into the
+	 * $this->data array.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $key Property name.
+	 * @return bool True if the value is set, otherwise false.
+	 */
+	public function __isset( $key ) {
+		if ( isset( $this->legacy_properties[ $key ] ) ) {
+			return true;
+		} elseif ( isset( $this->data[ $key ] ) ) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * Allow plugins to set otherwise unavailable object properties.
+	 *
+	 * This magic method is here for backward compatibility with plugins
+	 * that may attempt to modify the group extension by manually assigning
+	 * a value to an object property that no longer exists, such as
+	 * $this->enable_create_step.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param string $key Property name.
+	 * @param mixed $value Property value.
+	 */
+	public function __set( $key, $value ) {
+
+		if ( empty( $this->initialized ) ) {
+			$this->data[ $key ] = $value;
+		}
+
+		switch ( $key ) {
+			case 'enable_create_step' :
+				$this->screens['create']['enabled'] = $value;
+				break;
+
+			case 'enable_edit_item' :
+				$this->screens['edit']['enabled'] = $value;
+				break;
+
+			case 'enable_admin_item' :
+				$this->screens['admin']['enabled'] = $value;
+				break;
+
+			case 'create_step_position' :
+				$this->screens['create']['position'] = $value;
+				break;
+
+			// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
+			case 'admin_name' :
+				$this->screens['edit']['name'] = $value;
+				break;
+
+			case 'admin_slug' :
+				$this->screens['edit']['slug'] = $value;
+				break;
+
+			case 'create_name' :
+				$this->screens['create']['name'] = $value;
+				break;
+
+			case 'create_slug' :
+				$this->screens['create']['slug'] = $value;
+				break;
+
+			case 'admin_metabox_context' :
+				$this->screens['admin']['metabox_context'] = $value;
+				break;
+
+			case 'admin_metabox_priority' :
+				$this->screens['admin']['metabox_priority'] = $value;
+				break;
+
+			default :
+				$this->data[ $key ] = $value;
+				break;
+		}
+	}
+
+	/**
+	 * Return a list of legacy properties.
+	 *
+	 * The legacy implementation of BP_Group_Extension used all of these
+	 * object properties for configuration. Some have been moved.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @return array List of legacy property keys.
+	 */
+	protected function get_legacy_property_list() {
+		return array(
+			'name',
+			'slug',
+			'admin_name',
+			'admin_slug',
+			'create_name',
+			'create_slug',
+			'visibility',
+			'create_step_position',
+			'nav_item_position',
+			'admin_metabox_context',
+			'admin_metabox_priority',
+			'enable_create_step',
+			'enable_nav_item',
+			'enable_edit_item',
+			'enable_admin_item',
+			'nav_item_name',
+			'display_hook',
+			'template_file',
+		);
+	}
+
+	/**
+	 * Parse legacy properties.
+	 *
+	 * The old standard for BP_Group_Extension was for plugins to register
+	 * their settings as properties in their constructor. The new method is
+	 * to pass a config array to the init() method. In order to support
+	 * legacy plugins, we slurp up legacy properties, and later on we'll
+	 * parse them into the new init() array.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	protected function parse_legacy_properties() {
+
+		// Only run this one time
+		if ( ! empty( $this->legacy_properties_converted ) ) {
+			return;
+		}
+
+		$properties = $this->get_legacy_property_list();
+
+		// By-reference variable for convenience
+		$lpc =& $this->legacy_properties_converted;
+
+		foreach ( $properties as $property ) {
+
+			// No legacy config exists for this key
+			if ( ! isset( $this->{$property} ) ) {
+				continue;
+			}
+
+			// Grab the value and record it as appropriate
+			$value = $this->{$property};
+
+			switch ( $property ) {
+				case 'enable_create_step' :
+					$lpc['screens']['create']['enabled'] = (bool) $value;
+					break;
+
+				case 'enable_edit_item' :
+					$lpc['screens']['edit']['enabled'] = (bool) $value;
+					break;
+
+				case 'enable_admin_item' :
+					$lpc['screens']['admin']['enabled'] = (bool) $value;
+					break;
+
+				case 'create_step_position' :
+					$lpc['screens']['create']['position'] = $value;
+					break;
+
+				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
+				case 'admin_name' :
+					$lpc['screens']['edit']['name'] = $value;
+					break;
+
+				case 'admin_slug' :
+					$lpc['screens']['edit']['slug'] = $value;
+					break;
+
+				case 'create_name' :
+					$lpc['screens']['create']['name'] = $value;
+					break;
+
+				case 'create_slug' :
+					$lpc['screens']['create']['slug'] = $value;
+					break;
+
+				case 'admin_metabox_context' :
+					$lpc['screens']['admin']['metabox_context'] = $value;
+					break;
+
+				case 'admin_metabox_priority' :
+					$lpc['screens']['admin']['metabox_priority'] = $value;
+					break;
+
+				default :
+					$lpc[ $property ] = $value;
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Set up legacy properties.
+	 *
+	 * This method is responsible for ensuring that all legacy config
+	 * properties are stored in an array $this->legacy_properties, so that
+	 * they remain available to plugins that reference the variables at
+	 * their old locations.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @see BP_Group_Extension::__get()
+	 */
+	protected function setup_legacy_properties() {
+
+		// Only run this one time
+		if ( ! empty( $this->legacy_properties ) ) {
+			return;
+		}
+
+		$properties = $this->get_legacy_property_list();
+		$params     = $this->params;
+		$lp         =& $this->legacy_properties;
+
+		foreach ( $properties as $property ) {
+			switch ( $property ) {
+				case 'enable_create_step' :
+					$lp['enable_create_step'] = $params['screens']['create']['enabled'];
+					break;
+
+				case 'enable_edit_item' :
+					$lp['enable_edit_item'] = $params['screens']['edit']['enabled'];
+					break;
+
+				case 'enable_admin_item' :
+					$lp['enable_admin_item'] = $params['screens']['admin']['enabled'];
+					break;
+
+				case 'create_step_position' :
+					$lp['create_step_position'] = $params['screens']['create']['position'];
+					break;
+
+				// Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'
+				case 'admin_name' :
+					$lp['admin_name'] = $params['screens']['edit']['name'];
+					break;
+
+				case 'admin_slug' :
+					$lp['admin_slug'] = $params['screens']['edit']['slug'];
+					break;
+
+				case 'create_name' :
+					$lp['create_name'] = $params['screens']['create']['name'];
+					break;
+
+				case 'create_slug' :
+					$lp['create_slug'] = $params['screens']['create']['slug'];
+					break;
+
+				case 'admin_metabox_context' :
+					$lp['admin_metabox_context'] = $params['screens']['admin']['metabox_context'];
+					break;
+
+				case 'admin_metabox_priority' :
+					$lp['admin_metabox_priority'] = $params['screens']['admin']['metabox_priority'];
+					break;
+
+				default :
+					// All other items get moved over
+					$lp[ $property ] = $params[ $property ];
+
+					// Also reapply to the object, for backpat
+					$this->{$property} = $params[ $property ];
+
+					break;
+			}
+		}
+	}
+}
+
+/**
+ * Register a new Group Extension.
+ *
+ * @param string Name of the Extension class.
+ * @return false|null Returns false on failure, otherwise null.
+ */
+function bp_register_group_extension( $group_extension_class = '' ) {
+
+	if ( ! class_exists( $group_extension_class ) ) {
+		return false;
+	}
+
+	// Register the group extension on the bp_init action so we have access
+	// to all plugins.
+	add_action( 'bp_init', create_function( '', '
+		$extension = new ' . $group_extension_class . ';
+		add_action( "bp_actions", array( &$extension, "_register" ), 8 );
+		add_action( "admin_init", array( &$extension, "_register" ) );
+	' ), 11 );
+}
diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-member-query.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-member-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..8c6b8e05f4c1562e15028857ba6a446f2b1d6ccd
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-group-member-query.php
@@ -0,0 +1,378 @@
+<?php
+/**
+ * BuddyPress Groups Classes.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Query for the members of a group.
+ *
+ * Special notes about the group members data schema:
+ * - *Members* are entries with is_confirmed = 1.
+ * - *Pending requests* are entries with is_confirmed = 0 and inviter_id = 0.
+ * - *Pending and sent invitations* are entries with is_confirmed = 0 and
+ *   inviter_id != 0 and invite_sent = 1.
+ * - *Pending and unsent invitations* are entries with is_confirmed = 0 and
+ *   inviter_id != 0 and invite_sent = 0.
+ * - *Membership requests* are entries with is_confirmed = 0 and
+ *   inviter_id = 0 (and invite_sent = 0).
+ *
+ * @since BuddyPress (1.8.0)
+ *
+ * @param array $args  {
+ *     Array of arguments. Accepts all arguments from
+ *     {@link BP_User_Query}, with the following additions:
+ *
+ *     @type int    $group_id     ID of the group to limit results to.
+ *     @type array  $group_role   Array of group roles to match ('member',
+ *                                'mod', 'admin', 'banned').
+ *                                Default: array( 'member' ).
+ *     @type bool   $is_confirmed Whether to limit to confirmed members.
+ *                                Default: true.
+ *     @type string $type         Sort order. Accepts any value supported by
+ *                                {@link BP_User_Query}, in addition to 'last_joined'
+ *                                and 'first_joined'. Default: 'last_joined'.
+ * }
+ */
+class BP_Group_Member_Query extends BP_User_Query {
+
+	/**
+	 * Array of group member ids, cached to prevent redundant lookups.
+	 *
+	 * @since BuddyPress (1.8.1)
+	 * @access protected
+	 * @var null|array Null if not yet defined, otherwise an array of ints.
+	 */
+	protected $group_member_ids;
+
+	/**
+	 * Set up action hooks.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	public function setup_hooks() {
+		// 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
+		if ( empty( $this->query_vars_raw['type'] ) ) {
+			$this->query_vars_raw['type'] = 'last_joined';
+		}
+
+		// Set the sort order
+		add_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) );
+
+		// Set up our populate_extras method
+		add_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
+	}
+
+	/**
+	 * Get a list of user_ids to include in the IN clause of the main query.
+	 *
+	 * Overrides BP_User_Query::get_include_ids(), adding our additional
+	 * group-member logic.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param array $include Existing group IDs in the $include parameter,
+	 *                       as calculated in BP_User_Query.
+	 * @return array
+	 */
+	public function get_include_ids( $include = array() ) {
+		// The following args are specific to group member queries, and
+		// are not present in the query_vars of a normal BP_User_Query.
+		// We loop through to make sure that defaults are set (though
+		// values passed to the constructor will, as usual, override
+		// these defaults).
+		$this->query_vars = wp_parse_args( $this->query_vars, array(
+			'group_id'     => 0,
+			'group_role'   => array( 'member' ),
+			'is_confirmed' => true,
+			'invite_sent'  => null,
+			'inviter_id'   => null,
+			'type'         => 'last_joined',
+		) );
+
+		$group_member_ids = $this->get_group_member_ids();
+
+		// If the group member query returned no users, bail with an
+		// array that will guarantee no matches for BP_User_Query
+		if ( empty( $group_member_ids ) ) {
+			return array( 0 );
+		}
+
+		if ( ! empty( $include ) ) {
+			$group_member_ids = array_intersect( $include, $group_member_ids );
+		}
+
+		return $group_member_ids;
+	}
+
+	/**
+	 * Get the members of the queried group.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @return array $ids User IDs of relevant group member ids.
+	 */
+	protected function get_group_member_ids() {
+		global $wpdb;
+
+		if ( is_array( $this->group_member_ids ) ) {
+			return $this->group_member_ids;
+		}
+
+		$bp  = buddypress();
+		$sql = array(
+			'select'  => "SELECT user_id FROM {$bp->groups->table_name_members}",
+			'where'   => array(),
+			'orderby' => '',
+			'order'   => '',
+		);
+
+		/** WHERE clauses *****************************************************/
+
+		// Group id
+		$sql['where'][] = $wpdb->prepare( "group_id = %d", $this->query_vars['group_id'] );
+
+		// is_confirmed
+		$is_confirmed = ! empty( $this->query_vars['is_confirmed'] ) ? 1 : 0;
+		$sql['where'][] = $wpdb->prepare( "is_confirmed = %d", $is_confirmed );
+
+		// invite_sent
+		if ( ! is_null( $this->query_vars['invite_sent'] ) ) {
+			$invite_sent = ! empty( $this->query_vars['invite_sent'] ) ? 1 : 0;
+			$sql['where'][] = $wpdb->prepare( "invite_sent = %d", $invite_sent );
+		}
+
+		// 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)
+			if ( empty( $inviter_id ) ) {
+				$sql['where'][] = "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
+			} else {
+				// Parse and sanitize
+				$inviter_ids = wp_parse_id_list( $inviter_id );
+				if ( ! empty( $inviter_ids ) ) {
+					$inviter_ids_sql = implode( ',', $inviter_ids );
+					$sql['where'][] = "inviter_id IN ({$inviter_ids_sql})";
+				}
+			}
+		}
+
+		// Role information is stored as follows: admins have
+		// is_admin = 1, mods have is_mod = 1, banned have is_banned =
+		// 1, and members have all three set to 0.
+		$roles = !empty( $this->query_vars['group_role'] ) ? $this->query_vars['group_role'] : array();
+		if ( is_string( $roles ) ) {
+			$roles = explode( ',', $roles );
+		}
+
+		// Sanitize: Only 'admin', 'mod', 'member', and 'banned' are valid
+		$allowed_roles = array( 'admin', 'mod', 'member', 'banned' );
+		foreach ( $roles as $role_key => $role_value ) {
+			if ( ! in_array( $role_value, $allowed_roles ) ) {
+				unset( $roles[ $role_key ] );
+			}
+		}
+
+		$roles = array_unique( $roles );
+
+		// 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
+		$roles_sql = '';
+		if ( in_array( 'member', $roles ) ) {
+			$role_columns = array();
+			foreach ( array_diff( $allowed_roles, $roles ) as $excluded_role ) {
+				$role_columns[] = 'is_' . $excluded_role . ' = 0';
+			}
+
+			if ( ! empty( $role_columns ) ) {
+				$roles_sql = '(' . implode( ' AND ', $role_columns ) . ')';
+			}
+
+		// When querying for a set of roles *not* containing 'member',
+		// simply construct a list of is_* = 1 clauses
+		} else {
+			$role_columns = array();
+			foreach ( $roles as $role ) {
+				$role_columns[] = 'is_' . $role . ' = 1';
+			}
+
+			if ( ! empty( $role_columns ) ) {
+				$roles_sql = '(' . implode( ' OR ', $role_columns ) . ')';
+			}
+		}
+
+		if ( ! empty( $roles_sql ) ) {
+			$sql['where'][] = $roles_sql;
+		}
+
+		$sql['where'] = ! empty( $sql['where'] ) ? 'WHERE ' . implode( ' AND ', $sql['where'] ) : '';
+
+		// We fetch group members in order of last_joined, regardless
+		// 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()
+		$sql['orderby'] = "ORDER BY date_modified";
+		$sql['order']   = 'first_joined' === $this->query_vars['type'] ? 'ASC' : 'DESC';
+
+		$this->group_member_ids = $wpdb->get_col( "{$sql['select']} {$sql['where']} {$sql['orderby']} {$sql['order']}" );
+
+		/**
+		 * Filters the member IDs for the current group member query.
+		 *
+		 * Use this filter to build a custom query (such as when you've
+		 * defined a custom 'type').
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array                 $group_member_ids Array of associated member IDs.
+		 * @param BP_Group_Member_Query $this             Current BP_Group_Member_Query instance.
+		 */
+		$this->group_member_ids = apply_filters( 'bp_group_member_query_group_member_ids', $this->group_member_ids, $this );
+
+		return $this->group_member_ids;
+	}
+
+	/**
+	 * Tell BP_User_Query to order by the order of our query results.
+	 *
+	 * We only override BP_User_Query's native ordering in case of the
+	 * 'last_joined' and 'first_joined' $type parameters.
+	 *
+	 * @param BP_User_Query $query BP_User_Query object.
+	 */
+	public function set_orderby( $query ) {
+		$gm_ids = $this->get_group_member_ids();
+		if ( empty( $gm_ids ) ) {
+			$gm_ids = array( 0 );
+		}
+
+		// For 'last_joined', 'first_joined', and 'group_activity'
+		// types, we override the default orderby clause of
+		// BP_User_Query. In the case of 'group_activity', we perform
+		// a separate query to get the necessary order. In the case of
+		// 'last_joined' and 'first_joined', we can trust the order of
+		// results from  BP_Group_Member_Query::get_group_members().
+		// In all other cases, we fall through and let BP_User_Query
+		// do its own (non-group-specific) ordering.
+		if ( in_array( $query->query_vars['type'], array( 'last_joined', 'first_joined', 'group_activity' ) ) ) {
+
+			// 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
+			$gm_ids = array_merge( array( 'u.id' ), wp_parse_id_list( $gm_ids ) );
+			$gm_ids_sql = implode( ',', $gm_ids );
+
+			$query->uid_clauses['orderby'] = "ORDER BY FIELD(" . $gm_ids_sql . ")";
+		}
+
+		// Prevent this filter from running on future BP_User_Query
+		// instances on the same page
+		remove_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) );
+	}
+
+	/**
+	 * Fetch additional data required in bp_group_has_members() loops.
+	 *
+	 * Additional data fetched:
+	 *
+	 *      - is_banned
+	 *      - date_modified
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param BP_User_Query $query        BP_User_Query object. Because we're
+	 *                                    filtering the current object, we use
+	 *                                    $this inside of the method instead.
+	 * @param string        $user_ids_sql Sanitized, comma-separated string of
+	 *                                    the user ids returned by the main query.
+	 */
+	public function populate_group_member_extras( $query, $user_ids_sql ) {
+		global $wpdb;
+
+		$bp     = buddypress();
+		$extras = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_modified, is_admin, is_mod, comments, user_title, invite_sent, is_confirmed, inviter_id, is_banned FROM {$bp->groups->table_name_members} WHERE user_id IN ({$user_ids_sql}) AND group_id = %d", $this->query_vars['group_id'] ) );
+
+		foreach ( (array) $extras as $extra ) {
+			if ( isset( $this->results[ $extra->user_id ] ) ) {
+				// 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;
+				$this->results[ $extra->user_id ]->is_mod        = (int) $extra->is_mod;
+				$this->results[ $extra->user_id ]->is_banned     = (int) $extra->is_banned;
+				$this->results[ $extra->user_id ]->date_modified = $extra->date_modified;
+				$this->results[ $extra->user_id ]->user_title    = $extra->user_title;
+				$this->results[ $extra->user_id ]->comments      = $extra->comments;
+				$this->results[ $extra->user_id ]->invite_sent   = (int) $extra->invite_sent;
+				$this->results[ $extra->user_id ]->inviter_id    = (int) $extra->inviter_id;
+				$this->results[ $extra->user_id ]->is_confirmed  = (int) $extra->is_confirmed;
+				$this->results[ $extra->user_id ]->membership_id = (int) $extra->id;
+			}
+		}
+
+		// 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 );
+	}
+
+	/**
+	 * Sort user IDs by how recently they have generated activity within a given group.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param BP_User_Query $query  BP_User_Query object.
+	 * @param array         $gm_ids array of group member ids.
+	 *
+	 * @return array
+	 */
+	public function get_gm_ids_ordered_by_activity( $query, $gm_ids = array() ) {
+		global $wpdb;
+
+		if ( empty( $gm_ids ) ) {
+			return $gm_ids;
+		}
+
+		if ( ! bp_is_active( 'activity' ) ) {
+			return $gm_ids;
+		}
+
+		$activity_table = buddypress()->activity->table_name;
+
+		$sql = array(
+			'select'  => "SELECT user_id, max( date_recorded ) as date_recorded FROM {$activity_table}",
+			'where'   => array(),
+			'groupby' => 'GROUP BY user_id',
+			'orderby' => 'ORDER BY date_recorded',
+			'order'   => 'DESC',
+		);
+
+		$sql['where'] = array(
+			'user_id IN (' . implode( ',', wp_parse_id_list( $gm_ids ) ) . ')',
+			'item_id = ' . absint( $query->query_vars['group_id'] ),
+			$wpdb->prepare( "component = %s", buddypress()->groups->id ),
+		);
+
+		$sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] );
+
+		$group_user_ids = $wpdb->get_results( "{$sql['select']} {$sql['where']} {$sql['groupby']} {$sql['orderby']} {$sql['order']}" );
+
+		return wp_list_pluck( $group_user_ids, 'user_id' );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-group.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-group.php
new file mode 100644
index 0000000000000000000000000000000000000000..bd77987fc4892d8cf95ef07f7bc40d4c8edb8c82
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-group.php
@@ -0,0 +1,1587 @@
+<?php
+/**
+ * BuddyPress Groups Classes
+ *
+ * @package BuddyPress
+ * @subpackage GroupsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Group object.
+ */
+class BP_Groups_Group {
+
+	/**
+	 * ID of the group.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $id;
+
+	/**
+	 * User ID of the group's creator.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $creator_id;
+
+	/**
+	 * Name of the group.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $name;
+
+	/**
+	 * Group slug.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $slug;
+
+	/**
+	 * Group description.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $description;
+
+	/**
+	 * Group status.
+	 *
+	 * Core statuses are 'public', 'private', and 'hidden'.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $status;
+
+	/**
+	 * Should (legacy) bbPress forums be enabled for this group?
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $enable_forum;
+
+	/**
+	 * Date the group was created.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $date_created;
+
+	/**
+	 * Data about the group's admins.
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $admins;
+
+	/**
+	 * Data about the group's moderators.
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $mods;
+
+	/**
+	 * Total count of group members.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $total_member_count;
+
+	/**
+	 * Is the current user a member of this group?
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var bool
+	 */
+	public $is_member;
+
+	/**
+	 * Does the current user have an outstanding invitation to this group?
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @var bool
+	 */
+	public $is_invited;
+
+	/**
+	 * Does the current user have a pending membership request to this group?
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @var bool
+	 */
+	public $is_pending;
+
+	/**
+	 * Timestamp of the last activity that happened in this group.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_activity;
+
+	/**
+	 * If this is a private or hidden group, does the current user have access?
+	 *
+	 * @since BuddyPress (1.6.0)
+	 * @var bool
+	 */
+	public $user_has_access;
+
+	/**
+	 * Raw arguments passed to the constructor.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 * @var array
+	 */
+	public $args;
+
+	/**
+	 * 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 array    $args {
+	 *     Array of optional arguments.
+	 *     @type bool $populate_extras Whether to fetch "extra" data about
+	 *           the group (group admins/mods, access for the current user).
+	 *           Default: false.
+	 * }
+	 */
+	public function __construct( $id = null, $args = array() ) {
+		$this->args = wp_parse_args( $args, array(
+			'populate_extras' => false,
+		) );
+
+		if ( !empty( $id ) ) {
+			$this->id = $id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Set up data about the current group.
+	 */
+	public function populate() {
+		global $wpdb;
+
+		// Get BuddyPress
+		$bp    = buddypress();
+
+		// Check cache for group data
+		$group = wp_cache_get( $this->id, 'bp_groups' );
+
+		// 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 ) );
+
+			wp_cache_set( $this->id, $group, 'bp_groups' );
+		}
+
+		// No group found so set the ID and bail
+		if ( empty( $group ) || is_wp_error( $group ) ) {
+			$this->id = 0;
+			return;
+		}
+
+		// Group found so setup the object variables
+		$this->id           = $group->id;
+		$this->creator_id   = $group->creator_id;
+		$this->name         = stripslashes( $group->name );
+		$this->slug         = $group->slug;
+		$this->description  = stripslashes( $group->description );
+		$this->status       = $group->status;
+		$this->enable_forum = $group->enable_forum;
+		$this->date_created = $group->date_created;
+
+		// Are we getting extra group data?
+		if ( ! empty( $this->args['populate_extras'] ) ) {
+
+			/**
+			 * Filters the SQL prepared statement used to fetch group admins and mods.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $value SQL select statement used to fetch admins and mods.
+			 */
+			$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
+			foreach ( (array) $admin_mods as $user ) {
+				if ( !empty( $user->is_admin ) ) {
+					$this->admins[] = $user;
+				} else {
+					$this->mods[] = $user;
+				}
+			}
+
+			// Set up some specific group vars from meta. Excluded
+			// 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
+			$user_id          = bp_loggedin_user_id();
+			$this->is_member  = BP_Groups_Member::check_is_member( $user_id, $this->id );
+			$this->is_invited = BP_Groups_Member::check_has_invite( $user_id, $this->id );
+			$this->is_pending = BP_Groups_Member::check_for_membership_request( $user_id, $this->id );
+
+			// If this is a private or hidden group, does the current user have access?
+			if ( ( 'private' === $this->status ) || ( 'hidden' === $this->status ) ) {
+
+				// Assume user does not have access to hidden/private groups
+				$this->user_has_access = false;
+
+				// 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;
+				}
+			} else {
+				$this->user_has_access = true;
+			}
+		}
+	}
+
+	/**
+	 * Save the current group to the database.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->creator_id   = apply_filters( 'groups_group_creator_id_before_save',   $this->creator_id,   $this->id );
+		$this->name         = apply_filters( 'groups_group_name_before_save',         $this->name,         $this->id );
+ 		$this->slug         = apply_filters( 'groups_group_slug_before_save',         $this->slug,         $this->id );
+		$this->description  = apply_filters( 'groups_group_description_before_save',  $this->description,  $this->id );
+ 		$this->status       = apply_filters( 'groups_group_status_before_save',       $this->status,       $this->id );
+		$this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id );
+		$this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id );
+
+		/**
+		 * Fires before the current group item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Groups_Group $this Current instance of the group item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'groups_group_before_save', array( &$this ) );
+
+		// Groups need at least a name
+		if ( empty( $this->name ) ) {
+			return false;
+		}
+
+		// Set slug with group title if not passed
+		if ( empty( $this->slug ) ) {
+			$this->slug = sanitize_title( $this->name );
+		}
+
+		// Sanity check
+		if ( empty( $this->slug ) ) {
+			return false;
+		}
+
+		// Check for slug conflicts if creating new group
+		if ( empty( $this->id ) ) {
+			$this->slug = groups_check_slug( $this->slug );
+		}
+
+		if ( !empty( $this->id ) ) {
+			$sql = $wpdb->prepare(
+				"UPDATE {$bp->groups->table_name} SET
+					creator_id = %d,
+					name = %s,
+					slug = %s,
+					description = %s,
+					status = %s,
+					enable_forum = %d,
+					date_created = %s
+				WHERE
+					id = %d
+				",
+					$this->creator_id,
+					$this->name,
+					$this->slug,
+					$this->description,
+					$this->status,
+					$this->enable_forum,
+					$this->date_created,
+					$this->id
+			);
+		} else {
+			$sql = $wpdb->prepare(
+				"INSERT INTO {$bp->groups->table_name} (
+					creator_id,
+					name,
+					slug,
+					description,
+					status,
+					enable_forum,
+					date_created
+				) VALUES (
+					%d, %s, %s, %s, %s, %d, %s
+				)",
+					$this->creator_id,
+					$this->name,
+					$this->slug,
+					$this->description,
+					$this->status,
+					$this->enable_forum,
+					$this->date_created
+			);
+		}
+
+		if ( false === $wpdb->query($sql) )
+			return false;
+
+		if ( empty( $this->id ) )
+			$this->id = $wpdb->insert_id;
+
+		/**
+		 * Fires after the current group item has been saved.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Groups_Group $this Current instance of the group item that was saved. Passed by reference.
+		 */
+		do_action_ref_array( 'groups_group_after_save', array( &$this ) );
+
+		wp_cache_delete( $this->id, 'bp_groups' );
+
+		return true;
+	}
+
+	/**
+	 * Delete the current group.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function delete() {
+		global $wpdb;
+
+		// Delete groupmeta for the group
+		groups_delete_groupmeta( $this->id );
+
+		// 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
+		$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
+		BP_Groups_Member::delete_all( $this->id );
+
+		/**
+		 * Fires before the deletion of a group.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param BP_Groups_Group $this     Current instance of the group item being deleted. Passed by reference.
+		 * @param array           $user_ids Array of user IDs that were members of the group.
+		 */
+		do_action_ref_array( 'bp_groups_delete_group', array( &$this, $user_ids ) );
+
+		wp_cache_delete( $this->id, 'bp_groups' );
+
+		$bp = buddypress();
+
+		// 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;
+
+		return true;
+	}
+
+	/** Static Methods ****************************************************/
+
+	/**
+	 * Get whether a group exists for a given slug.
+	 *
+	 * @param string      $slug       Slug to check.
+	 * @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.
+	 */
+	public static function group_exists( $slug, $table_name = false ) {
+		global $wpdb;
+
+		if ( empty( $table_name ) )
+			$table_name = buddypress()->groups->table_name;
+
+		if ( empty( $slug ) )
+			return false;
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE slug = %s", strtolower( $slug ) ) );
+	}
+
+	/**
+	 * Get the ID of a group by the group's slug.
+	 *
+	 * Alias of {@link BP_Groups_Group::group_exists()}.
+	 *
+	 * @param string $slug See {@link BP_Groups_Group::group_exists()}.
+	 * @return string|null See {@link BP_Groups_Group::group_exists()}.
+	 */
+	public static function get_id_from_slug( $slug ) {
+		return BP_Groups_Group::group_exists( $slug );
+	}
+
+	/**
+	 * Get IDs of users with outstanding invites to a given group from a specified user.
+	 *
+	 * @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.
+	 */
+	public static function get_invites( $user_id, $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d and is_confirmed = 0 AND inviter_id = %d", $group_id, $user_id ) );
+	}
+
+	/**
+	 * Get a list of a user's groups, filtered by a search string.
+	 *
+	 * @param string $filter Search term. Matches against 'name' and
+	 *        'description' fields.
+	 * @param int $user_id ID of the user whose groups are being searched.
+	 *        Default: the displayed user.
+	 * @param mixed $order Not used.
+	 * @param int|null $limit Optional. The max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. The page offset of results to return.
+	 *        Default: null (no limit).
+	 * @return false|array {
+	 *     @type array $groups Array of matched and paginated group objects.
+	 *     @type int $total Total count of groups matching the query.
+	 * }
+	 */
+	public static function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
+
+		$search_terms_like = bp_esc_like( $filter ) . '%';
+
+		$pag_sql = $order_sql = $hidden_sql = '';
+
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		// Get all the group ids for the current user's groups.
+		$gids = BP_Groups_Member::get_group_ids( $user_id );
+
+		if ( empty( $gids['groups'] ) )
+			return false;
+
+		$bp = buddypress();
+
+		$gids = esc_sql( implode( ',', wp_parse_id_list( $gids['groups'] ) ) );
+
+		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids}) {$pag_sql}", $search_terms_like, $search_terms_like ) );
+		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) AND id IN ({$gids})", $search_terms_like, $search_terms_like ) );
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get a list of groups, filtered by a search string.
+	 *
+	 * @param string $filter Search term. Matches against 'name' and
+	 *        'description' fields.
+	 * @param int|null $limit Optional. The max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. The page offset of results to return.
+	 *        Default: null (no limit).
+	 * @param string|bool $sort_by Column to sort by. Default: false (default
+	 *        sort).
+	 * @param string|bool $order ASC or DESC. Default: false (default sort).
+	 * @return array {
+	 *     @type array $groups Array of matched and paginated group objects.
+	 *     @type int $total Total count of groups matching the query.
+	 * }
+	 */
+	public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
+		global $wpdb;
+
+		$search_terms_like = '%' . bp_esc_like( $filter ) . '%';
+
+		$pag_sql = $order_sql = $hidden_sql = '';
+
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		if ( !empty( $sort_by ) && !empty( $order ) ) {
+			$sort_by   = esc_sql( $sort_by );
+			$order     = esc_sql( $order );
+			$order_sql = "ORDER BY {$sort_by} {$order}";
+		}
+
+		if ( !bp_current_user_can( 'bp_moderate' ) )
+			$hidden_sql = "AND status != 'hidden'";
+
+		$bp = buddypress();
+
+		$paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) {$hidden_sql} {$order_sql} {$pag_sql}", $search_terms_like, $search_terms_like ) );
+		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE %s OR description LIKE %s ) {$hidden_sql}", $search_terms_like, $search_terms_like ) );
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Check for the existence of a slug.
+	 *
+	 * @param string $slug Slug to check.
+	 * @return string|null The slug, if found. Otherwise null.
+	 */
+	public static function check_slug( $slug ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE slug = %s", $slug ) );
+	}
+
+	/**
+	 * Get the slug for a given group ID.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return string|null The slug, if found. Otherwise null.
+	 */
+	public static function get_slug( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE id = %d", $group_id ) );
+	}
+
+	/**
+	 * Check whether a given group has any members.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return bool True if the group has members, otherwise false.
+	 */
+	public static function has_members( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$members = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
+
+		if ( empty( $members ) )
+			return false;
+
+		return true;
+	}
+
+	/**
+	 * Check whether a group has outstanding membership requests.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return int|null The number of outstanding requests, or null if
+	 *         none are found.
+	 */
+	public static function has_membership_requests( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
+	}
+
+	/**
+	 * Get outstanding membership requests for a group.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @param int|null $limit Optional. Max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. Page offset of results returned. Default:
+	 *        null (no limit).
+	 * @return array {
+	 *     @type array $requests The requested page of located requests.
+	 *     @type int $total Total number of requests outstanding for the
+	 *           group.
+	 * }
+	 */
+	public static function get_membership_requests( $group_id, $limit = null, $page = null ) {
+		global $wpdb;
+
+		if ( !empty( $limit ) && !empty( $page ) ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		$bp = buddypress();
+
+		$paged_requests = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0{$pag_sql}", $group_id ) );
+		$total_requests = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
+
+		return array( 'requests' => $paged_requests, 'total' => $total_requests );
+	}
+
+	/**
+	 * Query for groups.
+	 *
+	 * @see WP_Meta_Query::queries for a description of the 'meta_query'
+	 *      parameter format.
+	 *
+	 * @param array {
+	 *     Array of parameters. All items are optional.
+	 *     @type string $type Optional. Shorthand for certain orderby/
+	 *           order combinations. 'newest', 'active', 'popular',
+	 *           'alphabetical', 'random'. When present, will override
+	 *           orderby and order params. Default: null.
+	 *     @type string $orderby Optional. Property to sort by.
+	 *           'date_created', 'last_activity', 'total_member_count',
+	 *           'name', 'random'. Default: 'date_created'.
+	 *     @type string $order Optional. Sort order. 'ASC' or 'DESC'.
+	 *           Default: 'DESC'.
+	 *     @type int $per_page Optional. Number of items to return per page
+	 *           of results. Default: null (no limit).
+	 *     @type int $page Optional. Page offset of results to return.
+	 *           Default: null (no limit).
+	 *     @type int $user_id Optional. If provided, results will be limited
+	 *           to groups of which the specified user is a member. Default:
+	 *           null.
+	 *     @type string $search_terms Optional. If provided, only groups
+	 *           whose names or descriptions match the search terms will be
+	 *           returned. Default: false.
+	 *     @type array $meta_query Optional. An array of meta_query
+	 *           conditions. See {@link WP_Meta_Query::queries} for
+	 *           description.
+	 *     @type array|string Optional. Array or comma-separated list of
+	 *           group IDs. Results will be limited to groups within the
+	 *           list. Default: false.
+	 *     @type bool $populate_extras Whether to fetch additional
+	 *           information (such as member count) about groups. Default:
+	 *           true.
+	 *     @type array|string $exclude Optional. Array or comma-separated
+	 *           list of group IDs. Results will exclude the listed groups.
+	 *           Default: false.
+	 *     @type bool $update_meta_cache Whether to pre-fetch groupmeta for
+	 *           the returned groups. Default: true.
+	 *     @type bool $show_hidden Whether to include hidden groups in
+	 *           results. Default: false.
+	 * }
+	 * @return array {
+	 *     @type array $groups Array of group objects returned by the
+	 *           paginated query.
+	 *     @type int $total Total count of all groups matching non-
+	 *           paginated query params.
+	 * }
+	 */
+	public static function get( $args = array() ) {
+		global $wpdb;
+
+		// 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__ ) );
+
+			$old_args_keys = array(
+				0 => 'type',
+				1 => 'per_page',
+				2 => 'page',
+				3 => 'user_id',
+				4 => 'search_terms',
+				5 => 'include',
+				6 => 'populate_extras',
+				7 => 'exclude',
+				8 => 'show_hidden',
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$defaults = array(
+			'type'              => null,
+			'orderby'           => 'date_created',
+			'order'             => 'DESC',
+			'per_page'          => null,
+			'page'              => null,
+			'user_id'           => 0,
+			'search_terms'      => false,
+			'meta_query'        => false,
+			'include'           => false,
+			'populate_extras'   => true,
+			'update_meta_cache' => true,
+			'exclude'           => false,
+			'show_hidden'       => false,
+		);
+
+		$r = wp_parse_args( $args, $defaults );
+
+		$bp = buddypress();
+
+		$sql       = array();
+		$total_sql = array();
+
+		$sql['select'] = "SELECT DISTINCT g.id, g.*, gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
+		$sql['from']   = " FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2,";
+
+		if ( ! empty( $r['user_id'] ) ) {
+			$sql['members_from'] = " {$bp->groups->table_name_members} m,";
+		}
+
+		$sql['group_from'] = " {$bp->groups->table_name} g WHERE";
+
+		if ( ! empty( $r['user_id'] ) ) {
+			$sql['user_where'] = " g.id = m.group_id AND";
+		}
+
+		$sql['where'] = " g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count'";
+
+		if ( empty( $r['show_hidden'] ) ) {
+			$sql['hidden'] = " AND g.status != 'hidden'";
+		}
+
+		if ( ! empty( $r['search_terms'] ) ) {
+			$search_terms_like = '%' . bp_esc_like( $r['search_terms'] ) . '%';
+			$sql['search'] = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		$meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
+
+		if ( ! empty( $meta_query_sql['join'] ) ) {
+			$sql['from'] .= $meta_query_sql['join'];
+		}
+
+		if ( ! empty( $meta_query_sql['where'] ) ) {
+			$sql['meta'] = $meta_query_sql['where'];
+		}
+
+		if ( ! empty( $r['user_id'] ) ) {
+			$sql['user'] = $wpdb->prepare( " AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $r['user_id'] );
+		}
+
+		if ( ! empty( $r['include'] ) ) {
+			$include        = implode( ',', wp_parse_id_list( $r['include'] ) );
+			$sql['include'] = " AND g.id IN ({$include})";
+		}
+
+		if ( ! empty( $r['exclude'] ) ) {
+			$exclude        = implode( ',', wp_parse_id_list( $r['exclude'] ) );
+			$sql['exclude'] = " AND g.id NOT IN ({$exclude})";
+		}
+
+		/** Order/orderby ********************************************/
+
+		$order   = $r['order'];
+		$orderby = $r['orderby'];
+
+		// If a 'type' parameter was passed, parse it and overwrite
+		// 'order' and 'orderby' params passed to the function
+		if (  ! empty( $r['type'] ) ) {
+
+			/**
+			 * Filters the 'type' parameter used to overwrite 'order' and 'orderby' values.
+			 *
+			 * @since BuddyPress (2.1.0)
+			 *
+			 * @param array  $value Converted 'type' value for order and orderby.
+			 * @param string $value Parsed 'type' value for the get method.
+			 */
+			$order_orderby = apply_filters( 'bp_groups_get_orderby', self::convert_type_to_order_orderby( $r['type'] ), $r['type'] );
+
+			// 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
+			if ( ! empty( $order_orderby['order'] ) ) {
+				$order = $order_orderby['order'];
+			}
+
+			if ( ! empty( $order_orderby['orderby'] ) ) {
+				$orderby = $order_orderby['orderby'];
+			}
+		}
+
+		// Sanitize 'order'
+		$order = bp_esc_sql_order( $order );
+
+		/**
+		 * Filters the converted 'orderby' term.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $value   Converted 'orderby' term.
+		 * @param string $orderby Original orderby value.
+		 * @param string $value   Parsed 'type' value for the get method.
+		 */
+		$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
+		if ( 'rand()' === $orderby ) {
+			$sql[] = "ORDER BY rand()";
+		} else {
+			$sql[] = "ORDER BY {$orderby} {$order}";
+		}
+
+		if ( ! empty( $r['per_page'] ) && ! empty( $r['page'] ) && $r['per_page'] != -1 ) {
+			$sql['pagination'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['per_page']), intval( $r['per_page'] ) );
+		}
+
+		/**
+		 * Filters the pagination SQL statement.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Concatenated SQL statement.
+		 * @param array  $sql   Array of SQL parts before concatenation.
+		 * @param array  $r     Array of parsed arguments for the get method.
+		 */
+		$paged_groups_sql = apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array) $sql ), $sql, $r );
+		$paged_groups     = $wpdb->get_results( $paged_groups_sql );
+
+		$total_sql['select'] = "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name} g, {$bp->groups->table_name_groupmeta} gm";
+
+		if ( ! empty( $r['user_id'] ) ) {
+			$total_sql['select'] .= ", {$bp->groups->table_name_members} m";
+		}
+
+		if ( ! empty( $sql['hidden'] ) ) {
+			$total_sql['where'][] = "g.status != 'hidden'";
+		}
+
+		if ( ! empty( $sql['search'] ) ) {
+			$total_sql['where'][] = $wpdb->prepare( "( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		if ( ! empty( $r['user_id'] ) ) {
+			$total_sql['where'][] = $wpdb->prepare( "m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $r['user_id'] );
+		}
+
+		// Temporary implementation of meta_query for total count
+		// See #5099
+		if ( ! empty( $meta_query_sql['where'] ) ) {
+			// 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
+			$meta_query_clause = preg_replace( '/^\s*AND/', '', $meta_query_sql['where'] );
+			$total_sql['where'][] = $meta_query_clause;
+		}
+
+		// Already escaped in the paginated results block
+		if ( ! empty( $include ) ) {
+			$total_sql['where'][] = "g.id IN ({$include})";
+		}
+
+		// Already escaped in the paginated results block
+		if ( ! empty( $exclude ) ) {
+			$total_sql['where'][] = "g.id NOT IN ({$exclude})";
+		}
+
+		$total_sql['where'][] = "g.id = gm.group_id";
+		$total_sql['where'][] = "gm.meta_key = 'last_activity'";
+
+		$t_sql = $total_sql['select'];
+
+		if ( ! empty( $total_sql['where'] ) ) {
+			$t_sql .= " WHERE " . join( ' AND ', (array) $total_sql['where'] );
+		}
+
+		/**
+		 * Filters the SQL used to retrieve total group results.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $t_sql     Concatenated SQL statement used for retrieving total group results.
+		 * @param array  $total_sql Array of SQL parts for the query.
+		 * @param array  $r         Array of parsed arguments for the get method.
+		 */
+		$total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', $t_sql, $total_sql, $r );
+		$total_groups     = $wpdb->get_var( $total_groups_sql );
+
+		$group_ids = array();
+		foreach ( (array) $paged_groups as $group ) {
+			$group_ids[] = $group->id;
+		}
+
+		// 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
+		if ( ! empty( $r['update_meta_cache'] ) ) {
+			bp_groups_update_meta_cache( $group_ids );
+		}
+
+		unset( $sql, $total_sql );
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get the SQL for the 'meta_query' param in BP_Activity_Activity::get()
+	 *
+	 * We use WP_Meta_Query to do the heavy lifting of parsing the
+	 * meta_query array and creating the necessary SQL clauses. However,
+	 * since BP_Activity_Activity::get() builds its SQL differently than
+	 * WP_Query, we have to alter the return value (stripping the leading
+	 * AND keyword from the 'where' clause).
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 *
+	 * @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.
+	 */
+	protected static function get_meta_query_sql( $meta_query = array() ) {
+		global $wpdb;
+
+		$sql_array = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		if ( ! empty( $meta_query ) ) {
+			$groups_meta_query = new WP_Meta_Query( $meta_query );
+
+			// WP_Meta_Query expects the table name at
+			// $wpdb->group
+			$wpdb->groupmeta = buddypress()->groups->table_name_groupmeta;
+
+			$meta_sql = $groups_meta_query->get_sql( 'group', 'g', 'id' );
+
+			// BP_Groups_Group::get uses the comma syntax for table
+			// joins, which means that we have to do some regex to
+			// convert the INNER JOIN and move the ON clause to a
+			// WHERE condition
+			//
+			// @todo It may be better in the long run to refactor
+			// the more general query syntax to accord better with
+			// BP/WP convention
+			preg_match_all( '/JOIN (.+?) ON/', $meta_sql['join'], $matches_a );
+			preg_match_all( '/ON \((.+?)\)/', $meta_sql['join'], $matches_b );
+
+			if ( ! empty( $matches_a[1] ) && ! empty( $matches_b[1] ) ) {
+				$sql_array['join']  = implode( ',', $matches_a[1] ) . ', ';
+				$sql_array['where'] = $meta_sql['where'] . ' AND ' . implode( ' AND ', $matches_b[1] );
+			}
+		}
+
+		return $sql_array;
+	}
+
+	/**
+	 * Convert the 'type' parameter to 'order' and 'orderby'.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 *
+	 * @param string $type The 'type' shorthand param.
+	 * @return array {
+	 *	@type string $order SQL-friendly order string.
+	 *	@type string $orderby SQL-friendly orderby column name.
+	 * }
+	 */
+	protected static function convert_type_to_order_orderby( $type = '' ) {
+		$order = $orderby = '';
+
+		switch ( $type ) {
+			case 'newest' :
+				$order   = 'DESC';
+				$orderby = 'date_created';
+				break;
+
+			case 'active' :
+				$order   = 'DESC';
+				$orderby = 'last_activity';
+				break;
+
+			case 'popular' :
+				$order   = 'DESC';
+				$orderby = 'total_member_count';
+				break;
+
+			case 'alphabetical' :
+				$order   = 'ASC';
+				$orderby = 'name';
+				break;
+
+			case 'random' :
+				$order   = '';
+				$orderby = 'random';
+				break;
+		}
+
+		return array( 'order' => $order, 'orderby' => $orderby );
+	}
+
+	/**
+	 * Convert the 'orderby' param into a proper SQL term/column.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 * @access protected
+	 *
+	 * @param string $orderby Orderby term as passed to get().
+	 * @return string $order_by_term SQL-friendly orderby term.
+	 */
+	protected static function convert_orderby_to_order_by_term( $orderby ) {
+		$order_by_term = '';
+
+		switch ( $orderby ) {
+			case 'date_created' :
+			default :
+				$order_by_term = 'g.date_created';
+				break;
+
+			case 'last_activity' :
+				$order_by_term = 'last_activity';
+				break;
+
+			case 'total_member_count' :
+				$order_by_term = 'CONVERT(gm1.meta_value, SIGNED)';
+				break;
+
+			case 'name' :
+				$order_by_term = 'g.name';
+				break;
+
+			case 'random' :
+				$order_by_term = 'rand()';
+				break;
+		}
+
+		return $order_by_term;
+	}
+
+	/**
+	 * Get a list of groups, sorted by those that have the most legacy forum topics.
+	 *
+	 * @param int|null $limit Optional. The max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. The page offset of results to return.
+	 *        Default: null (no limit).
+	 * @param int $user_id Optional. If present, groups will be limited to
+	 *        those of which the specified user is a member.
+	 * @param string|bool $search_terms Optional. Limit groups to those whose
+	 *        name or description field contain the search string.
+	 * @param bool $populate_extras Optional. Whether to fetch extra
+	 *        information about the groups. Default: true.
+	 * @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
+	 *           paginated query.
+	 *     @type int $total Total count of all groups matching non-
+	 *           paginated query params.
+	 * }
+	 */
+	public static function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
+		global $wpdb, $bbdb;
+
+		if ( empty( $bbdb ) ) {
+
+			/** This action is documented in bp-forums/bp-forums-screens */
+			do_action( 'bbpress_init' );
+		}
+
+		if ( !empty( $limit ) && !empty( $page ) ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
+			$hidden_sql = " AND g.status != 'hidden'";
+
+		if ( !empty( $search_terms ) ) {
+			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
+			$search_sql        = $wpdb->prepare( ' AND ( g.name LIKE %s OR g.description LIKE %s ) ', $search_terms_like, $search_terms_like );
+		}
+
+		if ( !empty( $exclude ) ) {
+			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
+		$bp = buddypress();
+
+		if ( !empty( $user_id ) ) {
+			$user_id      = absint( esc_sql( $user_id ) );
+			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY f.topics DESC {$pag_sql}" );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql}" );
+		} else {
+			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY f.topics DESC {$pag_sql}" );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} {$exclude_sql}" );
+		}
+
+		if ( !empty( $populate_extras ) ) {
+			foreach ( (array) $paged_groups as $group ) {
+				$group_ids[] = $group->id;
+			}
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
+		}
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get a list of groups, sorted by those that have the most legacy forum posts.
+	 *
+	 * @param int|null $limit Optional. The max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. The page offset of results to return.
+	 *        Default: null (no limit).
+	 * @param string|bool $search_terms Optional. Limit groups to those whose
+	 *        name or description field contain the search string.
+	 * @param bool $populate_extras Optional. Whether to fetch extra
+	 *        information about the groups. Default: true.
+	 * @param string|array|bool 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
+	 *           paginated query.
+	 *     @type int $total Total count of all groups matching non-
+	 *           paginated query params.
+	 * }
+	 */
+	public static function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
+		global $wpdb, $bbdb;
+
+		if ( empty( $bbdb ) ) {
+
+			/** This action is documented in bp-forums/bp-forums-screens */
+			do_action( 'bbpress_init' );
+		}
+
+		if ( !empty( $limit ) && !empty( $page ) ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
+			$hidden_sql = " AND g.status != 'hidden'";
+
+		if ( !empty( $search_terms ) ) {
+			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
+			$search_sql        = $wpdb->prepare( ' AND ( g.name LIKE %s OR g.description LIKE %s ) ', $search_terms_like, $search_terms_like );
+		}
+
+		if ( !empty( $exclude ) ) {
+			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
+		$bp = buddypress();
+
+		if ( !empty( $user_id ) ) {
+			$user_id = esc_sql( $user_id );
+			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY f.posts ASC {$pag_sql}" );
+			$total_groups = $wpdb->get_results( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} " );
+		} else {
+			$paged_groups = $wpdb->get_results( "SELECT DISTINCT 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_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY f.posts ASC {$pag_sql}" );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} {$exclude_sql}" );
+		}
+
+		if ( !empty( $populate_extras ) ) {
+			foreach ( (array) $paged_groups as $group ) {
+				$group_ids[] = $group->id;
+			}
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
+		}
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get a list of groups whose names start with a given letter.
+	 *
+	 * @param string $letter The letter.
+	 * @param int|null $limit Optional. The max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. The page offset of results to return.
+	 *        Default: null (no limit).
+	 * @param bool $populate_extras Optional. Whether to fetch extra
+	 *        information about the groups. Default: true.
+	 * @param string|array|bool $exclude Optional. Array or comma-separated list of group
+	 *        IDs to exclude from results.
+	 * @return false|array {
+	 *     @type array $groups Array of group objects returned by the
+	 *           paginated query.
+	 *     @type int $total Total count of all groups matching non-
+	 *           paginated query params.
+	 * }
+	 */
+	public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
+		global $wpdb;
+
+		$pag_sql = $hidden_sql = $exclude_sql = '';
+
+		// Multibyte compliance
+		if ( function_exists( 'mb_strlen' ) ) {
+			if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) {
+				return false;
+			}
+		} else {
+			if ( strlen( $letter ) > 1 || is_numeric( $letter ) || !$letter ) {
+				return false;
+			}
+		}
+
+		$bp = buddypress();
+
+		if ( !empty( $exclude ) ) {
+			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
+		if ( !bp_current_user_can( 'bp_moderate' ) )
+			$hidden_sql = " AND status != 'hidden'";
+
+		$letter_like = bp_esc_like( $letter ) . '%';
+
+		if ( !empty( $limit ) && !empty( $page ) ) {
+			$pag_sql      = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+		}
+
+		$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE %s {$hidden_sql} {$exclude_sql}", $letter_like ) );
+
+		$paged_groups = $wpdb->get_results( $wpdb->prepare( "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} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE %s {$hidden_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}", $letter_like ) );
+
+		if ( !empty( $populate_extras ) ) {
+			foreach ( (array) $paged_groups as $group ) {
+				$group_ids[] = $group->id;
+			}
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
+		}
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get a list of random groups.
+	 *
+	 * Use BP_Groups_Group::get() with 'type' = 'random' instead.
+	 *
+	 * @param int|null $limit Optional. The max number of results to return.
+	 *        Default: null (no limit).
+	 * @param int|null $page Optional. The page offset of results to return.
+	 *        Default: null (no limit).
+	 * @param int $user_id Optional. If present, groups will be limited to
+	 *        those of which the specified user is a member.
+	 * @param string|bool $search_terms Optional. Limit groups to those whose
+	 *        name or description field contain the search string.
+	 * @param bool $populate_extras Optional. Whether to fetch extra
+	 *        information about the groups. Default: true.
+	 * @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
+	 *           paginated query.
+	 *     @type int $total Total count of all groups matching non-
+	 *           paginated query params.
+	 * }
+	 */
+	public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
+		global $wpdb;
+
+		$pag_sql = $hidden_sql = $search_sql = $exclude_sql = '';
+
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		if ( !is_user_logged_in() || ( !bp_current_user_can( 'bp_moderate' ) && ( $user_id != bp_loggedin_user_id() ) ) )
+			$hidden_sql = "AND g.status != 'hidden'";
+
+		if ( !empty( $search_terms ) ) {
+			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
+			$search_sql = $wpdb->prepare( " AND ( g.name LIKE %s OR g.description LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		if ( !empty( $exclude ) ) {
+			$exclude     = wp_parse_id_list( $exclude );
+			$exclude     = esc_sql( implode( ',', $exclude ) );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		}
+
+		$bp = buddypress();
+
+		if ( !empty( $user_id ) ) {
+			$user_id = esc_sql( $user_id );
+			$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} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql} ORDER BY rand() {$pag_sql}" );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.is_confirmed = 1 AND m.is_banned = 0 {$exclude_sql}" );
+		} else {
+			$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} g WHERE 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} {$search_sql} {$exclude_sql} ORDER BY rand() {$pag_sql}" );
+			$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} {$exclude_sql}" );
+		}
+
+		if ( !empty( $populate_extras ) ) {
+			foreach ( (array) $paged_groups as $group ) {
+				$group_ids[] = $group->id;
+			}
+			$paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' );
+		}
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Fetch extra data for a list of groups.
+	 *
+	 * This method is used throughout the class, by methods that take a
+	 * $populate_extras parameter.
+	 *
+	 * Data fetched:
+	 *
+	 *     - Logged-in user's status within each group (is_member,
+	 *       is_confirmed, is_pending, is_banned)
+	 *
+	 * @param array $paged_groups Array of groups.
+	 * @param string|array Array or comma-separated list of IDs matching
+	 *        $paged_groups.
+	 * @param string|bool $type Not used.
+	 * @return array $paged_groups
+	 */
+	public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
+		global $wpdb;
+
+		if ( empty( $group_ids ) )
+			return $paged_groups;
+
+		$bp = buddypress();
+
+		// Sanitize group IDs
+		$group_ids = implode( ',', wp_parse_id_list( $group_ids ) );
+
+		// 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() ) );
+		} else {
+			$user_status_results = array();
+		}
+
+		// Reindex
+		$user_status = array();
+		foreach ( $user_status_results as $user_status_result ) {
+			$user_status[ $user_status_result->group_id ] = $user_status_result;
+		}
+
+		for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
+			$is_member = $is_invited = $is_pending = '0';
+			$gid = $paged_groups[ $i ]->id;
+
+			if ( isset( $user_status[ $gid ] ) ) {
+
+				// 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
+				} elseif ( $user_status[ $gid ]->invite_sent ) {
+					$is_invited = '1';
+
+				// User has sent request, but has not been confirmed
+				} else {
+					$is_pending = '1';
+				}
+			}
+
+			$paged_groups[ $i ]->is_member = $is_member;
+			$paged_groups[ $i ]->is_invited = $is_invited;
+			$paged_groups[ $i ]->is_pending = $is_pending;
+		}
+
+		if ( is_user_logged_in() ) {
+			$user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", bp_loggedin_user_id() ) );
+		} else {
+			$user_banned = array();
+		}
+
+		for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) {
+			$paged_groups[$i]->is_banned = false;
+
+			foreach ( (array) $user_banned as $group_id ) {
+				if ( $group_id == $paged_groups[$i]->id ) {
+					$paged_groups[$i]->is_banned = true;
+				}
+			}
+		}
+
+		return $paged_groups;
+	}
+
+	/**
+	 * Delete all invitations to a given group.
+	 *
+	 * @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.
+	 */
+	public static function delete_all_invites( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d AND invite_sent = 1", $group_id ) );
+	}
+
+	/**
+	 * Get a total group count for the site.
+	 *
+	 * Will include hidden groups in the count only if
+	 * current_user_can( 'bp_moderate' ).
+	 *
+	 * @return int Group count.
+	 */
+	public static function get_total_group_count() {
+		global $wpdb;
+
+		$hidden_sql = '';
+		if ( !bp_current_user_can( 'bp_moderate' ) )
+			$hidden_sql = "WHERE status != 'hidden'";
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" );
+	}
+
+	/**
+	 * Get global count of forum topics in public groups (legacy forums).
+	 *
+	 * @param string $type Optional. If 'unreplied', count will be limited to
+	 *        those topics that have received no replies.
+	 * @return int Forum topic count.
+	 */
+	public static function get_global_forum_topic_count( $type ) {
+		global $bbdb, $wpdb;
+
+		$bp = buddypress();
+
+		if ( 'unreplied' == $type )
+			$bp->groups->filter_sql = ' AND t.topic_posts = 1';
+
+		/**
+		 * Filters the portion of the SQL related to global count of forum topics in public groups.
+		 *
+		 * https://buddypress.trac.wordpress.org/ticket/4306.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $filter_sql SQL portion for the query.
+		 * @param string $type       Type of forum topics to query for.
+		 */
+		$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
+		if ( 'AND' != substr( trim( strtoupper( $extra_sql ) ), 0, 3 ) )
+			$extra_sql = ' AND ' . $extra_sql;
+
+		return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
+	}
+
+	/**
+	 * Get the member count for a group.
+	 *
+	 * @param int $group_id Group ID.
+	 * @return int Count of confirmed members for the group.
+	 */
+	public static function get_total_member_count( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
+	}
+
+	/**
+	 * Get a total count of all topics of a given status, across groups/forums
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $status Which group type to count. 'public', 'private',
+	 *        'hidden', or 'all'. Default: 'public'.
+	 * @param string|bool $search_terms Provided search terms.
+	 *
+	 * @return int The topic count
+	 */
+	public static function get_global_topic_count( $status = 'public', $search_terms = false ) {
+		global $bbdb, $wpdb;
+
+		switch ( $status ) {
+			case 'all' :
+				$status_sql = '';
+				break;
+
+			case 'hidden' :
+				$status_sql = "AND g.status = 'hidden'";
+				break;
+
+			case 'private' :
+				$status_sql = "AND g.status = 'private'";
+				break;
+
+			case 'public' :
+			default :
+				$status_sql = "AND g.status = 'public'";
+				break;
+		}
+
+		$bp = buddypress();
+
+		$sql = array();
+
+		$sql['select'] = "SELECT COUNT(t.topic_id)";
+		$sql['from']   = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
+		$sql['where']  = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
+
+		if ( !empty( $search_terms ) ) {
+			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
+			$sql['where'] .= $wpdb->prepare( " AND ( t.topic_title LIKE %s )", $search_terms_like );
+		}
+
+		return $wpdb->get_var( implode( ' ', $sql ) );
+	}
+
+	/**
+	 * Get an array containing ids for each group type.
+	 *
+	 * A bit of a kludge workaround for some issues
+	 * with bp_has_groups().
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @return array
+	 */
+	public static function get_group_type_ids() {
+		global $wpdb;
+
+		$bp  = buddypress();
+		$ids = array();
+
+		$ids['all']     = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name}" );
+		$ids['public']  = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'public'" );
+		$ids['private'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'private'" );
+		$ids['hidden']  = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'hidden'" );
+
+		return $ids;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member-suggestions.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member-suggestions.php
new file mode 100644
index 0000000000000000000000000000000000000000..8f2375d3271e303c78c421622cfc37b1598e3e1d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member-suggestions.php
@@ -0,0 +1,177 @@
+<?php
+/**
+ * BuddyPress Groups Classes.
+ *
+ * @package BuddyPress
+ * @subpackage GroupsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Adds support for user at-mentions (for users in a specific Group) to the Suggestions API.
+ *
+ * @since BuddyPress (2.1.0)
+ */
+class BP_Groups_Member_Suggestions extends BP_Members_Suggestions {
+
+	/**
+	 * Default arguments for this suggestions service.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 * @access protected
+	 * @var array $args {
+	 *     @type int    $group_id     Positive integers will restrict the search to members in that group.
+	 *                                Negative integers will restrict the search to members in every other group.
+	 *     @type int    $limit        Maximum number of results to display. Default: 16.
+	 *     @type bool   $only_friends If true, only match the current user's friends. Default: false.
+	 *     @type string $term         The suggestion service will try to find results that contain this string.
+	 *                                Mandatory.
+	 * }
+	 */
+	protected $default_args = array(
+		'group_id'     => 0,
+		'limit'        => 16,
+		'only_friends' => false,
+		'term'         => '',
+		'type'         => '',
+	);
+
+
+	/**
+	 * Validate and sanitise the parameters for the suggestion service query.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
+	 */
+	public function validate() {
+		$this->args['group_id'] = (int) $this->args['group_id'];
+
+		/**
+		 * Filters the arguments used to validate and sanitize suggestion service query.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array                        $args  Array of arguments for the suggestion service query.
+		 * @param BP_Groups_Member_Suggestions $this  Instance of the current suggestion class.
+		 */
+		$this->args             = apply_filters( 'bp_groups_member_suggestions_args', $this->args, $this );
+
+		// Check for invalid or missing mandatory parameters.
+		if ( ! $this->args['group_id'] || ! bp_is_active( 'groups' ) ) {
+			return new WP_Error( 'missing_requirement' );
+		}
+
+		// Check that the specified group_id exists, and that the current user can access it.
+		$the_group = groups_get_group( array(
+			'group_id'        => absint( $this->args['group_id'] ),
+			'populate_extras' => true,
+		) );
+
+		if ( $the_group->id === 0 || ! $the_group->user_has_access ) {
+			return new WP_Error( 'access_denied' );
+		}
+
+		/**
+		 * Filters the validation results for the suggestion service query.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param bool|WP_Error                $value True if valid, WP_Error if not.
+		 * @param BP_Groups_Member_Suggestions $this  Instance of the current suggestion class.
+		 */
+		return apply_filters( 'bp_groups_member_suggestions_validate_args', parent::validate(), $this );
+	}
+
+	/**
+	 * Find and return a list of username suggestions that match the query.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
+	 */
+	public function get_suggestions() {
+		$user_query = array(
+			'count_total'     => '',  // Prevents total count
+			'populate_extras' => false,
+			'type'            => 'alphabetical',
+
+			'group_role'      => array( 'admin', 'member', 'mod' ),
+			'page'            => 1,
+			'per_page'        => $this->args['limit'],
+			'search_terms'    => $this->args['term'],
+			'search_wildcard' => 'right',
+		);
+
+		// Only return matches of friends of this user.
+		if ( $this->args['only_friends'] && is_user_logged_in() ) {
+			$user_query['user_id'] = get_current_user_id();
+		}
+
+		// Positive Group IDs will restrict the search to members in that group.
+		if ( $this->args['group_id'] > 0 ) {
+			$user_query['group_id'] = $this->args['group_id'];
+
+		// Negative Group IDs will restrict the search to members in every other group.
+		} else {
+			$group_query = array(
+				'count_total'     => '',  // Prevents total count
+				'populate_extras' => false,
+				'type'            => 'alphabetical',
+
+				'group_id'        => absint( $this->args['group_id'] ),
+				'group_role'      => array( 'admin', 'member', 'mod' ),
+				'page'            => 1,
+			);
+			$group_users = new BP_Group_Member_Query( $group_query );
+
+			if ( $group_users->results ) {
+				$user_query['exclude'] = wp_list_pluck( $group_users->results, 'ID' );
+			} else {
+				$user_query['include'] = array( 0 );
+			}
+		}
+
+		/**
+		 * Filters the arguments for the user query for the Suggestion API.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array                        $user_query Array of arguments for the query.
+		 * @param BP_Groups_Member_Suggestions $this       Instance of the current suggestion class.
+		 */
+		$user_query = apply_filters( 'bp_groups_member_suggestions_query_args', $user_query, $this );
+		if ( is_wp_error( $user_query ) ) {
+			return $user_query;
+		}
+
+
+		if ( isset( $user_query['group_id'] ) ) {
+			$user_query = new BP_Group_Member_Query( $user_query );
+		} else {
+			$user_query = new BP_User_Query( $user_query );
+		}
+
+		$results = array();
+		foreach ( $user_query->results as $user ) {
+			$result        = new stdClass();
+			$result->ID    = $user->user_nicename;
+			$result->image = bp_core_fetch_avatar( array( 'html' => false, 'item_id' => $user->ID ) );
+			$result->name  = bp_core_get_user_displayname( $user->ID );
+
+			$results[] = $result;
+		}
+
+		/**
+		 * Filters the results of the member suggestions user query.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array                        $results Array of member suggestions.
+		 * @param BP_Groups_Member_Suggestions $this    Instance of the current suggestion class.
+		 */
+		return apply_filters( 'bp_groups_member_suggestions_get_suggestions', $results, $this );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member.php
new file mode 100644
index 0000000000000000000000000000000000000000..dfd0ab5a271e58177a3a30baee82d341d7983a21
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member.php
@@ -0,0 +1,1107 @@
+<?php
+/**
+ * BuddyPress Groups Classes
+ *
+ * @package BuddyPress
+ * @subpackage GroupsClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Group Membership object.
+ */
+class BP_Groups_Member {
+
+	/**
+	 * ID of the membership.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $id;
+
+	/**
+	 * ID of the group associated with the membership.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $group_id;
+
+	/**
+	 * ID of the user associated with the membership.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $user_id;
+
+	/**
+	 * ID of the user whose invitation initiated the membership.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $inviter_id;
+
+	/**
+	 * Whether the member is an admin of the group.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $is_admin;
+
+	/**
+	 * Whether the member is a mod of the group.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $is_mod;
+
+	/**
+	 * Whether the member is banned from the group.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $is_banned;
+
+	/**
+	 * Title used to describe the group member's role in the group.
+	 *
+	 * Eg, 'Group Admin'.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $user_title;
+
+	/**
+	 * Last modified date of the membership.
+	 *
+	 * This value is updated when, eg, invitations are accepted.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	var $date_modified;
+
+	/**
+	 * Whether the membership has been confirmed.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $is_confirmed;
+
+	/**
+	 * Comments associated with the membership.
+	 *
+	 * In BP core, these are limited to the optional message users can
+	 * include when requesting membership to a private group.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	var $comments;
+
+	/**
+	 * Whether an invitation has been sent for this membership.
+	 *
+	 * The purpose of this flag is to mark when an invitation has been
+	 * "drafted" (the user has been added via the interface at Send
+	 * Invites), but the Send button has not been pressed, so the
+	 * invitee has not yet been notified.
+	 *
+	 * @access public
+	 * @var int
+	 */
+	var $invite_sent;
+
+	/**
+	 * WP_User object representing the membership's user.
+	 *
+	 * @access public
+	 * @var WP_User
+	 */
+	var $user;
+
+	/**
+	 * Constructor method.
+	 *
+	 * @param int $user_id Optional. Along with $group_id, can be used to
+	 *        look up a membership.
+	 * @param int $group_id Optional. Along with $user_id, can be used to
+	 *        look up a membership.
+	 * @param int|bool $id Optional. The unique ID of the membership object.
+	 * @param bool $populate Whether to populate the properties of the
+	 *        located membership. Default: true.
+	 */
+	public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
+
+		// User and group are not empty, and ID is
+		if ( !empty( $user_id ) && !empty( $group_id ) && empty( $id ) ) {
+			$this->user_id  = $user_id;
+			$this->group_id = $group_id;
+
+			if ( !empty( $populate ) ) {
+				$this->populate();
+			}
+		}
+
+		// ID is not empty
+		if ( !empty( $id ) ) {
+			$this->id = $id;
+
+			if ( !empty( $populate ) ) {
+				$this->populate();
+			}
+		}
+	}
+
+	/**
+	 * Populate the object's properties.
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( $this->user_id && $this->group_id && !$this->id )
+			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
+
+		if ( !empty( $this->id ) )
+			$sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_members} WHERE id = %d", $this->id );
+
+		$member = $wpdb->get_row($sql);
+
+		if ( !empty( $member ) ) {
+			$this->id            = $member->id;
+			$this->group_id      = $member->group_id;
+			$this->user_id       = $member->user_id;
+			$this->inviter_id    = $member->inviter_id;
+			$this->is_admin      = $member->is_admin;
+			$this->is_mod        = $member->is_mod;
+			$this->is_banned     = $member->is_banned;
+			$this->user_title    = $member->user_title;
+			$this->date_modified = $member->date_modified;
+			$this->is_confirmed  = $member->is_confirmed;
+			$this->comments      = $member->comments;
+			$this->invite_sent   = $member->invite_sent;
+
+			$this->user = new BP_Core_User( $this->user_id );
+		}
+	}
+
+	/**
+	 * Save the membership data to the database.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->user_id       = apply_filters( 'groups_member_user_id_before_save',       $this->user_id,       $this->id );
+		$this->group_id      = apply_filters( 'groups_member_group_id_before_save',      $this->group_id,      $this->id );
+		$this->inviter_id    = apply_filters( 'groups_member_inviter_id_before_save',    $this->inviter_id,    $this->id );
+		$this->is_admin      = apply_filters( 'groups_member_is_admin_before_save',      $this->is_admin,      $this->id );
+		$this->is_mod        = apply_filters( 'groups_member_is_mod_before_save',        $this->is_mod,        $this->id );
+		$this->is_banned     = apply_filters( 'groups_member_is_banned_before_save',     $this->is_banned,     $this->id );
+		$this->user_title    = apply_filters( 'groups_member_user_title_before_save',    $this->user_title,    $this->id );
+		$this->date_modified = apply_filters( 'groups_member_date_modified_before_save', $this->date_modified, $this->id );
+		$this->is_confirmed  = apply_filters( 'groups_member_is_confirmed_before_save',  $this->is_confirmed,  $this->id );
+		$this->comments      = apply_filters( 'groups_member_comments_before_save',      $this->comments,      $this->id );
+		$this->invite_sent   = apply_filters( 'groups_member_invite_sent_before_save',   $this->invite_sent,   $this->id );
+
+		/**
+		 * Fires before the current group membership item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Groups_Member $this Current instance of the group membership item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'groups_member_before_save', array( &$this ) );
+
+		if ( !empty( $this->id ) ) {
+			$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
+			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;
+			}
+
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_members} ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d )", $this->user_id, $this->group_id, $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 );
+		}
+
+		if ( !$wpdb->query( $sql ) )
+			return false;
+
+		$this->id = $wpdb->insert_id;
+
+		// Update the user's group count
+		self::refresh_total_group_count_for_user( $this->user_id );
+
+		// Update the group's member count
+		self::refresh_total_member_count_for_group( $this->group_id );
+
+		/**
+		 * Fires after the current group membership item has been saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Groups_Member $this Current instance of the group membership item has been saved. Passed by reference.
+		 */
+		do_action_ref_array( 'groups_member_after_save', array( &$this ) );
+
+		return true;
+	}
+
+	/**
+	 * Promote a member to a new status.
+	 *
+	 * @param string $status The new status. 'mod' or 'admin'.
+	 * @return bool True on success, false on failure.
+	 */
+	public function promote( $status = 'mod' ) {
+		if ( 'mod' == $status ) {
+			$this->is_admin   = 0;
+			$this->is_mod     = 1;
+			$this->user_title = __( 'Group Mod', 'buddypress' );
+		}
+
+		if ( 'admin' == $status ) {
+			$this->is_admin   = 1;
+			$this->is_mod     = 0;
+			$this->user_title = __( 'Group Admin', 'buddypress' );
+		}
+
+		return $this->save();
+	}
+
+	/**
+	 * Demote membership to Member status (non-admin, non-mod).
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function demote() {
+		$this->is_mod     = 0;
+		$this->is_admin   = 0;
+		$this->user_title = false;
+
+		return $this->save();
+	}
+
+	/**
+	 * Ban the user from the group.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function ban() {
+		if ( !empty( $this->is_admin ) )
+			return false;
+
+		$this->is_mod = 0;
+		$this->is_banned = 1;
+
+		return $this->save();
+	}
+
+	/**
+	 * Unban the user from the group.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function unban() {
+		if ( !empty( $this->is_admin ) )
+			return false;
+
+		$this->is_banned = 0;
+
+		return $this->save();
+	}
+
+	/**
+	 * Mark a pending invitation as accepted.
+	 */
+	public function accept_invite() {
+		$this->inviter_id    = 0;
+		$this->is_confirmed  = 1;
+		$this->date_modified = bp_core_current_time();
+	}
+
+	/**
+	 * Confirm a membership request.
+	 */
+	public function accept_request() {
+		$this->is_confirmed = 1;
+		$this->date_modified = bp_core_current_time();
+	}
+
+	/**
+	 * Remove the current membership.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function remove() {
+		global $wpdb;
+
+		/**
+		 * Fires before a member is removed from a group.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param BP_Groups_Member $this Current group membership object.
+		 */
+		do_action_ref_array( 'groups_member_before_remove', array( $this ) );
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
+
+		if ( !$result = $wpdb->query( $sql ) )
+			return false;
+
+		// Update the user's group count
+		self::refresh_total_group_count_for_user( $this->user_id );
+
+		// Update the group's member count
+		self::refresh_total_member_count_for_group( $this->group_id );
+
+		/**
+		 * Fires after a member is removed from a group.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param BP_Groups_Member $this Current group membership object.
+		 */
+		do_action_ref_array( 'groups_member_after_remove', array( $this ) );
+
+		return $result;
+	}
+
+	/** Static Methods ****************************************************/
+
+	/**
+	 * Refresh the total_group_count for a user.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param int $user_id ID of the user.
+	 * @return bool True on success, false on failure.
+	 */
+	public static function refresh_total_group_count_for_user( $user_id ) {
+		return bp_update_user_meta( $user_id, 'total_group_count', (int) self::total_group_count( $user_id ) );
+	}
+
+	/**
+	 * Refresh the total_member_count for a group.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return bool True on success, false on failure.
+	 */
+	public static function refresh_total_member_count_for_group( $group_id ) {
+		return groups_update_groupmeta( $group_id, 'total_member_count', (int) BP_Groups_Group::get_total_member_count( $group_id ) );
+	}
+
+	/**
+	 * Delete a membership, based on user + group IDs.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @param int $group_id ID of the group.
+	 * @return True on success, false on failure.
+	 */
+	public static function delete( $user_id, $group_id ) {
+		global $wpdb;
+
+		/**
+		 * Fires before a group membership is deleted.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param int $user_id  ID of the user.
+		 * @param int $group_id ID of the group.
+		 */
+		do_action( 'bp_groups_member_before_delete', $user_id, $group_id );
+
+		$bp = buddypress();
+		$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
+		self::refresh_total_group_count_for_user( $user_id );
+
+		// Update the group's member count
+		self::refresh_total_member_count_for_group( $group_id );
+
+		/**
+		 * Fires after a member is removed from a group.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param int $user_id  ID of the user.
+		 * @param int $group_id ID of the group.
+		 */
+		do_action( 'bp_groups_member_after_delete', $user_id, $group_id );
+
+		return $remove;
+	}
+
+	/**
+	 * Get the IDs of the groups of which a specified user is a member.
+	 *
+	 * @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).
+	 * @return array {
+	 *     @type array $groups Array of groups returned by paginated query.
+	 *     @type int $total Count of groups matching query.
+	 * }
+	 */
+	public static function get_group_ids( $user_id, $limit = false, $page = false ) {
+		global $wpdb;
+
+		$pag_sql = '';
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		$bp = buddypress();
+
+		// 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 );
+			$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(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", $user_id ) );
+		} else {
+			$group_sql = $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0{$pag_sql}", $user_id );
+			$total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id ) );
+		}
+
+		$groups = $wpdb->get_col( $group_sql );
+
+		return array( 'groups' => $groups, 'total' => (int) $total_groups );
+	}
+
+	/**
+	 * Get the IDs of the groups of which a specified user is a member, sorted by the date joined.
+	 *
+	 * @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_recently_joined( $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 ORDER BY m.date_modified DESC {$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_banned = 0 AND m.is_confirmed = 1 ORDER BY m.date_modified DESC" );
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * Get the IDs of the groups of which a specified user is an admin.
+	 *
+	 * @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_admin_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_admin = 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_admin = 1 ORDER BY date_modified ASC" );
+
+		return array( 'groups' => $paged_groups, 'total' => $total_groups );
+	}
+
+	/**
+	 * 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 count of groups of which the specified user is a member.
+	 *
+	 * @param int $user_id Optional. Default: ID of the displayed user.
+	 * @return int Group count.
+	 */
+	public static function total_group_count( $user_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			$user_id = bp_displayed_user_id();
+
+		$bp = buddypress();
+
+		if ( $user_id != bp_loggedin_user_id() && !bp_current_user_can( 'bp_moderate' ) ) {
+			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
+		} else {
+			return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) );
+		}
+	}
+
+	/**
+	 * Get a user's outstanding group invitations.
+	 *
+	 * @param int $user_id ID of the invitee.
+	 * @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|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.
+	 *     @type int $total Count of groups matching query.
+	 * }
+	 */
+	public static function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) {
+		global $wpdb;
+
+		$pag_sql = ( !empty( $limit ) && !empty( $page ) ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
+
+		if ( !empty( $exclude ) ) {
+			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
+			$exclude_sql = " AND g.id NOT IN ({$exclude})";
+		} else {
+			$exclude_sql = '';
+		}
+
+		$bp = buddypress();
+
+		$paged_groups = $wpdb->get_results( $wpdb->prepare( "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' AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d {$exclude_sql} ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
+
+		return array( 'groups' => $paged_groups, 'total' => self::get_invite_count_for_user( $user_id ) );
+	}
+
+	/**
+	 * Gets the total group invite count for a user.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param int $user_id The user ID
+	 * @return int
+	 */
+	public static function get_invite_count_for_user( $user_id = 0 ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$count = wp_cache_get( $user_id, 'bp_group_invite_count' );
+
+		if ( false === $count ) {
+			$count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d", $user_id ) );
+			wp_cache_set( $user_id, $count, 'bp_group_invite_count' );
+		}
+
+		return $count;
+	}
+
+	/**
+	 * Check whether a user has an outstanding invitation to a given group.
+	 *
+	 * @param int $user_id ID of the potential invitee.
+	 * @param int $group_id ID of the group.
+	 * @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.
+	 */
+	public static function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp  = buddypress();
+		$sql = "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0";
+
+		if ( 'sent' == $type )
+			$sql .= " AND invite_sent = 1";
+
+		return $wpdb->get_var( $wpdb->prepare( $sql, $user_id, $group_id ) );
+	}
+
+	/**
+	 * Delete an invitation, by specifying user ID and group ID.
+	 *
+	 * @global WPDB $wpdb
+	 *
+	 * @param  int $user_id  ID of the user.
+	 * @param  int $group_id ID of the group.
+	 * @return int Number of records deleted.
+	 */
+	public static function delete_invite( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) ) {
+			return false;
+		}
+
+		$table_name = buddypress()->groups->table_name_members;
+
+		$sql = "DELETE FROM {$table_name}
+				WHERE user_id = %d
+					AND group_id = %d
+					AND is_confirmed = 0
+					AND inviter_id != 0";
+
+		$prepared = $wpdb->prepare( $sql, $user_id, $group_id );
+
+		return $wpdb->query( $prepared );
+	}
+
+	/**
+	 * Delete an unconfirmed membership request, by user ID and group ID.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @param int $group_id ID of the group.
+	 * @return int Number of records deleted.
+	 */
+	public static function delete_request( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+ 		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id = 0 AND invite_sent = 0", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Check whether a user is an admin of a given group.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @param int $group_id ID of the group.
+	 * @param int|null ID of the membership if the user is an admin,
+	 *        otherwise null.
+	 *
+	 * @return mixed
+	 */
+	public static function check_is_admin( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_admin = 1 AND is_banned = 0", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Check whether a user is a mod of a given group.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @param int $group_id ID of the group.
+	 * @param int|null ID of the membership if the user is a mod,
+	 *        otherwise null.
+	 *
+	 * @return mixed
+	 */
+	public static function check_is_mod( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_mod = 1 AND is_banned = 0", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Check whether a user is a member of a given group.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @param int $group_id ID of the group.
+	 * @param int|null ID of the membership if the user is a member,
+	 *        otherwise null.
+	 *
+	 * @return mixed
+	 */
+	public static function check_is_member( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Check whether a user is banned from a given group.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @param int $group_id ID of the group.
+	 * @param int|null ID of the membership if the user is banned,
+	 *        otherwise null.
+	 *
+	 * @return mixed
+	 */
+	public static function check_is_banned( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT is_banned FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Is the specified user the creator of the group?
+	 *
+	 * @since BuddyPress (1.2.6)
+	 *
+	 * @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.
+	 */
+	public static function check_is_creator( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name} WHERE creator_id = %d AND id = %d", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Check whether a user has an outstanding membership request for a given group.
+	 *
+	 * @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.
+	 */
+	public static function check_for_membership_request( $user_id, $group_id ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) )
+			return false;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND is_banned = 0 AND inviter_id = 0", $user_id, $group_id ) );
+	}
+
+	/**
+	 * Get a list of randomly selected IDs of groups that the member belongs to.
+	 *
+	 * @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.
+	 */
+	public static function get_random_groups( $user_id = 0, $total_groups = 5 ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// 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 ) );
+		} else {
+			return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT %d", $user_id, $total_groups ) );
+		}
+	}
+
+	/**
+	 * Get the IDs of all a given group's members.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return array IDs of all group members.
+	 */
+	public static function get_group_member_ids( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
+	}
+
+	/**
+	 * Get a list of all a given group's admins.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return array Info about group admins (user_id + date_modified).
+	 */
+	public static function get_group_administrator_ids( $group_id ) {
+		global $wpdb;
+
+		$group_admins = wp_cache_get( $group_id, 'bp_group_admins' );
+
+		if ( false === $group_admins ) {
+			$bp = buddypress();
+			$group_admins = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) );
+
+			wp_cache_set( $group_id, $group_admins, 'bp_group_admins' );
+		}
+
+		return $group_admins;
+	}
+
+	/**
+	 * Get a list of all a given group's moderators.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return array Info about group mods (user_id + date_modified).
+	 */
+	public static function get_group_moderator_ids( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_mod = 1 AND is_banned = 0", $group_id ) );
+	}
+
+	/**
+	 * Get the IDs users with outstanding membership requests to the group.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return array IDs of users with outstanding membership requests.
+	 */
+	public static function get_all_membership_request_user_ids( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
+	}
+
+	/**
+	 * Get members of a group.
+	 *
+	 * @deprecated BuddyPress (1.8.0)
+	 *
+	 * @param $group_id
+	 * @param $limit
+	 * @param $page
+	 * @param $exclude_admins_mods
+	 * @param $exclude_banned
+	 * @param $exclude
+	 *
+	 * @return mixed
+	 */
+	public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
+		global $wpdb;
+
+		_deprecated_function( __METHOD__, '1.8', 'BP_Group_Member_Query' );
+
+		$pag_sql = '';
+		if ( !empty( $limit ) && !empty( $page ) )
+			$pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
+
+		$exclude_admins_sql = '';
+		if ( !empty( $exclude_admins_mods ) )
+			$exclude_admins_sql = "AND is_admin = 0 AND is_mod = 0";
+
+		$banned_sql = '';
+		if ( !empty( $exclude_banned ) )
+			$banned_sql = " AND is_banned = 0";
+
+		$exclude_sql = '';
+		if ( !empty( $exclude ) ) {
+			$exclude     = implode( ',', wp_parse_id_list( $exclude ) );
+			$exclude_sql = " AND m.user_id NOT IN ({$exclude})";
+		}
+
+		$bp = buddypress();
+
+		if ( bp_is_active( 'xprofile' ) ) {
+
+			/**
+			 * Filters the SQL prepared statement used to fetch group members.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $value SQL prepared statement for fetching group members.
+			 */
+			$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
+		} else {
+
+			/** This filter is documented in bp-groups/bp-groups-classes */
+			$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u WHERE u.ID = m.user_id AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
+		}
+
+		if ( empty( $members ) ) {
+			return false;
+		}
+
+		if ( empty( $pag_sql ) ) {
+			$total_member_count = count( $members );
+		} else {
+
+			/**
+			 * Filters the SQL prepared statement used to fetch group members total count.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $value SQL prepared statement for fetching group member count.
+			 */
+			$total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} m WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) );
+		}
+
+		// Fetch whether or not the user is a friend
+		foreach ( (array) $members as $user )
+			$user_ids[] = $user->user_id;
+
+		$user_ids = implode( ',', wp_parse_id_list( $user_ids ) );
+
+		if ( bp_is_active( 'friends' ) ) {
+			$friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) );
+			for ( $i = 0, $count = count( $members ); $i < $count; ++$i ) {
+				foreach ( (array) $friend_status as $status ) {
+					if ( $status->initiator_user_id == $members[$i]->user_id || $status->friend_user_id == $members[$i]->user_id ) {
+						$members[$i]->is_friend = $status->is_confirmed;
+					}
+				}
+			}
+		}
+
+		return array( 'members' => $members, 'count' => $total_member_count );
+	}
+
+	/**
+	 * Delete all memberships for a given group.
+	 *
+	 * @param int $group_id ID of the group.
+	 * @return int Number of records deleted.
+	 */
+	public static function delete_all( $group_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
+	}
+
+	/**
+	 * Delete all group membership information for the specified user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id ID of the user.
+	 *
+	 * @return mixed
+	 */
+	public static function delete_all_for_user( $user_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// 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 ( 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 );
+		}
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d", $user_id ) );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js
index 0255bdfda46e111d867fa48a0ea4ce91def7510c..42efbc7fb83f50c695851f8ff57987e0a42eb1c6 100644
--- a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js
+++ b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js
@@ -17,7 +17,7 @@ jQuery(document).ready( function() {
 			function(response)
 			{
 				jQuery(link).removeClass('loading');
-				groups_wiget_response(response);
+				groups_widget_response(response);
 			});
 
 			return false;
@@ -25,7 +25,7 @@ jQuery(document).ready( function() {
 	);
 });
 
-function groups_wiget_response(response) {
+function groups_widget_response(response) {
 	response = response.substr(0, response.length-1);
 	response = response.split('[[SPLIT]]');
 
diff --git a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js
index 62118304248c56a7dc8edec20d3670042ba60e9b..a0bb73f1fce9b4f7c2bb28baac88447dea6453d7 100644
--- a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js
+++ b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-function groups_wiget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#groups-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),groups_wiget_response(b)}),!1})});
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+function groups_widget_response(a){a=a.substr(0,a.length-1),a=a.split("[[SPLIT]]"),"-1"!==a[0]?jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]),jQuery(".widget ul#groups-list").fadeIn(200)}):jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b),jQuery(".widget ul#groups-list").fadeIn(200)})}jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;return jQuery(a).addClass("loading"),jQuery(".widget div#groups-list-options a").removeClass("selected"),jQuery(this).addClass("selected"),jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading"),groups_widget_response(b)}),!1})});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-loader.php b/wp-content/plugins/buddypress/bp-loader.php
index cac6f4887c04001740c26a933f43943ec056c4a7..506bb8aac217534ac1743294dcb69b1f88a40e4c 100644
--- a/wp-content/plugins/buddypress/bp-loader.php
+++ b/wp-content/plugins/buddypress/bp-loader.php
@@ -10,18 +10,18 @@
 
 /**
  * Plugin Name: BuddyPress
- * Plugin URI:  http://buddypress.org
- * Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
+ * Plugin URI:  https://buddypress.org/
+ * Description: BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more.
  * Author:      The BuddyPress Community
- * Author URI:  http://buddypress.org/community/members/
- * Version:     2.1.1
+ * Author URI:  https://buddypress.org/
+ * Version:     2.3.2.1
  * Text Domain: buddypress
  * Domain Path: /bp-languages/
  * License:     GPLv2 or later (license.txt)
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Constants *****************************************************************/
 
@@ -80,6 +80,11 @@ class BuddyPress {
 	 */
 	public $action_variables = array();
 
+	/**
+	 * @var string Current member directory type.
+	 */
+	public $current_member_type = '';
+
 	/**
 	 * @var array Required components (core, members).
 	 */
@@ -143,6 +148,8 @@ class BuddyPress {
 
 		// Always return the instance
 		return $instance;
+
+		// The last metroid is in captivity. The galaxy is at peace.
 	}
 
 	/** Magic Methods *********************************************************/
@@ -178,14 +185,14 @@ class BuddyPress {
 	public function __isset( $key ) { return isset( $this->data[$key] ); }
 
 	/**
-	 * Magic method for getting BuddyPress varibles.
+	 * Magic method for getting BuddyPress variables.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
 	public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
 
 	/**
-	 * Magic method for setting BuddyPress varibles.
+	 * Magic method for setting BuddyPress variables.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
@@ -222,8 +229,9 @@ class BuddyPress {
 
 		// Place your custom code (actions/filters) in a file called
 		// '/plugins/bp-custom.php' and it will be loaded before anything else.
-		if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
+		if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) ) {
 			require( WP_PLUGIN_DIR . '/bp-custom.php' );
+		}
 
 		// Path and URL
 		if ( ! defined( 'BP_PLUGIN_DIR' ) ) {
@@ -282,8 +290,9 @@ class BuddyPress {
 		// search requests are loaded
 		//
 		// @todo Make this better
-		if ( !defined( 'BP_SEARCH_SLUG' ) )
+		if ( ! defined( 'BP_SEARCH_SLUG' ) ) {
 			define( 'BP_SEARCH_SLUG', 'search' );
+		}
 	}
 
 	/**
@@ -300,11 +309,18 @@ class BuddyPress {
 
 		/** Versions **********************************************************/
 
-		$this->version    = '2.1.1';
-		$this->db_version = 8311;
+		$this->version    = '2.3.2.1';
+		$this->db_version = 9951;
 
 		/** Loading ***********************************************************/
 
+		/**
+		 * Filters the load_deprecated property value.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param constant BP_IGNORE_DEPRECATED Whether or not to ignore deprecated functionality.
+		 */
 		$this->load_deprecated = ! apply_filters( 'bp_ignore_deprecated', BP_IGNORE_DEPRECATED );
 
 		/** Toolbar ***********************************************************/
@@ -352,6 +368,13 @@ class BuddyPress {
 		/** Root **************************************************************/
 
 		// BuddyPress Root blog ID
+		/**
+		 * Filters the BuddyPress Root blog ID.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param constant BP_ROOT_BLOG BuddyPress Root blog ID.
+		 */
 		$this->root_blog_id = (int) apply_filters( 'bp_get_root_blog_id', BP_ROOT_BLOG );
 
 		/** Paths**************************************************************/
@@ -365,7 +388,7 @@ class BuddyPress {
 		// Languages
 		$this->lang_dir       = $this->plugin_dir . 'bp-languages';
 
-		// Templates (theme compatability)
+		// Templates (theme compatibility)
 		$this->themes_dir     = $this->plugin_dir . 'bp-templates';
 		$this->themes_url     = $this->plugin_url . 'bp-templates';
 
@@ -395,10 +418,14 @@ class BuddyPress {
 	private function legacy_constants() {
 
 		// Define the BuddyPress version
-		if ( !defined( 'BP_VERSION'    ) ) define( 'BP_VERSION',    $this->version   );
+		if ( ! defined( 'BP_VERSION' ) ) {
+			define( 'BP_VERSION', $this->version );
+		}
 
 		// Define the database version
-		if ( !defined( 'BP_DB_VERSION' ) ) define( 'BP_DB_VERSION', $this->db_version );
+		if ( ! defined( 'BP_DB_VERSION' ) ) {
+			define( 'BP_DB_VERSION', $this->db_version );
+		}
 	}
 
 	/**
@@ -419,30 +446,32 @@ class BuddyPress {
 
 		/** Update/Install ****************************************************/
 
-		// Theme compatability
+		// Theme compatibility
 		require( $this->plugin_dir . 'bp-core/bp-core-template-loader.php'     );
 		require( $this->plugin_dir . 'bp-core/bp-core-theme-compatibility.php' );
 
 		// Require all of the BuddyPress core libraries
-		require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' );
-		require( $this->plugin_dir . 'bp-core/bp-core-actions.php'    );
-		require( $this->plugin_dir . 'bp-core/bp-core-caps.php'       );
-		require( $this->plugin_dir . 'bp-core/bp-core-cache.php'      );
-		require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php'      );
-		require( $this->plugin_dir . 'bp-core/bp-core-update.php'     );
-		require( $this->plugin_dir . 'bp-core/bp-core-options.php'    );
-		require( $this->plugin_dir . 'bp-core/bp-core-classes.php'    );
-		require( $this->plugin_dir . 'bp-core/bp-core-filters.php'    );
-		require( $this->plugin_dir . 'bp-core/bp-core-avatars.php'    );
-		require( $this->plugin_dir . 'bp-core/bp-core-widgets.php'    );
-		require( $this->plugin_dir . 'bp-core/bp-core-template.php'   );
-		require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php'   );
-		require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php'   );
-		require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php'   );
-		require( $this->plugin_dir . 'bp-core/bp-core-component.php'  );
-		require( $this->plugin_dir . 'bp-core/bp-core-functions.php'  );
-		require( $this->plugin_dir . 'bp-core/bp-core-moderation.php' );
-		require( $this->plugin_dir . 'bp-core/bp-core-loader.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-dependency.php'  );
+		require( $this->plugin_dir . 'bp-core/bp-core-actions.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-caps.php'        );
+		require( $this->plugin_dir . 'bp-core/bp-core-cache.php'       );
+		require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php'       );
+		require( $this->plugin_dir . 'bp-core/bp-core-update.php'      );
+		require( $this->plugin_dir . 'bp-core/bp-core-options.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-classes.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-taxonomy.php'    );
+		require( $this->plugin_dir . 'bp-core/bp-core-filters.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-attachments.php' );
+		require( $this->plugin_dir . 'bp-core/bp-core-avatars.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-widgets.php'     );
+		require( $this->plugin_dir . 'bp-core/bp-core-template.php'    );
+		require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php'    );
+		require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php'    );
+		require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php'    );
+		require( $this->plugin_dir . 'bp-core/bp-core-component.php'   );
+		require( $this->plugin_dir . 'bp-core/bp-core-functions.php'   );
+		require( $this->plugin_dir . 'bp-core/bp-core-moderation.php'  );
+		require( $this->plugin_dir . 'bp-core/bp-core-loader.php'      );
 
 		// Skip or load deprecated content
 		if ( false !== $this->load_deprecated ) {
@@ -453,6 +482,8 @@ class BuddyPress {
 			require( $this->plugin_dir . 'bp-core/deprecated/1.9.php' );
 			require( $this->plugin_dir . 'bp-core/deprecated/2.0.php' );
 			require( $this->plugin_dir . 'bp-core/deprecated/2.1.php' );
+			require( $this->plugin_dir . 'bp-core/deprecated/2.2.php' );
+			require( $this->plugin_dir . 'bp-core/deprecated/2.3.php' );
 		}
 	}
 
@@ -473,8 +504,9 @@ class BuddyPress {
 		add_action( 'deactivate_' . $this->basename, 'bp_deactivation' );
 
 		// If BuddyPress is being deactivated, do not add any actions
-		if ( bp_is_deactivation( $this->basename ) )
+		if ( bp_is_deactivation( $this->basename ) ) {
 			return;
+		}
 
 		// Array of BuddyPress core actions
 		$actions = array(
@@ -492,10 +524,21 @@ class BuddyPress {
 		);
 
 		// Add the actions
-		foreach( $actions as $class_action )
-			add_action( 'bp_' . $class_action, array( $this, $class_action ), 5 );
+		foreach( $actions as $class_action ) {
+			if ( method_exists( $this, $class_action ) ) {
+				add_action( 'bp_' . $class_action, array( $this, $class_action ), 5 );
+			}
+		}
 
-		// All BuddyPress actions are setup (includes bbp-core-hooks.php)
+		/**
+		 * Fires after the setup of all BuddyPress actions.
+		 *
+		 * Includes bbp-core-hooks.php.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param BuddyPress $this. Current BuddyPress instance. Passed by reference.
+		 */
 		do_action_ref_array( 'bp_after_setup_actions', array( &$this ) );
 	}
 
@@ -578,15 +621,16 @@ class BuddyPress {
 	}
 
 	/**
-	 * Set up the default BuddyPress theme compatability location.
+	 * Set up the default BuddyPress theme compatibility location.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
 	public function setup_theme() {
 
 		// Bail if something already has this under control
-		if ( ! empty( $this->theme_compat->theme ) )
+		if ( ! empty( $this->theme_compat->theme ) ) {
 			return;
+		}
 
 		// Setup the theme package to use for compatibility
 		bp_setup_theme_compat( bp_get_theme_package_id() );
diff --git a/wp-content/plugins/buddypress/bp-members/admin/bp-members-admin-classes.php b/wp-content/plugins/buddypress/bp-members/admin/bp-members-admin-classes.php
new file mode 100644
index 0000000000000000000000000000000000000000..e32baff435bdbc02f8852c89ce12fe6b1a48ea4d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/admin/bp-members-admin-classes.php
@@ -0,0 +1,759 @@
+<?php
+
+/**
+ * BuddyPress Members List Classes
+ *
+ * @package BuddyPress
+ * @subpackage MembersAdminClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+if ( class_exists( 'WP_Users_List_Table') ) :
+
+/**
+ * List table class for signups admin page.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_Members_List_Table extends WP_Users_List_Table {
+
+	/**
+	 * Signup counts.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $signup_counts = 0;
+
+	/**
+	 * Constructor.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function __construct() {
+		// Define singular and plural labels, as well as whether we support AJAX.
+		parent::__construct( array(
+			'ajax'     => false,
+			'plural'   => 'signups',
+			'singular' => 'signup',
+		) );
+	}
+
+	/**
+	 * Set up items for display in the list table.
+	 *
+	 * Handles filtering of data, sorting, pagination, and any other data
+	 * manipulation required prior to rendering.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function prepare_items() {
+		global $usersearch;
+
+		$usersearch       = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+		$signups_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
+		$paged            = $this->get_pagenum();
+
+		$args = array(
+			'offset'     => ( $paged - 1 ) * $signups_per_page,
+			'number'     => $signups_per_page,
+			'usersearch' => $usersearch,
+			'orderby'    => 'signup_id',
+			'order'      => 'DESC'
+		);
+
+		if ( isset( $_REQUEST['orderby'] ) ) {
+			$args['orderby'] = $_REQUEST['orderby'];
+		}
+
+		if ( isset( $_REQUEST['order'] ) ) {
+			$args['order'] = $_REQUEST['order'];
+		}
+
+		$signups = BP_Signup::get( $args );
+
+		$this->items = $signups['signups'];
+		$this->signup_counts = $signups['total'];
+
+		$this->set_pagination_args( array(
+			'total_items' => $this->signup_counts,
+			'per_page'    => $signups_per_page,
+		) );
+	}
+
+	/**
+	 * Get the views (the links above the WP List Table).
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @uses WP_Users_List_Table::get_views() to get the users views
+	 */
+	public function get_views() {
+		$views = parent::get_views();
+
+		// Remove the 'current' class from the 'All' link
+		$views['all']        = str_replace( 'class="current"', '', $views['all'] );
+		$views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', esc_url( add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) );
+
+		return $views;
+	}
+
+	/**
+	 * Get rid of the extra nav.
+	 *
+	 * WP_Users_List_Table will add an extra nav to change user's role.
+	 * As we're dealing with signups, we don't need this.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $which
+	 */
+	public function extra_tablenav( $which ) {
+		return;
+	}
+
+	/**
+	 * Specific signups columns.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function get_columns() {
+
+		/**
+		 * Filters the single site Members signup columns.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $value Array of columns to display.
+		 */
+		return apply_filters( 'bp_members_signup_columns', array(
+			'cb'         => '<input type="checkbox" />',
+			'username'   => __( 'Username',    'buddypress' ),
+			'name'       => __( 'Name',        'buddypress' ),
+			'email'      => __( 'Email',       'buddypress' ),
+			'registered' => __( 'Registered',  'buddypress' ),
+			'date_sent'  => __( 'Last Sent',   'buddypress' ),
+			'count_sent' => __( 'Emails Sent', 'buddypress' )
+		) );
+	}
+
+	/**
+	 * Specific bulk actions for signups.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function get_bulk_actions() {
+		$actions = array(
+			'activate' => _x( 'Activate', 'Pending signup action', 'buddypress' ),
+			'resend'   => _x( 'Email',    'Pending signup action', 'buddypress' ),
+		);
+
+		if ( current_user_can( 'delete_users' ) ) {
+			$actions['delete'] = __( 'Delete', 'buddypress' );
+		}
+
+		return $actions;
+	}
+
+	/**
+	 * The text shown when no items are found.
+	 *
+	 * Nice job, clean sheet!
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function no_items() {
+
+		if ( bp_get_signup_allowed() ) {
+			esc_html_e( 'No pending accounts found.', 'buddypress' );
+		} else {
+			$link = false;
+
+			// Specific case when BuddyPress is not network activated
+			if ( is_multisite() && current_user_can( 'manage_network_users') ) {
+				$link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php'       ) ), esc_html__( 'Edit settings', 'buddypress' ) );
+			} elseif ( current_user_can( 'manage_options' ) ) {
+				$link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( bp_get_admin_url( 'options-general.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) );
+			}
+
+			printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
+		}
+
+	}
+
+	/**
+	 * The columns signups can be reordered with.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function get_sortable_columns() {
+		return array(
+			'username'   => 'login',
+			'email'      => 'email',
+			'registered' => 'signup_id',
+		);
+	}
+
+	/**
+	 * Display signups rows.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function display_rows() {
+		$style = '';
+		foreach ( $this->items as $userid => $signup_object ) {
+			$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
+			echo "\n\t" . $this->single_row( $signup_object, $style );
+		}
+	}
+
+	/**
+	 * Display a signup row.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @see WP_List_Table::single_row() for explanation of params.
+	 *
+	 * @param object|null $signup_object Signup user object.
+	 * @param string      $style         Styles for the row.
+	 * @param string      $role          Role to be assigned to user.
+	 * @param int         $numposts      Numper of posts.
+	 *
+	 * @return string
+	 */
+	public function single_row( $signup_object = null, $style = '', $role = '', $numposts = 0 ) {
+		echo '<tr' . $style . ' id="signup-' . esc_attr( $signup_object->id ) . '">';
+		echo $this->single_row_columns( $signup_object );
+		echo '</tr>';
+	}
+
+	/**
+	 * Markup for the checkbox used to select items for bulk actions.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_cb( $signup_object = null ) {
+	?>
+		<label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( esc_html__( 'Select user: %s', 'buddypress' ), $signup_object->user_login ); ?></label>
+		<input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" />
+		<?php
+	}
+
+	/**
+	 * The row actions (delete/activate/email).
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_username( $signup_object = null ) {
+		$avatar	= get_avatar( $signup_object->user_email, 32 );
+
+		// Activation email link
+		$email_link = add_query_arg(
+			array(
+				'page'	    => 'bp-signups',
+				'signup_id' => $signup_object->id,
+				'action'    => 'resend',
+			),
+			bp_get_admin_url( 'users.php' )
+		);
+
+		// Activate link
+		$activate_link = add_query_arg(
+			array(
+				'page'      => 'bp-signups',
+				'signup_id' => $signup_object->id,
+				'action'    => 'activate',
+			),
+			bp_get_admin_url( 'users.php' )
+		);
+
+		// Delete link
+		$delete_link = add_query_arg(
+			array(
+				'page'      => 'bp-signups',
+				'signup_id' => $signup_object->id,
+				'action'    => 'delete',
+			),
+			bp_get_admin_url( 'users.php' )
+		);
+
+		echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login );
+
+		$actions = array();
+
+		$actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) );
+		$actions['resend']   = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) );
+
+		if ( current_user_can( 'delete_users' ) ) {
+			$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );
+		}
+
+		/**
+		 * Filters the multisite row actions for each user in list.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array  $actions       Array of actions and corresponding links.
+		 * @param object $signup_object The signup data object.
+		 */
+		$actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object );
+
+		echo $this->row_actions( $actions );
+	}
+
+	/**
+	 * Display user name, if any.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_name( $signup_object = null ) {
+		echo esc_html( $signup_object->user_name );
+	}
+
+	/**
+	 * Display user email.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_email( $signup_object = null ) {
+		printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $signup_object->user_email ), esc_html( $signup_object->user_email ) );
+	}
+
+	/**
+	 * Display registration date.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_registered( $signup_object = null ) {
+		echo mysql2date( 'Y/m/d', $signup_object->registered );
+	}
+
+	/**
+	 * Display the last time an activation email has been sent.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_date_sent( $signup_object = null ) {
+		echo mysql2date( 'Y/m/d', $signup_object->date_sent );
+	}
+
+	/**
+	 * Display number of time an activation email has been sent.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object Signup object instance.
+	 *
+	 * @return int
+	 */
+	public function column_count_sent( $signup_object = null ) {
+		echo absint( $signup_object->count_sent );
+	}
+
+	/**
+	 * Allow plugins to add their custom column.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param object|null $signup_object The signup data object.
+	 * @param string      $column_name   The column name.
+	 *
+	 * @return string
+	 */
+	function column_default( $signup_object = null, $column_name = '' ) {
+
+		/**
+		 * Filters the single site custom columns for plugins.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $column_name   The column name.
+		 * @param object $signup_object The signup data object.
+		 */
+		return apply_filters( 'bp_members_signup_custom_column', '', $column_name, $signup_object );
+	}
+}
+
+endif;
+
+if ( class_exists( 'WP_MS_Users_List_Table' ) ) :
+/**
+ * List table class for signups network admin page.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_Members_MS_List_Table extends WP_MS_Users_List_Table {
+
+	/**
+	 * Signup counts.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @access public
+	 * @var int
+	 */
+	public $signup_counts = 0;
+
+	/**
+	 * Constructor
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function __construct() {
+		// Define singular and plural labels, as well as whether we support AJAX.
+		parent::__construct( array(
+			'ajax'     => false,
+			'plural'   => 'signups',
+			'singular' => 'signup',
+		) );
+	}
+
+	/**
+	 * Set up items for display in the list table.
+	 *
+	 * Handles filtering of data, sorting, pagination, and any other data
+	 * manipulation required prior to rendering.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function prepare_items() {
+		global $usersearch, $mode;
+
+		$usersearch       = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+		$signups_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
+		$paged            = $this->get_pagenum();
+
+		$args = array(
+			'offset'     => ( $paged - 1 ) * $signups_per_page,
+			'number'     => $signups_per_page,
+			'usersearch' => $usersearch,
+			'orderby'    => 'signup_id',
+			'order'      => 'DESC'
+		);
+
+		if ( isset( $_REQUEST['orderby'] ) ) {
+			$args['orderby'] = $_REQUEST['orderby'];
+		}
+
+		if ( isset( $_REQUEST['order'] ) ) {
+			$args['order'] = $_REQUEST['order'];
+		}
+
+		$mode    = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
+		$signups = BP_Signup::get( $args );
+
+		$this->items         = $signups['signups'];
+		$this->signup_counts = $signups['total'];
+
+		$this->set_pagination_args( array(
+			'total_items' => $this->signup_counts,
+			'per_page'    => $signups_per_page,
+		) );
+	}
+
+	/**
+	 * Get the views : the links above the WP List Table.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @uses WP_MS_Users_List_Table::get_views() to get the users views.
+	 */
+	public function get_views() {
+		$views = parent::get_views();
+
+		// Remove the 'current' class from the 'All' link
+		$views['all']        = str_replace( 'class="current"', '', $views['all'] );
+		$views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', esc_url( add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) );
+
+		return $views;
+	}
+
+	/**
+	 * Specific signups columns.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function get_columns() {
+
+		/**
+		 * Filters the multisite Members signup columns.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $value Array of columns to display.
+		 */
+		return apply_filters( 'bp_members_ms_signup_columns', array(
+			'cb'         => '<input type="checkbox" />',
+			'username'   => __( 'Username',    'buddypress' ),
+			'name'       => __( 'Name',        'buddypress' ),
+			'email'      => __( 'Email',       'buddypress' ),
+			'registered' => __( 'Registered',  'buddypress' ),
+			'date_sent'  => __( 'Last Sent',   'buddypress' ),
+			'count_sent' => __( 'Emails Sent', 'buddypress' )
+		) );
+	}
+
+	/**
+	 * Specific bulk actions for signups.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function get_bulk_actions() {
+		$actions = array(
+			'activate' => _x( 'Activate', 'Pending signup action', 'buddypress' ),
+			'resend'   => _x( 'Email',    'Pending signup action', 'buddypress' ),
+		);
+
+		if ( current_user_can( 'delete_users' ) ) {
+			$actions['delete'] = __( 'Delete', 'buddypress' );
+		}
+
+		return $actions;
+	}
+
+	/**
+	 * The text shown when no items are found.
+	 *
+	 * Nice job, clean sheet!
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function no_items() {
+		if ( bp_get_signup_allowed() ) {
+			esc_html_e( 'No pending accounts found.', 'buddypress' );
+		} else {
+			$link = false;
+
+			if ( current_user_can( 'manage_network_users' ) ) {
+				$link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) );
+			}
+
+			printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
+		}
+	}
+
+	/**
+	 * The columns signups can be reordered with.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function get_sortable_columns() {
+		return array(
+			'username'   => 'login',
+			'email'      => 'email',
+			'registered' => 'signup_id',
+		);
+	}
+
+	/**
+	 * Display signups rows.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function display_rows() {
+		$style = '';
+		foreach ( $this->items as $userid => $signup_object ) {
+			$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
+			echo "\n\t" . $this->single_row( $signup_object, $style );
+		}
+	}
+
+	/**
+	 * Display a signup row.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @see WP_List_Table::single_row() for explanation of params.
+	 *
+	 * @param object|null $signup_object Signup user object.
+	 * @param string      $style         Styles for the row.
+	 */
+	public function single_row( $signup_object = null, $style = '' ) {
+		echo '<tr' . $style . ' id="signup-' . esc_attr( $signup_object->id ) . '">';
+		echo $this->single_row_columns( $signup_object );
+		echo '</tr>';
+	}
+
+	/**
+	 * Markup for the checkbox used to select items for bulk actions.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object|null $signup_object The signup data object.
+	 */
+	public function column_cb( $signup_object = null ) {
+	?>
+		<label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( esc_html__( 'Select user: %s', 'buddypress' ), $signup_object->user_login ); ?></label>
+		<input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" />
+		<?php
+	}
+
+	/**
+	 * The row actions (delete/activate/email).
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_username( $signup_object = null ) {
+		$avatar	= get_avatar( $signup_object->user_email, 32 );
+
+		// Activation email link
+		$email_link = add_query_arg(
+			array(
+				'page'	    => 'bp-signups',
+				'signup_id' => $signup_object->id,
+				'action'    => 'resend',
+			),
+			bp_get_admin_url( 'users.php' )
+		);
+
+		// Activate link
+		$activate_link = add_query_arg(
+			array(
+				'page'      => 'bp-signups',
+				'signup_id' => $signup_object->id,
+				'action'    => 'activate',
+			),
+			bp_get_admin_url( 'users.php' )
+		);
+
+		// Delete link
+		$delete_link = add_query_arg(
+			array(
+				'page'      => 'bp-signups',
+				'signup_id' => $signup_object->id,
+				'action'    => 'delete',
+			),
+			bp_get_admin_url( 'users.php' )
+		);
+
+		echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login );
+
+		$actions = array();
+
+		$actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) );
+		$actions['resend']   = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link    ), __( 'Email',    'buddypress' ) );
+
+		if ( current_user_can( 'delete_users' ) ) {
+			$actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );
+		}
+
+		/** This filter is documented in bp-members/admin/bp-members-classes.php */
+		$actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object );
+
+		echo $this->row_actions( $actions );
+	}
+
+	/**
+	 * Display user name, if any.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_name( $signup_object = null ) {
+		echo esc_html( $signup_object->user_name );
+	}
+
+	/**
+	 * Display user email.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_email( $signup_object = null ) {
+		printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $signup_object->user_email ), esc_html( $signup_object->user_email ) );
+	}
+
+	/**
+	 * Display registration date.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object $signup_object The signup data object.
+	 */
+	public function column_registered( $signup_object = null ) {
+		global $mode;
+
+		if ( 'list' === $mode ) {
+			$date = 'Y/m/d';
+		} else {
+			$date = 'Y/m/d \<\b\r \/\> g:i:s a';
+		}
+
+		echo mysql2date( $date, $signup_object->registered ) . "</td>";
+	}
+
+	/**
+	 * Display the last time an activation email has been sent.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object|null $signup_object Signup object instance.
+	 */
+	public function column_date_sent( $signup_object = null ) {
+		global $mode;
+
+		if ( 'list' === $mode ) {
+			$date = 'Y/m/d';
+		} else {
+			$date = 'Y/m/d \<\b\r \/\> g:i:s a';
+		}
+
+		echo mysql2date( $date, $signup_object->date_sent );
+	}
+
+	/**
+	 * Display number of time an activation email has been sent.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object|null $signup_object Signup object instance.
+	 */
+	public function column_count_sent( $signup_object = null ) {
+		echo absint( $signup_object->count_sent );
+	}
+
+	/**
+	 * Allow plugins to add their custom column.
+	 *
+	 * @since BuddyPress 2.1.0
+	 *
+	 * @param object|null $signup_object The signup data object.
+	 * @param string      $column_name   The column name.
+	 *
+	 * @return string
+	 */
+	function column_default( $signup_object = null, $column_name = '' ) {
+
+		/**
+		 * Filters the multisite custom columns for plugins.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $column_name   The column name.
+		 * @param object $signup_object The signup data object.
+		 */
+		return apply_filters( 'bp_members_ms_signup_custom_column', '', $column_name, $signup_object );
+	}
+}
+
+endif;
diff --git a/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.css b/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.css
index 0f658bab85c45797e13931e9b91fd6fe62d9fb53..a1de09cf5081b4daa72406733e45fe34dde6f3b8 100644
--- a/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.css
+++ b/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.css
@@ -25,7 +25,8 @@ div#community-profile-page li.bp-members-profile-stats:before,
 div#community-profile-page li.bp-friends-profile-stats:before,
 div#community-profile-page li.bp-groups-profile-stats:before,
 div#community-profile-page li.bp-blogs-profile-stats:before,
-div#community-profile-page a.bp-xprofile-avatar-user-admin:before {
+div#community-profile-page a.bp-xprofile-avatar-user-admin:before,
+div#community-profile-page a.bp-xprofile-avatar-user-edit:before {
 	font: normal 20px/1 'dashicons';
 	speak: none;
 	display: inline-block;
@@ -60,6 +61,10 @@ div#community-profile-page a.bp-xprofile-avatar-user-admin:before {
 	content:"\f182";
 }
 
+div#community-profile-page a.bp-xprofile-avatar-user-edit:before {
+	content: "\f107";
+}
+
 div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar {
 	width:150px;
 	margin:0 auto;
diff --git a/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.min.css b/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.min.css
index 269deb2892a4c26efa03ccb23980e7dfe73574c9..baa0bdb205405ece62cfc6a7eefdd7e5d08ccc63 100644
--- a/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-members/admin/css/admin-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-div#profile-page.wrap form#your-profile{position:relative}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:-3.65em;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 2px;top:0;right:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:right}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:right;vertical-align:middle;width:200px}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 200px 10px 0;text-align:right}.clear-value{display:block;font-size:12px;margin-right:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-right:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 200px 10px 0;text-align:right}.field-visibility-settings{display:none;margin-right:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
\ No newline at end of file
+div#profile-page.wrap form#your-profile{position:relative}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:-3.65em;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page a.bp-xprofile-avatar-user-edit:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 2px;top:0;right:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page a.bp-xprofile-avatar-user-edit:before{content:"\f107"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:right}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:right;vertical-align:middle;width:200px}.clear-value,.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 200px 10px 0;text-align:right}.clear-value{font-size:12px;margin-right:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-right:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 200px 10px 0;text-align:right}.field-visibility-settings{display:none;margin-right:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-members/admin/css/admin.css b/wp-content/plugins/buddypress/bp-members/admin/css/admin.css
index e4599f718ac0835be75c33d59091883ec6ba7e41..c780cf90533284b1f5bd7e45df321543af4ea03f 100644
--- a/wp-content/plugins/buddypress/bp-members/admin/css/admin.css
+++ b/wp-content/plugins/buddypress/bp-members/admin/css/admin.css
@@ -25,7 +25,8 @@ div#community-profile-page li.bp-members-profile-stats:before,
 div#community-profile-page li.bp-friends-profile-stats:before,
 div#community-profile-page li.bp-groups-profile-stats:before,
 div#community-profile-page li.bp-blogs-profile-stats:before,
-div#community-profile-page a.bp-xprofile-avatar-user-admin:before {
+div#community-profile-page a.bp-xprofile-avatar-user-admin:before,
+div#community-profile-page a.bp-xprofile-avatar-user-edit:before {
 	font: normal 20px/1 'dashicons';
 	speak: none;
 	display: inline-block;
@@ -60,6 +61,10 @@ div#community-profile-page a.bp-xprofile-avatar-user-admin:before {
 	content:"\f182";
 }
 
+div#community-profile-page a.bp-xprofile-avatar-user-edit:before {
+	content: "\f107";
+}
+
 div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar {
 	width:150px;
 	margin:0 auto;
diff --git a/wp-content/plugins/buddypress/bp-members/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-members/admin/css/admin.min.css
index 77b1091595a2f264ba071b95bf9ddac50b5a9e2a..d4174e7a016eb208d3f464852d94acacc3f702eb 100644
--- a/wp-content/plugins/buddypress/bp-members/admin/css/admin.min.css
+++ b/wp-content/plugins/buddypress/bp-members/admin/css/admin.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-div#profile-page.wrap form#your-profile{position:relative}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:-3.65em;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:left}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:left;vertical-align:middle;width:200px}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 0 10px 200px;text-align:left}.clear-value{display:block;font-size:12px;margin-left:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-left:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 0 10px 200px;text-align:left}.field-visibility-settings{display:none;margin-left:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
\ No newline at end of file
+div#profile-page.wrap form#your-profile{position:relative}div#profile-page.wrap form#your-profile h3:first-of-type{margin-top:5em}div#profile-page.wrap form#your-profile #profile-nav{position:absolute;top:-3.65em;width:97%}div#community-profile-page #profile-nav{margin-bottom:1em}#bp_members_admin_user_stats ul{margin-bottom:0}div#community-profile-page a.bp-xprofile-avatar-user-admin:before,div#community-profile-page a.bp-xprofile-avatar-user-edit:before,div#community-profile-page li.bp-blogs-profile-stats:before,div#community-profile-page li.bp-friends-profile-stats:before,div#community-profile-page li.bp-groups-profile-stats:before,div#community-profile-page li.bp-members-profile-stats:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 2px 0 0;top:0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div#community-profile-page li.bp-members-profile-stats:before{content:"\f130"}div#community-profile-page li.bp-friends-profile-stats:before{content:"\f454"}div#community-profile-page li.bp-groups-profile-stats:before{content:"\f456"}div#community-profile-page li.bp-blogs-profile-stats:before{content:"\f120"}div#community-profile-page a.bp-xprofile-avatar-user-admin:before{content:"\f182"}div#community-profile-page a.bp-xprofile-avatar-user-edit:before{content:"\f107"}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar{width:150px;margin:0 auto}div#community-profile-page div#bp_xprofile_user_admin_avatar div.avatar img{max-width:100%;height:auto}div#community-profile-page div#bp_xprofile_user_admin_avatar a{display:block;margin:1em 0;text-decoration:none;color:#888}div#community-profile-page p.not-activated{margin:1em 1em 0;color:red}#community-profile-page #submitdiv #publishing-action{float:none;width:100%}.bp-view-profile{float:left}.alt{background:0 0}.bp-profile-field{border-bottom:dotted 1px #ccc;font-size:14px;margin:15px 0;padding:10px}.bp-profile-field:last-child{border-bottom:0}.bp-profile-field p{font-size:14px}.bp-profile-field .datebox>label,.bp-profile-field .radio>label,.bp-profile-field>label{display:inline-block;font-weight:600;text-align:left;vertical-align:middle;width:200px}.clear-value,.field_type_radio .radio div:not(.field-visibility-settings) label{display:block}.field_type_checkbox .checkbox>label,.field_type_multiselectbox>label,.field_type_radio .radio>label,.field_type_textarea>label{vertical-align:top}.bp-profile-field .description{margin:10px 0 10px 200px;text-align:left}.clear-value{font-size:12px;margin-left:200px}.field_type_checkbox .checkbox>label+label{display:block;margin-left:200px;width:auto}.field_type_radio .radio div:not(.field-visibility-settings){display:inline-block}.field-visibility-settings-notoggle,.field-visibility-settings-toggle{margin:10px 0 10px 200px;text-align:left}.field-visibility-settings{display:none;margin-left:200px}.field-visibility-settings .button{margin-bottom:15px}#normal-sortables .field-visibility-settings legend{font-size:16px;margin-bottom:10px}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-members/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-members/admin/js/admin.min.js
index 143a0172f75b8cb503b0ecd38c86d44d734f2220..3199f6cb8979d0fbc9abf6d8790ddecf90e0a64e 100644
--- a/wp-content/plugins/buddypress/bp-members/admin/js/admin.min.js
+++ b/wp-content/plugins/buddypress/bp-members/admin/js/admin.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 function clear(a){if(a=document.getElementById(a)){var b=a.getElementsByTagName("INPUT"),c=a.getElementsByTagName("OPTION"),d=0;if(b)for(d=0;d<b.length;d++)b[d].checked="";if(c)for(d=0;d<c.length;d++)c[d].selected=!1}}!function(a){a(".visibility-toggle-link").on("click",function(b){b.preventDefault(),a(this).parent().hide().siblings(".field-visibility-settings").show()}),a(".field-visibility-settings-close").on("click",function(b){b.preventDefault();var c=a(this).parent(),d=c.find("input:checked").parent().text();c.hide().siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(d).end().show()})}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
index 339a1a852406a60c86c3674f057630491d5842c4..a502f6ea2cc6a9a386ae787b86b55307ca22c107 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Catch a "Mark as Spammer/Not Spammer" click from the toolbar.
@@ -23,8 +23,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * Note: no longer used in the current state. See the Settings component.
  *
- * @param int $user_id Optional. User ID to mark as spam. Defaults to displayed
- *        user.
+ * @param int $user_id Optional. User ID to mark as spam. Defaults to displayed user.
  */
 function bp_core_action_set_spammer_status( $user_id = 0 ) {
 
@@ -64,7 +63,7 @@ function bp_core_action_set_spammer_status( $user_id = 0 ) {
 		bp_core_redirect( wp_get_referer() );
 	}
 }
-// Unhooked in BuddyPress (1.6) - moved to settings
+// Unhooked in BuddyPress (1.6.0) - moved to settings
 //add_action( 'bp_actions', 'bp_core_action_set_spammer_status' );
 
 /**
@@ -100,13 +99,13 @@ function bp_core_action_delete_user() {
 			bp_core_redirect( bp_loggedin_user_domain() );
 	}
 }
-// Unhooked in BuddyPress (1.6) - moved to settings
+// Unhooked in BuddyPress (1.6.0) - moved to settings
 //add_action( 'bp_actions', 'bp_core_action_delete_user' );
 
 /**
  * Redirect to a random member page when visiting a ?random-member URL.
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  */
 function bp_core_get_random_member() {
 	if ( ! isset( $_GET['random-member'] ) )
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-activity.php b/wp-content/plugins/buddypress/bp-members/bp-members-activity.php
new file mode 100644
index 0000000000000000000000000000000000000000..88715ecba7c8d389f12a621c5498226bf051d525
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-activity.php
@@ -0,0 +1,99 @@
+<?php
+
+/**
+ * BuddyPress Member Activity
+ *
+ * @package BuddyPress
+ * @subpackage MembersActivity
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Register the 'new member' activity type.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @uses bp_activity_set_action()
+ * @uses buddypress()
+ */
+function bp_members_register_activity_actions() {
+
+	bp_activity_set_action(
+		buddypress()->members->id,
+		'new_member',
+		__( 'New member registered', 'buddypress' ),
+		'bp_members_format_activity_action_new_member',
+		__( 'New Members', 'buddypress' ),
+		array( 'activity' )
+	);
+
+	/**
+	 * Fires after the default 'new member' activity types are registered.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	do_action( 'bp_members_register_activity_actions' );
+}
+add_action( 'bp_register_activity_actions', 'bp_members_register_activity_actions' );
+
+/**
+ * Format 'new_member' activity actions.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $action   Static activity action.
+ * @param object $activity Activity object.
+ *
+ * @return string
+ */
+function bp_members_format_activity_action_new_member( $action, $activity ) {
+	$userlink = bp_core_get_userlink( $activity->user_id );
+	$action   = sprintf( __( '%s became a registered member', 'buddypress' ), $userlink );
+
+	// Legacy filter - pass $user_id instead of $activity
+	if ( has_filter( 'bp_core_activity_registered_member_action' ) ) {
+		$action = apply_filters( 'bp_core_activity_registered_member_action', $action, $activity->user_id );
+	}
+
+	/**
+	 * Filters the formatted 'new member' activity actions.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string $action   Static activity action.
+	 * @param object $activity Activity object.
+	 */
+	return apply_filters( 'bp_members_format_activity_action_new_member', $action, $activity );
+}
+
+/**
+ * Create a "became a registered user" activity item when a user activates his account.
+ *
+ * @param array $user Array of userdata passed to bp_core_activated_user hook.
+ *
+ * @return bool
+ */
+function bp_core_new_user_activity( $user ) {
+	if ( empty( $user ) ) {
+		return false;
+	}
+
+	if ( is_array( $user ) ) {
+		$user_id = $user['user_id'];
+	} else {
+		$user_id = $user;
+	}
+
+	if ( empty( $user_id ) ) {
+		return false;
+	}
+
+	bp_activity_add( array(
+		'user_id'   => $user_id,
+		'component' => buddypress()->members->id,
+		'type'      => 'new_member'
+	) );
+}
+add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-admin.php b/wp-content/plugins/buddypress/bp-members/bp-members-admin.php
index 287fb67d6de116719b869b6b7d7a4de253167213..9175086f51fb79420600cb9d349e52e16271fd01 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-admin.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-admin.php
@@ -1,7 +1,7 @@
 <?php
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 if ( !class_exists( 'BP_Members_Admin' ) ) :
 /**
@@ -105,7 +105,7 @@ class BP_Members_Admin {
 		$this->js_url    = trailingslashit( $this->admin_url . 'js'  ); // Admin CSS URL
 
 		// Capability depends on config
-		$this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options';
+		$this->capability = bp_core_do_network_admin() ? 'manage_network_users' : 'edit_users';
 
 		// The Edit Profile Screen id
 		$this->user_page = '';
@@ -144,7 +144,7 @@ class BP_Members_Admin {
 
 		// When BuddyPress is not network activated, only Super Admin can moderate signups
 		if ( ! empty( $this->subsite_activated ) ) {
-			$this->capability = 'manage_network_options';
+			$this->capability = 'manage_network_users';
 		}
 	}
 
@@ -186,6 +186,9 @@ class BP_Members_Admin {
 		// Add user row actions for single site
 		add_filter( 'user_row_actions', array( $this, 'row_actions' ), 10, 2 );
 
+		// Process changes to member type.
+		add_action( 'bp_members_admin_load', array( $this, 'process_member_type_update' ) );
+
 		/** Signups ***********************************************************/
 
 		if ( is_admin() ) {
@@ -204,7 +207,7 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Get the user ID
+	 * Get the user ID.
 	 *
 	 * Look for $_GET['user_id']. If anything else, force the user ID to the
 	 * current user's ID so they aren't left without a user to edit.
@@ -214,24 +217,22 @@ class BP_Members_Admin {
 	 * @return int
 	 */
 	private function get_user_id() {
+		if ( ! empty( $this->user_id ) ) {
+			return $this->user_id;
+		}
 
-		// No user ID to start
-		$user_id = 0;
+		$this->user_id = (int) get_current_user_id();
 
-		// We'll need a user ID when not on the user admin
+		// We'll need a user ID when not on self profile
 		if ( ! empty( $_GET['user_id'] ) ) {
-			$user_id = $_GET['user_id'];
-
-		// Assume the current user ID
-		} else {
-			$user_id = get_current_user_id();
+			$this->user_id = (int) $_GET['user_id'];
 		}
 
-		return intval( $user_id );
+		return $this->user_id;
 	}
 
 	/**
-	 * Can the current user edit the one displayed
+	 * Can the current user edit the one displayed.
 	 *
 	 * self profile editing / or bp_moderate check.
 	 * This might be replaced by more granular capabilities
@@ -239,6 +240,10 @@ class BP_Members_Admin {
 	 *
 	 * @access public
 	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param int $user_id ID of the user being checked for edit ability.
+	 *
+	 * @return bool
 	 */
 	private function member_can_edit( $user_id = 0 ) {
 		$retval = false;
@@ -261,7 +266,7 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Get admin notice when saving a user or member profile
+	 * Get admin notice when saving a user or member profile.
 	 *
 	 * @since BuddyPress (2.1.0)
 	 *
@@ -308,7 +313,7 @@ class BP_Members_Admin {
 			case 'avatar':
 				$notice = array(
 					'class'   => 'error',
-					'message' => __( 'There was a problem deleting that avatar, please try again.', 'buddypress' )
+					'message' => __( 'There was a problem deleting that profile photo. Please try again.', 'buddypress' )
 				);
 				break;
 			case 'ham' :
@@ -326,7 +331,7 @@ class BP_Members_Admin {
 			case 1 :
 				$notice = array(
 					'class'   => 'error',
-					'message' => __( 'An error occured while trying to update the profile.', 'buddypress' )
+					'message' => __( 'An error occurred while trying to update the profile.', 'buddypress' )
 				);
 				break;
 			case 2:
@@ -338,7 +343,7 @@ class BP_Members_Admin {
 			case 3:
 				$notice = array(
 					'class'   => 'error',
-					'message' => __( 'There was a problem updating some of your profile information, please try again.', 'buddypress' )
+					'message' => __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' )
 				);
 				break;
 			}
@@ -462,9 +467,7 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Highlight the Users menu if on Edit Profile.
-	 *
-	 * + Check if on the user's admin profile
+	 * Highlight the Users menu if on Edit Profile and check if on the user's admin profile.
 	 *
 	 * @access public
 	 * @since BuddyPress (2.1.0)
@@ -477,7 +480,7 @@ class BP_Members_Admin {
 			$this->is_self_profile = true;
 
 		// Is the user attempting to edit their own profile
-		} else {
+		} elseif ( isset( $_GET['user_id' ] ) || ( isset( $_GET['page'] ) && ( 'bp-profile-edit' === $_GET['page'] ) ) ) {
 			$this->is_self_profile = (bool) ( $this->get_user_id() === $this->current_user_id );
 		}
 
@@ -549,6 +552,14 @@ class BP_Members_Admin {
 
 		$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 		$css = $this->css_url . "admin{$min}.css";
+
+		/**
+		 * Filters the CSS URL to enqueue in the Members admin area.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $css URL to the CSS admin file to load.
+		 */
 		$css = apply_filters( 'bp_members_admin_css', $css );
 
 		wp_enqueue_style( 'bp-members-css', $css, array(), bp_get_version() );
@@ -558,14 +569,29 @@ class BP_Members_Admin {
 			wp_style_add_data( 'bp-members-css', 'suffix', $min );
 		}
 
-		// Only load javascript for BuddyPress profile
+		// Only load JavaScript for BuddyPress profile
 		if ( get_current_screen()->id == $this->user_page ) {
 			$js = $this->js_url . "admin{$min}.js";
+
+			/**
+			 * Filters the JS URL to enqueue in the Members admin area.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param string $js URL to the JavaScript admin file to load.
+			 */
 			$js = apply_filters( 'bp_members_admin_js', $js );
 			wp_enqueue_script( 'bp-members-js', $js, array( 'jquery' ), bp_get_version(), true );
 		}
 
-		// Plugins may want to hook here to load some css/js
+		/**
+		 * Fires after all of the members JavaScript and CSS are enqueued.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $id        ID of the current screen.
+		 * @param array  $screen_id Array of allowed screens to add scripts and styles to.
+		 */
 		do_action( 'bp_members_admin_enqueue_scripts', get_current_screen()->id, $this->screen_id );
 	}
 
@@ -574,6 +600,11 @@ class BP_Members_Admin {
 	 *
 	 * @access public
 	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param object|null $user   User to create profile navigation for.
+	 * @param string      $active Which profile to highlight.
+	 *
+	 * @return string
 	 */
 	public function profile_nav( $user = null, $active = 'WordPress' ) {
 
@@ -582,7 +613,7 @@ class BP_Members_Admin {
 			return;
 		}
 
-		// Add the user ID to query agruments when not editing yourself
+		// Add the user ID to query arguments when not editing yourself
 		if ( false === $this->is_self_profile ) {
 			$query_args = array( 'user_id' => $user->ID );
 		} else {
@@ -656,10 +687,23 @@ class BP_Members_Admin {
 			}
 		}
 
-		// Call an action for plugins to hook in early
+		/**
+		 * Fires at the start of the signups admin load.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $doaction Current bulk action being processed.
+		 * @param array  $_REQUEST Current $_REQUEST global.
+		 */
 		do_action_ref_array( 'bp_members_admin_load', array( $doaction, $_REQUEST ) );
 
-		// Allowed actions
+		/**
+		 * Filters the allowed actions for use in the user admin page.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $value Array of allowed actions to use.
+		 */
 		$allowed_actions = apply_filters( 'bp_members_admin_allowed_actions', array( 'update', 'delete_avatar', 'spam', 'ham' ) );
 
 		// Prepare the display of the Community Profile screen
@@ -678,8 +722,8 @@ class BP_Members_Admin {
 			// Help panel - sidebar links
 			get_current_screen()->set_help_sidebar(
 				'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
-				'<p>' . __( '<a href="http://codex.buddypress.org/buddypress-site-administration/managing-user-profiles/">Managing Profiles</a>', 'buddypress' ) . '</p>' .
-				'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+				'<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/extended-profiles/">Managing Profiles</a>', 'buddypress' ) . '</p>' .
+				'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 			);
 
 			// Register metaboxes for the edit screen.
@@ -697,8 +741,15 @@ class BP_Members_Admin {
 			$this->stats_metabox->priority = 'core';
 
 			/**
-			 * xProfile Hooks to load the profile fields if component is active
-			 * Plugins should not use this hook, please use 'bp_members_admin_user_metaboxes' instead
+			 * Fires before loading the profile fields if component is active.
+			 *
+			 * Plugins should not use this hook, please use 'bp_members_admin_user_metaboxes' instead.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param int    $user_id       Current user ID for the screen.
+			 * @param string $id            Current screen ID.
+			 * @param object $stats_metabox Object holding position data for use with the stats metabox.
 			 */
 			do_action_ref_array( 'bp_members_admin_xprofile_metabox', array( $user_id, get_current_screen()->id, $this->stats_metabox ) );
 
@@ -719,16 +770,35 @@ class BP_Members_Admin {
 				sanitize_key( $this->stats_metabox->priority )
 			);
 
+			// Member Type metabox. Only added if member types have been registered.
+			$member_types = bp_get_member_types();
+			if ( ! empty( $member_types ) ) {
+				add_meta_box(
+					'bp_members_admin_member_type',
+					_x( 'Member Type', 'members user-admin edit screen', 'buddypress' ),
+					array( $this, 'user_admin_member_type_metabox' ),
+					get_current_screen()->id,
+					'side',
+					'core'
+				);
+			}
+
 			/**
-			 * Custom metabox ?
-			 * Plugins can restrict metabox to "bp_moderate" admins checking
-			 * the first argument ($this->is_self_profile) is false in their hook
-			 * They can also restruct their metabox to self profile editing
-			 * by cheking it set to true.
+			 * Fires at the end of the Community Profile screen.
+			 *
+			 * Plugins can restrict metabox to "bp_moderate" admins by checking if
+			 * the first argument ($this->is_self_profile) is false in their callback.
+			 * They can also restrict their metabox to self profile editing
+			 * by setting it to true.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param bool $is_self_profile Whether or not it is the current user's profile.
+			 * @param int  $user_id         Current user ID.
 			 */
 			do_action( 'bp_members_admin_user_metaboxes', $this->is_self_profile, $user_id );
 
-			// Enqueue javascripts
+			// Enqueue JavaScript files
 			wp_enqueue_script( 'postbox'   );
 			wp_enqueue_script( 'dashboard' );
 
@@ -749,6 +819,16 @@ class BP_Members_Admin {
 		} else {
 			$this->redirect = $redirect_to;
 
+			/**
+			 * Fires at end of user profile admin load if doaction does not match any available actions.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param string $doaction Current bulk action being processed.
+			 * @param int    $user_id  Current user ID.
+			 * @param array  $_REQUEST Current $_REQUEST global.
+			 * @param string $redirect Determined redirect url to send user to.
+			 */
 			do_action_ref_array( 'bp_members_admin_update_user', array( $doaction, $user_id, $_REQUEST, $this->redirect ) );
 
 			bp_core_redirect( $this->redirect );
@@ -832,8 +912,6 @@ class BP_Members_Admin {
 					<div id="poststuff">
 
 						<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
-							<div id="post-body-content">
-							</div><!-- #post-body-content -->
 
 							<div id="postbox-container-1" class="postbox-container">
 								<?php do_meta_boxes( get_current_screen()->id, 'side', $user ); ?>
@@ -882,7 +960,7 @@ class BP_Members_Admin {
 			return;
 		}
 
-		// Bail if user has not been activated yet (how didy ou get here?)
+		// Bail if user has not been activated yet (how did you get here?)
 		if ( isset( $user->user_status ) && ( 2 == $user->user_status ) ) : ?>
 
 			<p class="not-activated"><?php esc_html_e( 'User account has not yet been activated', 'buddypress' ); ?></p><br/>
@@ -991,6 +1069,15 @@ class BP_Members_Admin {
 			<?php
 			// Loading other stats only if user has activated their account
 			if ( empty( $user->user_status ) ) {
+
+				/**
+				 * Fires in the user stats metabox if the user has activated their account.
+				 *
+				 * @since BuddyPress (2.0.0)
+				 *
+				 * @param array  $value Array holding the user ID.
+				 * @param object $user  Current displayed user object.
+				 */
 				do_action( 'bp_members_admin_user_stats', array( 'user_id' => $user->ID ), $user );
 			}
 			?>
@@ -999,14 +1086,81 @@ class BP_Members_Admin {
 		<?php
 	}
 
+	/**
+	 * Render the Member Type metabox.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param WP_User $user The WP_User object to be edited.
+	 */
+	public function user_admin_member_type_metabox( $user = null ) {
+
+		// Bail if no user ID.
+		if ( empty( $user->ID ) ) {
+			return;
+		}
+
+		$types = bp_get_member_types( array(), 'objects' );
+		$current_type = bp_get_member_type( $user->ID );
+		?>
+
+		<select name="bp-members-profile-member-type">
+			<option value="" <?php selected( '', $current_type ); ?>><?php /* translators: no option picked in select box */ esc_attr_e( '----', 'buddypress' ) ?></option>
+			<?php foreach ( $types as $type ) : ?>
+				<option value="<?php echo esc_attr( $type->name ) ?>" <?php selected( $type->name, $current_type ) ?>><?php echo esc_html( $type->labels['singular_name'] ) ?></option>
+			<?php endforeach; ?>
+		</select>
+
+		<?php
+
+		wp_nonce_field( 'bp-member-type-change-' . $user->ID, 'bp-member-type-nonce' );
+	}
+
+	/**
+	 * Process changes from the Member Type metabox.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 * @access public
+	 */
+	public function process_member_type_update() {
+		if ( ! isset( $_POST['bp-member-type-nonce'] ) || ! isset( $_POST['bp-members-profile-member-type'] ) ) {
+			return;
+		}
+
+		$user_id = $this->get_user_id();
+
+		check_admin_referer( 'bp-member-type-change-' . $user_id, 'bp-member-type-nonce' );
+
+		// Permission check.
+		if ( ! current_user_can( 'bp_moderate' ) && $user_id != bp_loggedin_user_id() ) {
+			return;
+		}
+
+		// Member type string must either reference a valid member type, or be empty.
+		$member_type = stripslashes( $_POST['bp-members-profile-member-type'] );
+		if ( ! empty( $member_type ) && ! bp_get_member_type_object( $member_type ) ) {
+			return;
+		}
+
+		/*
+		 * If an invalid member type is passed, someone's doing something
+		 * fishy with the POST request, so we can fail silently.
+		 */
+		if ( bp_set_member_type( $user_id, $member_type ) ) {
+			// @todo Success messages can't be posted because other stuff happens on the page load.
+		}
+	}
+
 	/**
 	 * Add a link to Profile in Users listing row actions.
 	 *
 	 * @access public
 	 * @since BuddyPress (2.0.0)
 	 *
-	 * @param array $actions WordPress row actions (edit, delete).
-	 * @param object $user The object for the user row.
+	 * @param array|string $actions WordPress row actions (edit, delete).
+	 * @param object       $user    The object for the user row.
+	 *
 	 * @return array Merged actions.
 	 */
 	public function row_actions( $actions = '', $user = null ) {
@@ -1059,7 +1213,7 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Add a filter to edit profile url in WP Admin Bar
+	 * Add a filter to edit profile url in WP Admin Bar.
 	 *
 	 * @access public
 	 * @since BuddyPress (2.1.0)
@@ -1069,12 +1223,18 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Filter the profile url
+	 * Filter the profile url.
 	 *
 	 * @access public
 	 * @since BuddyPress (2.1.0)
 	 *
 	 * @uses  user_admin_url()
+	 *
+	 * @param string $profile_link Profile Link for admin bar.
+	 * @param string $url          Profile URL.
+	 * @param int    $user_id      User ID.
+	 *
+	 * @return string
 	 */
 	public function filter_adminbar_profile_link( $profile_link = '', $url = '', $user_id = 0 ) {
 		if ( ! is_super_admin( $user_id ) && is_admin() ) {
@@ -1084,7 +1244,7 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Remove the filter to edit profile url in WP Admin Bar
+	 * Remove the filter to edit profile url in WP Admin Bar.
 	 *
 	 * @access public
 	 * @since BuddyPress (2.1.0)
@@ -1101,10 +1261,11 @@ class BP_Members_Admin {
 	 * @access public
 	 * @since BuddyPress (2.0.0)
 	 *
-	 * @param  int $value
-	 * @param  string $option
-	 * @param  int $new_value
-	 * @return int the pagination preferences
+	 * @param int    $value
+	 * @param string $option
+	 * @param int    $new_value
+	 *
+	 * @return int The pagination preferences.
 	 */
 	public function signup_screen_options( $value = 0, $option = '', $new_value = 0 ) {
 		if ( 'users_page_bp_signups_network_per_page' != $option && 'users_page_bp_signups_per_page' != $option ) {
@@ -1128,7 +1289,8 @@ class BP_Members_Admin {
 	 *
 	 * @since BuddyPress (2.0.0)
 	 *
-	 * @param  WP_User_Query $query The users query.
+	 * @param WP_User_Query $query The users query.
+	 *
 	 * @return WP_User_Query The users query without the signups.
 	 */
 	public function remove_signups_from_user_query( $query = null ) {
@@ -1170,7 +1332,8 @@ class BP_Members_Admin {
 	 *
 	 * @since BuddyPress (2.0.0)
 	 *
-	 * @param  array $views WP List Table views.
+	 * @param array $views WP List Table views.
+	 *
 	 * @return array The views with the signup view added.
 	 */
 	public function signup_filter_view( $views = array() ) {
@@ -1187,7 +1350,7 @@ class BP_Members_Admin {
 		$url     = add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) );
 		$text    = sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $signups ) . ')</span>' );
 
-		$views['registered'] = sprintf( '<a href="%1$s" class="%2$s">%3$s</a>', $url, $class, $text );
+		$views['registered'] = sprintf( '<a href="%1$s" class="%2$s">%3$s</a>', esc_url( $url ), $class, $text );
 
 		return $views;
 	}
@@ -1197,8 +1360,9 @@ class BP_Members_Admin {
 	 *
 	 * @since BuddyPress (2.0.0)
 	 *
-	 * @param  string $class    The name of the class to use.
-	 * @param  string $required The parent class.
+	 * @param string $class    The name of the class to use.
+	 * @param string $required The parent class.
+	 *
 	 * @return WP_List_Table    The List table.
 	 */
 	public static function get_list_table_class( $class = '', $required = '' ) {
@@ -1208,7 +1372,7 @@ class BP_Members_Admin {
 
 		if ( ! empty( $required ) ) {
 			require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
-			require_once( buddypress()->members->admin->admin_dir . 'bp-members-classes.php'    );
+			require_once( buddypress()->members->admin->admin_dir . 'bp-members-admin-classes.php' );
 		}
 
 		return new $class();
@@ -1232,10 +1396,23 @@ class BP_Members_Admin {
 		$redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] );
 		$doaction    = bp_admin_list_table_current_bulk_action();
 
-		// Call an action for plugins to hook in early
+		/**
+		 * Fires at the start of the signups admin load.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $doaction Current bulk action being processed.
+		 * @param array  $_REQUEST Current $_REQUEST global.
+		 */
 		do_action( 'bp_signups_admin_load', $doaction, $_REQUEST );
 
-		// Allowed actions
+		/**
+		 * Filters the allowed actions for use in the user signups admin page.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $value Array of allowed actions to use.
+		 */
 		$allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions', array( 'do_delete', 'do_activate', 'do_resend' ) );
 
 		// Prepare the display of the Community Profile screen
@@ -1254,7 +1431,7 @@ class BP_Members_Admin {
 				'id'      => 'bp-signups-overview',
 				'title'   => __( 'Overview', 'buddypress' ),
 				'content' =>
-				'<p>' . __( 'This is the admininistration screen for pending accounts on your site.', 'buddypress' ) . '</p>' .
+				'<p>' . __( 'This is the administration screen for pending accounts on your site.', 'buddypress' ) . '</p>' .
 				'<p>' . __( 'From the screen options, you can customize the displayed columns and the pagination of this screen.', 'buddypress' ) . '</p>' .
 				'<p>' . __( 'You can reorder the list of your pending accounts by clicking on the Username, Email or Registered column headers.', 'buddypress' ) . '</p>' .
 				'<p>' . __( 'Using the search form, you can find pending accounts more easily. The Username and Email fields will be included in the search.', 'buddypress' ) . '</p>'
@@ -1274,7 +1451,7 @@ class BP_Members_Admin {
 			// Help panel - sidebar links
 			get_current_screen()->set_help_sidebar(
 				'<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
-				'<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
+				'<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
 			);
 		} else {
 			if ( ! empty( $_REQUEST['signup_ids' ] ) ) {
@@ -1309,7 +1486,7 @@ class BP_Members_Admin {
 				bp_core_redirect( $redirect_to );
 
 			// Handle activated accounts
-			} else if ( 'do_activate' == $doaction ) {
+			} elseif ( 'do_activate' == $doaction ) {
 
 				// nonce check
 				check_admin_referer( 'signups_activate' );
@@ -1336,7 +1513,7 @@ class BP_Members_Admin {
 				bp_core_redirect( $redirect_to );
 
 			// Handle sign-ups delete
-			} else if ( 'do_delete' == $doaction ) {
+			} elseif ( 'do_delete' == $doaction ) {
 
 				// nonce check
 				check_admin_referer( 'signups_delete' );
@@ -1366,6 +1543,15 @@ class BP_Members_Admin {
 			} else {
 				$this->redirect = $redirect_to;
 
+				/**
+				 * Fires at end of signups admin load if doaction does not match any actions.
+				 *
+				 * @since BuddyPress (2.0.0)
+				 *
+				 * @param string $doaction Current bulk action being processed.
+				 * @param array  $_REQUEST Current $_REQUEST global.
+				 * @param string $redirect Determined redirect url to send user to.
+				 */
 				do_action( 'bp_members_admin_update_signups', $doaction, $_REQUEST, $this->redirect );
 
 				bp_core_redirect( $this->redirect );
@@ -1400,7 +1586,7 @@ class BP_Members_Admin {
 	}
 
 	/**
-	 * Get admin notice when viewing the sign-up page
+	 * Get admin notice when viewing the sign-up page.
 	 *
 	 * @since BuddyPress (2.1.0)
 	 *
@@ -1524,21 +1710,21 @@ class BP_Members_Admin {
 				case 'do_resend':
 					$notice = array(
 						'class'   => 'error',
-						'message' => esc_html__( 'There was a problem sending the activation emails, please try again.', 'buddypress' ),
+						'message' => esc_html__( 'There was a problem sending the activation emails. Please try again.', 'buddypress' ),
 					);
 					break;
 
 				case 'do_activate':
 					$notice = array(
 						'class'   => 'error',
-						'message' => esc_html__( 'There was a problem activating accounts, please try again.', 'buddypress' ),
+						'message' => esc_html__( 'There was a problem activating accounts. Please try again.', 'buddypress' ),
 					);
 					break;
 
 				case 'do_delete':
 					$notice = array(
 						'class'   => 'error',
-						'message' => esc_html__( 'There was a problem deleting sign-ups, please try again.', 'buddypress' ),
+						'message' => esc_html__( 'There was a problem deleting sign-ups. Please try again.', 'buddypress' ),
 					);
 					break;
 			}
@@ -1551,10 +1737,10 @@ class BP_Members_Admin {
 	 * Signups admin page router.
 	 *
 	 * Depending on the context, display
-	 * - the list of signups
-	 * - or the delete confirmation screen
-	 * - or the activate confirmation screen
-	 * - or the "resend" email confirmation screen
+	 * - the list of signups,
+	 * - or the delete confirmation screen,
+	 * - or the activate confirmation screen,
+	 * - or the "resend" email confirmation screen.
 	 *
 	 * Also prepare the admin notices.
 	 *
@@ -1695,9 +1881,11 @@ class BP_Members_Admin {
 	 * @since BuddyPress (2.0.0)
 	 *
 	 * @param string $action Delete, activate, or resend activation link.
+	 *
+	 * @return string
 	 */
 	public function signups_admin_manage( $action = '' ) {
-		if ( ! is_super_admin() || empty( $action ) ) {
+		if ( ! current_user_can( $this->capability ) || empty( $action ) ) {
 			die( '-1' );
 		}
 
@@ -1705,7 +1893,7 @@ class BP_Members_Admin {
 		$ids = false;
 		if ( ! empty( $_POST['allsignups'] ) ) {
 			$ids = wp_parse_id_list( $_POST['allsignups'] );
-		} else if ( ! empty( $_GET['signup_id'] ) ) {
+		} elseif ( ! empty( $_GET['signup_id'] ) ) {
 			$ids = absint( $_GET['signup_id'] );
 		}
 
@@ -1726,17 +1914,29 @@ class BP_Members_Admin {
 		switch ( $action ) {
 			case 'delete' :
 				$header_text = __( 'Delete Pending Accounts', 'buddypress' );
-				$helper_text = _n( 'You are about to delete the following account:', 'You are about to delete the following accounts:', count( $signup_ids ), 'buddypress' );
+				if ( 1 == count( $signup_ids ) ) {
+					$helper_text = __( 'You are about to delete the following account:', 'buddypress' );
+				} else {
+					$helper_text = __( 'You are about to delete the following accounts:', 'buddypress' );
+				}
 				break;
 
 			case 'activate' :
 				$header_text = __( 'Activate Pending Accounts', 'buddypress' );
-				$helper_text = _n( 'You are about to activate the following account:', 'You are about to activate the following accounts:', count( $signup_ids ), 'buddypress' );
+				if ( 1 == count( $signup_ids ) ) {
+					$helper_text = __( 'You are about to activate the following account:', 'buddypress' );
+				} else {
+					$helper_text = __( 'You are about to activate the following accounts:', 'buddypress' );
+				}
 				break;
 
 			case 'resend' :
 				$header_text = __( 'Resend Activation Emails', 'buddypress' );
-				$helper_text = _n( 'You are about to resend an activation email to the following account:', 'You are about to resend activation emails to the following accounts:', count( $signup_ids ), 'buddypress' );
+				if ( 1 == count( $signup_ids ) ) {
+					$helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' );
+				} else {
+					$helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' );
+				}
 				break;
 		}
 
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
index 591667921ce862c1f2247150bd72173ec8d6b61c..edd47e476b821b7af98078090c1259add2e77fff 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Members Toolbar
+ * BuddyPress Members Toolbar.
  *
  * Handles the member functions related to the WordPress Toolbar.
  *
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Add the "My Account" menu and all submenus.
@@ -20,7 +20,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support
  */
 function bp_members_admin_bar_my_account_menu() {
-	global $bp, $wp_admin_bar;
+	global $wp_admin_bar;
 
 	// Bail if this is an ajax request
 	if ( defined( 'DOING_AJAX' ) )
@@ -29,6 +29,8 @@ function bp_members_admin_bar_my_account_menu() {
 	// Logged in user
 	if ( is_user_logged_in() ) {
 
+		$bp = buddypress();
+
 		// Stored in the global so we can add menus easily later on
 		$bp->my_account_menu_id = 'my-account-buddypress';
 
@@ -72,7 +74,7 @@ add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 );
  * @since BuddyPress (1.5.0)
  */
 function bp_members_admin_bar_user_admin_menu() {
-	global $bp, $wp_admin_bar;
+	global $wp_admin_bar;
 
 	// Only show if viewing a user
 	if ( !bp_is_user() )
@@ -82,6 +84,8 @@ function bp_members_admin_bar_user_admin_menu() {
 	if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() )
 		return false;
 
+	$bp = buddypress();
+
 	// Unique ID for the 'My Account' menu
 	$bp->user_admin_menu_id = 'user-admin';
 
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-cache.php b/wp-content/plugins/buddypress/bp-members/bp-members-cache.php
new file mode 100644
index 0000000000000000000000000000000000000000..7bd949c27b785450b81c68fabb880c2a5dfb9772
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-cache.php
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * Caching functions specific to BuddyPress Members.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+
+/**
+ * Pre-fetch member type data when initializing a Members loop.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param BP_User_Query $bp_user_query BP_User_Query object.
+ */
+function bp_members_prefetch_member_type( BP_User_Query $bp_user_query ) {
+	$uncached_member_ids = bp_get_non_cached_ids( $bp_user_query->user_ids, 'bp_member_member_type' );
+
+	$member_types = bp_get_object_terms( $uncached_member_ids, 'bp_member_type', array(
+		'fields' => 'all_with_object_id',
+	) );
+
+	// Rekey by user ID.
+	$keyed_member_types = array();
+	foreach ( $member_types as $member_type ) {
+		if ( ! isset( $keyed_member_types[ $member_type->object_id ] ) ) {
+			$keyed_member_types[ $member_type->object_id ] = array();
+		}
+
+		$keyed_member_types[ $member_type->object_id ][] = $member_type->name;
+	}
+
+	$cached_member_ids = array();
+	foreach ( $keyed_member_types as $user_id => $user_member_types ) {
+		wp_cache_set( $user_id, $user_member_types, 'bp_member_member_type' );
+		$cached_member_ids[] = $user_id;
+	}
+
+	// Cache an empty value for users with no type.
+	foreach ( array_diff( $uncached_member_ids, $cached_member_ids ) as $no_type_id ) {
+		wp_cache_set( $no_type_id, '', 'bp_member_member_type' );
+	}
+}
+add_action( 'bp_user_query_populate_extras', 'bp_members_prefetch_member_type' );
+
+/**
+ * Clear the member_type cache for a user.
+ *
+ * Called when the user is deleted or marked as spam.
+ *
+ * @since BuddyPres (2.2.0)
+ *
+ * @param int $user_id ID of the deleted user.
+ */
+function bp_members_clear_member_type_cache( $user_id ) {
+	wp_cache_delete( $user_id, 'bp_member_member_type' );
+}
+add_action( 'wpmu_delete_user', 'bp_members_clear_member_type_cache' );
+add_action( 'delete_user', 'bp_members_clear_member_type_cache' );
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-classes.php b/wp-content/plugins/buddypress/bp-members/bp-members-classes.php
index ca74e5ed5416ad591d4f6263523940d81f9cf337..e281b2d875b9b8f7260e24e848b33091b0f48cbb 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-classes.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-classes.php
@@ -1,660 +1,12 @@
 <?php
-
 /**
- * Signups Management class.
+ * BuddyPress Members Classes.
  *
  * @package BuddyPress
- * @subpackage coreClasses
- *
- * @since BuddyPress (2.0.0)
+ * @subpackage MembersClasses
  */
-class BP_Signup {
-
-	/**
-	 * ID of the signup which the object relates to.
-	 *
-	 * @var integer
-	 */
-	public $id;
-
-	/**
-	 * The URL to the full size of the avatar for the user.
-	 *
-	 * @var string
-	 */
-	public $avatar;
-
-	/**
-	 * The username for the user.
-	 *
-	 * @var string
-	 */
-	public $user_login;
-
-	/**
-	 * The email for the user.
-	 *
-	 * @var string
-	 */
-	public $user_email;
-
-	/**
-	 * The full name of the user.
-	 *
-	 * @var string
-	 */
-	public $user_name;
-
-	/**
-	 * Metadata associated with the signup.
-	 *
-	 * @var array
-	 */
-	public $meta;
-
-	/**
-	 * The registered date for the user.
-	 *
-	 * @var string
-	 */
-	public $registered;
-
-	/**
-	 * The activation key for the user.
-	 *
-	 * @var string
-	 */
-	public $activation_key;
-
-
-	/** Public Methods *******************************************************/
-
-	/**
-	 * Class constructor.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param integer $signup_id The ID for the signup being queried.
-	 */
-	public function __construct( $signup_id = 0 ) {
-		if ( !empty( $signup_id ) ) {
-			$this->id = $signup_id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Populate the instantiated class with data based on the signup_id provided.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function populate() {
-		global $wpdb;
-
-		$signups_table = buddypress()->members->table_name_signups;
-		$signup        = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$signups_table} WHERE signup_id = %d AND active = 0", $this->id ) );
-
-		$this->avatar         = get_avatar( $signup->user_email, 32 );
-		$this->user_login     = $signup->user_login;
-		$this->user_email     = $signup->user_email;
-		$this->meta           = maybe_unserialize( $signup->meta );
-		$this->user_name      = ! empty( $this->meta['field_1'] ) ? wp_unslash( $this->meta['field_1'] ) : '';
-		$this->registered     = $signup->registered;
-		$this->activation_key = $signup->activation_key;
-	}
-
-	/** Static Methods *******************************************************/
-
-	/**
-	 * Fetch signups based on parameters.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $args the argument to retrieve desired signups
-	 * @return array {
-	 *     @type array $signups Located signups.
-	 *     @type int $total Total number of signups matching params.
-	 * }
-	 */
-	public static function get( $args = array() ) {
-		global $wpdb;
-
-		$r = bp_parse_args( $args,
-			array(
-				'offset'         => 0,
-				'number'         => 1,
-				'usersearch'     => false,
-				'orderby'        => 'signup_id',
-				'order'          => 'DESC',
-				'include'        => false,
-				'activation_key' => '',
-				'user_login'     => '',
-			),
-			'bp_core_signups_get_args'
-		);
-
-		// @todo whitelist sanitization
-		if ( $r['orderby'] !== 'signup_id' ) {
-			$r['orderby'] = 'user_' . $r['orderby'];
-		}
-
-		$r['orderby'] = sanitize_title( $r['orderby'] );
-
-		$sql = array();
-		$signups_table  = buddypress()->members->table_name_signups;
-		$sql['select']  = "SELECT * FROM {$signups_table}";
-		$sql['where']   = array();
-		$sql['where'][] = "active = 0";
-
-		if ( empty( $r['include'] ) ) {
-
-			// Search terms
-			if ( ! empty( $r['usersearch'] ) ) {
-				$search_terms_like = '%' . bp_esc_like( $r['usersearch'] ) . '%';
-				$sql['where'][]    = $wpdb->prepare( "( user_login LIKE %s OR user_email LIKE %s OR meta LIKE %s )", $search_terms_like, $search_terms_like, $search_terms_like );
-			}
-
-			// Activation key
-			if ( ! empty( $r['activation_key'] ) ) {
-				$sql['where'][] = $wpdb->prepare( "activation_key = %s", $r['activation_key'] );
-			}
-
-			// User login
-			if ( ! empty( $r['user_login'] ) ) {
-				$sql['where'][] = $wpdb->prepare( "user_login = %s", $r['user_login'] );
-			}
-
-			$sql['orderby'] = "ORDER BY {$r['orderby']}";
-			$sql['order']	= bp_esc_sql_order( $r['order'] );
-			$sql['limit']	= $wpdb->prepare( "LIMIT %d, %d", $r['offset'], $r['number'] );
-		} else {
-			$in = implode( ',', wp_parse_id_list( $r['include'] ) );
-			$sql['in'] = "AND signup_id IN ({$in})";
-		}
-
-		// Implode WHERE clauses
-		$sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] );
-
-		$paged_signups = $wpdb->get_results( apply_filters( 'bp_members_signups_paged_query', join( ' ', $sql ), $sql, $args, $r ) );
-
-		if ( empty( $paged_signups ) ) {
-			return array( 'signups' => false, 'total' => false );
-		}
-
-		// Used to calculate a diff between now & last
-		// time an activation link has been resent
-		$now = current_time( 'timestamp', true );
-
-		foreach ( (array) $paged_signups as $key => $signup ) {
-
-			$signup->id   = intval( $signup->signup_id );
-
-			$signup->meta = ! empty( $signup->meta ) ? maybe_unserialize( $signup->meta ) : false;
-
-			$signup->user_name = '';
-			if ( ! empty( $signup->meta['field_1'] ) ) {
-				$signup->user_name = wp_unslash( $signup->meta['field_1'] );
-			}
-
-			// Sent date defaults to date of registration
-			if ( ! empty( $signup->meta['sent_date'] ) ) {
-				$signup->date_sent = $signup->meta['sent_date'];
-			} else {
-				$signup->date_sent = $signup->registered;
-			}
-
-			$sent_at = mysql2date('U', $signup->date_sent );
-			$diff    = $now - $sent_at;
-
-			/**
-			 * add a boolean in case the last time an activation link
-			 * has been sent happened less than a day ago
-			 */
-			if ( $diff < 1 * DAY_IN_SECONDS ) {
-				$signup->recently_sent = true;
-			}
-
-			if ( ! empty( $signup->meta['count_sent'] ) ) {
-				$signup->count_sent = absint( $signup->meta['count_sent'] );
-			} else {
-				$signup->count_sent = 1;
-			}
-
-			$paged_signups[ $key ] = $signup;
-		}
-
-		unset( $sql['limit'] );
-		$sql['select'] = preg_replace( "/SELECT.*?FROM/", "SELECT COUNT(*) FROM", $sql['select'] );
-		$total_signups = $wpdb->get_var( apply_filters( 'bp_members_signups_count_query', join( ' ', $sql ), $sql, $args, $r ) );
-
-		return array( 'signups' => $paged_signups, 'total' => $total_signups );
-	}
-
-	/**
-	 * Add a signup.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $args
-	 * @return int|bool ID of newly created signup on success, false on
-	 *         failure.
-	 */
-	public static function add( $args = array() ) {
-		global $wpdb;
-
-		$r = bp_parse_args( $args,
-			array(
-				'domain'         => '',
-				'path'           => '',
-				'title'          => '',
-				'user_login'     => '',
-				'user_email'     => '',
-				'registered'     => current_time( 'mysql', true ),
-				'activation_key' => '',
-				'meta'           => '',
-			),
-			'bp_core_signups_add_args'
-		);
-
-		$r['meta'] = maybe_serialize( $r['meta'] );
-
-		$inserted = $wpdb->insert(
-			buddypress()->members->table_name_signups,
-			$r,
-			array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )
-		);
-
-		if ( $inserted ) {
-			$retval = $wpdb->insert_id;
-		} else {
-			$retval = false;
-		}
-
-		return apply_filters( 'bp_core_signups_add', $retval );
-	}
-
-	/**
-	 * Create a WP user at signup.
-	 *
-	 * Since BP 2.0, non-multisite configurations have stored signups in
-	 * the same way as Multisite configs traditionally have: in the
-	 * wp_signups table. However, because some plugins may be looking
-	 * directly in the wp_users table for non-activated signups, we
-	 * mirror signups there by creating "phantom" users, mimicking WP's
-	 * default behavior.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param string $user_login User login string.
-	 * @param string $user_password User password.
-	 * @param string $user_email User email address.
-	 * @param array $usermeta Metadata associated with the signup.
-	 * @return int User id.
-	 */
-	public static function add_backcompat( $user_login = '', $user_password = '', $user_email = '', $usermeta = array() ) {
-		global $wpdb;
-
-		$errors = new WP_Error();
-
-		$user_id = wp_insert_user( array(
-			'user_login'   => $user_login,
-			'user_pass'    => $user_password,
-			'display_name' => sanitize_title( $user_login ),
-			'user_email'   => $user_email
-		) );
-
-		if ( is_wp_error( $user_id ) || empty( $user_id ) ) {
-			$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you. Please contact the <a href="mailto:%s">webmaster</a>.', 'buddypress' ), bp_get_option( 'admin_email' ) ) );
-			return $errors;
-		}
-
-		// Update the user status to '2', ie "not activated"
-		// (0 = active, 1 = spam, 2 = not active)
-		$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 2 WHERE ID = %d", $user_id ) );
-
-		// WordPress creates these options automatically on
-		// wp_insert_user(), but we delete them so that inactive
-		// signups don't appear in various user counts.
-		delete_user_option( $user_id, 'capabilities' );
-		delete_user_option( $user_id, 'user_level'   );
-
-		// Set any profile data
-		if ( bp_is_active( 'xprofile' ) ) {
-			if ( ! empty( $usermeta['profile_field_ids'] ) ) {
-				$profile_field_ids = explode( ',', $usermeta['profile_field_ids'] );
-
-				foreach ( (array) $profile_field_ids as $field_id ) {
-					if ( empty( $usermeta["field_{$field_id}"] ) ) {
-						continue;
-					}
-
-					$current_field = $usermeta["field_{$field_id}"];
-					xprofile_set_field_data( $field_id, $user_id, $current_field );
-
-					// Save the visibility level
-					$visibility_level = ! empty( $usermeta['field_' . $field_id . '_visibility'] ) ? $usermeta['field_' . $field_id . '_visibility'] : 'public';
-					xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
-				}
-			}
-		}
-
-		return apply_filters( 'bp_core_signups_add_backcompat', $user_id );
-	}
-
-	/**
-	 * Check a user status (from wp_users) on a non-multisite config.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param int $user_id ID of the user being checked.
-	 * @return int|bool The status if found, otherwise false.
-	 */
-	public static function check_user_status( $user_id = 0 ) {
-		global $wpdb;
-
-		if ( empty( $user_id ) ) {
-			return false;
-		}
-
-		$user_status = $wpdb->get_var( $wpdb->prepare( "SELECT user_status FROM {$wpdb->users} WHERE ID = %d", $user_id ) );
-
-		return apply_filters( 'bp_core_signups_check_user_status', intval( $user_status ) );
-	}
-
-	/**
-	 * Activate a signup.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param string $key Activation key.
-	 * @return bool True on success, false on failure.
-	 */
-	public static function validate( $key = '' ) {
-		global $wpdb;
-
-		if ( empty( $key ) ) {
-			return;
-		}
-
-		$activated = $wpdb->update(
-			// Signups table
-			buddypress()->members->table_name_signups,
-			array(
-				'active' => 1,
-				'activated' => current_time( 'mysql', true ),
-			),
-			array(
-				'activation_key' => $key,
-			),
-			// Data sanitization format
-			array(
-				'%d',
-				'%s',
-			),
-			// WHERE sanitization format
-			array(
-				'%s',
-			)
-		);
-
-		return apply_filters( 'bp_core_signups_validate', $activated );
-	}
-
-	/**
-	 * How many inactive signups do we have?
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @return int the number of signups
-	 */
-	public static function count_signups() {
-		global $wpdb;
-
-		$signups_table = buddypress()->members->table_name_signups;
-		$count_signups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) AS total FROM {$signups_table} WHERE active = %d", 0 ) );
-
-		return apply_filters( 'bp_core_signups_count', (int) $count_signups );
-	}
-
-	/**
-	 * Update the meta for a signup.
-	 *
-	 * This is the way we use to "trace" the last date an activation
-	 * email was sent and how many times activation was sent.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param  array $args
-	 * @return int the signup id
-	 */
-	public static function update( $args = array() ) {
-		global $wpdb;
-
-		$r = bp_parse_args( $args,
-			array(
-				'signup_id'  => 0,
-				'meta'       => array(),
-			),
-			'bp_core_signups_update_args'
-		);
-
-		if ( empty( $r['signup_id'] ) || empty( $r['meta'] ) ) {
-			return false;
-		}
-
-		$wpdb->update(
-			// Signups table
-			buddypress()->members->table_name_signups,
-			// Data to update
-			array(
-				'meta' => serialize( $r['meta'] ),
-			),
-			// WHERE
-			array(
-				'signup_id' => $r['signup_id'],
-			),
-			// Data sanitization format
-			array(
-				'%s',
-			),
-			// WHERE sanitization format
-			array(
-				'%d',
-			)
-		);
-
-		return apply_filters( 'bp_core_signups_update', $r['signup_id'] );
-	}
-
-	/**
-	 * Resend an activation email.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $signup_ids Single ID or list of IDs to resend.
-	 * @return array
-	 */
-	public static function resend( $signup_ids = array() ) {
-		if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) {
-			return false;
-		}
-
-		$to_resend = self::get( array(
-			'include' => $signup_ids,
-		) );
-
-		if ( ! $signups = $to_resend['signups'] ) {
-			return false;
-		}
-
-		$result = array();
-
-		do_action( 'bp_core_signup_before_resend', $signup_ids );
-
-		foreach ( $signups as $signup ) {
-
-			$meta               = $signup->meta;
-			$meta['sent_date']  = current_time( 'mysql', true );
-			$meta['count_sent'] = $signup->count_sent + 1;
-
-			// Send activation email
-			if ( is_multisite() ) {
-				wpmu_signup_user_notification( $signup->user_login, $signup->user_email, $signup->activation_key, serialize( $meta ) );
-			} else {
-
-				// Check user status before sending email
-				$user_id = email_exists( $signup->user_email );
-
-				if ( ! empty( $user_id ) && 2 != self::check_user_status( $user_id ) ) {
-
-					// Status is not 2, so user's account has been activated
-					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
-
-					// repare signups table
-					self::validate( $signup->activation_key );
-
-					continue;
-
-				// Send the validation email
-				} else {
-					bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key );
-				}
-			}
-
-			// Update metas
-			$result['resent'][] = self::update( array(
-				'signup_id' => $signup->signup_id,
-				'meta'      => $meta,
-			) );
-		}
-
-		do_action( 'bp_core_signup_after_resend', $signup_ids, $result );
-
-		return apply_filters( 'bp_core_signup_resend', $result );
-	}
-
-	/**
-	 * Activate a pending account.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $signup_ids Single ID or list of IDs to activate.
-	 * @return array
-	 */
-	public static function activate( $signup_ids = array() ) {
-		if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) {
-			return false;
-		}
-
-		$to_activate = self::get( array(
-			'include' => $signup_ids,
-		) );
-
-		if ( ! $signups = $to_activate['signups'] ) {
-			return false;
-		}
-
-		$result = array();
-
-		do_action( 'bp_core_signup_before_activate', $signup_ids );
-
-		foreach ( $signups as $signup ) {
-
-			$user = bp_core_activate_signup( $signup->activation_key );
-
-			if ( ! empty( $user->errors ) ) {
-
-				$user_id = username_exists( $signup->user_login );
-
-				if ( 2 !== self::check_user_status( $user_id ) ) {
-					$user_id = false;
-				}
-
-				if ( empty( $user_id ) ) {
-
-					// Status is not 2, so user's account has been activated
-					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
-
-					// repare signups table
-					self::validate( $signup->activation_key );
-
-				// we have a user id, account is not active, let's delete it
-				} else {
-					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, $user->get_error_message() );
-				}
-
-			} else {
-				$result['activated'][] = $user;
-			}
-		}
-
-		do_action( 'bp_core_signup_after_activate', $signup_ids, $result );
-
-		return apply_filters( 'bp_core_signup_activate', $result );
-	}
-
-	/**
-	 * Delete a pending account.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $signup_ids Single ID or list of IDs to delete.
-	 * @return array
-	 */
-	public static function delete( $signup_ids = array() ) {
-		global $wpdb;
-
-		if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) {
-			return false;
-		}
-
-		$to_delete = self::get( array(
-			'include' => $signup_ids,
-		) );
-
-		if ( ! $signups = $to_delete['signups'] ) {
-			return false;
-		}
-
-		$result = array();
-
-		do_action( 'bp_core_signup_before_delete', $signup_ids );
-
-		foreach ( $signups as $signup ) {
-			$user_id = username_exists( $signup->user_login );
-
-			if ( ! empty( $user_id ) && $signup->activation_key == wp_hash( $user_id ) ) {
-
-				if ( 2 != self::check_user_status( $user_id ) ) {
-
-					// Status is not 2, so user's account has been activated
-					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
-
-					// repare signups table
-					self::validate( $signup->activation_key );
-
-				// we have a user id, account is not active, let's delete it
-				} else {
-					bp_core_delete_account( $user_id );
-				}
-			}
-
-			if ( empty( $result['errors'][ $signup->signup_id ] ) ) {
-				$wpdb->delete(
-					// Signups table
-					buddypress()->members->table_name_signups,
-					// Where
-					array( 'signup_id' => $signup->signup_id, ),
-					// WHERE sanitization format
-					array( '%d', )
-				);
-
-				$result['deleted'][] = $signup->signup_id;
-			}
-		}
 
-		do_action( 'bp_core_signup_after_delete', $signup_ids, $result );
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
 
-		return apply_filters( 'bp_core_signup_delete', $result );
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-signup.php';
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
index 6d236015c5a1b8ebd1c8e9b9d829ff9a5ce2fbcf..b4556268e071564e494963ffcca1be90d083ae9c 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Members Filters
+ * BuddyPress Members Filters.
  *
  * Filters specific to the Members component.
  *
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Escape commonly used fullname output functions.
@@ -18,6 +18,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
 add_filter( 'bp_displayed_user_fullname',    'esc_html' );
 add_filter( 'bp_get_loggedin_user_fullname', 'esc_html' );
 
+// Filter the user registration URL to point to BuddyPress's registration page.
+add_filter( 'register_url', 'bp_get_signup_page' );
+
 /**
  * Load additional sign-up sanitization filters on bp_loaded.
  *
@@ -54,15 +57,17 @@ function bp_members_signup_sanitization() {
 add_action( 'bp_loaded', 'bp_members_signup_sanitization' );
 
 /**
- * Make sure the username is not the blog slug in case of root profile & subdirectory blog
+ * Make sure the username is not the blog slug in case of root profile & subdirectory blog.
  *
  * If BP_ENABLE_ROOT_PROFILES is defined & multisite config is set to subdirectories,
  * then there is a chance site.url/username == site.url/blogslug. If so, user's profile
  * is not reachable, instead the blog is displayed. This filter makes sure the signup username
  * is not the same than the blog slug for this particular config.
  *
- * @since  BuddyPress (2.1.0)
- * @param  array $illegal_names
+ * @since BuddyPress (2.1.0)
+ *
+ * @param array $illegal_names
+ *
  * @return array $illegal_names
  */
 function bp_members_signup_with_subdirectory_blog( $illegal_names = array() ) {
@@ -95,9 +100,10 @@ add_filter( 'subdirectory_reserved_names', 'bp_members_signup_with_subdirectory_
  *
  * @since BuddyPress (1.6.0)
  *
- * @param string $url WP profile edit URL.
- * @param int $user_id ID of the user.
+ * @param string $url     WP profile edit URL.
+ * @param int    $user_id ID of the user.
  * @param string $scheme
+ *
  * @return string
  */
 function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) {
@@ -111,6 +117,15 @@ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) {
 		$profile_link = $url;
 	}
 
+	/**
+	 * Filters the user profile URL to point to BuddyPress profile edit.
+	 *
+	 * @since BuddyPress (1.5.2)
+	 *
+	 * @param string $url WP profile edit URL.
+	 * @param int    $user_id ID of the user.
+	 * @param string $scheme Scheme to use.
+	 */
 	return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme );
 }
 add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
index 6a6de2733972612d3f610082293fad0dbf30f434..08a0314f49832c3f2d51bd428c826df43d6c7747 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Member Functions
+ * BuddyPress Member Functions.
  *
  * Functions specific to the members component.
  *
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Check for the existence of a Members directory page.
@@ -20,7 +20,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @return bool True if found, otherwise false.
  */
 function bp_members_has_directory() {
-	global $bp;
+	$bp = buddypress();
 
 	return (bool) !empty( $bp->pages->members->id );
 }
@@ -75,22 +75,21 @@ add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 );
  * need backward compatibility with BP_Core_User::get_users(), filter the
  * bp_use_legacy_user_query value, returning true.
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of arguments. All are optional. See {@link BP_User_Query} for
  *     a more complete description of arguments.
- *     @type string $type Sort order. Default: 'active'.
- *     @type int $user_id Limit results to friends of a user. Default: false.
- *     @type mixed $exclude IDs to exclude from results. Default: false.
- *     @type string $search_terms Limit to users matching search terms. Default: false.
- *     @type string $meta_key Limit to users with a meta_key. Default: false.
- *     @type string $meta_value Limit to users with a meta_value (with
- *           meta_key). Default: false.
- *     @type mixed $include Limit results by user IDs. Default: false.
- *     @type int $per_page Results per page. Default: 20.
- *     @type int $page Page of results. Default: 1.
- *     @type bool $populate_extras Fetch optional extras. Default: true.
- *     @type string|bool $count_total How to do total user count.
- *           Default: 'count_query'.
+ *     @type string       $type            Sort order. Default: 'active'.
+ *     @type int          $user_id         Limit results to friends of a user. Default: false.
+ *     @type mixed        $exclude         IDs to exclude from results. Default: false.
+ *     @type string       $search_terms    Limit to users matching search terms. Default: false.
+ *     @type string       $meta_key        Limit to users with a meta_key. Default: false.
+ *     @type string       $meta_value      Limit to users with a meta_value (with meta_key). Default: false.
+ *     @type array|string $member_type     Array or comma-separated string of member types.
+ *     @type mixed        $include         Limit results by user IDs. Default: false.
+ *     @type int          $per_page        Results per page. Default: 20.
+ *     @type int          $page            Page of results. Default: 1.
+ *     @type bool         $populate_extras Fetch optional extras. Default: true.
+ *     @type string|bool  $count_total     How to do total user count. Default: 'count_query'.
  * }
  * @return array
  */
@@ -104,6 +103,7 @@ function bp_core_get_users( $args = '' ) {
 		'search_terms'    => false,        // Limit to users that match these search terms
 		'meta_key'        => false,        // Limit to users who have this piece of usermeta
 		'meta_value'      => false,        // With meta_key, limit to users where usermeta matches this value
+		'member_type'     => '',
 		'include'         => false,        // Pass comma separated list of user_ids to limit to only these users
 		'per_page'        => 20,           // The number of results to return per page
 		'page'            => 1,            // The page to return if limiting per page
@@ -139,15 +139,25 @@ function bp_core_get_users( $args = '' ) {
 		);
 	}
 
+	/**
+	 * Filters the results of the user query.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $retval Array of users for the current query.
+	 * @param array $r      Array of parsed query arguments.
+	 */
 	return apply_filters( 'bp_core_get_users', $retval, $r );
 }
 
 /**
- * Return the domain for the passed user: e.g. http://domain.com/members/andy/.
+ * Return the domain for the passed user: e.g. http://example.com/members/andy/.
  *
- * @param int $user_id The ID of the user.
- * @param string $user_nicename Optional. user_nicename of the user.
- * @param string $user_login Optional. user_login of the user.
+ * @param int         $user_id       The ID of the user.
+ * @param string|bool $user_nicename Optional. user_nicename of the user.
+ * @param string|bool $user_login    Optional. user_login of the user.
+ *
+ * @return string
  */
 function bp_core_get_user_domain( $user_id = 0, $user_nicename = false, $user_login = false ) {
 
@@ -168,6 +178,16 @@ function bp_core_get_user_domain( $user_id = 0, $user_nicename = false, $user_lo
 	// Use the 'bp_core_get_user_domain' filter instead.
 	$domain       = apply_filters( 'bp_core_get_user_domain_pre_cache', $domain, $user_id, $user_nicename, $user_login );
 
+	/**
+	 * Filters the domain for the passed user.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string $domain        Domain for the passed user.
+	 * @param int    $user_id       ID of the passed user.
+	 * @param string $user_nicename User nicename of the passed user.
+	 * @param string $user_login    User login of the passed user.
+	 */
 	return apply_filters( 'bp_core_get_user_domain', $domain, $user_id, $user_nicename, $user_login );
 }
 
@@ -175,6 +195,7 @@ function bp_core_get_user_domain( $user_id = 0, $user_nicename = false, $user_lo
  * Fetch everything in the wp_users table for a user, without any usermeta.
  *
  * @param int $user_id The ID of the user.
+ *
  * @return array
  */
 function bp_core_get_core_userdata( $user_id = 0 ) {
@@ -186,6 +207,14 @@ function bp_core_get_core_userdata( $user_id = 0 ) {
 		$userdata = BP_Core_User::get_core_userdata( $user_id );
 		wp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' );
 	}
+
+	/**
+	 * Filters the userdata for a passed user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param array $userdata Array of user data for a passed user.
+	 */
 	return apply_filters( 'bp_core_get_core_userdata', $userdata );
 }
 
@@ -197,6 +226,7 @@ function bp_core_get_core_userdata( $user_id = 0 ) {
  * @todo Deprecate.
  *
  * @param string $user_login user_login of the user being queried.
+ *
  * @return int
  */
 function bp_core_get_displayed_userid( $user_login ) {
@@ -209,6 +239,7 @@ function bp_core_get_displayed_userid( $user_login ) {
  * @since BuddyPress (1.0.0)
  *
  * @param string $username user_login to check.
+ *
  * @return int|null The ID of the matched user on success, null on failure.
  */
 function bp_core_get_userid( $username = '' ) {
@@ -218,6 +249,14 @@ function bp_core_get_userid( $username = '' ) {
 
 	$user = get_user_by( 'login', $username );
 
+	/**
+	 * Filters the ID of a user, based on user_login.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param int|null $value    ID of the user or null.
+	 * @param string   $username User login to check.
+	 */
 	return apply_filters( 'bp_core_get_userid', ! empty( $user->ID ) ? $user->ID : NULL, $username );
 }
 
@@ -227,6 +266,7 @@ function bp_core_get_userid( $username = '' ) {
  * @since BuddyPress (1.2.3)
  *
  * @param string $user_nicename user_nicename to check.
+ *
  * @return int|null The ID of the matched user on success, null on failure.
  */
 function bp_core_get_userid_from_nicename( $user_nicename = '' ) {
@@ -236,6 +276,14 @@ function bp_core_get_userid_from_nicename( $user_nicename = '' ) {
 
 	$user = get_user_by( 'slug', $user_nicename );
 
+	/**
+	 * Filters the user ID based on user_nicename.
+	 *
+	 * @since BuddyPress (1.2.3)
+	 *
+	 * @param int|null $value         ID of the user or null.
+	 * @param string   $user_nicename User nicename to check.
+	 */
 	return apply_filters( 'bp_core_get_userid_from_nicename', ! empty( $user->ID ) ? $user->ID : NULL, $user_nicename );
 }
 
@@ -245,9 +293,10 @@ function bp_core_get_userid_from_nicename( $user_nicename = '' ) {
  * This function is sensitive to the BP_ENABLE_USERNAME_COMPATIBILITY_MODE,
  * so it will return the user_login or user_nicename as appropriate.
  *
- * @param int $user_id User ID to check.
- * @param string $user_nicename Optional. user_nicename of user being checked.
- * @param string $user_login Optional. user_login of user being checked.
+ * @param int         $user_id       User ID to check.
+ * @param string|bool $user_nicename Optional. user_nicename of user being checked.
+ * @param string|bool $user_login    Optional. user_login of user being checked.
+ *
  * @return string|bool The username of the matched user, or false.
  */
 function bp_core_get_username( $user_id = 0, $user_nicename = false, $user_login = false ) {
@@ -310,6 +359,13 @@ function bp_core_get_username( $user_id = 0, $user_nicename = false, $user_login
 	//	wp_cache_delete( 'bp_user_username_' . $user_id );
 	}
 
+	/**
+	 * Filters the username based on originally provided user ID.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string $username Username determined by user ID.
+	 */
 	return apply_filters( 'bp_core_get_username', $username );
 }
 
@@ -324,6 +380,7 @@ function bp_core_get_username( $user_id = 0, $user_nicename = false, $user_login
  * @todo Refactor to use a WP core function, if possible.
  *
  * @param int $user_id User ID to check.
+ *
  * @return string|bool The username of the matched user, or false.
  */
 function bp_members_get_user_nicename( $user_id ) {
@@ -367,6 +424,13 @@ function bp_members_get_user_nicename( $user_id ) {
 		wp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' );
 	}
 
+	/**
+	 * Filters the user_nicename based on originally provided user ID.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $username User nice name determined by user ID.
+	 */
 	return apply_filters( 'bp_members_get_user_nicename', $user_nicename );
 }
 
@@ -374,8 +438,9 @@ function bp_members_get_user_nicename( $user_id ) {
  * Return the email address for the user based on user ID.
  *
  * @param int $uid User ID to check.
+ *
  * @return string The email for the matched user. Empty string if no user
- *         matched the $uid.
+ *                matched the $uid.
  */
 function bp_core_get_user_email( $uid ) {
 
@@ -394,23 +459,31 @@ function bp_core_get_user_email( $uid ) {
 		wp_cache_set( 'bp_user_email_' . $uid, $email, 'bp' );
 	}
 
+	/**
+	 * Filters the user email for user based on user ID.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string $email Email determined for the user.
+	 */
 	return apply_filters( 'bp_core_get_user_email', $email );
 }
 
 /**
  * Return a HTML formatted link for a user with the user's full name as the link text.
  *
- * eg: <a href="http://andy.domain.com/">Andy Peatling</a>
+ * eg: <a href="http://andy.example.com/">Andy Peatling</a>
  *
  * Optional parameters will return just the name or just the URL.
  *
- * @param int $user_id User ID to check.
+ * @param int  $user_id   User ID to check.
  * @param bool $no_anchor Disable URL and HTML and just return full name.
- *        Default: false.
+ *                        Default: false.
  * @param bool $just_link Disable full name and HTML and just return the URL
- *        text. Default false.
+ *                        text. Default false.
+ *
  * @return string|bool The link text based on passed parameters, or false on
- *         no match.
+ *                     no match.
  */
 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false ) {
 	$display_name = bp_core_get_user_displayname( $user_id );
@@ -431,6 +504,14 @@ function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false
 		return $url;
 	}
 
+	/**
+	 * Filters the link text for the passed in user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value   Link text based on passed parameters.
+	 * @param int    $user_id ID of the user to check.
+	 */
 	return apply_filters( 'bp_core_get_userlink', '<a href="' . $url . '" title="' . $display_name . '">' . $display_name . '</a>', $user_id );
 }
 
@@ -443,6 +524,8 @@ function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false
  * @since BuddyPress (2.0.0)
  *
  * @param array $user_ids
+ *
+ * @return array
  */
 function bp_core_get_user_displaynames( $user_ids ) {
 
@@ -521,13 +604,11 @@ function bp_core_get_user_displaynames( $user_ids ) {
  * Fetch the display name for a user.
  *
  * @param int|string $user_id_or_username User ID or username.
+ *
  * @return string|bool The display name for the user in question, or false if
- *         user not found.
+ *                     user not found.
  */
 function bp_core_get_user_displayname( $user_id_or_username ) {
-
-	$fullname = '';
-
 	if ( empty( $user_id_or_username ) ) {
 		return false;
 	}
@@ -550,6 +631,14 @@ function bp_core_get_user_displayname( $user_id_or_username ) {
 		$fullname = $display_names[ $user_id ];
 	}
 
+	/**
+	 * Filters the display name for the passed in user.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string $fullname Display name for the user.
+	 * @param int    $user_id  ID of the user to check.
+	 */
 	return apply_filters( 'bp_core_get_user_displayname', $fullname, $user_id );
 }
 add_filter( 'bp_core_get_user_displayname', 'strip_tags', 1 );
@@ -561,10 +650,19 @@ add_filter( 'bp_core_get_user_displayname', 'esc_html'      );
  * Return the user link for the user based on user email address.
  *
  * @param string $email The email address for the user.
+ *
  * @return string The link to the users home base. False on no match.
  */
 function bp_core_get_userlink_by_email( $email ) {
 	$user = get_user_by( 'email', $email );
+
+	/**
+	 * Filters the user link for the user based on user email address.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string|bool $value URL for the user if found, otherwise false.
+	 */
 	return apply_filters( 'bp_core_get_userlink_by_email', bp_core_get_userlink( $user->ID, false, false, true ) );
 }
 
@@ -572,7 +670,9 @@ function bp_core_get_userlink_by_email( $email ) {
  * Return the user link for the user based on the supplied identifier.
  *
  * @param string $username If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set,
- *        this should be user_login, otherwise it should be user_nicename.
+ *                         this should be user_login, otherwise it should
+ *                         be user_nicename.
+ *
  * @return string|bool The link to the user's domain, false on no match.
  */
 function bp_core_get_userlink_by_username( $username ) {
@@ -582,6 +682,13 @@ function bp_core_get_userlink_by_username( $username ) {
 		$user_id = bp_core_get_userid_from_nicename( $username );
 	}
 
+	/**
+	 * Filters the user link for the user based on username.
+	 *
+	 * @since BuddyPress (1.0.1)
+	 *
+	 * @param string|bool $value URL for the user if found, otherwise false.
+	 */
 	return apply_filters( 'bp_core_get_userlink_by_username', bp_core_get_userlink( $user_id, false, false, true ) );
 }
 
@@ -597,24 +704,34 @@ function bp_core_get_userlink_by_username( $username ) {
 function bp_core_get_total_member_count() {
 	global $wpdb;
 
-	if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) {
+	$count = wp_cache_get( 'bp_total_member_count', 'bp' );
+
+	if ( false === $count ) {
 		$status_sql = bp_core_get_status_sql();
 		$count = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users} WHERE {$status_sql}" );
 		wp_cache_set( 'bp_total_member_count', $count, 'bp' );
 	}
 
+	/**
+	 * Filters the total number of members for the installation.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param int $count Total number of members.
+	 */
 	return apply_filters( 'bp_core_get_total_member_count', $count );
 }
 
 /**
- * Return the total number of members, limited to those members with last_activity
+ * Return the total number of members, limited to those members with last_activity.
  *
- * @return int The number of active members
+ * @return int The number of active members.
  */
 function bp_core_get_active_member_count() {
 	global $wpdb;
 
-	if ( !$count = get_transient( 'bp_active_member_count' ) ) {
+	$count = get_transient( 'bp_active_member_count' );
+	if ( false === $count ) {
 		$bp = buddypress();
 
 		// Avoid a costly join by splitting the lookup
@@ -631,6 +748,13 @@ function bp_core_get_active_member_count() {
 		set_transient( 'bp_active_member_count', $count );
 	}
 
+	/**
+	 * Filters the total number of members for the installation limited to those with last_activity.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int $count Total number of active members.
+	 */
 	return apply_filters( 'bp_core_get_active_member_count', $count );
 }
 
@@ -645,12 +769,14 @@ function bp_core_get_active_member_count() {
  *
  * @since BuddyPress (1.6.0)
  *
- * @param int $user_id The ID of the user being spammed/hammed.
- * @param string $status 'spam' if being marked as spam, 'ham' otherwise.
- * @param bool $do_wp_cleanup True to force the cleanup of WordPress content
- *        and status, otherwise false. Generally, this should only be false if
- *        WordPress is expected to have performed this cleanup independently,
- *        as when hooked to 'make_spam_user'.
+ * @param int    $user_id       The ID of the user being spammed/hammed.
+ * @param string $status        'spam' if being marked as spam, 'ham' otherwise.
+ * @param bool   $do_wp_cleanup True to force the cleanup of WordPress content
+ *                              and status, otherwise false. Generally, this should
+ *                              only be false if WordPress is expected to have
+ *                              performed this cleanup independently, as when hooked
+ *                              to 'make_spam_user'.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = true ) {
@@ -677,13 +803,7 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru
 	remove_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' );
 	remove_action( 'make_ham_user',  'bp_core_mark_user_ham_admin'  );
 
-	// Determine if we are on an admin page
-	$is_admin = is_admin();
-	if ( $is_admin && ! defined( 'DOING_AJAX' ) ) {
-		$is_admin = (bool) ( buddypress()->members->admin->user_page !== get_current_screen()->id );
-	}
-
-	// When marking as spam in the Dashboard, these actions are handled by WordPress
+	// force the cleanup of WordPress content and status for multisite configs
 	if ( $do_wp_cleanup ) {
 
 		// Get the blogs for the user
@@ -704,14 +824,36 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru
 		if ( is_multisite() ) {
 			update_user_status( $user_id, 'spam', $is_spam );
 		}
+	}
+
+	// Update the user status
+	$wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) );
 
-		// Always set single site status
-		$wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) );
+	// Clean user cache
+	clean_user_cache( $user_id );
 
+	if ( ! is_multisite() ) {
 		// Call multisite actions in single site mode for good measure
-		if ( !is_multisite() ) {
-			$wp_action = ( true === $is_spam ) ? 'make_spam_user' : 'make_ham_user';
-			do_action( $wp_action, bp_displayed_user_id() );
+		if ( true === $is_spam ) {
+
+			/**
+			 * Fires at end of processing spammer in Dashboard if not multisite and user is spam.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param int $value user ID.
+			 */
+			do_action( 'make_spam_user', $user_id );
+		} else {
+
+			/**
+			 * Fires at end of processing spammer in Dashboard if not multisite and user is not spam.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param int $value user ID.
+			 */
+			do_action( 'make_ham_user', $user_id );
 		}
 	}
 
@@ -721,10 +863,36 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru
 	}
 
 	// We need a special hook for is_spam so that components can delete data at spam time
-	$bp_action = ( true === $is_spam ) ? 'bp_make_spam_user' : 'bp_make_ham_user';
-	do_action( $bp_action, $user_id );
+	if ( true === $is_spam ) {
+
+		/**
+		 * Fires at the end of the process spammer process if the user is spam.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $value Displayed user ID.
+		 */
+		do_action( 'bp_make_spam_user', $user_id );
+	} else {
 
-	// Allow plugins to do neat things
+		/**
+		 * Fires at the end of the process spammer process if the user is not spam.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $value Displayed user ID.
+		 */
+		do_action( 'bp_make_ham_user', $user_id );
+	}
+
+	/**
+	 * Fires at the end of the process for hanlding spammer status.
+	 *
+	 * @since BuddyPress (1.5.5)
+	 *
+	 * @param int  $user_id ID of the processed user.
+	 * @param bool $is_spam The determined spam status of processed user.
+	 */
 	do_action( 'bp_core_process_spammer_status', $user_id, $is_spam );
 
 	// Put things back how we found them
@@ -733,7 +901,6 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru
 
 	return true;
 }
-
 /**
  * Hook to WP's make_spam_user and run our custom BP spam functions.
  *
@@ -762,6 +929,7 @@ add_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' );
  * Check whether a user has been marked as a spammer.
  *
  * @param int $user_id The ID for the user.
+ *
  * @return bool True if spammer, otherwise false.
  */
 function bp_is_user_spammer( $user_id = 0 ) {
@@ -812,6 +980,13 @@ function bp_is_user_spammer( $user_id = 0 ) {
 		}
 	}
 
+	/**
+	 * Filters whether a user is marked as a spammer.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $is_spammer Whether or not user is marked as spammer.
+	 */
 	return apply_filters( 'bp_is_user_spammer', (bool) $is_spammer );
 }
 
@@ -819,6 +994,7 @@ function bp_is_user_spammer( $user_id = 0 ) {
  * Check whether a user has been marked as deleted.
  *
  * @param int $user_id The ID for the user.
+ *
  * @return bool True if deleted, otherwise false.
  */
 function bp_is_user_deleted( $user_id = 0 ) {
@@ -869,6 +1045,13 @@ function bp_is_user_deleted( $user_id = 0 ) {
 		}
 	}
 
+	/**
+	 * Filters whether a user is marked as deleted.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param bool $is_deleted Whether or not user is marked as deleted.
+	 */
 	return apply_filters( 'bp_is_user_deleted', (bool) $is_deleted );
 }
 
@@ -883,6 +1066,7 @@ function bp_is_user_deleted( $user_id = 0 ) {
  * @uses bp_is_user_deleted() To check if user is deleted
  *
  * @param int $user_id The user ID to check.
+ *
  * @return bool True if active, otherwise false.
  */
 function bp_is_user_active( $user_id = 0 ) {
@@ -919,11 +1103,12 @@ function bp_is_user_active( $user_id = 0 ) {
  * @todo No need for the user fallback checks, since they're done in
  *       bp_is_user_active().
  *
- * @uses is_user_logged_in() To check if user is logged in
- * @uses bp_get_displayed_user_id() To get current user ID
- * @uses bp_is_user_active() To check if user is active
+ * @uses is_user_logged_in() To check if user is logged in.
+ * @uses bp_get_displayed_user_id() To get current user ID.
+ * @uses bp_is_user_active() To check if user is active.
  *
  * @param int $user_id The user ID to check.
+ *
  * @return bool True if inactive, otherwise false.
  */
 function bp_is_user_inactive( $user_id = 0 ) {
@@ -947,8 +1132,9 @@ function bp_is_user_inactive( $user_id = 0 ) {
  *
  * @since BuddyPress (1.9.0)
  *
- * @param int $user_id ID of the user being updated.
- * @param string $time Time of last activity, in 'Y-m-d H:i:s' format.
+ * @param int    $user_id ID of the user being updated.
+ * @param string $time    Time of last activity, in 'Y-m-d H:i:s' format.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_update_user_last_activity( $user_id = 0, $time = '' ) {
@@ -973,7 +1159,7 @@ function bp_update_user_last_activity( $user_id = 0, $time = '' ) {
 	// Remove our warning and re-add.
 	remove_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10, 4 );
 	remove_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, 3 );
-	update_user_meta( $user_id, 'last_activity', $time );
+	bp_update_user_meta( $user_id, 'last_activity', $time );
 	add_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10, 4 );
 	add_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, 3 );
 
@@ -992,9 +1178,11 @@ function bp_update_user_last_activity( $user_id = 0, $time = '' ) {
  *
  * @access private For internal use only.
  *
- * @param null $retval
- * @param int $object_id ID of the user.
- * @param string $meta_key Meta key being fetched.
+ * @param null   $retval
+ * @param int    $object_id ID of the user.
+ * @param string $meta_key  Meta key being fetched.
+ *
+ * @return mixed
  */
 function _bp_get_user_meta_last_activity_warning( $retval, $object_id, $meta_key ) {
 	static $warned = false;
@@ -1025,9 +1213,9 @@ add_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10,
  *
  * @access private For internal use only.
  *
- * @param int $meta_id ID of the just-set usermeta row.
- * @param int $object_id ID of the user.
- * @param string $meta_key Meta key being fetched.
+ * @param int    $meta_id    ID of the just-set usermeta row.
+ * @param int    $object_id  ID of the user.
+ * @param string $meta_key   Meta key being fetched.
  * @param string $meta_value Active time.
  */
 function _bp_update_user_meta_last_activity_warning( $meta_id, $object_id, $meta_key, $meta_value ) {
@@ -1042,8 +1230,9 @@ add_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning'
  * Get the last activity for a given user.
  *
  * @param int $user_id The ID of the user.
+ *
  * @return string Time of last activity, in 'Y-m-d H:i:s' format, or an empty
- *         string if none is found.
+ *                string if none is found.
  */
 function bp_get_user_last_activity( $user_id = 0 ) {
 	$activity = '';
@@ -1053,6 +1242,15 @@ function bp_get_user_last_activity( $user_id = 0 ) {
 		$activity = $last_activity[ $user_id ]['date_recorded'];
 	}
 
+	/**
+	 * Filters the last activity for a given user.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $activity Time of last activity, in 'Y-m-d H:i:s' format or
+	 *                         an empty string if none found.
+	 * @param int    $user_id  ID of the user being checked.
+	 */
 	return apply_filters( 'bp_get_user_last_activity', $activity, $user_id );
 }
 
@@ -1092,6 +1290,7 @@ function bp_last_activity_migrate() {
  * @todo Deprecate.
  *
  * @param int $user_id ID of the user being queried.
+ *
  * @return array Post IDs.
  */
 function bp_core_get_all_posts_for_user( $user_id = 0 ) {
@@ -1110,7 +1309,7 @@ function bp_core_get_all_posts_for_user( $user_id = 0 ) {
  * Primarily used for self-deletions, as requested through Settings.
  *
  * @param int $user_id Optional. ID of the user to be deleted. Default: the
- *        logged-in user.
+ *                     logged-in user.
  * @return bool True on success, false on failure.
  */
 function bp_core_delete_account( $user_id = 0 ) {
@@ -1139,6 +1338,13 @@ function bp_core_delete_account( $user_id = 0 ) {
 		}
 	}
 
+	/**
+	 * Fires before the processing of an account deletion.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int $user_id ID of the user account being deleted.
+	 */
 	do_action( 'bp_core_pre_delete_account', $user_id );
 
 	// Specifically handle multi-site environment
@@ -1154,6 +1360,13 @@ function bp_core_delete_account( $user_id = 0 ) {
 		$retval = wp_delete_user( $user_id );
 	}
 
+	/**
+	 * Fires after the deletion of an account.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int $user_id ID of the user account that was deleted.
+	 */
 	do_action( 'bp_core_deleted_account', $user_id );
 
 	return $retval;
@@ -1165,6 +1378,7 @@ function bp_core_delete_account( $user_id = 0 ) {
  * @since BuddyPress (1.9.0)
  *
  * @param int $user_id ID of the user who is about to be deleted.
+ *
  * @return bool True on success, false on failure.
  */
 function bp_core_delete_avatar_on_user_delete( $user_id ) {
@@ -1182,6 +1396,7 @@ add_action( 'delete_user', 'bp_core_delete_avatar_on_user_delete' );
  * Uses multibyte functions when available on the PHP build.
  *
  * @param string $str String to be upper-cased.
+ *
  * @return string
  */
 function bp_core_ucfirst( $str ) {
@@ -1202,9 +1417,10 @@ function bp_core_ucfirst( $str ) {
  * @since BuddyPress (1.1.2)
  *
  * @param WP_User|WP_Error $user Either the WP_User object or the WP_Error
- *        object, as passed to the 'authenticate' filter.
+ *                               object, as passed to the 'authenticate' filter.
+ *
  * @return WP_User|WP_Error If the user is not a spammer, return the WP_User
- *         object. Otherwise a new WP_Error object.
+ *                          object. Otherwise a new WP_Error object.
  */
 function bp_core_boot_spammer( $user ) {
 
@@ -1275,9 +1491,10 @@ function bp_core_flush_illegal_names() {
 /**
  * Add BuddyPress-specific items to the illegal_names array.
  *
- * @param array|string $value Illegal names as being saved defined in
- *        Multisite settings.
+ * @param array|string $value    Illegal names as being saved defined in
+ *                               Multisite settings.
  * @param array|string $oldvalue The old value of the option.
+ *
  * @return array Merged and unique array of illegal names.
  */
 function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) {
@@ -1330,7 +1547,13 @@ function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) {
 		}
 	}
 
-	// Add our slugs to the array and allow them to be filtered
+	/**
+	 * Filters the array of default illegal usernames.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param array $value Merged and unique array of illegal usernames.
+	 */
 	$filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array_merge( array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ), $bp_component_slugs ) );
 
 	// Merge the arrays together
@@ -1339,6 +1562,13 @@ function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) {
 	// Remove duplicates
 	$illegal_names          = array_unique( (array) $merged_names );
 
+	/**
+	 * Filters the array of default illegal names.
+	 *
+	 * @since BuddyPress (1.2.5)
+	 *
+	 * @param array $value Merged and unique array of illegal names.
+	 */
 	return apply_filters( 'bp_core_illegal_names', $illegal_names );
 }
 add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names', 10, 2 );
@@ -1354,9 +1584,10 @@ add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names',
  *
  * @since BuddyPress (1.6.2)
  *
- * @param string $user_email The email being checked
+ * @param string $user_email The email being checked.
+ *
  * @return bool|array True if the address passes all checks; otherwise an array
- *         of error codes.
+ *                    of error codes.
  */
 function bp_core_validate_email_address( $user_email ) {
 	$errors = array();
@@ -1405,9 +1636,9 @@ function bp_core_validate_email_address( $user_email ) {
  *
  * @see bp_core_validate_email_address()
  *
- * @param WP_Error $errors WP_Error object.
- * @param array $validation_results The return value of a validation function
- *        like bp_core_validate_email_address().
+ * @param WP_Error $errors             WP_Error object.
+ * @param array    $validation_results The return value of a validation function
+ *                                     like bp_core_validate_email_address().
  */
 function bp_core_add_validation_error_messages( WP_Error $errors, $validation_results ) {
 	if ( ! empty( $validation_results['invalid'] ) ) {
@@ -1430,8 +1661,9 @@ function bp_core_add_validation_error_messages( WP_Error $errors, $validation_re
 /**
  * Validate a user name and email address when creating a new user.
  *
- * @param string $user_name Username to validate.
+ * @param string $user_name  Username to validate.
  * @param string $user_email Email address to validate.
+ *
  * @return array Results of user validation including errors, if any.
  */
 function bp_core_validate_user_signup( $user_name, $user_email ) {
@@ -1450,7 +1682,13 @@ function bp_core_validate_user_signup( $user_name, $user_email ) {
 	} else {
 		$errors = new WP_Error();
 
-		// Apply any user_login filters added by BP or other plugins before validating
+		/**
+		 * Filters the username before being validated.
+		 *
+		 * @since BuddyPress (1.5.5)
+		 *
+		 * @param string $user_name Username to validate.
+		 */
 		$user_name = apply_filters( 'pre_user_login', $user_name );
 
 		// User name can't be empty
@@ -1514,6 +1752,13 @@ function bp_core_validate_user_signup( $user_name, $user_email ) {
 		$result = apply_filters( 'wpmu_validate_user_signup', $result );
 	}
 
+	/**
+	 * Filters the result of the user signup validation.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param array $result Results of user validation including errors, if any.
+	 */
  	return apply_filters( 'bp_core_validate_user_signup', $result );
 }
 
@@ -1522,8 +1767,9 @@ function bp_core_validate_user_signup( $user_name, $user_email ) {
  *
  * @todo Why do we have this wrapper?
  *
- * @param string $blog_url Blog URL requested during registration.
+ * @param string $blog_url   Blog URL requested during registration.
  * @param string $blog_title Blog title requested during registration.
+ *
  * @return array
  */
 function bp_core_validate_blog_signup( $blog_url, $blog_title ) {
@@ -1531,6 +1777,13 @@ function bp_core_validate_blog_signup( $blog_url, $blog_title ) {
 		return false;
 	}
 
+	/**
+	 * Filters the validated blog url and title provided at signup.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param array $value Array with the new site data and error messages.
+	 */
 	return apply_filters( 'bp_core_validate_blog_signup', wpmu_validate_blog_signup( $blog_url, $blog_title ) );
 }
 
@@ -1539,11 +1792,12 @@ function bp_core_validate_blog_signup( $blog_url, $blog_title ) {
  *
  * @todo There appears to be a bug in the return value on success.
  *
- * @param string $user_login Login name requested by the user.
+ * @param string $user_login    Login name requested by the user.
  * @param string $user_password Password requested by the user.
- * @param string $user_email Email address entered by the user.
- * @param array $usermeta Miscellaneous metadata about the user (blog-specific
- *        signup data, xprofile data, etc).
+ * @param string $user_email    Email address entered by the user.
+ * @param array  $usermeta      Miscellaneous metadata about the user (blog-specific
+ *                              signup data, xprofile data, etc).
+ *
  * @return bool|WP_Error True on success, WP_Error on failure.
  */
 function bp_core_signup_user( $user_login, $user_password, $user_email, $usermeta ) {
@@ -1583,7 +1837,7 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet
 			}
 
 			$activation_key = wp_hash( $user_id );
-			update_user_meta( $user_id, 'activation_key', $activation_key );
+			bp_update_user_meta( $user_id, 'activation_key', $activation_key );
 		}
 
 		$args = array(
@@ -1595,6 +1849,18 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet
 
 		BP_Signup::add( $args );
 
+		/**
+		 * Filters if BuddyPress should send an activation key for a new signup.
+		 *
+		 * @since BuddyPress (1.2.3)
+		 *
+		 * @param bool   $value          Whether or not to send the activation key.
+		 * @param int    $user_id        User ID to send activation key to.
+		 * @param string $user_email     User email to send activation key to.
+		 * @param string $activation_key Activation key to be sent.
+		 * @param array  $usermeta       Miscellaneous metadata about the user (blog-specific
+		 *                               signup data, xprofile data, etc).
+		 */
 		if ( apply_filters( 'bp_core_signup_send_activation_key', true, $user_id, $user_email, $activation_key, $usermeta ) ) {
 			bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
 		}
@@ -1602,6 +1868,18 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet
 
 	$bp->signup->username = $user_login;
 
+	/**
+	 * Fires at the end of the process to sign up a user.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param bool|WP_Error   $user_id       True on success, WP_Error on failure.
+	 * @param string          $user_login    Login name requested by the user.
+	 * @param string          $user_password Password requested by the user.
+	 * @param string          $user_email    Email address requested by the user.
+	 * @param array           $usermeta      Miscellaneous metadata about the user (blog-specific
+	 *                                       signup data, xprofile data, etc).
+	 */
 	do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta );
 
 	return $user_id;
@@ -1611,17 +1889,29 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet
  * Create a blog and user based on data supplied at user registration.
  *
  * @param string $blog_domain Domain requested by user.
- * @param string $blog_path Path requested by user.
- * @param string $blog_title Title as entered by user.
- * @param string $user_name user_login of requesting user.
- * @param string $user_email Email address of requesting user.
- * @param string $usermeta Miscellaneous metadata for the user.
+ * @param string $blog_path   Path requested by user.
+ * @param string $blog_title  Title as entered by user.
+ * @param string $user_name   user_login of requesting user.
+ * @param string $user_email  Email address of requesting user.
+ * @param string $usermeta    Miscellaneous metadata for the user.
+ *
+ * @return bool
  */
 function bp_core_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta ) {
 	if ( ! is_multisite() || ! function_exists( 'wpmu_signup_blog' ) ) {
 		return false;
 	}
 
+	/**
+	 * Filters the result of wpmu_signup_blog()
+	 *
+	 * This filter provides no value and is retained for
+	 * backwards compatibility.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param void $value
+	 */
 	return apply_filters( 'bp_core_signup_blog', wpmu_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta ) );
 }
 
@@ -1629,6 +1919,7 @@ function bp_core_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name,
  * Activate a signup, as identified by an activation key.
  *
  * @param string $key Activation key.
+ *
  * @return int|bool User ID on success, false on failure.
  */
 function bp_core_activate_signup( $key ) {
@@ -1677,7 +1968,7 @@ function bp_core_activate_signup( $key ) {
 
 		// If a user ID is found, this may be a legacy signup, or one
 		// created locally for backward compatibility. Process it.
-		} else if ( $key == wp_hash( $user_id ) ) {
+		} elseif ( $key == wp_hash( $user_id ) ) {
 			// Change the user's status so they become active
 			if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) {
 				return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
@@ -1723,6 +2014,16 @@ function bp_core_activate_signup( $key ) {
 		wp_new_user_notification( $user_id );
 
 		if ( isset( $user_already_created ) ) {
+
+			/**
+			 * Fires if the user has already been created.
+			 *
+			 * @since BuddyPress (1.2.2)
+			 *
+			 * @param int    $user_id ID of the user being checked.
+			 * @param string $key     Activation key.
+			 * @param array  $user    Array of user data.
+			 */
 			do_action( 'bp_core_activated_user', $user_id, $key, $user );
 			return $user_id;
 		}
@@ -1758,6 +2059,15 @@ function bp_core_activate_signup( $key ) {
 		$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_pass = %s WHERE ID = %d", $user['meta']['password'], $user_id ) );
 	}
 
+	/**
+	 * Fires at the end of the user activation process.
+	 *
+	 * @since BuddyPress (1.2.2)
+	 *
+	 * @param int    $user_id ID of the user being checked.
+	 * @param string $key     Activation key.
+	 * @param array  $user    Array of user data.
+	 */
 	do_action( 'bp_core_activated_user', $user_id, $key, $user );
 
 	return $user_id;
@@ -1844,34 +2154,6 @@ function bp_members_migrate_signups() {
 	}
 }
 
-/**
- * Create a "became a registered user" activity item when a user activates his account.
- *
- * @param array $user Array of userdata passed to bp_core_activated_user hook.
- */
-function bp_core_new_user_activity( $user ) {
-	if ( empty( $user ) || ! bp_is_active( 'activity' ) || ! bp_is_active( 'xprofile' ) ) {
-		return false;
-	}
-
-	if ( is_array( $user ) ) {
-		$user_id = $user['user_id'];
-	} else {
-		$user_id = $user;
-	}
-
-	if ( empty( $user_id ) ) {
-		return false;
-	}
-
-	bp_activity_add( array(
-		'user_id'   => $user_id,
-		'component' => 'xprofile',
-		'type'      => 'new_member'
-	) );
-}
-add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
-
 /**
  * Map a user's WP display name to the XProfile fullname field, if necessary.
  *
@@ -1879,6 +2161,8 @@ add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );
  * during normal registration, XProfile data is provided directly by the user.
  *
  * @param int $user_id ID of the user.
+ *
+ * @return bool
  */
 function bp_core_map_user_registration( $user_id ) {
 
@@ -1914,60 +2198,101 @@ function bp_core_signup_avatar_upload_dir() {
 		return false;
 	}
 
-	$path  = bp_core_avatar_upload_path() . '/avatars/signups/' . $bp->signup->avatar_dir;
-	$newbdir = $path;
-
-	if ( ! file_exists( $path ) ) {
-		@wp_mkdir_p( $path );
-	}
-
-	$newurl = bp_core_avatar_url() . '/avatars/signups/' . $bp->signup->avatar_dir;
-	$newburl = $newurl;
-	$newsubdir = '/avatars/signups/' . $bp->signup->avatar_dir;
-
+	$directory = 'avatars/signups';
+	$path      = bp_core_avatar_upload_path() . '/' . $directory . '/' . $bp->signup->avatar_dir;
+	$newbdir   = $path;
+	$newurl    = bp_core_avatar_url() . '/' . $directory . '/' . $bp->signup->avatar_dir;
+	$newburl   = $newurl;
+	$newsubdir = '/' . $directory . '/' . $bp->signup->avatar_dir;
+
+	/**
+	 * Filters the avatar storage directory for use during registration.
+	 *
+	 * @since BuddyPress (1.1.1)
+	 *
+	 * @param array $value Array of path and URL values for created storage directory.
+	 */
 	return apply_filters( 'bp_core_signup_avatar_upload_dir', array(
 		'path'    => $path,
 		'url'     => $newurl,
 		'subdir'  => $newsubdir,
 		'basedir' => $newbdir,
 		'baseurl' => $newburl,
-		'error' => false
+		'error'   => false
 	) );
 }
 
 /**
  * Send activation email to a newly registered user.
  *
- * @param int $user_id ID of the new user.
+ * @param int    $user_id    ID of the new user.
  * @param string $user_email Email address of the new user.
- * @param string $key Activation key.
+ * @param string $key        Activation key.
  */
 function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) {
-	$activate_url = bp_get_activation_page() ."?key=$key";
+	$activate_url = trailingslashit( bp_get_activation_page() ) . "{$key}/";
 	$activate_url = esc_url( $activate_url );
 
 	$message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url );
 	$subject = bp_get_email_subject( array( 'text' => __( 'Activate Your Account', 'buddypress' ) ) );
 
-	// Send the message
+	/**
+	 * Filters the user email that the validation email will be sent to.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $user_email User email the notification is being sent to.
+	 * @param int    $user_id    ID of the new user receiving email.
+	 */
 	$to      = apply_filters( 'bp_core_signup_send_validation_email_to',     $user_email, $user_id                );
+
+	/**
+	 * Filters the validation email subject that will be sent to user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $subject Email validation subject text.
+	 * @param int    $user_id ID of the new user receiving email.
+	 */
 	$subject = apply_filters( 'bp_core_signup_send_validation_email_subject', $subject,    $user_id                );
+
+	/**
+	 * Filters the validation email message that will be sent to user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $message      Email validation message text.
+	 * @param int    $user_id      ID of the new user receiving email.
+	 * @param string $activate_url URL to use for activating account.
+	 */
 	$message = apply_filters( 'bp_core_signup_send_validation_email_message', $message,    $user_id, $activate_url );
 
 	wp_mail( $to, $subject, $message );
 
+	/**
+	 * Fires after the sending of activation email to a newly registered user.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $subject    Subject for the sent email.
+	 * @param string $message    Message for the sent email.
+	 * @param int    $user_id    ID of the new user.
+	 * @param string $user_email Email address of the new user.
+	 * @param string $key        Activation key.
+	 */
 	do_action( 'bp_core_sent_user_validation_email', $subject, $message, $user_id, $user_email, $key );
 }
 
 /**
  * Display a "resend email" link when an unregistered user attempts to log in.
  *
- * @param WP_User|WP_Error $user Either the WP_User or the WP_Error object
- * @param string $username The inputted, attempted username.
- * @param string $password The inputted, attempted password.
- * @return WP_User|WP_Error
- *
  * @since BuddyPress (1.2.2)
+ *
+ * @param WP_User|WP_Error $user     Either the WP_User or the WP_Error object.
+ * @param string           $username The inputted, attempted username.
+ * @param string           $password The inputted, attempted password.
+ *
+ * @return WP_User|WP_Error
  */
 function bp_core_signup_disable_inactive( $user = null, $username = '', $password ='' ) {
 	// login form not used
@@ -2013,7 +2338,7 @@ function bp_core_signup_disable_inactive( $user = null, $username = '', $passwor
 		'bp-resend-activation'
 	);
 
-	$resend_string = '<br /><br />' . sprintf( __( 'If you have not received an email yet, <a href="%s">click here to resend it</a>.', 'buddypress' ), $resend_url );
+	$resend_string = '<br /><br />' . sprintf( __( 'If you have not received an email yet, <a href="%s">click here to resend it</a>.', 'buddypress' ), esc_url( $resend_url ) );
 
 	return new WP_Error( 'bp_account_not_activated', __( '<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link.', 'buddypress' ) . $resend_string );
 }
@@ -2098,9 +2423,9 @@ add_action( 'bp_init', 'bp_core_wpsignup_redirect' );
 function bp_stop_live_spammer() {
 	// if we're on the login page, stop now to prevent redirect loop
 	$is_login = false;
-	if ( isset( $_GLOBALS['pagenow'] ) && false !== strpos( $GLOBALS['pagenow'], 'wp-login.php' ) ) {
+	if ( isset( $GLOBALS['pagenow'] ) && ( false !== strpos( $GLOBALS['pagenow'], 'wp-login.php' ) ) ) {
 		$is_login = true;
-	} else if ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) {
+	} elseif ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) {
 		$is_login = true;
 	}
 
@@ -2124,7 +2449,13 @@ function bp_stop_live_spammer() {
 			'reauth' => 1
 		);
 
-		// setup login URL
+		/**
+		 * Filters the url used for redirection for a logged in user marked as spam.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param string $value URL to redirect user to.
+		 */
 		$login_url = apply_filters( 'bp_live_spammer_redirect', add_query_arg( $args, wp_login_url() ) );
 
 		// redirect user to login page
@@ -2148,3 +2479,316 @@ function bp_live_spammer_login_error() {
 	add_action( 'login_head', 'wp_shake_js', 12 );
 }
 add_action( 'login_form_bp-spam', 'bp_live_spammer_login_error' );
+
+/** Member Types *************************************************************/
+
+/**
+ * Register a member type.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $member_type Unique string identifier for the member type.
+ * @param array  $args {
+ *     Array of arguments describing the member type.
+ *
+ *     @type array       $labels {
+ *         Array of labels to use in various parts of the interface.
+ *
+ *         @type string $name          Default name. Should typically be plural.
+ *         @type string $singular_name Singular name.
+ *     }
+ *     @type bool|string $has_directory Whether the member type should have its own type-specific directory.
+ *                                      Pass `true` to use the `$member_type` string as the type's slug.
+ *                                      Pass a string to customize the slug. Pass `false` to disable.
+ *                                      Default: true.
+ * }
+ * @return object|WP_Error Member type object on success, WP_Error object on failure.
+ */
+function bp_register_member_type( $member_type, $args = array() ) {
+	$bp = buddypress();
+
+	if ( isset( $bp->members->types[ $member_type ] ) ) {
+		return new WP_Error( 'bp_member_type_exists', __( 'Member type already exists.', 'buddypress' ), $member_type );
+	}
+
+	$r = bp_parse_args( $args, array(
+		'labels'        => array(),
+		'has_directory' => true,
+	), 'register_member_type' );
+
+	$member_type = sanitize_key( $member_type );
+
+	// Store the post type name as data in the object (not just as the array key).
+	$r['name'] = $member_type;
+
+	// Make sure the relevant labels have been filled in.
+	$default_name = isset( $r['labels']['name'] ) ? $r['labels']['name'] : ucfirst( $r['name'] );
+	$r['labels'] = array_merge( array(
+		'name'          => $default_name,
+		'singular_name' => $default_name,
+	), $r['labels'] );
+
+	// Directory slug.
+	if ( $r['has_directory'] ) {
+		// A string value is intepreted as the directory slug. Otherwise fall back on member type.
+		if ( is_string( $r['has_directory'] ) ) {
+			$directory_slug = $r['has_directory'];
+		} else {
+			$directory_slug = $member_type;
+		}
+
+		// Sanitize for use in URLs.
+		$r['directory_slug'] = sanitize_title( $directory_slug );
+		$r['has_directory']  = true;
+	} else {
+		$r['directory_slug'] = '';
+		$r['has_directory']  = false;
+	}
+
+	$bp->members->types[ $member_type ] = $type = (object) $r;
+
+	/**
+	 * Fires after a member type is registered.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string $member_type Member type identifier.
+	 * @param object $type        Member type object.
+	 */
+	do_action( 'bp_registered_member_type', $member_type, $type );
+
+	return $type;
+}
+
+/**
+ * Retrieve a member type object by name.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $member_type The name of the member type.
+ *
+ * @return object A member type object.
+ */
+function bp_get_member_type_object( $member_type ) {
+	$types = bp_get_member_types( array(), 'objects' );
+
+	if ( empty( $types[ $member_type ] ) ) {
+		return null;
+	}
+
+	return $types[ $member_type ];
+}
+
+/**
+ * Get a list of all registered member type objects.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see bp_register_member_type() for accepted arguments.
+ *
+ * @param array|string $args     Optional. An array of key => value arguments to match against
+ *                               the member type objects. Default empty array.
+ * @param string       $output   Optional. The type of output to return. Accepts 'names'
+ *                               or 'objects'. Default 'names'.
+ * @param string       $operator Optional. The logical operation to perform. 'or' means only one
+ *                               element from the array needs to match; 'and' means all elements
+ *                               must match. Accepts 'or' or 'and'. Default 'and'.
+ *
+ * @return array A list of member type names or objects.
+ */
+function bp_get_member_types( $args = array(), $output = 'names', $operator = 'and' ) {
+	$types = buddypress()->members->types;
+
+	$types = wp_filter_object_list( $types, $args, $operator );
+
+	/**
+	 * Filters the array of member type objects.
+	 *
+	 * This filter is run before the $output filter has been applied, so that
+	 * filtering functions have access to the entire member type objects.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array  $types     Member type objects, keyed by name.
+	 * @param array  $args      Array of key=>value arguments for filtering.
+	 * @param string $operator  'or' to match any of $args, 'and' to require all.
+	 */
+	$types = apply_filters( 'bp_get_member_types', $types, $args, $operator );
+
+	if ( 'names' === $output ) {
+		$types = wp_list_pluck( $types, 'name' );
+	}
+
+	return $types;
+}
+
+/**
+ * Set type for a member.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int    $user_id     ID of the user.
+ * @param string $member_type Member type.
+ * @param bool   $append      Optional. True to append this to existing types for user,
+ *                            false to replace. Default: false.
+ * @return See {@see bp_set_object_terms()}.
+ */
+function bp_set_member_type( $user_id, $member_type, $append = false ) {
+	// Pass an empty $member_type to remove a user's type.
+	if ( ! empty( $member_type ) && ! bp_get_member_type_object( $member_type ) ) {
+		return false;
+	}
+
+	$retval = bp_set_object_terms( $user_id, $member_type, 'bp_member_type', $append );
+
+	// Bust the cache if the type has been updated.
+	if ( ! is_wp_error( $retval ) ) {
+		wp_cache_delete( $user_id, 'bp_member_member_type' );
+
+		/**
+		 * Fires just after a user's member type has been changed.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int    $user_id     ID of the user whose member type has been updated.
+		 * @param string $member_type Member type.
+		 * @param bool   $append      Whether the type is being appended to existing types.
+		 */
+		do_action( 'bp_set_member_type', $user_id, $member_type, $append );
+	}
+
+	return $retval;
+}
+
+/**
+ * Remove type for a member.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param int    $user_id     ID of the user.
+ * @param string $member_type Member Type.
+ *
+ * @return bool|WP_Error
+ */
+function bp_remove_member_type( $user_id, $member_type ) {
+	// Bail if no valid member type was passed.
+	if ( empty( $member_type ) || ! bp_get_member_type_object( $member_type ) ) {
+		return false;
+	}
+
+	$deleted = bp_remove_object_terms( $user_id, $member_type, 'bp_member_type' );
+
+	// Bust the cache if the type has been removed.
+	if ( ! is_wp_error( $deleted ) ) {
+		wp_cache_delete( $user_id, 'bp_member_member_type' );
+
+		/**
+		 * Fires just after a user's member type has been removed.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param int    $user_id     ID of the user whose member type has been updated.
+		 * @param string $member_type Member type.
+		 */
+		do_action( 'bp_remove_member_type', $user_id, $member_type );
+	}
+
+	return $deleted;
+}
+
+/**
+ * Get type for a member.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int               $user_id ID of the user.
+ * @param bool              $single  Optional. Whether to return a single type string. If multiple types are found
+ *                                   for the user, the oldest one will be returned. Default: true.
+ *
+ * @return string|array|bool On success, returns a single member type (if $single is true) or an array of member
+ *                           types (if $single is false). Returns false on failure.
+ */
+function bp_get_member_type( $user_id, $single = true ) {
+	$types = wp_cache_get( $user_id, 'bp_member_member_type' );
+
+	if ( false === $types ) {
+		$types = bp_get_object_terms( $user_id, 'bp_member_type' );
+
+		if ( ! is_wp_error( $types ) ) {
+			$types = wp_list_pluck( $types, 'name' );
+			wp_cache_set( $user_id, $types, 'bp_member_member_type' );
+		}
+	}
+
+	$type = false;
+	if ( ! empty( $types ) ) {
+		if ( $single ) {
+			$type = array_pop( $types );
+		} else {
+			$type = $types;
+		}
+	}
+
+	/**
+	 * Filters a user's member type(s).
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string $type    Member type.
+	 * @param int    $user_id ID of the user.
+	 * @param bool   $single  Whether to return a single type string, or an array.
+	 */
+	return apply_filters( 'bp_get_member_type', $type, $user_id, $single );
+}
+
+/**
+ * Check whether the given user has a certain member type.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param int    $user_id     $user_id ID of the user.
+ * @param string $member_type Member Type.
+ *
+ * @return bool Whether the user has the given member type.
+ */
+function bp_has_member_type( $user_id, $member_type ) {
+	// Bail if no valid member type was passed.
+	if ( empty( $member_type ) || ! bp_get_member_type_object( $member_type ) ) {
+		return false;
+	}
+
+	// Get all user's member types.
+	$types = bp_get_member_type( $user_id, false );
+
+	if ( ! is_array( $types ) ) {
+		return false;
+	}
+
+	return in_array( $member_type, $types );
+}
+
+/**
+ * Delete a user's member type when the user when the user is deleted.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int $user_id ID of the user.
+ *
+ * @return See {@see bp_set_member_type()}.
+ */
+function bp_remove_member_type_on_user_delete( $user_id ) {
+	return bp_set_member_type( $user_id, '' );
+}
+add_action( 'wpmu_delete_user', 'bp_remove_member_type_on_user_delete' );
+add_action( 'delete_user', 'bp_remove_member_type_on_user_delete' );
+
+/**
+ * Get the "current" member type, if one is provided, in member directories.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @return string
+ */
+function bp_get_current_member_type() {
+	return apply_filters( 'bp_get_current_member_type', buddypress()->current_member_type );
+}
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
index 1ab4a64e1eb6bef2b9001f6c538f370fe7849fcd..3a3795d7321644fea9b0bc4d4f63a79e9d41cd5f 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php
@@ -1,17 +1,28 @@
 <?php
 
 /**
- * BuddyPress Member Loader
+ * BuddyPress Member Loader.
  *
  * @package BuddyPress
  * @subpackage Members
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Members_Component extends BP_Component {
 
+	/**
+	 * Member types.
+	 *
+	 * @see bp_register_member_type()
+	 *
+	 * @access public
+	 * @since  BuddyPress (2.2.0)
+	 * @var    array
+	 */
+	public $types = array();
+
 	/**
 	 * Start the members component creation process.
 	 *
@@ -45,9 +56,15 @@ class BP_Members_Component extends BP_Component {
 			'screens',
 			'template',
 			'adminbar',
-			'functions'
+			'functions',
+			'widgets',
+			'cache',
 		);
 
+		if ( bp_is_active( 'activity' ) ) {
+			$includes[] = 'activity';
+		}
+
 		// Include these only if in admin
 		if ( is_admin() ) {
 			$includes[] = 'admin';
@@ -104,7 +121,7 @@ class BP_Members_Component extends BP_Component {
 		// Hits the DB on single WP installs so get this separately
 		$bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin( bp_loggedin_user_id() );
 
-		// The domain for the user currently logged in. eg: http://domain.com/members/andy
+		// The domain for the user currently logged in. eg: http://example.com/members/andy
 		$bp->loggedin_user->domain         = bp_core_get_user_domain( bp_loggedin_user_id() );
 
 		/** Displayed user ****************************************************/
@@ -197,9 +214,9 @@ class BP_Members_Component extends BP_Component {
 	 * @see BP_Component::setup_nav() for a description of arguments.
 	 *
 	 * @param array $main_nav Optional. See BP_Component::setup_nav() for
-	 *        description.
-	 * @param array $sub_nav Optional. See BP_Component::setup_nav() for
-	 *        description.
+	 *                        description.
+	 * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
+	 *                        description.
 	 */
 	public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
 
@@ -261,6 +278,22 @@ class BP_Members_Component extends BP_Component {
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_last_activity',
+			'bp_member_type'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
index c2037be016ef42bb0d65fe17ccab1cb353b1208e..2377fdc1b6434d5eb27be884db71a2eb155da0fc 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Member Screens
+ * BuddyPress Member Screens.
  *
  * Handlers for member screens that aren't handled elsewhere.
  *
@@ -10,13 +10,27 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Handle the display of the profile page by loading the correct template file.
  */
 function bp_members_screen_display_profile() {
+
+	/**
+	 * Fires right before the loading of the Member profile screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_members_screen_display_profile' );
+
+	/**
+	 * Filters the template to load for the Member profile page screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $template Path to the Member template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );
 }
 
@@ -27,8 +41,20 @@ function bp_members_screen_index() {
 	if ( bp_is_members_directory() ) {
 		bp_update_is_directory( true, 'members' );
 
+		/**
+		 * Fires right before the loading of the Member directory index screen template file.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 */
 		do_action( 'bp_members_screen_index' );
 
+		/**
+		 * Filters the template to load for the Member directory page screen.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Path to the member directory template to load.
+		 */
 		bp_core_load_template( apply_filters( 'bp_members_screen_index', 'members/index' ) );
 	}
 }
@@ -38,7 +64,7 @@ add_action( 'bp_screens', 'bp_members_screen_index' );
  * Handle the loading of the signup screen.
  */
 function bp_core_screen_signup() {
-	global $bp;
+	$bp = buddypress();
 
 	if ( ! bp_is_current_component( 'register' ) || bp_current_action() )
 		return;
@@ -48,11 +74,18 @@ function bp_core_screen_signup() {
 
 	// If the user is logged in, redirect away from here
 	if ( is_user_logged_in() ) {
-		if ( bp_is_component_front_page( 'register' ) )
-			$redirect_to = trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
-		else
-			$redirect_to = bp_get_root_domain();
 
+		$redirect_to = bp_is_component_front_page( 'register' )
+			? bp_get_members_directory_permalink()
+			: bp_get_root_domain();
+
+		/**
+		 * Filters the URL to redirect logged in users to when visiting registration page.
+		 *
+		 * @since BuddyPress (1.5.1)
+		 *
+		 * @param string $redirect_to URL to redirect user to.
+		 */
 		bp_core_redirect( apply_filters( 'bp_loggedin_register_page_redirect_to', $redirect_to ) );
 
 		return;
@@ -66,6 +99,11 @@ function bp_core_screen_signup() {
 	// If the signup page is submitted, validate and save
 	} elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {
 
+	    /**
+		 * Fires before the validation of a new signup.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 */
 		do_action( 'bp_signup_pre_validate' );
 
 		// Check the base account details for problems
@@ -118,7 +156,7 @@ function bp_core_screen_signup() {
 
 		// Finally, let's check the blog details, if the user wants a blog and blog creation is enabled
 		if ( isset( $_POST['signup_with_blog'] ) ) {
-			$active_signup = $bp->site_options['registration'];
+			$active_signup = bp_core_get_root_option( 'registration' );
 
 			if ( 'blog' == $active_signup || 'all' == $active_signup ) {
 				$blog_details = bp_core_validate_blog_signup( $_POST['signup_blog_url'], $_POST['signup_blog_title'] );
@@ -132,6 +170,11 @@ function bp_core_screen_signup() {
 			}
 		}
 
+	    /**
+		 * Fires after the validation of a new signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'bp_signup_validate' );
 
 		// Add any errors to the action for the field in the template for display.
@@ -139,13 +182,21 @@ function bp_core_screen_signup() {
 			foreach ( (array) $bp->signup->errors as $fieldname => $error_message ) {
 				// addslashes() and stripslashes() to avoid create_function()
 				// syntax errors when the $error_message contains quotes
+
+				/**
+				 * Filters the error message in the loop.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string $value Error message wrapped in html.
+				 */
 				add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "<div class=\"error\">" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "</div>" );' ) );
 			}
 		} else {
 			$bp->signup->step = 'save-details';
 
 			// No errors! Let's register those deets.
-			$active_signup = !empty( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : '';
+			$active_signup = bp_core_get_root_option( 'registration' );
 
 			if ( 'none' != $active_signup ) {
 
@@ -185,6 +236,13 @@ function bp_core_screen_signup() {
 				if ( 'blog' == $active_signup || 'all' == $active_signup )
 					$usermeta['public'] = ( isset( $_POST['signup_blog_privacy'] ) && 'public' == $_POST['signup_blog_privacy'] ) ? true : false;
 
+				/**
+				 * Filters the user meta used for signup.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 *
+				 * @param array $usermeta Array of user meta to add to signup.
+				 */
 				$usermeta = apply_filters( 'bp_signup_usermeta', $usermeta );
 
 				// Finally, sign up the user and/or blog
@@ -201,62 +259,120 @@ function bp_core_screen_signup() {
 				}
 			}
 
+			/**
+			 * Fires after the completion of a new signup.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'bp_complete_signup' );
 		}
 
 	}
 
+	/**
+	 * Fires right before the loading of the Member registration screen template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_core_screen_signup' );
+
+	/**
+	 * Filters the template to load for the Member registration page screen.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string $value Path to the Member registration template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) );
 }
 add_action( 'bp_screens', 'bp_core_screen_signup' );
 
 /**
  * Handle the loading of the Activate screen.
+ *
+ * @todo Move the actual activation process into an action in bp-members-actions.php
  */
 function bp_core_screen_activation() {
-	global $bp;
 
-	if ( !bp_is_current_component( 'activate' ) )
+	// Bail if not viewing the activation page
+	if ( ! bp_is_current_component( 'activate' ) ) {
 		return false;
+	}
 
-	// If the user is logged in, redirect away from here
+	// If the user is already logged in, redirect away from here
 	if ( is_user_logged_in() ) {
-		if ( bp_is_component_front_page( 'activate' ) ) {
-			$redirect_to = trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
-		} else {
-			$redirect_to = trailingslashit( bp_get_root_domain() );
-		}
 
-		bp_core_redirect( apply_filters( 'bp_loggedin_activate_page_redirect_to', $redirect_to ) );
+		// If activation page is also front page, set to members directory to
+		// avoid an infinite loop. Otherwise, set to root domain.
+		$redirect_to = bp_is_component_front_page( 'activate' )
+			? bp_get_members_directory_permalink()
+			: bp_get_root_domain();
+
+		// Trailing slash it, as we expect these URL's to be
+		$redirect_to = trailingslashit( $redirect_to );
+
+		/**
+		 * Filters the URL to redirect logged in users to when visiting activation page.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $redirect_to URL to redirect user to.
+		 */
+		$redirect_to = apply_filters( 'bp_loggedin_activate_page_redirect_to', $redirect_to );
+
+		// Redirect away from the activation page
+		bp_core_redirect( $redirect_to );
+	}
 
-		return;
+	// grab the key (the old way)
+	$key = isset( $_GET['key'] ) ? $_GET['key'] : '';
+
+	// grab the key (the new way)
+	if ( empty( $key ) ) {
+		$key = bp_current_action();
 	}
 
-	// Check if an activation key has been passed
-	if ( isset( $_GET['key'] ) ) {
+	// Get BuddyPress
+	$bp = buddypress();
 
-		// Activate the signup
-		$user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $_GET['key'] ) );
+	// we've got a key; let's attempt to activate the signup
+	if ( ! empty( $key ) ) {
+
+		/**
+		 * Filters the activation signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param bool|int $value Value returned by activation.
+		 *                        Integer on success, boolean on failure.
+		 */
+		$user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) );
 
 		// If there were errors, add a message and redirect
-		if ( !empty( $user->errors ) ) {
+		if ( ! empty( $user->errors ) ) {
 			bp_core_add_message( $user->get_error_message(), 'error' );
 			bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) );
 		}
 
-		$hashed_key = wp_hash( $_GET['key'] );
+		$hashed_key = wp_hash( $key );
 
-		// Check if the avatar folder exists. If it does, move rename it, move
-		// it and delete the signup avatar dir
-		if ( file_exists( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key ) )
+		// Check if the signup avatar folder exists. If it does, move the folder to
+		// the BP user avatars directory
+		if ( file_exists( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key ) ) {
 			@rename( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key, bp_core_avatar_upload_path() . '/avatars/' . $user );
+		}
 
 		bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
-
 		$bp->activation_complete = true;
 	}
 
+	/**
+	 * Filters the template to load for the Member activation page screen.
+	 *
+	 * @since BuddyPress (1.1.1)
+	 *
+	 * @param string $value Path to the Member activation template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_core_template_activate', array( 'activate', 'registration/activate' ) ) );
 }
 add_action( 'bp_screens', 'bp_core_screen_activation' );
@@ -290,13 +406,19 @@ class BP_Members_Theme_Compat {
 	public function is_members() {
 
 		// Bail if not looking at the members component or a user's page
-		if ( ! bp_is_members_component() && ! bp_is_user() )
+		if ( ! bp_is_members_component() && ! bp_is_user() ) {
 			return;
+		}
 
 		// Members Directory
 		if ( ! bp_current_action() && ! bp_current_item() ) {
 			bp_update_is_directory( true, 'members' );
 
+			/**
+			 * Fires if looking at Members directory when needing theme compat.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'bp_members_screen_index' );
 
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'directory_template_hierarchy' ) );
@@ -305,11 +427,18 @@ class BP_Members_Theme_Compat {
 
 		// User page
 		} elseif ( bp_is_user() ) {
+
 			// If we're on a single activity permalink page, we shouldn't use the members
 			// template, so stop here!
-			if ( bp_is_active( 'activity' ) && bp_is_single_activity() )
+			if ( bp_is_active( 'activity' ) && bp_is_single_activity() ) {
 				return;
+			}
 
+			/**
+			 * Fires if looking at Members user page when needing theme compat.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'bp_members_screen_display_profile' );
 
 			add_filter( 'bp_get_buddypress_template',                array( $this, 'single_template_hierarchy' ) );
@@ -329,12 +458,19 @@ class BP_Members_Theme_Compat {
 	 *
 	 * @since BuddyPress (1.8.0)
 	 *
-	 * @param string $templates The templates from bp_get_theme_compat_templates().
+	 * @param array $templates The templates from bp_get_theme_compat_templates().
+	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function directory_template_hierarchy( $templates = array() ) {
 
-		// Setup our templates based on priority
+		/**
+		 * Filters the template hierarchy for theme compat and members directory page.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of template paths to add to hierarchy.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_members_directory', array(
 			'members/index-directory.php'
 		) );
@@ -385,14 +521,21 @@ class BP_Members_Theme_Compat {
 	 * @since BuddyPress (1.8.0)
 	 *
 	 * @param string $templates The templates from
-	 *        bp_get_theme_compat_templates().
+	 *                          bp_get_theme_compat_templates().
+	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function single_template_hierarchy( $templates ) {
 		// Setup some variables we're going to reference in our custom templates
 		$user_nicename = buddypress()->displayed_user->userdata->user_nicename;
 
-		// Setup our templates based on priority
+		/**
+		 * Filters the template hierarchy for theme compat and member pages.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of template paths to add to hierarchy.
+		 */
 		$new_templates = apply_filters( 'bp_template_hierarchy_members_single_item', array(
 			'members/single/index-id-'        . sanitize_file_name( bp_displayed_user_id() ) . '.php',
 			'members/single/index-nicename-'  . sanitize_file_name( $user_nicename )         . '.php',
@@ -416,7 +559,7 @@ class BP_Members_Theme_Compat {
 	public function single_dummy_post() {
 		bp_theme_compat_reset_post( array(
 			'ID'             => 0,
-			'post_title'     => '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>',
+			'post_title'     => bp_get_displayed_user_fullname(),
 			'post_author'    => 0,
 			'post_date'      => 0,
 			'post_content'   => '',
@@ -441,7 +584,7 @@ new BP_Members_Theme_Compat();
 /**
  * The main theme compat class for BuddyPress Registration.
  *
- * This class sets up the necessary theme compatability actions to safely output
+ * This class sets up the necessary theme compatibility actions to safely output
  * registration template parts to the_title and the_content areas of a theme.
  *
  * @since BuddyPress (1.7.0)
@@ -449,7 +592,7 @@ new BP_Members_Theme_Compat();
 class BP_Registration_Theme_Compat {
 
 	/**
-	 * Setup the groups component theme compatibility
+	 * Setup the groups component theme compatibility.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 */
@@ -489,12 +632,22 @@ class BP_Registration_Theme_Compat {
 	 * @since BuddyPress (1.8.0)
 	 *
 	 * @param string $templates The templates from bp_get_theme_compat_templates().
+	 *
 	 * @return array $templates Array of custom templates to look for.
 	 */
 	public function template_hierarchy( $templates ) {
 		$component = sanitize_file_name( bp_current_component() );
 
-		// Setup our templates based on priority
+		/**
+		 * Filters the template hierarchy for theme compat and registration/activation pages.
+		 *
+		 * This filter is a variable filter that depends on the current component
+		 * being used.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 *
+		 * @param array $value Array of template paths to add to hierarchy.
+		 */
 		$new_templates = apply_filters( "bp_template_hierarchy_{$component}", array(
 			"members/index-{$component}.php"
 		) );
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-template.php b/wp-content/plugins/buddypress/bp-members/bp-members-template.php
index dbce029ddf56c653cf2df28be39f997095242b7d..728f59a36dba04cdebe6311b974632bc30ca8e53 100644
--- a/wp-content/plugins/buddypress/bp-members/bp-members-template.php
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-template.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Member Template Tags
+ * BuddyPress Member Template Tags.
  *
  * Functions that are safe to use inside your template files and themes.
  *
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the members component slug.
@@ -30,6 +30,14 @@ function bp_members_slug() {
 	 * @return string
 	 */
 	function bp_get_members_slug() {
+
+		/**
+		 * Filters the Members component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Members component slug.
+		 */
 		return apply_filters( 'bp_get_members_slug', buddypress()->members->slug );
 	}
 
@@ -51,6 +59,14 @@ function bp_members_root_slug() {
 	 * @return string
 	 */
 	function bp_get_members_root_slug() {
+
+		/**
+		 * Filters the Members component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Members component root slug.
+		 */
 		return apply_filters( 'bp_get_members_root_slug', buddypress()->members->root_slug );
 	}
 
@@ -62,7 +78,7 @@ function bp_members_root_slug() {
  * @uses bp_get_members_directory_permalink()
  */
 function bp_members_directory_permalink() {
-	echo bp_get_members_directory_permalink();
+	echo esc_url( bp_get_members_directory_permalink() );
 }
 	/**
 	 * Return member directory permalink.
@@ -72,6 +88,14 @@ function bp_members_directory_permalink() {
 	 * @return string
 	 */
 	function bp_get_members_directory_permalink() {
+
+		/**
+		 * Filters the member directory permalink.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Members directory permalink.
+		 */
 		return apply_filters( 'bp_get_members_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) );
 	}
 
@@ -103,6 +127,13 @@ function bp_signup_slug() {
 			$slug = 'register';
 		}
 
+		/**
+		 * Filters the sign-up slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Sign-up slug.
+		 */
 		return apply_filters( 'bp_get_signup_slug', $slug );
 	}
 
@@ -134,6 +165,13 @@ function bp_activate_slug() {
 			$slug = 'activate';
 		}
 
+		/**
+		 * Filters the activation slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Activation slug.
+		 */
 		return apply_filters( 'bp_get_activate_slug', $slug );
 	}
 
@@ -150,7 +188,7 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var int
 	 */
-	var $current_member = -1;
+	public $current_member = -1;
 
 	/**
 	 * The number of members returned by the paged query.
@@ -158,7 +196,7 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var int
 	 */
-	var $member_count;
+	public $member_count;
 
 	/**
 	 * Array of members located by the query.
@@ -166,7 +204,7 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var array
 	 */
-	var $members;
+	public $members;
 
 	/**
 	 * The member object currently being iterated on.
@@ -174,7 +212,7 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var object
 	 */
-	var $member;
+	public $member;
 
 	/**
 	 * A flag for whether the loop is currently being iterated.
@@ -182,23 +220,39 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var bool
 	 */
-	var $in_the_loop;
+	public $in_the_loop;
+
+	/**
+	 * The type of member being requested. Used for ordering results.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $type;
+
+	/**
+	 * The unique string used for pagination queries.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $pag_arg;
 
 	/**
 	 * The page number being requested.
 	 *
 	 * @access public
-	 * @var public
+	 * @var string
 	 */
-	var $pag_page;
+	public $pag_page;
 
 	/**
 	 * The number of items being requested per page.
 	 *
 	 * @access public
-	 * @var public
+	 * @var string
 	 */
-	var $pag_num;
+	public $pag_num;
 
 	/**
 	 * An HTML string containing pagination links.
@@ -206,7 +260,7 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var string
 	 */
-	var $pag_links;
+	public $pag_links;
 
 	/**
 	 * The total number of members matching the query parameters.
@@ -214,37 +268,39 @@ class BP_Core_Members_Template {
 	 * @access public
 	 * @var int
 	 */
-	var $total_member_count;
+	public $total_member_count;
 
 	/**
 	 * Constructor method.
 	 *
 	 * @see BP_User_Query for an in-depth description of parameters.
 	 *
-	 * @param string $type Sort order.
-	 * @param int $page_number Page of results.
-	 * @param int $per_page Number of results per page.
-	 * @param int $max Max number of results to return.
-	 * @param int $user_id Limit to friends of a user.
-	 * @param string $search_terms Limit to users matching search terms.
-	 * @param array $include Limit results by these user IDs.
-	 * @param bool $populate_extras Fetch optional extras.
-	 * @param array $exclude Exclude these IDs from results.
-	 * @param array $meta_key Limit to users with a meta_key.
-	 * @param array $meta_value Limit to users with a meta_value (with meta_key).
-	 * @param array $page_arg Optional. The string used as a query
-	 *        parameter in pagination links. Default: 'upage'.
-	 */
-	function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) {
-
-		$this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number;
-		$this->pag_num  = !empty( $_REQUEST['num'] )   ? intval( $_REQUEST['num'] )   : (int) $per_page;
+	 * @param string       $type            Sort order.
+	 * @param int          $page_number     Page of results.
+	 * @param int          $per_page        Number of results per page.
+	 * @param int          $max             Max number of results to return.
+	 * @param int          $user_id         Limit to friends of a user.
+	 * @param string       $search_terms    Limit to users matching search terms.
+	 * @param array        $include         Limit results by these user IDs.
+	 * @param bool         $populate_extras Fetch optional extras.
+	 * @param array        $exclude         Exclude these IDs from results.
+	 * @param array        $meta_key        Limit to users with a meta_key.
+	 * @param array        $meta_value      Limit to users with a meta_value (with meta_key).
+	 * @param string       $page_arg        Optional. The string used as a query parameter in pagination links.
+	 *                                      Default: 'upage'.
+	 * @param array|string $member_type     Array or comma-separated string of member types to limit results to.
+	 */
+	function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage', $member_type = '' ) {
+
+		$this->pag_arg  = sanitize_key( $page_arg );
+		$this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $page_number );
+		$this->pag_num  = bp_sanitize_pagination_arg( 'num',          $per_page    );
 		$this->type     = $type;
 
 		if ( !empty( $_REQUEST['letter'] ) )
 			$this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras, $exclude );
 		else
-			$this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value ) );
+			$this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'member_type' => $member_type ) );
 
 		if ( !$max || $max >= (int) $this->members['total'] )
 			$this->total_member_count = (int) $this->members['total'];
@@ -265,7 +321,7 @@ class BP_Core_Members_Template {
 
 		if ( (int) $this->total_member_count && (int) $this->pag_num ) {
 			$pag_args = array(
-				$page_arg => '%#%',
+				$this->pag_arg => '%#%',
 			);
 
 			if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) {
@@ -274,8 +330,15 @@ class BP_Core_Members_Template {
 				$base = '';
 			}
 
+			/**
+			 * Defaults to an empty array to make sure paginate_links()
+			 * won't add the $page_arg to the links which would break
+			 * pagination in case JavaScript is disabled.
+			 */
+			$add_args = array();
+
 			if ( ! empty( $search_terms ) ) {
-				$pag_args['s'] = urlencode( $search_terms );
+				$add_args['s'] = urlencode( $search_terms );
 			}
 
 			$this->pag_links = paginate_links( array(
@@ -285,7 +348,8 @@ class BP_Core_Members_Template {
 				'current'   => (int) $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Member pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Member pagination next text', 'buddypress' ),
-				'mid_size'   => 1
+				'mid_size'  => 1,
+				'add_args'  => $add_args,
 			) );
 		}
 	}
@@ -341,6 +405,12 @@ class BP_Core_Members_Template {
 		if ( $this->current_member + 1 < $this->member_count ) {
 			return true;
 		} elseif ( $this->current_member + 1 == $this->member_count ) {
+
+			/**
+			 * Fires right before the rewinding of members listing.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action('member_loop_end');
 			// Do some cleaning up after the loop
 			$this->rewind_members();
@@ -365,8 +435,16 @@ class BP_Core_Members_Template {
 		$this->member      = $this->next_member();
 
 		// loop has just started
-		if ( 0 == $this->current_member )
+		if ( 0 == $this->current_member ) {
+
+			/**
+			 * Fires if the current member is the first in the loop.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'member_loop_start' );
+		}
+
 	}
 }
 
@@ -388,7 +466,7 @@ function bp_rewind_members() {
  *
  * @global object $members_template {@link BP_Members_Template}
  *
- * @param array $args {
+ * @param array|string $args {
  *     Arguments for limiting the contents of the members loop. Most arguments
  *     are in the same format as {@link BP_User_Query}. However, because
  *     the format of the arguments accepted here differs in a number of ways,
@@ -398,31 +476,31 @@ function bp_rewind_members() {
  *     Arguments can be passed as an associative array, or as a URL query
  *     string (eg, 'user_id=4&per_page=3').
  *
- *     @type int $type Sort order. 'active', 'random', 'newest', 'popular',
- *           'online', 'alphabetical'. Default: 'active'.
- *     @type int|bool $page Page of results to display. Default: 1.
- *     @type int|bool $per_page Number of results per page. Default: 20.
- *     @type int|bool $max Maximum number of results to return.
- *           Default: false (unlimited).
- *     @type string $page_arg The string used as a query parameter in
- *           pagination links. Default: 'bpage'.
- *     @type array|int|string|bool $include Limit results by a list of user
- *           IDs. Accepts an array, a single integer, a comma-separated list of
- *           IDs, or false (to disable this limiting). Default: false.
- *	     'active', 'alphabetical', 'newest', or 'random'.
- *     @type array|int|string|bool $exclude Exclude users from results by ID.
- *           Accepts an array, a single integer, a comma-separated list of
- *           IDs, or false (to disable this limiting). Default: false.
- *     @type int $user_id If provided, results are limited to the friends of
- *           the specified user. When on a user's Friends page, defaults to
- *           the ID of the displayed user. Otherwise defaults to 0.
- *     @type string $search_terms Limit results by a search term. Default: null.
- *     @type string $meta_key Limit results by the presence of a usermeta key.
- *           Default: false.
- *     @type mixed $meta_value When used with meta_key, limits results by the
- *           a matching usermeta value. Default: false.
- *     @type bool $populate_extras Whether to fetch optional data, such as
- *           friend counts. Default: true.
+ *     @type int                   $type            Sort order. Accepts 'active', 'random', 'newest', 'popular',
+ *                                                  'online', 'alphabetical'. Default: 'active'.
+ *     @type int|bool              $page            Page of results to display. Default: 1.
+ *     @type int|bool              $per_page        Number of results per page. Default: 20.
+ *     @type int|bool              $max             Maximum number of results to return. Default: false (unlimited).
+ *     @type string                $page_arg        The string used as a query parameter in pagination links.
+ *                                                  Default: 'bpage'.
+ *     @type array|int|string|bool $include         Limit results by a list of user IDs. Accepts an array, a
+ *                                                  single integer, a comma-separated list of IDs, or false (to
+ *                                                  disable this limiting). Accepts 'active', 'alphabetical',
+ *                                                  'newest', or 'random'. Default: false.
+ *     @type array|int|string|bool $exclude         Exclude users from results by ID. Accepts an array, a single
+ *                                                  integer, a comma-separated list of IDs, or false (to disable
+ *                                                  this limiting). Default: false.
+ *     @type int                   $user_id         If provided, results are limited to the friends of the specified
+ *                                                  user. When on a user's Friends page, defaults to the ID of the
+ *                                                  displayed user. Otherwise defaults to 0.
+ *     @type string|array          $member_type     Array or comma-separated list of member types to limit results to.
+ *     @type string                $search_terms    Limit results by a search term. Default: null.
+ *     @type string                $meta_key        Limit results by the presence of a usermeta key.
+ *                                                  Default: false.
+ *     @type mixed                 $meta_value      When used with meta_key, limits results by the
+ *                                                  a matching usermeta value. Default: false.
+ *     @type bool                  $populate_extras Whether to fetch optional data, such as
+ *                                                  friend counts. Default: true.
  * }
  * @return bool Returns true when blogs are found, otherwise false.
  */
@@ -437,6 +515,16 @@ function bp_has_members( $args = '' ) {
 		$user_id = bp_displayed_user_id();
 	}
 
+	$member_type = bp_get_current_member_type();
+	if ( ! $member_type && ! empty( $_GET['member_type'] ) ) {
+		if ( is_array( $_GET['member_type'] ) ) {
+			$member_type = $_GET['member_type'];
+		} else {
+			// Can be a comma-separated list.
+			$member_type = explode( ',', $_GET['member_type'] );
+		}
+	}
+
 	// type: active ( default ) | random | newest | popular | online | alphabetical
 	$r = bp_parse_args( $args, array(
 		'type'            => 'active',
@@ -450,6 +538,7 @@ function bp_has_members( $args = '' ) {
 		'exclude'         => false,    // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users
 
 		'user_id'         => $user_id, // Pass a user_id to only show friends of this user
+		'member_type'     => $member_type,
 		'search_terms'    => null,     // Pass search_terms to filter users by their profile data
 
 		'meta_key'        => false,	   // Only return users with this usermeta
@@ -485,9 +574,18 @@ function bp_has_members( $args = '' ) {
 		$r['exclude'],
 		$r['meta_key'],
 		$r['meta_value'],
-		$r['page_arg']
+		$r['page_arg'],
+		$r['member_type']
 	);
 
+	/**
+	 * Filters whether or not BuddyPress has members to iterate over.
+	 *
+	 * @since BuddyPress (1.2.4)
+	 *
+	 * @param bool  $value            Whether or not there are members to iterate over.
+	 * @param array $members_template Populated $members_template global.
+	 */
 	return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template );
 }
 
@@ -533,15 +631,39 @@ function bp_members_pagination_count() {
 		$to_num    = bp_core_number_format( ( $start_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $start_num + ( $members_template->pag_num - 1 ) );
 		$total     = bp_core_number_format( $members_template->total_member_count );
 
-		if ( 'active' == $members_template->type )
-			$pag = sprintf( _n( 'Viewing 1 active member', 'Viewing %1$s - %2$s of %3$s active members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
-		else if ( 'popular' == $members_template->type )
-			$pag = sprintf( _n( 'Viewing 1 member with friends', 'Viewing %1$s - %2$s of %3$s members with friends', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
-		else if ( 'online' == $members_template->type )
-			$pag = sprintf( _n( 'Viewing 1 online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
-		else
-			$pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
+		if ( 'active' == $members_template->type ) {
+			if ( 1 == $members_template->total_member_count ) {
+				$pag = __( 'Viewing 1 active member', 'buddypress' );
+			} else {
+				$pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s active member', 'Viewing %1$s - %2$s of %3$s active members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
+			}
+		} elseif ( 'popular' == $members_template->type ) {
+			if ( 1 == $members_template->total_member_count ) {
+				$pag = __( 'Viewing 1 member with friends', 'buddypress' );
+			} else {
+				$pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s member with friends', 'Viewing %1$s - %2$s of %3$s members with friends', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
+			}
+		} elseif ( 'online' == $members_template->type ) {
+			if ( 1 == $members_template->total_member_count ) {
+				$pag = __( 'Viewing 1 online member', 'buddypress' );
+			} else {
+				$pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
+			}
+		} else {
+			if ( 1 == $members_template->total_member_count ) {
+				$pag = __( 'Viewing 1 member', 'buddypress' );
+			} else {
+				$pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total );
+			}
+		}
 
+		/**
+		 * Filters the members pagination count.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $pag Pagination count string.
+		 */
 		return apply_filters( 'bp_members_pagination_count', $pag );
 	}
 
@@ -559,6 +681,13 @@ function bp_members_pagination_links() {
 	function bp_get_members_pagination_links() {
 		global $members_template;
 
+		/**
+		 * Filters the members pagination link.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $pag_links HTML markup for pagination links.
+		 */
 		return apply_filters( 'bp_get_members_pagination_links', $members_template->pag_links );
 	}
 
@@ -578,6 +707,14 @@ function bp_member_user_id() {
 	function bp_get_member_user_id() {
 		global $members_template;
 		$member_id = isset( $members_template->member->id ) ? (int) $members_template->member->id : false;
+
+		/**
+		 * Filters the ID of the current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $member_id ID of the member being iterated over.
+		 */
 		return apply_filters( 'bp_get_member_user_id', $member_id );
 	}
 
@@ -585,36 +722,60 @@ function bp_member_user_id() {
  * Output the row class of the current member in the loop.
  *
  * @since BuddyPress (1.7.0)
+ *
+ * @param array $classes Array of custom classes
  */
-function bp_member_class() {
-	echo bp_get_member_class();
+function bp_member_class( $classes = array() ) {
+	echo bp_get_member_class( $classes );
 }
 	/**
 	 * Return the row class of the current member in the loop.
 	 *
 	 * @since BuddyPress (1.7.0)
 	 *
-	 * @return string Row class of the member.
+	 * @param array $classes Array of custom classes
+	 *
+	 * @return string Row class of the member
 	 */
-	function bp_get_member_class() {
+	function bp_get_member_class( $classes = array() ) {
 		global $members_template;
 
-		$classes      = array();
-		$current_time = bp_core_current_time();
-		$pos_in_loop  = (int) $members_template->current_member;
+		// Add even/odd classes, but only if there's more than 1 member
+		if ( $members_template->member_count > 1 ) {
+			$pos_in_loop = (int) $members_template->current_member;
+			$classes[]   = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
 
-		// If we've only one group in the loop, don't both with odd and even.
-		if ( $members_template->member_count > 1 )
-			$classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
-		else
+		// If we've only one member in the loop, don't bother with odd and even
+		} else {
 			$classes[] = 'bp-single-member';
+		}
 
-		// Has the user been active recently?
+		// Maybe add 'is-online' class
 		if ( ! empty( $members_template->member->last_activity ) ) {
-			if ( strtotime( $current_time ) <= strtotime( '+5 minutes', strtotime( $members_template->member->last_activity ) ) )
+
+			// Calculate some times
+			$current_time  = strtotime( bp_core_current_time() );
+			$last_activity = strtotime( $members_template->member->last_activity );
+			$still_online  = strtotime( '+5 minutes', $last_activity );
+
+			// Has the user been active recently?
+			if ( $current_time <= $still_online ) {
 				$classes[] = 'is-online';
+			}
 		}
 
+		// Add current user class
+		if ( bp_loggedin_user_id() === (int) $members_template->member->id ) {
+			$classes[] = 'is-current-user';
+		}
+
+		/**
+		 * Filters the determined classes to add to the HTML element.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param string $classes Classes to be added to the HTML element.
+		 */
 		$classes = apply_filters( 'bp_get_member_class', $classes );
 		$classes = array_merge( $classes, array() );
 		$retval  = 'class="' . join( ' ', $classes ) . '"';
@@ -635,6 +796,14 @@ function bp_member_user_nicename() {
 	 */
 	function bp_get_member_user_nicename() {
 		global $members_template;
+
+		/**
+		 * Filters the nicename of the current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.5)
+		 *
+		 * @param string $user_nicename Nicename for the current member.
+		 */
 		return apply_filters( 'bp_get_member_user_nicename', $members_template->member->user_nicename );
 	}
 
@@ -651,6 +820,14 @@ function bp_member_user_login() {
 	 */
 	function bp_get_member_user_login() {
 		global $members_template;
+
+		/**
+		 * Filters the login of the current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.5)
+		 *
+		 * @param string $user_login Login for the current member.
+		 */
 		return apply_filters( 'bp_get_member_user_login', $members_template->member->user_login );
 	}
 
@@ -667,6 +844,14 @@ function bp_member_user_email() {
 	 */
 	function bp_get_member_user_email() {
 		global $members_template;
+
+		/**
+		 * Filters the email address of the current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.5)
+		 *
+		 * @param string $user_email Email address for the current member.
+		 */
 		return apply_filters( 'bp_get_member_user_email', $members_template->member->user_email );
 	}
 
@@ -677,6 +862,14 @@ function bp_member_user_email() {
  */
 function bp_member_is_loggedin_user() {
 	global $members_template;
+
+	/**
+	 * Filters whether the current member in the loop is the logged-in user.
+	 *
+	 * @since BuddyPress (1.2.5)
+	 *
+	 * @param bool $value Whether current member in the loop is logged in.
+	 */
 	return apply_filters( 'bp_member_is_loggedin_user', bp_loggedin_user_id() == $members_template->member->id ? true : false );
 }
 
@@ -685,9 +878,18 @@ function bp_member_is_loggedin_user() {
  *
  * @see bp_get_member_avatar() for description of arguments.
  *
- * @param array $args See {@link bp_get_member_avatar()}.
+ * @param array|string $args See {@link bp_get_member_avatar()}.
  */
 function bp_member_avatar( $args = '' ) {
+
+	/**
+	 * Filters a members avatar.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Formatted HTML <img> element,
+	 *                      or raw avatar URL based on $html arg.
+	 */
 	echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) );
 }
 	/**
@@ -696,17 +898,17 @@ function bp_member_avatar( $args = '' ) {
 	 * @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()}.
-	 *     @type string $alt Default: 'Profile picture of [user name]'.
-	 *     @type string $class Default: 'avatar'.
-	 *     @type string $type Default: 'thumb'.
-	 *     @type int|bool $width Default: false.
-	 *     @type int|bool $height Default: false.
-	 *     @type bool $id Currently unused.
-	 *     @type bool $no_grav Default: false.
+	 *     @type string   $alt     Default: 'Profile picture of [user name]'.
+	 *     @type string   $class   Default: 'avatar'.
+	 *     @type string   $type    Default: 'thumb'.
+	 *     @type int|bool $width   Default: false.
+	 *     @type int|bool $height  Default: false.
+	 *     @type bool     $id      Currently unused.
+	 *     @type bool     $no_grav Default: false.
 	 * }
 	 * @return string User avatar string.
 	 */
@@ -727,6 +929,14 @@ function bp_member_avatar( $args = '' ) {
 		$r = wp_parse_args( $args, $defaults );
 		extract( $r, EXTR_SKIP );
 
+		/**
+		 * Filters a members avatar.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Formatted HTML <img> element,
+		 *                      or raw avatar URL based on $html arg.
+		 */
 		return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) );
 	}
 
@@ -744,6 +954,13 @@ function bp_member_permalink() {
 	function bp_get_member_permalink() {
 		global $members_template;
 
+		/**
+		 * Filters the permalink for the current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Permalink for the current member in the loop.
+		 */
 		return apply_filters( 'bp_get_member_permalink', bp_core_get_user_domain( $members_template->member->id, $members_template->member->user_nicename, $members_template->member->user_login ) );
 	}
 
@@ -761,6 +978,14 @@ function bp_member_permalink() {
  * Output display name of current member in the loop.
  */
 function bp_member_name() {
+
+	/**
+	 * Filters the display name of current member in the loop.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param string $value Display name for current member.
+	 */
 	echo apply_filters( 'bp_member_name', bp_get_member_name() );
 }
 	/**
@@ -795,6 +1020,13 @@ function bp_member_name() {
 			}
 		}
 
+		/**
+		 * Filters the display name of current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $fullname Display name for current member.
+		 */
 		return apply_filters( 'bp_get_member_name', $members_template->member->fullname );
 	}
 	add_filter( 'bp_get_member_name', 'wp_filter_kses' );
@@ -816,8 +1048,9 @@ function bp_member_last_active( $args = array() ) {
 	 * @param array $args {
 	 *     Array of optional arguments.
 	 *     @type mixed $active_format If true, formatted "active 5 minutes
-	 *           ago". If false, formatted "5 minutes ago". If string, should
-	 *           be sprintf'able like 'last seen %s ago'.
+	 *                                ago". If false, formatted "5 minutes ago".
+	 *                                If string, should be sprintf'able like
+	 *                                'last seen %s ago'.
 	 * }
 	 * @return string
 	 */
@@ -829,7 +1062,7 @@ function bp_member_last_active( $args = array() ) {
 			'active_format' => true
 		) );
 
-		// Backwards compatibilty for anyone forcing a 'true' active_format
+		// Backwards compatibility for anyone forcing a 'true' active_format
 		if ( true === $r['active_format'] ) {
 			$r['active_format'] = __( 'active %s', 'buddypress' );
 		}
@@ -847,12 +1080,21 @@ function bp_member_last_active( $args = array() ) {
 			$last_activity = __( 'Never active', 'buddypress' );
 		}
 
-		// Filter and return
+		/**
+		 * Filters the current members last active time.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $last_activity Formatted time since last activity.
+		 * @param array  $r             Array of parsed arguments for query.
+		 */
 		return apply_filters( 'bp_member_last_active', $last_activity, $r );
 	}
 
 /**
  * Output the latest update of the current member in the loop.
+ *
+ * @param array|string $args
  */
 function bp_member_latest_update( $args = '' ) {
 	echo bp_get_member_latest_update( $args );
@@ -860,11 +1102,11 @@ function bp_member_latest_update( $args = '' ) {
 	/**
 	 * Get the latest update from the current member in the loop.
 	 *
-	 * @param array $args {
+	 * @param array|string $args {
 	 *     Array of optional arguments.
-	 *     @type int $length Truncation length. Default: 225.
+	 *     @type int  $length    Truncation length. Default: 225.
 	 *     @type bool $view_link Whether to provide a 'View' link for
-	 *           truncated entries. Default: false.
+	 *                           truncated entries. Default: false.
 	 * }
 	 * @return string
 	 */
@@ -882,6 +1124,13 @@ function bp_member_latest_update( $args = '' ) {
 		if ( !bp_is_active( 'activity' ) || empty( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) )
 			return false;
 
+		/**
+		 * Filters the excerpt of the latest update for current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.5)
+		 *
+		 * @param string $value Excerpt of the latest update for current member in the loop.
+		 */
 		$update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) );
 
 		$update_content = sprintf( _x( '- &quot;%s&quot;', 'member latest update in member directory', 'buddypress' ), $update_content );
@@ -894,6 +1143,13 @@ function bp_member_latest_update( $args = '' ) {
 			$update_content .= '<span class="activity-read-more"><a href="' . bp_activity_get_permalink( $update['id'] ) . '" rel="nofollow">' . $view . '</a></span>';
 		}
 
+		/**
+		 * Filters the latest update from the current member in the loop.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $update_content Formatted latest update for current member.
+		 */
 		return apply_filters( 'bp_get_member_latest_update', $update_content );
 	}
 
@@ -902,7 +1158,7 @@ function bp_member_latest_update( $args = '' ) {
  *
  * @see bp_get_member_profile_data() for a description of params.
  *
- * @param array $args See {@link bp_get_member_profile_data()}.
+ * @param array|string $args See {@link bp_get_member_profile_data()}.
  */
 function bp_member_profile_data( $args = '' ) {
 	echo bp_get_member_profile_data( $args );
@@ -914,12 +1170,12 @@ function bp_member_profile_data( $args = '' ) {
 	 * to fetch profile data cached in the template global. It is also safe
 	 * to use outside of the loop.
 	 *
-	 * @param array $args {
-	 *     Array of config paramaters.
-	 *     @type string $field Name of the profile field.
-	 *     @type int $user_id ID of the user whose data is being fetched.
-	 *           Defaults to the current member in the loop, or if not
-	 *           present, to the currently displayed user.
+	 * @param array|string $args {
+	 *     Array of config parameters.
+	 *     @type string $field   Name of the profile field.
+	 *     @type int    $user_id ID of the user whose data is being fetched.
+	 *                           Defaults to the current member in the loop, or if not
+	 *                           present, to the currently displayed user.
 	 * }
 	 * @return string|bool Profile data if found, otherwise false.
 	 */
@@ -969,6 +1225,13 @@ function bp_member_profile_data( $args = '' ) {
 			$data = xprofile_format_profile_field( $profile_data[ $r['field'] ]['field_type'], $profile_data[ $r['field'] ]['field_data'] );
 		}
 
+		/**
+		 * Filters resulting piece of member profile data.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string|bool $data Profile data if found, otherwise false.
+		 */
 		return apply_filters( 'bp_get_member_profile_data', $data );
 	}
 
@@ -986,8 +1249,15 @@ function bp_member_registered() {
 	function bp_get_member_registered() {
 		global $members_template;
 
-		$registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, _x( 'registered %s', 'Records the timestamp that the user registered into the activy stream', 'buddypress' ) ) );
+		$registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, _x( 'registered %s', 'Records the timestamp that the user registered into the activity stream', 'buddypress' ) ) );
 
+		/**
+		 * Filters the 'registered [x days ago]' string for the current member.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $registered The 'registered [x days ago]' string.
+		 */
 		return apply_filters( 'bp_member_registered', $registered );
 	}
 
@@ -1031,6 +1301,13 @@ function bp_directory_members_search_form() {
 		<input type="submit" id="members_search_submit" name="members_search_submit" value="' . __( 'Search', 'buddypress' ) . '" />
 	</form>';
 
+	/**
+	 * Filters the Members component search form.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $search_form_html HTML markup for the member search form.
+	 */
 	echo apply_filters( 'bp_directory_members_search_form', $search_form_html );
 }
 
@@ -1046,6 +1323,14 @@ function bp_total_site_member_count() {
 	 * @return int
 	 */
 	function bp_get_total_site_member_count() {
+
+		/**
+		 * Filters the total site member count.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param int $value Number-formatted total site member count.
+		 */
 		return apply_filters( 'bp_get_total_site_member_count', bp_core_number_format( bp_core_get_total_member_count() ) );
 	}
 
@@ -1067,7 +1352,7 @@ function bp_total_site_member_count() {
  * @deprecated Does not seem to be called anywhere in BP core.
  */
 function bp_get_loggedin_user_nav() {
-	global $bp;
+	$bp = buddypress();
 
 	// Loop through each navigation item
 	foreach( (array) $bp->bp_nav as $nav_item ) {
@@ -1109,7 +1394,7 @@ function bp_get_loggedin_user_nav() {
  * Render the navigation markup for the displayed user.
  */
 function bp_get_displayed_user_nav() {
-	global $bp;
+	$bp = buddypress();
 
 	foreach ( (array) $bp->bp_nav as $user_nav_item ) {
 		if ( empty( $user_nav_item['show_for_displayed_user'] ) && !bp_is_my_profile() )
@@ -1126,6 +1411,17 @@ function bp_get_displayed_user_nav() {
 			$link = trailingslashit( bp_displayed_user_domain() . $user_nav_item['link'] );
 		}
 
+		/**
+		 * Filters the navigation markup for the displayed user.
+		 *
+		 * This is a dynamic filter that is dependent on the navigation tab component being rendered.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value         Markup for the tab list item including link.
+		 * @param array  $user_nav_item Array holding parts used to construct tab list item.
+		 *                              Passed by reference.
+		 */
 		echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) );
 	}
 }
@@ -1136,6 +1432,8 @@ function bp_get_displayed_user_nav() {
  * Output the logged-in user's avatar.
  *
  * @see bp_get_loggedin_user_avatar() for a description of params.
+ *
+ * @param array|string $args
  */
 function bp_loggedin_user_avatar( $args = '' ) {
 	echo bp_get_loggedin_user_avatar( $args );
@@ -1146,38 +1444,45 @@ function bp_loggedin_user_avatar( $args = '' ) {
 	 * @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()}.
-	 *     @type string $alt Default: 'Profile picture of [user name]'.
-	 *     @type bool $html Default: true.
-	 *     @type string $type Default: 'thumb'.
-	 *     @type int|bool $width Default: false.
+	 *     @type string   $alt    Default: 'Profile picture of [user name]'.
+	 *     @type bool     $html   Default: true.
+	 *     @type string   $type   Default: 'thumb'.
+	 *     @type int|bool $width  Default: false.
 	 *     @type int|bool $height Default: false.
 	 * }
 	 * @return string User avatar string.
 	 */
 	function bp_get_loggedin_user_avatar( $args = '' ) {
 
-		$defaults = array(
-			'type'   => 'thumb',
-			'width'  => false,
-			'height' => false,
-			'html'   => true,
-			'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() )
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
+		$r = wp_parse_args( $args, array(
+			'item_id' => bp_loggedin_user_id(),
+			'type'    => 'thumb',
+			'width'   => false,
+			'height'  => false,
+			'html'    => true,
+			'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() )
+		) );
 
-		return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
+		/**
+		 * Filters the logged in user's avatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value User avatar string.
+		 */
+		return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( $r ), $r, $args );
 	}
 
 /**
  * Output the displayed user's avatar.
  *
  * @see bp_get_displayed_user_avatar() for a description of params.
+ *
+ * @param array|string $args
  */
 function bp_displayed_user_avatar( $args = '' ) {
 	echo bp_get_displayed_user_avatar( $args );
@@ -1188,32 +1493,37 @@ function bp_displayed_user_avatar( $args = '' ) {
 	 * @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()}.
-	 *     @type string $alt Default: 'Profile picture of [user name]'.
-	 *     @type bool $html Default: true.
-	 *     @type string $type Default: 'thumb'.
-	 *     @type int|bool $width Default: false.
+	 *     @type string   $alt    Default: 'Profile picture of [user name]'.
+	 *     @type bool     $html   Default: true.
+	 *     @type string   $type   Default: 'thumb'.
+	 *     @type int|bool $width  Default: false.
 	 *     @type int|bool $height Default: false.
 	 * }
 	 * @return string User avatar string.
 	 */
 	function bp_get_displayed_user_avatar( $args = '' ) {
 
-		$defaults = array(
-			'type'   => 'thumb',
-			'width'  => false,
-			'height' => false,
-			'html'   => true,
-			'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
+		$r = wp_parse_args( $args, array(
+			'item_id' => bp_displayed_user_id(),
+			'type'    => 'thumb',
+			'width'   => false,
+			'height'  => false,
+			'html'    => true,
+			'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
+		) );
 
-		return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
+		/**
+		 * Filters the displayed user's avatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value User avatar string.
+		 */
+		return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( $r ), $r, $args );
 	}
 
 /**
@@ -1228,7 +1538,7 @@ function bp_displayed_user_email() {
 	 * @return string
 	 */
 	function bp_get_displayed_user_email() {
-		global $bp;
+		$bp = buddypress();
 
 		// If displayed user exists, return email address
 		if ( isset( $bp->displayed_user->userdata->user_email ) )
@@ -1236,6 +1546,13 @@ function bp_displayed_user_email() {
 		else
 			$retval = '';
 
+		/**
+		 * Filters the email address of the displayed user.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $retval Email address for displayed user.
+		 */
 		return apply_filters( 'bp_get_displayed_user_email', esc_attr( $retval ) );
 	}
 
@@ -1247,12 +1564,21 @@ function bp_displayed_user_email() {
  * @param int $user_id See {@link bp_get_last_activity()}.
  */
 function bp_last_activity( $user_id = 0 ) {
+
+	/**
+	 * Filters the 'active [x days ago]' string for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Formatted 'active [x days ago]' string.
+	 */
 	echo apply_filters( 'bp_last_activity', bp_get_last_activity( $user_id ) );
 }
 	/**
 	 * Get the "active [x days ago]" string for a user.
 	 *
 	 * @param int $user_id ID of the user. Default: displayed user ID.
+	 *
 	 * @return string
 	 */
 	function bp_get_last_activity( $user_id = 0 ) {
@@ -1262,6 +1588,13 @@ function bp_last_activity( $user_id = 0 ) {
 
 		$last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('active %s', 'buddypress') );
 
+		/**
+		 * Filters the 'active [x days ago]' string for a user.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $value Formatted 'active [x days ago]' string.
+		 */
 		return apply_filters( 'bp_get_last_activity', $last_activity );
 	}
 
@@ -1276,9 +1609,9 @@ function bp_user_firstname() {
 	 *
 	 * Simply takes all the characters before the first space in a name.
 	 *
-	 * @param string $name Full name to use when generating first name.
-	 *        Defaults to displayed user's first name, or to logged-in
-	 *        user's first name if it's unavailable.
+	 * @param string|bool $name Full name to use when generating first name.
+	 *                          Defaults to displayed user's first name, or to
+	 *                          logged-in user's first name if it's unavailable.
 	 * @return string
 	 */
 	function bp_get_user_firstname( $name = false ) {
@@ -1293,6 +1626,14 @@ function bp_user_firstname() {
 
 		$fullname = (array) explode( ' ', $name );
 
+		/**
+		 * Filters the first name of a user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value    First name of user.
+		 * @param string $fullname Full name of user.
+		 */
 		return apply_filters( 'bp_get_user_firstname', $fullname[0], $fullname );
 	}
 
@@ -1308,6 +1649,14 @@ function bp_loggedin_user_link() {
 	 * @return string
 	 */
 	function bp_get_loggedin_user_link() {
+
+		/**
+		 * Filters the link for the logged-in user's profile.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param string $value Link for the logged-in user's profile.
+		 */
 		return apply_filters( 'bp_get_loggedin_user_link', bp_loggedin_user_domain() );
 	}
 
@@ -1323,6 +1672,14 @@ function bp_displayed_user_link() {
 	 * @return string
 	 */
 	function bp_get_displayed_user_link() {
+
+		/**
+		 * Filters the link for the displayed user's profile.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 *
+		 * @param string $value Link for the displayed user's profile.
+		 */
 		return apply_filters( 'bp_get_displayed_user_link', bp_displayed_user_domain() );
 	}
 
@@ -1344,7 +1701,15 @@ function bp_current_user_id() { return bp_displayed_user_id(); }
  * @return string
  */
 function bp_displayed_user_domain() {
-	global $bp;
+	$bp = buddypress();
+
+	/**
+	 * Filters the generated link for the displayed user's profile.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Generated link for the displayed user's profile.
+	 */
 	return apply_filters( 'bp_displayed_user_domain', isset( $bp->displayed_user->domain ) ? $bp->displayed_user->domain : '' );
 }
 
@@ -1354,7 +1719,15 @@ function bp_displayed_user_domain() {
  * @return string
  */
 function bp_loggedin_user_domain() {
-	global $bp;
+	$bp = buddypress();
+
+	/**
+	 * Filters the generated link for the logged-in user's profile.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $value Generated link for the logged-in user's profile.
+	 */
 	return apply_filters( 'bp_loggedin_user_domain', isset( $bp->loggedin_user->domain ) ? $bp->loggedin_user->domain : '' );
 }
 
@@ -1370,7 +1743,15 @@ function bp_displayed_user_fullname() {
 	 * @return string
 	 */
 	function bp_get_displayed_user_fullname() {
-		global $bp;
+		$bp = buddypress();
+
+		/**
+		 * Filters the displayed user's display name.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $value Displayed user's display name.
+		 */
 		return apply_filters( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' );
 	}
 
@@ -1392,7 +1773,15 @@ function bp_loggedin_user_fullname() {
 	 * @return string
 	 */
 	function bp_get_loggedin_user_fullname() {
-		global $bp;
+		$bp = buddypress();
+
+		/**
+		 * Filters the logged-in user's display name.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Logged-in user's display name.
+		 */
 		return apply_filters( 'bp_get_loggedin_user_fullname', isset( $bp->loggedin_user->fullname ) ? $bp->loggedin_user->fullname : '' );
 	}
 
@@ -1408,7 +1797,7 @@ function bp_displayed_user_username() {
 	 * @return string
 	 */
 	function bp_get_displayed_user_username() {
-		global $bp;
+		$bp = buddypress();
 
 		if ( bp_displayed_user_id() ) {
 			$username = bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login );
@@ -1416,6 +1805,13 @@ function bp_displayed_user_username() {
 			$username = '';
 		}
 
+		/**
+		 * Filters the username of the displayed user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $username Username of the displayed user.
+		 */
 		return apply_filters( 'bp_get_displayed_user_username', $username );
 	}
 
@@ -1431,7 +1827,7 @@ function bp_loggedin_user_username() {
 	 * @return string
 	 */
 	function bp_get_loggedin_user_username() {
-		global $bp;
+		$bp = buddypress();
 
 		if ( bp_loggedin_user_id() ) {
 			$username = bp_core_get_username( bp_loggedin_user_id(), $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login );
@@ -1439,8 +1835,37 @@ function bp_loggedin_user_username() {
 			$username = '';
 		}
 
+		/**
+		 * Filters the username of the logged-in user.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $username Username of the logged-in user.
+		 */
 		return apply_filters( 'bp_get_loggedin_user_username', $username );
 	}
+/**
+ * Echo the current member type message.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_current_member_type_message() {
+	echo bp_get_current_member_type_message();
+}
+	/**
+	 * Generate the current member type message.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return string
+	 */
+	function bp_get_current_member_type_message() {
+		$type_object = bp_get_member_type_object( bp_get_current_member_type() );
+
+		$message = sprintf( __( 'Viewing members of the type: %s', 'buddypress' ), '<strong>' . $type_object->labels['singular_name'] . '</strong>' );
+
+		return apply_filters( 'bp_get_current_member_type_message', $message );
+	}
 
 /** Signup Form ***************************************************************/
 
@@ -1466,7 +1891,7 @@ function bp_has_custom_signup_page() {
  * Output the URL to the signup page.
  */
 function bp_signup_page() {
-	echo bp_get_signup_page();
+	echo esc_url( bp_get_signup_page() );
 }
 	/**
 	 * Get the URL to the signup page.
@@ -1480,6 +1905,13 @@ function bp_signup_page() {
 			$page = bp_get_root_domain() . '/wp-signup.php';
 		}
 
+		/**
+		 * Filters the URL to the signup page.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $page URL to the signup page.
+		 */
 		return apply_filters( 'bp_get_signup_page', $page );
 	}
 
@@ -1502,10 +1934,10 @@ function bp_has_custom_activation_page() {
 }
 
 /**
- * Output the URL of the actvitation page.
+ * Output the URL of the activation page.
  */
 function bp_activation_page() {
-	echo bp_get_activation_page();
+	echo esc_url( bp_get_activation_page() );
 }
 	/**
 	 * Get the URL of the activation page.
@@ -1519,6 +1951,13 @@ function bp_activation_page() {
 			$page = trailingslashit( bp_get_root_domain() ) . 'wp-activate.php';
 		}
 
+		/**
+		 * Filters the URL of the activation page.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param string $page URL to the activation page.
+		 */
 		return apply_filters( 'bp_get_activation_page', $page );
 	}
 
@@ -1540,6 +1979,13 @@ function bp_signup_username_value() {
 		if ( isset( $_POST['signup_username'] ) )
 			$value = $_POST['signup_username'];
 
+		/**
+		 * Filters the username submitted during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Username submitted during signup.
+		 */
 		return apply_filters( 'bp_get_signup_username_value', $value );
 	}
 
@@ -1561,6 +2007,13 @@ function bp_signup_email_value() {
 		if ( isset( $_POST['signup_email'] ) )
 			$value = $_POST['signup_email'];
 
+		/**
+		 * Filters the email address submitted during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Email address submitted during signup.
+		 */
 		return apply_filters( 'bp_get_signup_email_value', $value );
 	}
 
@@ -1580,6 +2033,13 @@ function bp_signup_with_blog_value() {
 		if ( isset( $_POST['signup_with_blog'] ) )
 			$value = $_POST['signup_with_blog'];
 
+		/**
+		 * Filters the 'signup_with_blog' value submitted during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value 'signup_with_blog' value submitted during signup.
+		 */
 		return apply_filters( 'bp_get_signup_with_blog_value', $value );
 	}
 
@@ -1601,6 +2061,13 @@ function bp_signup_blog_url_value() {
 		if ( isset( $_POST['signup_blog_url'] ) )
 			$value = $_POST['signup_blog_url'];
 
+		/**
+		 * Filters the 'signup_blog_url' value submitted during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value 'signup_blog_url' value submitted during signup.
+		 */
 		return apply_filters( 'bp_get_signup_blog_url_value', $value );
 	}
 
@@ -1627,6 +2094,14 @@ function bp_signup_subdomain_base() {
 		// In case plugins are still using this filter
 		$subdomain_base = apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
 
+		/**
+		 * Filters the base URL for subdomain installations of WordPress Multisite.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $subdomain_base The base URL - eg, 'example.com' for
+		 *                               site_url() example.com or www.example.com.
+		 */
 		return apply_filters( 'bp_signup_subdomain_base', $subdomain_base );
 	}
 
@@ -1648,6 +2123,13 @@ function bp_signup_blog_title_value() {
 		if ( isset( $_POST['signup_blog_title'] ) )
 			$value = $_POST['signup_blog_title'];
 
+		/**
+		 * Filters the 'signup_blog_title' value submitted during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value 'signup_blog_title' value submitted during signup.
+		 */
 		return apply_filters( 'bp_get_signup_blog_title_value', $value );
 	}
 
@@ -1669,6 +2151,13 @@ function bp_signup_blog_privacy_value() {
 		if ( isset( $_POST['signup_blog_privacy'] ) )
 			$value = $_POST['signup_blog_privacy'];
 
+		/**
+		 * Filters the 'signup_blog_privacy' value submitted during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value 'signup_blog_privacy' value submitted during signup.
+		 */
 		return apply_filters( 'bp_get_signup_blog_privacy_value', $value );
 	}
 
@@ -1684,7 +2173,7 @@ function bp_signup_avatar_dir_value() {
 	 * @return string
 	 */
 	function bp_get_signup_avatar_dir_value() {
-		global $bp;
+		$bp = buddypress();
 
 		// Check if signup_avatar_dir is passed
 		if ( !empty( $_POST['signup_avatar_dir'] ) )
@@ -1698,7 +2187,14 @@ function bp_signup_avatar_dir_value() {
 		else
 			$signup_avatar_dir = false;
 
-		return apply_filters( 'bp_get_signup_avatar_dir_value', $bp->signup->avatar_dir );
+		/**
+		 * Filters the avatar dir used during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string|bool $signup_avatar_dir Avatar dir used during signup or false.
+		 */
+		return apply_filters( 'bp_get_signup_avatar_dir_value', $signup_avatar_dir );
 	}
 
 /**
@@ -1713,9 +2209,7 @@ function bp_current_signup_step() {
 	 * @return string
 	 */
 	function bp_get_current_signup_step() {
-		global $bp;
-
-		return $bp->signup->step;
+		return buddypress()->signup->step;
 	}
 
 /**
@@ -1723,7 +2217,7 @@ function bp_current_signup_step() {
  *
  * @see bp_get_signup_avatar() for description of arguments.
  *
- * @param array $args See {@link bp_get_signup_avatar(}.
+ * @param array|string $args See {@link bp_get_signup_avatar(}.
  */
 function bp_signup_avatar( $args = '' ) {
 	echo bp_get_signup_avatar( $args );
@@ -1733,12 +2227,12 @@ function bp_signup_avatar( $args = '' ) {
 	 *
 	 * @see bp_core_fetch_avatar() for description of arguments.
 	 *
-	 * @param array $args {
+	 * @param array|string $args {
 	 *     Array of optional arguments.
-	 *     @type int $size Height/weight in pixels. Default: value of
-	 *           bp_core_avatar_full_width().
+	 *     @type int    $size  Height/weight in pixels. Default: value of
+	 *                         bp_core_avatar_full_width().
 	 *     @type string $class CSS class. Default: 'avatar'.
-	 *     @type string $alt HTML 'alt' attribute. Default: 'Your Avatar'.
+	 *     @type string $alt   HTML 'alt' attribute. Default: 'Your Avatar'.
 	 * }
 	 * @return string
 	 */
@@ -1773,17 +2267,31 @@ function bp_signup_avatar( $args = '' ) {
 			// Set default gravatar type
 			if ( empty( $bp->grav_default->user ) )
 				$default_grav = 'wavatar';
-			else if ( 'mystery' == $bp->grav_default->user )
+			elseif ( 'mystery' == $bp->grav_default->user )
 				$default_grav = $bp->plugin_url . 'bp-core/images/mystery-man.jpg';
 			else
 				$default_grav = $bp->grav_default->user;
 
-			// Create
-			$gravatar_url    = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' );
+			/**
+			 * Filters the base Gravatar url used for signup avatars when no avatar dir found.
+			 *
+			 * @since BuddyPress (1.0.2)
+			 *
+			 * @param string $value Gravatar url to use.
+			 */
+			$gravatar_url    = apply_filters( 'bp_gravatar_url', '//www.gravatar.com/avatar/' );
 			$md5_lcase_email = md5( strtolower( bp_get_signup_email_value() ) );
 			$gravatar_img    = '<img src="' . $gravatar_url . $md5_lcase_email . '?d=' . $default_grav . '&amp;s=' . $size . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="' . $class . '" />';
 		}
 
+		/**
+		 * Filters the user avatar during signup.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $gravatar_img Avatar HTML image tag.
+		 * @param array  $args         Array of parsed args for avatar query.
+		 */
 		return apply_filters( 'bp_get_signup_avatar', $gravatar_img, $args );
 	}
 
@@ -1801,12 +2309,14 @@ function bp_signup_allowed() {
 	 * @return bool
 	 */
 	function bp_get_signup_allowed() {
-		global $bp;
+		$bp = buddypress();
 
 		$signup_allowed = false;
 
 		if ( is_multisite() ) {
-			if ( in_array( $bp->site_options['registration'], array( 'all', 'user' ) ) ) {
+			$registration = bp_core_get_root_option( 'registration' );
+
+			if ( in_array( $registration, array( 'all', 'user' ) ) ) {
 				$signup_allowed = true;
 			}
 
@@ -1816,6 +2326,13 @@ function bp_signup_allowed() {
 			}
 		}
 
+		/**
+		 * Filters whether or not new signups are allowed.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param bool $signup_allowed Whether or not new signups are allowed.
+		 */
 		return apply_filters( 'bp_get_signup_allowed', $signup_allowed );
 	}
 
@@ -1839,32 +2356,34 @@ add_action( 'bp_head', 'bp_members_activity_feed' );
  *
  * @see bp_get_members_component_link() for description of parameters.
  *
- * @param string $component See {@bp_get_members_component_link()}.
- * @param string $action See {@bp_get_members_component_link()}.
- * @param string $query_args See {@bp_get_members_component_link()}.
- * @param string $nonce See {@bp_get_members_component_link()}.
+ * @param string      $component See {@bp_get_members_component_link()}.
+ * @param string      $action See {@bp_get_members_component_link()}.
+ * @param string      $query_args See {@bp_get_members_component_link()}.
+ * @param string|bool $nonce See {@bp_get_members_component_link()}.
  */
 function bp_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
-	echo bp_get_members_component_link( $component, $action, $query_args, $nonce );
+	echo esc_url( bp_get_members_component_link( $component, $action, $query_args, $nonce ) );
 }
 	/**
 	 * Generate a link to a members component subpage.
 	 *
-	 * @param string $component ID of the component (eg 'friends').
-	 * @param string $action Optional. 'action' slug (eg 'invites').
-	 * @param array $query_args Optional. Array of URL params to add to the
-	 *        URL. See {@link add_query_arg()} for format.
-	 * @param array $nonce Optional. If provided, the URL will be passed
-	 *        through wp_nonce_url() with $nonce as the action string.
+	 * @param string       $component  ID of the component (eg 'friends').
+	 * @param string       $action     Optional. 'action' slug (eg 'invites').
+	 * @param array|string $query_args Optional. Array of URL params to add to the
+	 *                                 URL. See {@link add_query_arg()} for format.
+	 * @param array|bool   $nonce      Optional. If provided, the URL will be passed
+	 *                                 through wp_nonce_url() with $nonce as the
+	 *                                 action string.
 	 * @return string
 	 */
 	function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
-		global $bp;
 
 		// Must be displayed user
 		if ( !bp_displayed_user_id() )
 			return;
 
+		$bp = buddypress();
+
 		// Append $action to $url if there is no $type
 		if ( !empty( $action ) )
 			$url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action;
diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php b/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php
new file mode 100644
index 0000000000000000000000000000000000000000..c02c9da7e3ff464a7c9970d24f05825a4b2c5a6e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php
@@ -0,0 +1,621 @@
+<?php
+/**
+ * BuddyPress Members Widgets.
+ *
+ * @package BuddyPress
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Register bp-members widgets.
+ *
+ * Previously, these widgets were registered in bp-core.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_members_register_widgets() {
+	add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Members_Widget");'         ) );
+	add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Whos_Online_Widget");'     ) );
+	add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Recently_Active_Widget");' ) );
+}
+add_action( 'bp_register_widgets', 'bp_members_register_widgets' );
+
+/**
+ * Members Widget.
+ *
+ * @since BuddyPress (1.0.3)
+ */
+class BP_Core_Members_Widget extends WP_Widget {
+
+	/**
+	 * Constructor method.
+	 */
+	public function __construct() {
+
+		// Setup widget name & description
+		$name        = _x( '(BuddyPress) Members', 'widget name', 'buddypress' );
+		$description = __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' );
+
+		// Call WP_Widget constructor
+		parent::__construct( false, $name, array(
+			'description' => $description,
+			'classname'   => 'widget_bp_core_members_widget buddypress widget',
+		) );
+
+		// Maybe enqueue JS for widget
+		if ( is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) {
+			wp_enqueue_script( 'bp-widget-members' );
+		}
+	}
+
+	/**
+	 * Display the Members widget.
+	 *
+	 * @see WP_Widget::widget() for description of parameters.
+	 *
+	 * @param array $args     Widget arguments.
+	 * @param array $instance Widget settings, as saved by the user.
+	 */
+	public function widget( $args, $instance ) {
+
+		// Get widget settings
+		$settings = $this->parse_settings( $instance );
+
+		/**
+		 * Filters the title of the Members widget.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $settings The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $settings['title'], $settings, $this->id_base );
+		$title = $settings['link_title'] ? '<a href="' . bp_get_members_directory_permalink() . '">' . $title . '</a>' : $title;
+
+		// Output before widget HTMl, title (and maybe content before & after it)
+		echo $args['before_widget']
+		   . $args['before_title']
+		   . $title
+		   . $args['after_title'];
+
+		// Setup args for querying members
+		$members_args = array(
+			'user_id'         => 0,
+			'type'            => $settings['member_default'],
+			'per_page'        => $settings['max_members'],
+			'max'             => $settings['max_members'],
+			'populate_extras' => true,
+			'search_terms'    => false,
+		); ?>
+
+		<?php if ( bp_has_members( $members_args ) ) : ?>
+
+			<div class="item-options" id="members-list-options">
+				<a href="<?php bp_members_directory_permalink(); ?>" id="newest-members" <?php if ( 'newest' === $settings['member_default'] ) : ?>class="selected"<?php endif; ?>><?php esc_html_e( 'Newest', 'buddypress' ); ?></a>
+				|  <a href="<?php bp_members_directory_permalink(); ?>" id="recently-active-members" <?php if ( 'active' === $settings['member_default'] ) : ?>class="selected"<?php endif; ?>><?php esc_html_e( 'Active', 'buddypress' ); ?></a>
+
+				<?php if ( bp_is_active( 'friends' ) ) : ?>
+
+					| <a href="<?php bp_members_directory_permalink(); ?>" id="popular-members" <?php if ( 'popular' === $settings['member_default'] ) : ?>class="selected"<?php endif; ?>><?php esc_html_e( 'Popular', 'buddypress' ); ?></a>
+
+				<?php endif; ?>
+
+			</div>
+
+			<ul id="members-list" class="item-list">
+
+				<?php while ( bp_members() ) : bp_the_member(); ?>
+
+					<li class="vcard">
+						<div class="item-avatar">
+							<a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name(); ?>"><?php bp_member_avatar(); ?></a>
+						</div>
+
+						<div class="item">
+							<div class="item-title fn"><a href="<?php bp_member_permalink(); ?>" title="<?php bp_member_name(); ?>"><?php bp_member_name(); ?></a></div>
+							<div class="item-meta">
+								<span class="activity"><?php
+									if ( 'newest' === $settings['member_default'] ) :
+										bp_member_registered();
+									elseif ( 'active' === $settings['member_default'] ) :
+										bp_member_last_active();
+									elseif ( 'popular' === $settings['member_default'] ) :
+										bp_member_total_friend_count();
+									endif; ?></span>
+							</div>
+						</div>
+					</li>
+
+				<?php endwhile; ?>
+
+			</ul>
+
+			<?php wp_nonce_field( 'bp_core_widget_members', '_wpnonce-members', false ); ?>
+
+			<input type="hidden" name="members_widget_max" id="members_widget_max" value="<?php echo esc_attr( $settings['max_members'] ); ?>" />
+
+		<?php else: ?>
+
+			<div class="widget-error">
+				<?php esc_html_e( 'No one has signed up yet!', 'buddypress' ); ?>
+			</div>
+
+		<?php endif; ?>
+
+		<?php echo $args['after_widget'];
+	}
+
+	/**
+	 * Update the Members widget options.
+	 *
+	 * @param array $new_instance The new instance options.
+	 * @param array $old_instance The old instance options.
+	 *
+	 * @return array $instance     The parsed options to be saved.
+	 */
+	public function update( $new_instance, $old_instance ) {
+		$instance = $old_instance;
+
+		$instance['title']          = strip_tags( $new_instance['title'] );
+		$instance['max_members']    = strip_tags( $new_instance['max_members'] );
+		$instance['member_default'] = strip_tags( $new_instance['member_default'] );
+		$instance['link_title']	    = (bool) $new_instance['link_title'];
+
+		return $instance;
+	}
+
+	/**
+	 * Output the Members widget options form.
+	 *
+	 * @param array $instance Widget instance settings.
+	 *
+	 * @return string
+	 */
+	public function form( $instance ) {
+
+		// Get widget settings
+		$settings       = $this->parse_settings( $instance );
+		$title          = strip_tags( $settings['title'] );
+		$max_members    = strip_tags( $settings['max_members'] );
+		$member_default = strip_tags( $settings['member_default'] );
+		$link_title     = (bool) $settings['link_title']; ?>
+
+		<p>
+			<label for="bp-core-widget-title">
+				<?php esc_html_e( 'Title:', 'buddypress' ); ?>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" />
+			</label>
+		</p>
+
+		<p>
+			<label for="<?php echo $this->get_field_name( 'link_title' ) ?>">
+				<input type="checkbox" name="<?php echo $this->get_field_name( 'link_title' ) ?>" value="1" <?php checked( $link_title ) ?> />
+				<?php esc_html_e( 'Link widget title to Members directory', 'buddypress' ); ?>
+			</label>
+		</p>
+
+		<p>
+			<label for="bp-core-widget-members-max">
+				<?php esc_html_e( 'Max members to show:', 'buddypress' ); ?>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
+			</label>
+		</p>
+
+		<p>
+			<label for="bp-core-widget-groups-default"><?php esc_html_e( 'Default members to show:', 'buddypress' ); ?>
+				<select name="<?php echo $this->get_field_name( 'member_default' ) ?>">
+					<option value="newest"  <?php if ( 'newest'  === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Newest',  'buddypress' ); ?></option>
+					<option value="active"  <?php if ( 'active'  === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Active',  'buddypress' ); ?></option>
+					<option value="popular" <?php if ( 'popular' === $member_default ) : ?>selected="selected"<?php endif; ?>><?php esc_html_e( 'Popular', 'buddypress' ); ?></option>
+				</select>
+			</label>
+		</p>
+
+	<?php
+	}
+
+	/**
+	 * Merge the widget settings into defaults array.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $instance Widget instance settings.
+	 *
+	 * @uses bp_parse_args() To merge widget settings into defaults.
+	 *
+	 * @return array
+	 */
+	public function parse_settings( $instance = array() ) {
+		return bp_parse_args( $instance, array(
+			'title' 	     => __( 'Members', 'buddypress' ),
+			'max_members' 	 => 5,
+			'member_default' => 'active',
+			'link_title' 	 => false
+		), 'members_widget_settings' );
+	}
+}
+
+/**
+ * Who's Online Widget.
+ *
+ * @since BuddyPress (1.0.3)
+ */
+class BP_Core_Whos_Online_Widget extends WP_Widget {
+
+	/**
+	 * Constructor method.
+	 */
+	public function __construct() {
+		$name        = _x( "(BuddyPress) Who's Online", 'widget name', 'buddypress' );
+		$description = __( 'Profile photos of online users', 'buddypress' );
+		parent::__construct( false, $name, array(
+			'description' => $description,
+			'classname' => 'widget_bp_core_whos_online_widget buddypress widget',
+		) );
+	}
+
+	/**
+	 * Display the Who's Online widget.
+	 *
+	 * @see WP_Widget::widget() for description of parameters.
+	 *
+	 * @param array $args     Widget arguments.
+	 * @param array $instance Widget settings, as saved by the user.
+	 */
+	public function widget( $args, $instance ) {
+
+		// Get widget settings
+		$settings = $this->parse_settings( $instance );
+
+		/**
+		 * Filters the title of the Who's Online widget.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $settings The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $settings['title'], $settings, $this->id_base );
+
+		echo $args['before_widget']
+		   . $args['before_title']
+		   . $title
+		   . $args['after_title'];
+
+		// Setup args for querying members
+		$members_args = array(
+			'user_id'         => 0,
+			'type'            => 'online',
+			'per_page'        => $settings['max_members'],
+			'max'             => $settings['max_members'],
+			'populate_extras' => true,
+			'search_terms'    => false,
+		); ?>
+
+		<?php if ( bp_has_members( $members_args ) ) : ?>
+
+			<div class="avatar-block">
+
+				<?php while ( bp_members() ) : bp_the_member(); ?>
+
+					<div class="item-avatar">
+						<a href="<?php bp_member_permalink(); ?>" title="<?php bp_member_name(); ?>"><?php bp_member_avatar(); ?></a>
+					</div>
+
+				<?php endwhile; ?>
+
+			</div>
+
+		<?php else: ?>
+
+			<div class="widget-error">
+				<?php esc_html_e( 'There are no users currently online', 'buddypress' ); ?>
+			</div>
+
+		<?php endif; ?>
+
+		<?php echo $args['after_widget'];
+	}
+
+	/**
+	 * Update the Who's Online widget options.
+	 *
+	 * @param array $new_instance The new instance options.
+	 * @param array $old_instance The old instance options.
+	 *
+	 * @return array $instance     The parsed options to be saved.
+	 */
+	public function update( $new_instance, $old_instance ) {
+		$instance                = $old_instance;
+		$instance['title']       = strip_tags( $new_instance['title'] );
+		$instance['max_members'] = strip_tags( $new_instance['max_members'] );
+
+		return $instance;
+	}
+
+	/**
+	 * Output the Who's Online widget options form.
+	 *
+	 * @param array $instance Widget instance settings.
+	 *
+	 * @return string
+	 */
+	public function form( $instance ) {
+
+		// Get widget settings
+		$settings    = $this->parse_settings( $instance );
+		$title       = strip_tags( $settings['title'] );
+		$max_members = strip_tags( $settings['max_members'] ); ?>
+
+		<p>
+			<label for="bp-core-widget-title">
+				<?php esc_html_e( 'Title:', 'buddypress' ); ?>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" />
+			</label>
+		</p>
+
+		<p>
+			<label for="bp-core-widget-members-max">
+				<?php esc_html_e( 'Max Members to show:', 'buddypress' ); ?>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
+			</label>
+		</p>
+
+	<?php
+	}
+
+	/**
+	 * Merge the widget settings into defaults array.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $instance Widget instance settings.
+	 *
+	 * @uses bp_parse_args() To merge widget settings into defaults.
+	 *
+	 * @return array
+	 */
+	public function parse_settings( $instance = array() ) {
+		return bp_parse_args( $instance, array(
+			'title' 	     => __( "Who's Online", 'buddypress' ),
+			'max_members' 	 => 15,
+		), 'members_widget_settings' );
+	}
+}
+
+/**
+ * Recently Active Members Widget.
+ *
+ * @since BuddyPress (1.0.3)
+ */
+class BP_Core_Recently_Active_Widget extends WP_Widget {
+
+	/**
+	 * Constructor method.
+	 */
+	public function __construct() {
+		$name        = _x( '(BuddyPress) Recently Active Members', 'widget name', 'buddypress' );
+		$description = __( 'Profile photos of recently active members', 'buddypress' );
+		parent::__construct( false, $name, array(
+			'description' => $description,
+			'classname'   => 'widget_bp_core_recently_active_widget buddypress widget',
+		) );
+	}
+
+	/**
+	 * Display the Recently Active widget.
+	 *
+	 * @see WP_Widget::widget() for description of parameters.
+	 *
+	 * @param array $args     Widget arguments.
+	 * @param array $instance Widget settings, as saved by the user.
+	 */
+	public function widget( $args, $instance ) {
+
+		// Get widget settings
+		$settings = $this->parse_settings( $instance );
+
+		/**
+		 * Filters the title of the Recently Active widget.
+		 *
+		 * @since BuddyPress (1.8.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $settings The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $settings['title'], $settings, $this->id_base );
+
+		echo $args['before_widget'];
+		echo $args['before_title']
+		   . $title
+		   . $args['after_title'];
+
+		// Setup args for querying members
+		$members_args = array(
+			'user_id'         => 0,
+			'type'            => 'active',
+			'per_page'        => $settings['max_members'],
+			'max'             => $settings['max_members'],
+			'populate_extras' => true,
+			'search_terms'    => false,
+		); ?>
+
+		<?php if ( bp_has_members( $members_args ) ) : ?>
+
+			<div class="avatar-block">
+
+				<?php while ( bp_members() ) : bp_the_member(); ?>
+
+					<div class="item-avatar">
+						<a href="<?php bp_member_permalink(); ?>" title="<?php bp_member_name(); ?>"><?php bp_member_avatar(); ?></a>
+					</div>
+
+				<?php endwhile; ?>
+
+			</div>
+
+		<?php else: ?>
+
+			<div class="widget-error">
+				<?php esc_html_e( 'There are no recently active members', 'buddypress' ); ?>
+			</div>
+
+		<?php endif; ?>
+
+		<?php echo $args['after_widget'];
+	}
+
+	/**
+	 * Update the Recently Active widget options.
+	 *
+	 * @param array $new_instance The new instance options.
+	 * @param array $old_instance The old instance options.
+	 *
+	 * @return array $instance The parsed options to be saved.
+	 */
+	public function update( $new_instance, $old_instance ) {
+		$instance                = $old_instance;
+		$instance['title']       = strip_tags( $new_instance['title'] );
+		$instance['max_members'] = strip_tags( $new_instance['max_members'] );
+
+		return $instance;
+	}
+
+	/**
+	 * Output the Recently Active widget options form.
+	 *
+	 * @param array $instance Widget instance settings.
+	 *
+	 * @return string
+	 */
+	public function form( $instance ) {
+
+		// Get widget settings
+		$settings    = $this->parse_settings( $instance );
+		$title       = strip_tags( $settings['title'] );
+		$max_members = strip_tags( $settings['max_members'] ); ?>
+
+		<p>
+			<label for="bp-core-widget-members-title">
+				<?php esc_html_e( 'Title:', 'buddypress' ); ?>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" />
+			</label>
+		</p>
+
+		<p>
+			<label for="bp-core-widget-members-max">
+				<?php esc_html_e( 'Max Members to show:', 'buddypress' ); ?>
+				<input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo esc_attr( $max_members ); ?>" style="width: 30%" />
+			</label>
+		</p>
+
+	<?php
+	}
+
+	/**
+	 * Merge the widget settings into defaults array.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $instance Widget instance settings.
+	 *
+	 * @uses bp_parse_args() To merge widget settings into defaults.
+	 *
+	 * @return array
+	 */
+	public function parse_settings( $instance = array() ) {
+		return bp_parse_args( $instance, array(
+			'title' 	     => __( 'Recently Active Members', 'buddypress' ),
+			'max_members' 	 => 15,
+		), 'recently_active_members_widget_settings' );
+	}
+}
+
+/**
+ * AJAX request handler for Members widgets.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @see BP_Core_Members_Widget
+ */
+function bp_core_ajax_widget_members() {
+
+	check_ajax_referer( 'bp_core_widget_members' );
+
+	// Setup some variables to check
+	$filter      = ! empty( $_POST['filter']      ) ? $_POST['filter']                : 'recently-active-members';
+	$max_members = ! empty( $_POST['max-members'] ) ? absint( $_POST['max-members'] ) : 5;
+
+	// Determine the type of members query to perform
+	switch ( $filter ) {
+
+		// Newest activated
+		case 'newest-members' :
+			$type = 'newest';
+			break;
+
+		// Popular by friends
+		case 'popular-members' :
+			if ( bp_is_active( 'friends' ) ) {
+				$type = 'popular';
+			} else {
+				$type = 'active';
+			}
+			break;
+
+		// Default
+		case 'recently-active-members' :
+		default :
+			$type = 'active';
+			break;
+	}
+
+	// Setup args for querying members
+	$members_args = array(
+		'user_id'         => 0,
+		'type'            => $type,
+		'per_page'        => $max_members,
+		'max'             => $max_members,
+		'populate_extras' => true,
+		'search_terms'    => false,
+	);
+
+	// Query for members
+	if ( bp_has_members( $members_args ) ) : ?>
+		<?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?>
+		<?php while ( bp_members() ) : bp_the_member(); ?>
+			<li class="vcard">
+				<div class="item-avatar">
+					<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
+				</div>
+
+				<div class="item">
+					<div class="item-title fn"><a href="<?php bp_member_permalink(); ?>" title="<?php bp_member_name(); ?>"><?php bp_member_name(); ?></a></div>
+					<?php if ( 'active' === $type ) : ?>
+						<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
+					<?php elseif ( 'newest' === $type ) : ?>
+						<div class="item-meta"><span class="activity"><?php bp_member_registered(); ?></span></div>
+					<?php elseif ( bp_is_active( 'friends' ) ) : ?>
+						<div class="item-meta"><span class="activity"><?php bp_member_total_friend_count(); ?></span></div>
+					<?php endif; ?>
+				</div>
+			</li>
+
+		<?php endwhile; ?>
+
+	<?php else: ?>
+		<?php echo "-1[[SPLIT]]<li>"; ?>
+		<?php esc_html_e( 'There were no members found, please try another filter.', 'buddypress' ) ?>
+		<?php echo "</li>"; ?>
+	<?php endif;
+}
+add_action( 'wp_ajax_widget_members',        'bp_core_ajax_widget_members' );
+add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' );
diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-signup.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-signup.php
new file mode 100644
index 0000000000000000000000000000000000000000..9af77c8990cac1c2c2d7ac1c48baa5ab01b2a5c6
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-signup.php
@@ -0,0 +1,795 @@
+<?php
+
+/**
+ * Signups Management class.
+ *
+ * @package BuddyPress
+ * @subpackage coreClasses
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_Signup {
+
+	/**
+	 * ID of the signup which the object relates to.
+	 *
+	 * @var integer
+	 */
+	public $id;
+
+	/**
+	 * The URL to the full size of the avatar for the user.
+	 *
+	 * @var string
+	 */
+	public $avatar;
+
+	/**
+	 * The username for the user.
+	 *
+	 * @var string
+	 */
+	public $user_login;
+
+	/**
+	 * The email for the user.
+	 *
+	 * @var string
+	 */
+	public $user_email;
+
+	/**
+	 * The full name of the user.
+	 *
+	 * @var string
+	 */
+	public $user_name;
+
+	/**
+	 * Metadata associated with the signup.
+	 *
+	 * @var array
+	 */
+	public $meta;
+
+	/**
+	 * The registered date for the user.
+	 *
+	 * @var string
+	 */
+	public $registered;
+
+	/**
+	 * The activation key for the user.
+	 *
+	 * @var string
+	 */
+	public $activation_key;
+
+
+	/** Public Methods *******************************************************/
+
+	/**
+	 * Class constructor.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param integer $signup_id The ID for the signup being queried.
+	 */
+	public function __construct( $signup_id = 0 ) {
+		if ( !empty( $signup_id ) ) {
+			$this->id = $signup_id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Populate the instantiated class with data based on the signup_id provided.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$signups_table = buddypress()->members->table_name_signups;
+		$signup        = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$signups_table} WHERE signup_id = %d AND active = 0", $this->id ) );
+
+		$this->avatar         = get_avatar( $signup->user_email, 32 );
+		$this->user_login     = $signup->user_login;
+		$this->user_email     = $signup->user_email;
+		$this->meta           = maybe_unserialize( $signup->meta );
+		$this->user_name      = ! empty( $this->meta['field_1'] ) ? wp_unslash( $this->meta['field_1'] ) : '';
+		$this->registered     = $signup->registered;
+		$this->activation_key = $signup->activation_key;
+	}
+
+	/** Static Methods *******************************************************/
+
+	/**
+	 * Fetch signups based on parameters.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $args the argument to retrieve desired signups.
+	 *
+	 * @return array {
+	 *     @type array $signups Located signups.
+	 *     @type int   $total   Total number of signups matching params.
+	 * }
+	 */
+	public static function get( $args = array() ) {
+		global $wpdb;
+
+		$r = bp_parse_args( $args,
+			array(
+				'offset'         => 0,
+				'number'         => 1,
+				'usersearch'     => false,
+				'orderby'        => 'signup_id',
+				'order'          => 'DESC',
+				'include'        => false,
+				'activation_key' => '',
+				'user_login'     => '',
+			),
+			'bp_core_signups_get_args'
+		);
+
+		// @todo whitelist sanitization
+		if ( $r['orderby'] !== 'signup_id' ) {
+			$r['orderby'] = 'user_' . $r['orderby'];
+		}
+
+		$r['orderby'] = sanitize_title( $r['orderby'] );
+
+		$sql = array();
+		$signups_table  = buddypress()->members->table_name_signups;
+		$sql['select']  = "SELECT * FROM {$signups_table}";
+		$sql['where']   = array();
+		$sql['where'][] = "active = 0";
+
+		if ( empty( $r['include'] ) ) {
+
+			// Search terms
+			if ( ! empty( $r['usersearch'] ) ) {
+				$search_terms_like = '%' . bp_esc_like( $r['usersearch'] ) . '%';
+				$sql['where'][]    = $wpdb->prepare( "( user_login LIKE %s OR user_email LIKE %s OR meta LIKE %s )", $search_terms_like, $search_terms_like, $search_terms_like );
+			}
+
+			// Activation key
+			if ( ! empty( $r['activation_key'] ) ) {
+				$sql['where'][] = $wpdb->prepare( "activation_key = %s", $r['activation_key'] );
+			}
+
+			// User login
+			if ( ! empty( $r['user_login'] ) ) {
+				$sql['where'][] = $wpdb->prepare( "user_login = %s", $r['user_login'] );
+			}
+
+			$sql['orderby'] = "ORDER BY {$r['orderby']}";
+			$sql['order']	= bp_esc_sql_order( $r['order'] );
+			$sql['limit']	= $wpdb->prepare( "LIMIT %d, %d", $r['offset'], $r['number'] );
+		} else {
+			$in = implode( ',', wp_parse_id_list( $r['include'] ) );
+			$sql['in'] = "AND signup_id IN ({$in})";
+		}
+
+		// Implode WHERE clauses
+		$sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] );
+
+		/**
+		 * Filters the Signups paged query.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $value SQL statement.
+		 * @param array  $sql   Array of SQL statement parts.
+		 * @param array  $args  Array of original arguments for get() method.
+		 * @param array  $r     Array of parsed arguments for get() method.
+		 */
+		$paged_signups = $wpdb->get_results( apply_filters( 'bp_members_signups_paged_query', join( ' ', $sql ), $sql, $args, $r ) );
+
+		if ( empty( $paged_signups ) ) {
+			return array( 'signups' => false, 'total' => false );
+		}
+
+		// Used to calculate a diff between now & last
+		// time an activation link has been resent
+		$now = current_time( 'timestamp', true );
+
+		foreach ( (array) $paged_signups as $key => $signup ) {
+
+			$signup->id   = intval( $signup->signup_id );
+
+			$signup->meta = ! empty( $signup->meta ) ? maybe_unserialize( $signup->meta ) : false;
+
+			$signup->user_name = '';
+			if ( ! empty( $signup->meta['field_1'] ) ) {
+				$signup->user_name = wp_unslash( $signup->meta['field_1'] );
+			}
+
+			// Sent date defaults to date of registration
+			if ( ! empty( $signup->meta['sent_date'] ) ) {
+				$signup->date_sent = $signup->meta['sent_date'];
+			} else {
+				$signup->date_sent = $signup->registered;
+			}
+
+			$sent_at = mysql2date('U', $signup->date_sent );
+			$diff    = $now - $sent_at;
+
+			/**
+			 * add a boolean in case the last time an activation link
+			 * has been sent happened less than a day ago
+			 */
+			if ( $diff < 1 * DAY_IN_SECONDS ) {
+				$signup->recently_sent = true;
+			}
+
+			if ( ! empty( $signup->meta['count_sent'] ) ) {
+				$signup->count_sent = absint( $signup->meta['count_sent'] );
+			} else {
+				$signup->count_sent = 1;
+			}
+
+			$paged_signups[ $key ] = $signup;
+		}
+
+		unset( $sql['limit'] );
+		$sql['select'] = preg_replace( "/SELECT.*?FROM/", "SELECT COUNT(*) FROM", $sql['select'] );
+
+		/**
+		 * Filters the Signups count query.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $value SQL statement.
+		 * @param array  $sql   Array of SQL statement parts.
+		 * @param array  $args  Array of original arguments for get() method.
+		 * @param array  $r     Array of parsed arguments for get() method.
+		 */
+		$total_signups = $wpdb->get_var( apply_filters( 'bp_members_signups_count_query', join( ' ', $sql ), $sql, $args, $r ) );
+
+		return array( 'signups' => $paged_signups, 'total' => $total_signups );
+	}
+
+	/**
+	 * Add a signup.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $args
+	 *
+	 * @return int|bool ID of newly created signup on success, false on
+	 *                  failure.
+	 */
+	public static function add( $args = array() ) {
+		global $wpdb;
+
+		$r = bp_parse_args( $args,
+			array(
+				'domain'         => '',
+				'path'           => '',
+				'title'          => '',
+				'user_login'     => '',
+				'user_email'     => '',
+				'registered'     => current_time( 'mysql', true ),
+				'activation_key' => '',
+				'meta'           => '',
+			),
+			'bp_core_signups_add_args'
+		);
+
+		$r['meta'] = maybe_serialize( $r['meta'] );
+
+		$inserted = $wpdb->insert(
+			buddypress()->members->table_name_signups,
+			$r,
+			array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )
+		);
+
+		if ( $inserted ) {
+			$retval = $wpdb->insert_id;
+		} else {
+			$retval = false;
+		}
+
+		/**
+		 * Filters the result of a signup addition.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int|bool $retval Newly added user ID on success, false on failure.
+		 */
+		return apply_filters( 'bp_core_signups_add', $retval );
+	}
+
+	/**
+	 * Create a WP user at signup.
+	 *
+	 * Since BP 2.0, non-multisite configurations have stored signups in
+	 * the same way as Multisite configs traditionally have: in the
+	 * wp_signups table. However, because some plugins may be looking
+	 * directly in the wp_users table for non-activated signups, we
+	 * mirror signups there by creating "phantom" users, mimicking WP's
+	 * default behavior.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $user_login    User login string.
+	 * @param string $user_password User password.
+	 * @param string $user_email    User email address.
+	 * @param array  $usermeta      Metadata associated with the signup.
+	 *
+	 * @return int User id.
+	 */
+	public static function add_backcompat( $user_login = '', $user_password = '', $user_email = '', $usermeta = array() ) {
+		global $wpdb;
+
+		$user_id = wp_insert_user( array(
+			'user_login'   => $user_login,
+			'user_pass'    => $user_password,
+			'display_name' => sanitize_title( $user_login ),
+			'user_email'   => $user_email
+		) );
+
+		if ( is_wp_error( $user_id ) || empty( $user_id ) ) {
+			return $user_id;
+		}
+
+		// Update the user status to '2', ie "not activated"
+		// (0 = active, 1 = spam, 2 = not active)
+		$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 2 WHERE ID = %d", $user_id ) );
+
+		// WordPress creates these options automatically on
+		// wp_insert_user(), but we delete them so that inactive
+		// signups don't appear in various user counts.
+		delete_user_option( $user_id, 'capabilities' );
+		delete_user_option( $user_id, 'user_level'   );
+
+		// Set any profile data
+		if ( bp_is_active( 'xprofile' ) ) {
+			if ( ! empty( $usermeta['profile_field_ids'] ) ) {
+				$profile_field_ids = explode( ',', $usermeta['profile_field_ids'] );
+
+				foreach ( (array) $profile_field_ids as $field_id ) {
+					if ( empty( $usermeta["field_{$field_id}"] ) ) {
+						continue;
+					}
+
+					$current_field = $usermeta["field_{$field_id}"];
+					xprofile_set_field_data( $field_id, $user_id, $current_field );
+
+					// Save the visibility level
+					$visibility_level = ! empty( $usermeta['field_' . $field_id . '_visibility'] ) ? $usermeta['field_' . $field_id . '_visibility'] : 'public';
+					xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
+				}
+			}
+		}
+
+		/**
+		 * Filters the user ID for the backcompat functionality.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int $user_id User ID being registered.
+		 */
+		return apply_filters( 'bp_core_signups_add_backcompat', $user_id );
+	}
+
+	/**
+	 * Check a user status (from wp_users) on a non-multisite config.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param int $user_id ID of the user being checked.
+	 *
+	 * @return int|bool The status if found, otherwise false.
+	 */
+	public static function check_user_status( $user_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) ) {
+			return false;
+		}
+
+		$user_status = $wpdb->get_var( $wpdb->prepare( "SELECT user_status FROM {$wpdb->users} WHERE ID = %d", $user_id ) );
+
+		/**
+		 * Filters the user status of a provided user ID.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int $value User status of the provided user ID.
+		 */
+		return apply_filters( 'bp_core_signups_check_user_status', intval( $user_status ) );
+	}
+
+	/**
+	 * Activate a signup.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $key Activation key.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public static function validate( $key = '' ) {
+		global $wpdb;
+
+		if ( empty( $key ) ) {
+			return;
+		}
+
+		$activated = $wpdb->update(
+			// Signups table
+			buddypress()->members->table_name_signups,
+			array(
+				'active' => 1,
+				'activated' => current_time( 'mysql', true ),
+			),
+			array(
+				'activation_key' => $key,
+			),
+			// Data sanitization format
+			array(
+				'%d',
+				'%s',
+			),
+			// WHERE sanitization format
+			array(
+				'%s',
+			)
+		);
+
+		/**
+		 * Filters the status of the activated user.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param bool $activated Whether or not the activation was successful.
+		 */
+		return apply_filters( 'bp_core_signups_validate', $activated );
+	}
+
+	/**
+	 * How many inactive signups do we have?
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @return int The number of signups.
+	 */
+	public static function count_signups() {
+		global $wpdb;
+
+		$signups_table = buddypress()->members->table_name_signups;
+		$count_signups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) AS total FROM {$signups_table} WHERE active = %d", 0 ) );
+
+		/**
+		 * Filters the total inactive signups.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int $count_signups How many total signups there are.
+		 */
+		return apply_filters( 'bp_core_signups_count', (int) $count_signups );
+	}
+
+	/**
+	 * Update the meta for a signup.
+	 *
+	 * This is the way we use to "trace" the last date an activation
+	 * email was sent and how many times activation was sent.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $args
+	 *
+	 * @return int The signup id
+	 */
+	public static function update( $args = array() ) {
+		global $wpdb;
+
+		$r = bp_parse_args( $args,
+			array(
+				'signup_id'  => 0,
+				'meta'       => array(),
+			),
+			'bp_core_signups_update_args'
+		);
+
+		if ( empty( $r['signup_id'] ) || empty( $r['meta'] ) ) {
+			return false;
+		}
+
+		$wpdb->update(
+			// Signups table
+			buddypress()->members->table_name_signups,
+			// Data to update
+			array(
+				'meta' => serialize( $r['meta'] ),
+			),
+			// WHERE
+			array(
+				'signup_id' => $r['signup_id'],
+			),
+			// Data sanitization format
+			array(
+				'%s',
+			),
+			// WHERE sanitization format
+			array(
+				'%d',
+			)
+		);
+
+		/**
+		 * Filters the signup ID which received a meta update.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int $value The signup ID.
+		 */
+		return apply_filters( 'bp_core_signups_update', $r['signup_id'] );
+	}
+
+	/**
+	 * Resend an activation email.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $signup_ids Single ID or list of IDs to resend.
+	 *
+	 * @return array
+	 */
+	public static function resend( $signup_ids = array() ) {
+		if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) {
+			return false;
+		}
+
+		$to_resend = self::get( array(
+			'include' => $signup_ids,
+		) );
+
+		if ( ! $signups = $to_resend['signups'] ) {
+			return false;
+		}
+
+		$result = array();
+
+		/**
+		 * Fires before activation emails are resent.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $signup_ids Array of IDs to resend activation emails to.
+		 */
+		do_action( 'bp_core_signup_before_resend', $signup_ids );
+
+		foreach ( $signups as $signup ) {
+
+			$meta               = $signup->meta;
+			$meta['sent_date']  = current_time( 'mysql', true );
+			$meta['count_sent'] = $signup->count_sent + 1;
+
+			// Send activation email
+			if ( is_multisite() ) {
+				wpmu_signup_user_notification( $signup->user_login, $signup->user_email, $signup->activation_key, serialize( $meta ) );
+			} else {
+
+				// Check user status before sending email
+				$user_id = email_exists( $signup->user_email );
+
+				if ( ! empty( $user_id ) && 2 != self::check_user_status( $user_id ) ) {
+
+					// Status is not 2, so user's account has been activated
+					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
+
+					// repair signups table
+					self::validate( $signup->activation_key );
+
+					continue;
+
+				// Send the validation email
+				} else {
+					bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key );
+				}
+			}
+
+			// Update metas
+			$result['resent'][] = self::update( array(
+				'signup_id' => $signup->signup_id,
+				'meta'      => $meta,
+			) );
+		}
+
+		/**
+		 * Fires after activation emails are resent.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $signup_ids Array of IDs to resend activation emails to.
+		 * @param array $result     Updated metadata related to activation emails.
+		 */
+		do_action( 'bp_core_signup_after_resend', $signup_ids, $result );
+
+		/**
+		 * Filters the result of the metadata for signup activation email resends.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $result Updated metadata related to activation emails.
+		 */
+		return apply_filters( 'bp_core_signup_resend', $result );
+	}
+
+	/**
+	 * Activate a pending account.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $signup_ids Single ID or list of IDs to activate.
+	 *
+	 * @return array
+	 */
+	public static function activate( $signup_ids = array() ) {
+		if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) {
+			return false;
+		}
+
+		$to_activate = self::get( array(
+			'include' => $signup_ids,
+		) );
+
+		if ( ! $signups = $to_activate['signups'] ) {
+			return false;
+		}
+
+		$result = array();
+
+		/**
+		 * Fires before activation of user accounts.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $signup_ids Array of IDs to activate.
+		 */
+		do_action( 'bp_core_signup_before_activate', $signup_ids );
+
+		foreach ( $signups as $signup ) {
+
+			$user = bp_core_activate_signup( $signup->activation_key );
+
+			if ( ! empty( $user->errors ) ) {
+
+				$user_id = username_exists( $signup->user_login );
+
+				if ( 2 !== self::check_user_status( $user_id ) ) {
+					$user_id = false;
+				}
+
+				if ( empty( $user_id ) ) {
+
+					// Status is not 2, so user's account has been activated
+					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
+
+					// repair signups table
+					self::validate( $signup->activation_key );
+
+				// we have a user id, account is not active, let's delete it
+				} else {
+					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, $user->get_error_message() );
+				}
+
+			} else {
+				$result['activated'][] = $user;
+			}
+		}
+
+		/**
+		 * Fires after activation of user accounts.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $signup_ids Array of IDs activated activate.
+		 * @param array $result     Array of data for activated accounts.
+		 */
+		do_action( 'bp_core_signup_after_activate', $signup_ids, $result );
+
+		/**
+		 * Filters the result of the metadata after user activation.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $result Updated metadata related to user activation.
+		 */
+		return apply_filters( 'bp_core_signup_activate', $result );
+	}
+
+	/**
+	 * Delete a pending account.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $signup_ids Single ID or list of IDs to delete.
+	 *
+	 * @return array
+	 */
+	public static function delete( $signup_ids = array() ) {
+		global $wpdb;
+
+		if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) {
+			return false;
+		}
+
+		$to_delete = self::get( array(
+			'include' => $signup_ids,
+		) );
+
+		if ( ! $signups = $to_delete['signups'] ) {
+			return false;
+		}
+
+		$result = array();
+
+		/**
+		 * Fires before deletion of pending accounts.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $signup_ids Array of pending IDs to delete.
+		 */
+		do_action( 'bp_core_signup_before_delete', $signup_ids );
+
+		foreach ( $signups as $signup ) {
+			$user_id = username_exists( $signup->user_login );
+
+			if ( ! empty( $user_id ) && $signup->activation_key == wp_hash( $user_id ) ) {
+
+				if ( 2 != self::check_user_status( $user_id ) ) {
+
+					// Status is not 2, so user's account has been activated
+					$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
+
+					// repair signups table
+					self::validate( $signup->activation_key );
+
+				// we have a user id, account is not active, let's delete it
+				} else {
+					bp_core_delete_account( $user_id );
+				}
+			}
+
+			if ( empty( $result['errors'][ $signup->signup_id ] ) ) {
+				$wpdb->delete(
+					// Signups table
+					buddypress()->members->table_name_signups,
+					// Where
+					array( 'signup_id' => $signup->signup_id, ),
+					// WHERE sanitization format
+					array( '%d', )
+				);
+
+				$result['deleted'][] = $signup->signup_id;
+			}
+		}
+
+		/**
+		 * Fires after deletion of pending accounts.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $signup_ids Array of pending IDs to delete.
+		 * @param array $result     Array of data for deleted accounts.
+		 */
+		do_action( 'bp_core_signup_after_delete', $signup_ids, $result );
+
+		/**
+		 * Filters the result of the metadata for deleted pending accounts.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $result Updated metadata related to deleted pending accounts.
+		 */
+		return apply_filters( 'bp_core_signup_delete', $result );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
index 3c44904c14220661f4ebecddc166a248a6db0a54..e471f82ce9a995cf6b5c7e7c46c466a05beeed4d 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Messages Actions
+ * BuddyPress Messages Actions.
  *
  * Action functions are exactly the same as screen functions, however they do
  * not have a template screen associated with them. Usually they will send the
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Process a request to view a single message thread.
@@ -47,7 +47,7 @@ function messages_action_conversation() {
 		if ( ! empty( $new_reply ) ) {
 			bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) );
 		} else {
-			bp_core_add_message( __( 'There was a problem sending your reply, please try again', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was a problem sending your reply. Please try again.', 'buddypress' ), 'error' );
 		}
 
 		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' );
@@ -56,6 +56,11 @@ function messages_action_conversation() {
 	// Mark message read
 	messages_mark_thread_read( $thread_id );
 
+	/**
+	 * Fires after processing a view request for a single message thread.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
 	do_action( 'messages_action_conversation' );
 }
 add_action( 'bp_actions', 'messages_action_conversation' );
@@ -91,6 +96,155 @@ function messages_action_delete_message() {
 }
 add_action( 'bp_actions', 'messages_action_delete_message' );
 
+/**
+ * Handle marking a single message thread as read.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return bool|null Returns false on failure. Otherwise redirects back to the
+ *                   message box URL.
+ */
+function bp_messages_action_mark_read() {
+
+	if ( ! bp_is_messages_component() || bp_is_current_action( 'notices' ) || ! bp_is_action_variable( 'read', 0 ) ) {
+		return false;
+	}
+
+	$action = ! empty( $_GET['action'] ) ? $_GET['action'] : '';
+	$nonce  = ! empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : '';
+	$id     = ! empty( $_GET['message_id'] ) ? intval( $_GET['message_id'] ) : '';
+
+	// Bail if no action or no ID.
+	if ( 'read' !== $action || empty( $id ) || empty( $nonce ) ) {
+		return false;
+	}
+
+	// Check the nonce.
+	if ( ! bp_verify_nonce_request( 'bp_message_thread_mark_read_' . $id ) ) {
+		return false;
+	}
+
+	// Check access to the message and mark as read.
+	if ( messages_check_thread_access( $id ) ) {
+		messages_mark_thread_read( $id );
+		bp_core_add_message( __( 'Message marked as read.', 'buddypress' ) );
+	} else {
+		bp_core_add_message( __( 'There was a problem marking that message.', 'buddypress' ), 'error' );
+	}
+
+	// Redirect back to the message box.
+	bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+}
+add_action( 'bp_actions', 'bp_messages_action_mark_read' );
+
+/**
+ * Handle marking a single message thread as unread.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return bool|null Returns false on failure. Otherwise redirects back to the
+ *                   message box URL.
+ */
+function bp_messages_action_mark_unread() {
+
+	if ( ! bp_is_messages_component() || bp_is_current_action( 'notices' ) || ! bp_is_action_variable( 'unread', 0 ) ) {
+		return false;
+	}
+
+	$action = ! empty( $_GET['action'] ) ? $_GET['action'] : '';
+	$nonce  = ! empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : '';
+	$id     = ! empty( $_GET['message_id'] ) ? intval( $_GET['message_id'] ) : '';
+
+	// Bail if no action or no ID.
+	if ( 'unread' !== $action || empty( $id ) || empty( $nonce ) ) {
+		return false;
+	}
+
+	// Check the nonce.
+	if ( ! bp_verify_nonce_request( 'bp_message_thread_mark_unread_' . $id ) ) {
+		return false;
+	}
+
+	// Check access to the message and mark unread.
+	if ( messages_check_thread_access( $id ) ) {
+		messages_mark_thread_unread( $id );
+		bp_core_add_message( __( 'Message marked unread.', 'buddypress' ) );
+	} else {
+		bp_core_add_message( __( 'There was a problem marking that message.', 'buddypress' ), 'error' );
+	}
+
+	// Redirect back to the message box URL.
+	bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
+}
+add_action( 'bp_actions', 'bp_messages_action_mark_unread' );
+
+/**
+ * Handle bulk management (mark as read/unread, delete) of message threads.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return bool Returns false on failure. Otherwise redirects back to the
+ *              message box URL.
+ */
+function bp_messages_action_bulk_manage() {
+
+	if ( ! bp_is_messages_component() || bp_is_current_action( 'notices' ) || ! bp_is_action_variable( 'bulk-manage', 0 ) ) {
+		return false;
+	}
+
+	$action   = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : '';
+	$nonce    = ! empty( $_POST['messages_bulk_nonce'] ) ? $_POST['messages_bulk_nonce'] : '';
+	$messages = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : '';
+
+	$messages = wp_parse_id_list( $messages );
+
+	// Bail if no action or no IDs.
+	if ( ( ! in_array( $action, array( 'delete', 'read', 'unread' ) ) ) || empty( $messages ) || empty( $nonce ) ) {
+		bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' );
+	}
+
+	// Check the nonce.
+	if ( ! wp_verify_nonce( $nonce, 'messages_bulk_nonce' ) ) {
+		return false;
+	}
+
+	// Make sure the user has access to all notifications before managing them.
+	foreach ( $messages as $message ) {
+		if ( ! messages_check_thread_access( $message ) ) {
+			bp_core_add_message( __( 'There was a problem managing your messages.', 'buddypress' ), 'error' );
+			bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' );
+		}
+	}
+
+	// Delete, mark as read or unread depending on the user 'action'.
+	switch ( $action ) {
+		case 'delete' :
+			foreach ( $messages as $message ) {
+				messages_delete_thread( $message );
+			}
+			bp_core_add_message( __( 'Messages deleted.', 'buddypress' ) );
+		break;
+
+		case 'read' :
+			foreach ( $messages as $message ) {
+				messages_mark_thread_read( $message );
+			}
+			bp_core_add_message( __( 'Messages marked as read', 'buddypress' ) );
+		break;
+
+		case 'unread' :
+			foreach ( $messages as $message ) {
+				messages_mark_thread_unread( $message );
+			}
+			bp_core_add_message( __( 'Messages marked as unread.', 'buddypress' ) );
+		break;
+	}
+
+	// Redirect back to message box.
+	bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' );
+}
+add_action( 'bp_actions', 'bp_messages_action_bulk_manage' );
+
 /**
  * Process a request to bulk delete messages.
  *
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
index ef0e2f95ae97d07717d70f8eb53d296aa913b9e3..53ea6cd3941cfe47096c87f6c421fb302f66fa75 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Messages Caching
+ * BuddyPress Messages Caching.
  *
  * Caching functions handle the clearing of cached objects and pages on specific
  * actions throughout BuddyPress.
@@ -10,7 +10,30 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Slurp up metadata for a set of messages.
+ *
+ * It grabs all message meta associated with all of the messages passed in
+ * $message_ids and adds it to WP cache. This improves efficiency when using
+ * message meta within a loop context.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int|string|array|bool $message_ids Accepts a single message_id, or a
+ *                                           comma-separated list or array of message ids.
+ */
+function bp_messages_update_meta_cache( $message_ids = false ) {
+	bp_update_meta_cache( array(
+		'object_ids' 	   => $message_ids,
+		'object_type' 	   => buddypress()->messages->id,
+		'cache_group'      => 'message_meta',
+		'object_column'    => 'message_id',
+		'meta_table' 	   => buddypress()->messages->table_name_meta,
+		'cache_key_prefix' => 'bp_messages_meta'
+	) );
+}
 
 // List actions to clear super cached pages on, if super cache is installed
 add_action( 'messages_delete_thread',  'bp_core_clear_cache' );
@@ -23,31 +46,45 @@ add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' );
 add_action( 'messages_screen_inbox',   'bp_core_clear_cache' );
 
 /**
- * Clear unread count cache for each recipient after a message is sent.
+ * Clear message cache after a message is saved.
  *
  * @since BuddyPress (2.0.0)
  *
  * @param BP_Messages_Message $message
  */
-function bp_messages_clear_unread_count_cache_on_message_save( BP_Messages_Message $message ) {
+function bp_messages_clear_cache_on_message_save( BP_Messages_Message $message ) {
+	// Delete thread cache
+	wp_cache_delete( $message->thread_id, 'bp_messages_threads' );
+
+	// Delete unread count for each recipient
 	foreach ( (array) $message->recipients as $recipient ) {
 		wp_cache_delete( $recipient->user_id, 'bp_messages_unread_count' );
 	}
+
+	// Delete thread recipient cache
+	wp_cache_delete( 'thread_recipients_' . $message->thread_id, 'bp_messages' );
 }
-add_action( 'messages_message_after_save', 'bp_messages_clear_unread_count_cache_on_message_save' );
+add_action( 'messages_message_after_save', 'bp_messages_clear_cache_on_message_save' );
 
 /**
- * Clear unread count cache for the logged-in user after a message is deleted.
+ * Clear message cache after a message thread is deleted.
  *
  * @since BuddyPress (2.0.0)
  *
- * @param int|array $thread_ids If single thread, the thread ID. Otherwise, an
- *  array of thread IDs
+ * @param int|array $thread_ids If single thread, the thread ID.
+ *                              Otherwise, an array of thread IDs.
  */
-function bp_messages_clear_unread_count_cache_on_message_delete( $thread_ids ) {
+function bp_messages_clear_cache_on_message_delete( $thread_ids ) {
+	// Delete thread and thread recipient cache
+	foreach( (array) $thread_ids as $thread_id ) {
+		wp_cache_delete( $thread_id, 'bp_messages_threads' );
+		wp_cache_delete( "thread_recipients_{$thread_id}", 'bp_messages' );
+	}
+
+	// Delete unread count for logged-in user
 	wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
 }
-add_action( 'messages_before_delete_thread', 'bp_messages_clear_unread_count_cache_on_message_delete' );
+add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete' );
 
 /**
  * Invalidate cache for notices.
@@ -55,6 +92,8 @@ add_action( 'messages_before_delete_thread', 'bp_messages_clear_unread_count_cac
  * Currently, invalidates active notice cache.
  *
  * @since BuddyPress (2.0.0)
+ *
+ * @param BP_Messages_Notice $notice
  */
 function bp_notices_clear_cache( $notice ) {
 	wp_cache_delete( 'active_notice', 'bp_messages' );
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
index 28e202f419260692aa29555c9e78fcaf66597835..e9c9b383584074f0f9945c2f97649b8a0e55e183 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * BuddyPress Messages Classes
  *
@@ -8,968 +7,8 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
-
-/**
- * BuddyPress Message Thread class.
- *
- * @since BuddyPress (1.0.0)
- */
-class BP_Messages_Thread {
-	/**
-	 * The message thread ID.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 * @var int
-	 */
-	public $thread_id;
-
-	/**
-	 * The current messages.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 * @var object
-	 */
-	public $messages;
-
-	/**
-	 * The current recipients in the message thread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 * @var object
-	 */
-	public $recipients;
-
-	/**
-	 * The user IDs of all messages in the message thread.
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var array
-	 */
-	public $sender_ids;
-
-	/**
-	 * The unread count for the logged-in user.
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var int
-	 */
-	public $unread_count;
-
-	/**
-	 * The content of the last message in this thread
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var string
-	 */
-	public $last_message_content;
-
-	/**
-	 * The date of the last message in this thread
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var string
-	 */
-	public $last_message_date;
-
-	/**
-	 * The ID of the last message in this thread
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var int
-	 */
-	public $last_message_id;
-
-	/**
-	 * The subject of the last message in this thread
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var string
-	 */
-	public $last_message_subject;
-
-	/**
-	 * The user ID of the author of the last message in this thread
-	 *
-	 * @since BuddyPress (1.2.0)
-	 * @var int
-	 */
-	public $last_sender_id;
-
-	/**
-	 * Sort order of the messages in this thread (ASC or DESC).
-	 *
-	 * @since BuddyPress (1.5.0)
-	 * @var string
-	 */
-	public $messages_order;
-
-	/**
-	 * Constructor.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 * @param string $order The order to sort the messages. Either 'ASC' or 'DESC'.
-	 */
-	public function __construct( $thread_id = false, $order = 'ASC' ) {
-		if ( $thread_id ) {
-			$this->populate( $thread_id, $order );
-		}
-	}
-
-	/**
-	 * Populate method.
-	 *
-	 * Used in constructor.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 * @param string $order The order to sort the messages. Either 'ASC' or 'DESC'.
-	 */
-	public function populate( $thread_id, $order ) {
-		global $wpdb, $bp;
-
-		if( 'ASC' != $order && 'DESC' != $order ) {
-			$order= 'ASC';
-		}
-
-		$this->messages_order = $order;
-		$this->thread_id      = $thread_id;
-
-		if ( !$this->messages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE thread_id = %d ORDER BY date_sent " . $order, $this->thread_id ) ) ) {
-			return false;
-		}
-
-		foreach ( (array) $this->messages as $key => $message ) {
-			$this->sender_ids[$message->sender_id] = $message->sender_id;
-		}
-
-		// Fetch the recipients
-		$this->recipients = $this->get_recipients();
-
-		// Get the unread count for the logged in user
-		if ( isset( $this->recipients[bp_loggedin_user_id()] ) ) {
-			$this->unread_count = $this->recipients[bp_loggedin_user_id()]->unread_count;
-		}
-	}
-
-	/**
-	 * Mark a thread initialized in this class as read.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @see BP_Messages_Thread::mark_as_read()
-	 */
-	public function mark_read() {
-		BP_Messages_Thread::mark_as_read( $this->thread_id );
-	}
-
-	/**
-	 * Mark a thread initialized in this class as unread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @see BP_Messages_Thread::mark_as_unread()
-	 */
-	public function mark_unread() {
-		BP_Messages_Thread::mark_as_unread( $this->thread_id );
-	}
-
-	/**
-	 * Returns recipients for a message thread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return object
-	 */
-	public function get_recipients() {
-		global $wpdb, $bp;
-
-		$recipients = array();
-		$results    = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
-
-		foreach ( (array) $results as $recipient )
-			$recipients[$recipient->user_id] = $recipient;
-
-		return $recipients;
-	}
-
-	/** Static Functions ******************************************************/
-
-	/**
-	 * Delete a message thread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID
-	 * @return bool
-	 */
-	public static function delete( $thread_id ) {
-		global $wpdb, $bp;
-
-		// Mark messages as deleted
-		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET is_deleted = 1 WHERE thread_id = %d AND user_id = %d", $thread_id, bp_loggedin_user_id() ) );
-
-		// Get the message id in order to pass to the action
-		$message_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
-
-		// Check to see if any more recipients remain for this message
-		// if not, then delete the message from the database.
-		$recipients = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND is_deleted = 0", $thread_id ) );
-
-		if ( empty( $recipients ) ) {
-			// Delete all the messages
-			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
-
-			// Delete all the recipients
-			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ) );
-		}
-
-		do_action( 'messages_thread_deleted_thread', $message_id );
-
-		return true;
-	}
-
-	/**
-	 * Get current message threads for a user.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int    $user_id The user ID.
-	 * @param string $box  The type of mailbox to get. Either 'inbox' or 'sentbox'.
-	 *                     Defaults to 'inbox'.
-	 * @param string $type The type of messages to get. Either 'all' or 'unread'
-	 *                     or 'read'. Defaults to 'all'.
-	 * @param int    $limit The number of messages to get. Defaults to null.
-	 * @param int    $page  The page number to get. Defaults to null.
-	 * @param string $search_terms The search term to use. Defaults to ''.
-	 * @return array|bool Array on success. Boolean false on failure.
-	 */
-	public static function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null, $search_terms = '' ) {
-		global $wpdb, $bp;
-
-		$user_id_sql = $pag_sql = $type_sql = $search_sql = '';
-
-		if ( $limit && $page ) {
-			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-		}
-
-		if ( $type == 'unread' ) {
-			$type_sql = " AND r.unread_count != 0 ";
-		} elseif ( $type == 'read' ) {
-			$type_sql = " AND r.unread_count = 0 ";
-		}
-
-		if ( ! empty( $search_terms ) ) {
-			$search_terms_like = '%' . bp_esc_like( $search_terms ) . '%';
-			$search_sql        = $wpdb->prepare( "AND ( subject LIKE %s OR message LIKE %s )", $search_terms_like, $search_terms_like );
-		}
-
-		if ( 'sentbox' == $box ) {
-			$user_id_sql = $wpdb->prepare( 'm.sender_id = %d', $user_id );
-			$thread_ids  = $wpdb->get_results( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND {$user_id_sql} AND r.is_deleted = 0 {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}" );
-			$total_threads = $wpdb->get_var( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND {$user_id_sql} AND r.is_deleted = 0 {$search_sql} " );
-		} else {
-			$user_id_sql = $wpdb->prepare( 'r.user_id = %d', $user_id );
-			$thread_ids = $wpdb->get_results( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND {$user_id_sql} AND r.sender_only = 0 {$type_sql} {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}" );
-			$total_threads = $wpdb->get_var( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND {$user_id_sql} AND r.sender_only = 0 {$type_sql} {$search_sql}" );
-		}
-
-		if ( empty( $thread_ids ) ) {
-			return false;
-		}
-
-		// Sort threads by date_sent
-		foreach( (array) $thread_ids as $thread ) {
-			$sorted_threads[$thread->thread_id] = strtotime( $thread->date_sent );
-		}
-
-		arsort( $sorted_threads );
-
-		$threads = false;
-		foreach ( (array) $sorted_threads as $thread_id => $date_sent ) {
-			$threads[] = new BP_Messages_Thread( $thread_id );
-		}
-
-		return array( 'threads' => &$threads, 'total' => (int) $total_threads );
-	}
-
-	/**
-	 * Mark a thread as read.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 */
-	public static function mark_as_read( $thread_id ) {
-		global $wpdb, $bp;
-
-		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
-		$wpdb->query($sql);
-
-		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
-	}
-
-	/**
-	 * Mark a thread as unread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 */
-	public static function mark_as_unread( $thread_id ) {
-		global $wpdb, $bp;
-
-		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
-		$wpdb->query($sql);
-
-		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
-	}
-
-	/**
-	 * Returns the total number of message threads for a user.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int    $user_id The user ID.
-	 * @param string $box  The type of mailbox to get. Either 'inbox' or 'sentbox'.
-	 *                     Defaults to 'inbox'.
-	 * @param string $type The type of messages to get. Either 'all' or 'unread'
-	 *                     or 'read'. Defaults to 'all'.
-	 * @return int
-	 */
-	public static function get_total_threads_for_user( $user_id, $box = 'inbox', $type = 'all' ) {
-		global $wpdb, $bp;
-
-		$exclude_sender = '';
-		if ( $box != 'sentbox' )
-			$exclude_sender = ' AND sender_only != 1';
-
-		if ( $type == 'unread' )
-			$type_sql = " AND unread_count != 0 ";
-		else if ( $type == 'read' )
-			$type_sql = " AND unread_count = 0 ";
-
-		return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0{$exclude_sender} {$type_sql}", $user_id ) );
-	}
-
-	/**
-	 * Determine if the logged-in user is a sender of any message in a thread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 * @param bool
-	 */
-	public static function user_is_sender( $thread_id ) {
-		global $wpdb, $bp;
-
-		$sender_ids = $wpdb->get_col( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
-
-		if ( ! $sender_ids ) {
-			return false;
-		}
-
-		return in_array( bp_loggedin_user_id(), $sender_ids );
-	}
-
-	/**
-	 * Returns the userlink of the last sender in a message thread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 * @return string|bool The user link on success. Boolean false on failure.
-	 */
-	public static function get_last_sender( $thread_id ) {
-		global $wpdb, $bp;
-
-		if ( ! $sender_id = $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d GROUP BY sender_id ORDER BY date_sent LIMIT 1", $thread_id ) ) ) {
-			return false;
-		}
-
-		return bp_core_get_userlink( $sender_id, true );
-	}
-
-	/**
-	 * Gets the unread message count for a user.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $user_id The user ID.
-	 * @return int
-	 */
-	public static function get_inbox_count( $user_id = 0 ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) ) {
-			$user_id = bp_loggedin_user_id();
-		}
-
-		$unread_count = wp_cache_get( $user_id, 'bp_messages_unread_count' );
-
-		if ( false === $unread_count ) {
-			$unread_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM(unread_count) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0 AND sender_only = 0", $user_id ) );
-
-			wp_cache_set( $user_id, $unread_count, 'bp_messages_unread_count' );
-		}
-
-		return (int) $unread_count;
-	}
-
-	/**
-	 * Checks whether a user is a part of a message thread discussion.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 * @param int $user_id The user ID.
-	 * @return int The message ID on success.
-	 */
-	public static function check_access( $thread_id, $user_id = 0 ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_id ) )
-			$user_id = bp_loggedin_user_id();
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND is_deleted = 0 AND user_id = %d", $thread_id, $user_id ) );
-	}
-
-	/**
-	 * Checks whether a message thread exists.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param int $thread_id The message thread ID.
-	 * @return int The message thread ID on success.
-	 */
-	public static function is_valid( $thread_id = 0 ) {
-		global $wpdb;
-
-		// Bail if no thread ID is passed
-		if ( empty( $thread_id ) ) {
-			return false;
-		}
-
-		$bp = buddypress();
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT thread_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d LIMIT 1", $thread_id ) );
-	}
-
-	/**
-	 * Returns a string containing all the message recipient userlinks.
-	 *
-	 * String is comma-delimited.
-	 *
-	 * If a message thread has more than four users, the returned string is simply
-	 * "X Recipients" where "X" is the number of recipients in the message thread.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param object $recipients Object containing the message recipients.
-	 * @return string
-	 */
-	public static function get_recipient_links( $recipients ) {
-		if ( count( $recipients ) >= 5 )
-			return sprintf( __( '%s Recipients', 'buddypress' ), number_format_i18n( count( $recipients ) ) );
-
-		$recipient_links = array();
-
-		foreach ( (array) $recipients as $recipient ) {
-			$recipient_link = bp_core_get_userlink( $recipient->user_id );
-
-			if ( empty( $recipient_link ) ) {
-				$recipient_link = __( 'Deleted User', 'buddypress' );
-			}
-
-			$recipient_links[] = $recipient_link;
-		}
-
-		return implode( ', ', (array) $recipient_links );
-	}
-
-	/**
-	 * Upgrade method for the older BP message thread DB table.
-	 *
-	 * @since BuddyPress (1.2.0)
-	 *
-	 * @todo We should remove this.  No one is going to upgrade from v1.1, right?
-	 * @return bool
-	 */
-	public static function update_tables() {
-		global $wpdb, $bp;
-
-		$bp_prefix = bp_core_get_table_prefix();
-		$errors    = false;
-		$threads   = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" );
-
-		// Nothing to update, just return true to remove the table
-		if ( empty( $threads ) ) {
-			return true;
-		}
-
-		foreach( (array) $threads as $thread ) {
-			$message_ids = maybe_unserialize( $thread->message_ids );
-
-			if ( !empty( $message_ids ) ) {
-				$message_ids = implode( ',', $message_ids );
-
-				// Add the thread_id to the messages table
-				if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_messages} SET thread_id = %d WHERE id IN ({$message_ids})", $thread->id ) ) )
-					$errors = true;
-			}
-		}
-
-		if ( $errors ) {
-			return false;
-		}
-
-		return true;
-	}
-}
-
-/**
- * Single message class.
- */
-class BP_Messages_Message {
-	/**
-	 * ID of the message.
-	 *
-	 * @var int
-	 */
-	public $id;
-
-	/**
-	 * ID of the message thread.
-	 *
-	 * @var int
-	 */
-	public $thread_id;
-
-	/**
-	 * ID of the sender.
-	 *
-	 * @var int
-	 */
-	public $sender_id;
-
-	/**
-	 * Subject line of the message.
-	 *
-	 * @var string
-	 */
-	public $subject;
-
-	/**
-	 * Content of the message.
-	 *
-	 * @var string
-	 */
-	public $message;
-
-	/**
-	 * Date the message was sent.
-	 *
-	 * @var string
-	 */
-	public $date_sent;
-
-	/**
-	 * Message recipients.
-	 *
-	 * @var bool|array
-	 */
-	public $recipients = false;
-
-	/**
-	 * Constructor.
-	 *
-	 * @param int $id Optional. ID of the message.
-	 */
-	public function __construct( $id = null ) {
-		$this->date_sent = bp_core_current_time();
-		$this->sender_id = bp_loggedin_user_id();
-
-		if ( !empty( $id ) ) {
-			$this->populate( $id );
-		}
-	}
-
-	/**
-	 * Set up data related to a specific message object.
-	 *
-	 * @param int $id ID of the message.
-	 */
-	public function populate( $id ) {
-		global $wpdb, $bp;
-
-		if ( $message = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE id = %d", $id ) ) ) {
-			$this->id        = $message->id;
-			$this->thread_id = $message->thread_id;
-			$this->sender_id = $message->sender_id;
-			$this->subject   = $message->subject;
-			$this->message   = $message->message;
-			$this->date_sent = $message->date_sent;
-		}
-	}
-
-	/**
-	 * Send a message.
-	 *
-	 * @return int|bool ID of the newly created message on success, false
-	 *         on failure.
-	 */
-	public function send() {
-		global $wpdb, $bp;
-
-		$this->sender_id = apply_filters( 'messages_message_sender_id_before_save', $this->sender_id, $this->id );
-		$this->thread_id = apply_filters( 'messages_message_thread_id_before_save', $this->thread_id, $this->id );
-		$this->subject   = apply_filters( 'messages_message_subject_before_save',   $this->subject,   $this->id );
-		$this->message   = apply_filters( 'messages_message_content_before_save',   $this->message,   $this->id );
-		$this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id );
-
-		do_action_ref_array( 'messages_message_before_save', array( &$this ) );
-
-		// Make sure we have at least one recipient before sending.
-		if ( empty( $this->recipients ) )
-			return false;
-
-		$new_thread = false;
-
-		// If we have no thread_id then this is the first message of a new thread.
-		if ( empty( $this->thread_id ) ) {
-			$this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1;
-			$new_thread = true;
-		}
-
-		// First insert the message into the messages table
-		if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, %s )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) )
-			return false;
-
-		$this->id = $wpdb->insert_id;
-
-		$recipient_ids = array();
-
-		if ( $new_thread ) {
-			// Add an recipient entry for all recipients
-			foreach ( (array) $this->recipients as $recipient ) {
-				$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient->user_id, $this->thread_id ) );
-				$recipient_ids[] = $recipient->user_id;
-			}
-
-			// Add a sender recipient entry if the sender is not in the list of recipients
-			if ( !in_array( $this->sender_id, $recipient_ids ) )
-				$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, sender_only ) VALUES ( %d, %d, 1 )", $this->sender_id, $this->thread_id ) );
-		} else {
-			// Update the unread count for all recipients
-			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = unread_count + 1, sender_only = 0, is_deleted = 0 WHERE thread_id = %d AND user_id != %d", $this->thread_id, $this->sender_id ) );
-		}
-
-		messages_remove_callback_values();
-
-		do_action_ref_array( 'messages_message_after_save', array( &$this ) );
-
-		return $this->id;
-	}
-
-	/**
-	 * Get a list of recipients for a message.
-	 *
-	 * @return array
-	 */
-	public function get_recipients() {
-		global $bp, $wpdb;
-		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
-	}
-
-	/** Static Functions **************************************************/
-
-	/**
-	 * Get list of recipient IDs from their usernames.
-	 *
-	 * @param array $recipient_usernames Usernames of recipients.
-	 * @return array
-	 */
-	public static function get_recipient_ids( $recipient_usernames ) {
-		if ( !$recipient_usernames )
-			return false;
-
-		if ( is_array( $recipient_usernames ) ) {
-			for ( $i = 0, $count = count( $recipient_usernames ); $i < $count; ++$i ) {
-				if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) ) {
-					$recipient_ids[] = $rid;
-				}
-			}
-		}
-
-		return $recipient_ids;
-	}
-
-	/**
-	 * Get the ID of the message last sent by the logged-in user for a given thread.
-	 *
-	 * @param int $thread_id ID of the thread.
-	 * @return int|null ID of the message if found, otherwise null.
-	 */
-	public static function get_last_sent_for_user( $thread_id ) {
-		global $wpdb, $bp;
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND thread_id = %d ORDER BY date_sent DESC LIMIT 1", bp_loggedin_user_id(), $thread_id ) );
-	}
-
-	/**
-	 * Check whether a user is the sender of a message.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @param int $message_id ID of the message.
-	 * @return int|null Returns the ID of the message if the user is the
-	 *         sender, otherwise null.
-	 */
-	public static function is_user_sender( $user_id, $message_id ) {
-		global $wpdb, $bp;
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND id = %d", $user_id, $message_id ) );
-	}
-
-	/**
-	 * Get the ID of the sender of a message.
-	 *
-	 * @param int $message_id ID of the message.
-	 * @return int|null The ID of the sender if found, otherwise null.
-	 */
-	public static function get_message_sender( $message_id ) {
-		global $wpdb, $bp;
-		return $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE id = %d", $message_id ) );
-	}
-}
-
-/**
- * BuddyPress Notices class.
- *
- * Use this class to create, activate, deactivate or delete notices.
- *
- * @since BuddyPress (1.0.0)
- */
-class BP_Messages_Notice {
-	/**
-	 * The notice ID.
-	 *
-	 * @var int
-	 */
-	public $id = null;
-
-	/**
-	 * The subject line for the notice.
-	 *
-	 * @var string
-	 */
-	public $subject;
-
-	/**
-	 * The content of the notice.
-	 *
-	 * @var string
-	 */
-	public $message;
-
-	/**
-	 * The date the notice was created.
-	 *
-	 * @var string
-	 */
-	public $date_sent;
-
-	/**
-	 * Whether the notice is active or not.
-	 *
-	 * @var int
-	 */
-	public $is_active;
-
-	/**
-	 * Constructor.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 */
-	public function __construct( $id = null ) {
-		if ( $id ) {
-			$this->id = $id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Populate method.
-	 *
-	 * Runs during constructor.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 */
-	public function populate() {
-		global $wpdb, $bp;
-
-		$notice = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id ) );
-
-		if ( $notice ) {
-			$this->subject   = $notice->subject;
-			$this->message   = $notice->message;
-			$this->date_sent = $notice->date_sent;
-			$this->is_active = $notice->is_active;
-		}
-	}
-
-	/**
-	 * Saves a notice.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return bool
-	 */
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->subject = apply_filters( 'messages_notice_subject_before_save', $this->subject, $this->id );
-		$this->message = apply_filters( 'messages_notice_message_before_save', $this->message, $this->id );
-
-		do_action_ref_array( 'messages_notice_before_save', array( &$this ) );
-
-		if ( empty( $this->id ) ) {
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, %s, %d)", $this->subject, $this->message, $this->date_sent, $this->is_active );
-		} else {
-			$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET subject = %s, message = %s, is_active = %d WHERE id = %d", $this->subject, $this->message, $this->is_active, $this->id );
-		}
-
-		if ( ! $wpdb->query( $sql ) ) {
-			return false;
-		}
-
-		if ( ! $id = $this->id ) {
-			$id = $wpdb->insert_id;
-		}
-
-		// Now deactivate all notices apart from the new one.
-		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET is_active = 0 WHERE id != %d", $id ) );
-
-		bp_update_user_last_activity( bp_loggedin_user_id(), bp_core_current_time() );
-
-		do_action_ref_array( 'messages_notice_after_save', array( &$this ) );
-
-		return true;
-	}
-
-	/**
-	 * Activates a notice.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return bool
-	 */
-	public function activate() {
-		$this->is_active = 1;
-		return (bool) $this->save();
-	}
-
-	/**
-	 * Deactivates a notice.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return bool
-	 */
-	public function deactivate() {
-		$this->is_active = 0;
-		return (bool) $this->save();
-	}
-
-	/**
-	 * Deletes a notice.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return bool
-	 */
-	public function delete() {
-		global $wpdb, $bp;
-
-		do_action( 'messages_notice_before_delete', $this );
-
-		$sql = $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id );
-
-		if ( ! $wpdb->query( $sql ) ) {
-			return false;
-		}
-
-		return true;
-	}
-
-	/** Static Methods ********************************************************/
-
-	/**
-	 * Pulls up a list of notices.
-	 *
-	 * To get all notices, pass a value of -1 to pag_num
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @param array $data {
-	 *     Array of parameters.
-	 *     @type int $pag_num Number of notices per page. Defaults to 20.
-	 *     @type int $pag_page The page number.  Defaults to 1.
-	 * }
-	 * @return array
-	 */
-	public static function get_notices( $args = array() ) {
-		global $wpdb, $bp;
-
-		$r = wp_parse_args( $args, array(
-			'pag_num'  => 20, // Number of notices per page
-			'pag_page' => 1   // Page number
-		) );
-
-		$limit_sql = '';
-		if ( (int) $r['pag_num'] >= 0 ) {
-			$limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $r['pag_page'] - 1 ) * $r['pag_num'] ), (int) $r['pag_num'] );
-		}
-
-		$notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" );
-
-		return $notices;
-	}
-
-	/**
-	 * Returns the total number of recorded notices.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return int
-	 */
-	public static function get_total_notice_count() {
-		global $wpdb, $bp;
-
-		$notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices );
-
-		return $notice_count;
-	}
-
-	/**
-	 * Returns the active notice that should be displayed on the frontend.
-	 *
-	 * @since BuddyPress (1.0.0)
-	 *
-	 * @return object The BP_Messages_Notice object
-	 */
-	public static function get_active() {
-		$notice = wp_cache_get( 'active_notice', 'bp_messages' );
-
-		if ( false === $notice ) {
-			global $wpdb, $bp;
-
-			$notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" );
-			$notice    = new BP_Messages_Notice( $notice_id );
-
-			wp_cache_set( 'active_notice', $notice, 'bp_messages' );
-		}
+defined( 'ABSPATH' ) || exit;
 
-		return $notice;
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-messages-thread.php';
+require dirname( __FILE__ ) . '/classes/class-bp-messages-message.php';
+require dirname( __FILE__ ) . '/classes/class-bp-messages-notice.php';
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php
index ac91992b9ff59f8f1195b1e8052d6f90c0537141..a696034cd2e77e7adfa7acfc91c7fff459a87f8b 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Enqueue the JS for messages autocomplete.
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
index e49e4ce073c09fec11ded29cb646eeed5e704193..ef7049f0ce0d462633bbd1e27bc7e5b7853ac7c1 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php
@@ -1,16 +1,16 @@
 <?php
 
 /**
- * BuddyPress Messages Filters
+ * BuddyPress Messages Filters.
  *
- * Apply WordPress defined filters to private messages
+ * Apply WordPress defined filters to private messages.
  *
  * @package BuddyPress
  * @subpackage MessagesFilters
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 add_filter( 'bp_get_message_notice_subject',        'wp_filter_kses', 1 );
 add_filter( 'bp_get_message_notice_text',           'wp_filter_kses', 1 );
@@ -65,3 +65,27 @@ add_filter( 'bp_get_messages_subject_value',     'stripslashes_deep' );
 add_filter( 'bp_get_messages_content_value',     'stripslashes_deep' );
 add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' );
 add_filter( 'bp_get_the_thread_subject',         'stripslashes_deep' );
+
+/**
+ * Enforce limitations on viewing private message contents
+ *
+ * @since BuddyPress (2.3.2)
+ *
+ * @see bp_has_message_threads() for description of parameters
+ *
+ * @param array|string $args See {@link bp_has_message_threads()}.
+ */
+function bp_messages_enforce_current_user( $args = array() ) {
+
+	// Non-community moderators can only ever see their own messages
+	if ( is_user_logged_in() && ! bp_current_user_can( 'bp_moderate' ) ) {
+		$_user_id = (int) bp_loggedin_user_id();
+		if ( $_user_id !== (int) $args['user_id'] ) {
+			$args['user_id'] = $_user_id;
+		}
+	}
+
+	// Return possibly modified $args array
+	return $args;
+}
+add_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_enforce_current_user', 5 );
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
index 370953396594a7f7049ebf37ec72b8d43fd5ad73..f7dc3cb1612a114dd348b9f6bd84e26c3d39a51f 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Messages Functions
+ * BuddyPress Messages Functions.
  *
  * Business functions are where all the magic happens in BuddyPress. They will
  * handle the actual saving or manipulation of information. Usually they will
@@ -13,26 +13,25 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Create a new message.
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of arguments.
- *     @type int $sender_id Optional. ID of the user who is sending the
- *           message. Default: ID of the logged-in user.
- *     @type int $thread_id Optional. ID of the parent thread. Leave blank to
- *           create a new thread for the message.
- *     @type array $recipients IDs or usernames of message recipients. If this
- *           is an existing thread, it is unnecessary to pass a $recipients
- *           argument - existing thread recipients will be assumed.
- *     @type string $subject Optional. Subject line for the message. For
- *           existing threads, the existing subject will be used. For new
- *           threads, 'No Subject' will be used if no $subject is provided.
- *     @type string $content Content of the message. Cannot be empty.
- *     @type string $date_sent Date sent, in 'Y-m-d H:i:s' format. Default:
- *           current date/time.
+ *     @type int    $sender_id  Optional. ID of the user who is sending the
+ *                              message. Default: ID of the logged-in user.
+ *     @type int    $thread_id  Optional. ID of the parent thread. Leave blank to
+ *                              create a new thread for the message.
+ *     @type array  $recipients IDs or usernames of message recipients. If this
+ *                              is an existing thread, it is unnecessary to pass a $recipients
+ *                              argument - existing thread recipients will be assumed.
+ *     @type string $subject    Optional. Subject line for the message. For
+ *                              existing threads, the existing subject will be used. For new
+ *                              threads, 'No Subject' will be used if no $subject is provided.
+ *     @type string $content    Content of the message. Cannot be empty.
+ *     @type string $date_sent  Date sent, in 'Y-m-d H:i:s' format. Default: current date/time.
  * }
  * @return int|bool ID of the message thread on success, false on failure.
  */
@@ -155,7 +154,13 @@ function messages_new_message( $args = '' ) {
 		return false;
 	}
 
-	// Allow additional actions when a message is sent successfully
+	/**
+	 * Fires after a message has been successfully sent.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param BP_Messages_Message $message Message object. Passed by reference.
+	 */
 	do_action_ref_array( 'messages_message_sent', array( &$message ) );
 
 	// Return the thread ID
@@ -167,6 +172,7 @@ function messages_new_message( $args = '' ) {
  *
  * @param string $subject Subject of the notice.
  * @param string $message Content of the notice.
+ *
  * @return bool True on success, false on failure.
  */
 function messages_send_notice( $subject, $message ) {
@@ -182,6 +188,14 @@ function messages_send_notice( $subject, $message ) {
 		$notice->is_active = 1;
 		$notice->save(); // send it.
 
+		/**
+		 * Fires after a notice has been successfully sent.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $subject Subject of the notice.
+		 * @param string $message Content of the notice.
+		 */
 		do_action_ref_array( 'messages_send_notice', array( $subject, $message ) );
 
 		return true;
@@ -192,9 +206,18 @@ function messages_send_notice( $subject, $message ) {
  * Delete message thread(s).
  *
  * @param int|array Thread ID or array of thread IDs.
+ *
  * @return bool True on success, false on failure.
  */
 function messages_delete_thread( $thread_ids ) {
+
+	/**
+	 * Fires before specified thread IDs have been deleted.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int|array Thread ID or array of thread IDs that were deleted.
+	 */
 	do_action( 'messages_before_delete_thread', $thread_ids );
 
 	if ( is_array( $thread_ids ) ) {
@@ -209,6 +232,13 @@ function messages_delete_thread( $thread_ids ) {
 			return false;
 		}
 
+		/**
+		 * Fires after specified thread IDs have been deleted.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int|array Thread ID or array of thread IDs that were deleted.
+		 */
 		do_action( 'messages_delete_thread', $thread_ids );
 
 		return true;
@@ -217,6 +247,7 @@ function messages_delete_thread( $thread_ids ) {
 			return false;
 		}
 
+		/** This action is documented in bp-messages/bp-messages-functions.php */
 		do_action( 'messages_delete_thread', $thread_ids );
 
 		return true;
@@ -227,8 +258,8 @@ function messages_delete_thread( $thread_ids ) {
  * Check whether a user has access to a thread.
  *
  * @param int $thread_id ID of the thread.
- * @param int $user_id Optional. ID of the user. Default: ID of the logged-in
- *        user.
+ * @param int $user_id   Optional. ID of the user. Default: ID of the logged-in user.
+ *
  * @return int|null Message ID if the user has access, otherwise null.
  */
 function messages_check_thread_access( $thread_id, $user_id = 0 ) {
@@ -269,8 +300,8 @@ function messages_mark_thread_unread( $thread_id ) {
  * values on the messages page.
  *
  * @param string $recipients Comma-separated list of recipient usernames.
- * @param string $subject Subject of the message.
- * @param string $content Content of the message.
+ * @param string $subject    Subject of the message.
+ * @param string $content    Content of the message.
  */
 function messages_add_callback_values( $recipients, $subject, $content ) {
 	@setcookie( 'bp_messages_send_to', $recipients, time() + 60 * 60 * 24, COOKIEPATH );
@@ -292,8 +323,8 @@ function messages_remove_callback_values() {
 /**
  * Get the unread messages count for a user.
  *
- * @param int $user_id Optional. ID of the user. Default: ID of the
- *        logged-in user.
+ * @param int $user_id Optional. ID of the user. Default: ID of the logged-in user.
+ *
  * @return int
  */
 function messages_get_unread_count( $user_id = 0 ) {
@@ -307,10 +338,11 @@ function messages_get_unread_count( $user_id = 0 ) {
 /**
  * Check whether a user is the sender of a message.
  *
- * @param int $user_id ID of the user.
+ * @param int $user_id    ID of the user.
  * @param int $message_id ID of the message.
+ *
  * @return int|null Returns the ID of the message if the user is the
- *         sender, otherwise null.
+ *                  sender, otherwise null.
  */
 function messages_is_user_sender( $user_id, $message_id ) {
 	return BP_Messages_Message::is_user_sender( $user_id, $message_id );
@@ -320,6 +352,7 @@ function messages_is_user_sender( $user_id, $message_id ) {
  * Get the ID of the sender of a message.
  *
  * @param int $message_id ID of the message.
+ *
  * @return int|null The ID of the sender if found, otherwise null.
  */
 function messages_get_message_sender( $message_id ) {
@@ -330,8 +363,140 @@ function messages_get_message_sender( $message_id ) {
  * Check whether a message thread exists.
  *
  * @param int $thread_id ID of the thread.
+ *
  * @return int|null The message thread ID on success, null on failure.
  */
 function messages_is_valid_thread( $thread_id ) {
 	return BP_Messages_Thread::is_valid( $thread_id );
 }
+
+/**
+ * Get the thread ID from a message ID.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  int $message_id ID of the message.
+ * @return int The ID of the thread if found, otherwise 0.
+ */
+function messages_get_message_thread_id( $message_id = 0 ) {
+	global $wpdb;
+
+	$bp = buddypress();
+
+	return (int) $wpdb->get_var( $wpdb->prepare( "SELECT thread_id FROM {$bp->messages->table_name_messages} WHERE id = %d", $message_id ) );
+}
+
+/** Messages Meta *******************************************************/
+
+/**
+ * Delete metadata for a message.
+ *
+ * If $meta_key is false, this will delete all meta for the message ID.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see delete_metadata() for full documentation excluding $meta_type variable.
+ *
+ * @param int         $message_id ID of the message to have meta deleted for.
+ * @param string|bool $meta_key   Meta key to delete. Default false.
+ * @param string|bool $meta_value Meta value to delete. Default false.
+ * @param bool        $delete_all Whether or not to delete all meta data.
+ *
+ * @return bool
+ */
+function bp_messages_delete_meta( $message_id, $meta_key = false, $meta_value = false, $delete_all = false ) {
+	// Legacy - if no meta_key is passed, delete all for the item
+	if ( empty( $meta_key ) ) {
+		global $wpdb;
+
+		$keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$wpdb->messagemeta} WHERE message_id = %d", $message_id ) );
+
+		// With no meta_key, ignore $delete_all
+		$delete_all = false;
+	} else {
+		$keys = array( $meta_key );
+	}
+
+	// no keys, so stop now!
+	if ( empty( $keys ) ) {
+		return false;
+	}
+
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	foreach ( $keys as $key ) {
+		$retval = delete_metadata( 'message', $message_id, $key, $meta_value, $delete_all );
+	}
+
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
+
+/**
+ * Get a piece of message metadata.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see get_metadata() for full documentation excluding $meta_type variable.
+ *
+ * @param int    $message_id ID of the message to retrieve meta for.
+ * @param string $meta_key   Meta key to retrieve. Default empty string.
+ * @param bool   $single     Whether or not to fetch all or a single value.
+ *
+ * @return mixed
+ */
+function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) {
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	$retval = get_metadata( 'message', $message_id, $meta_key, $single );
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
+
+/**
+ * Update a piece of message metadata.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see update_metadata() for full documentation excluding $meta_type variable.
+ *
+ * @param int         $message_id ID of the message to have meta deleted for.
+ * @param string|bool $meta_key   Meta key to update.
+ * @param string|bool $meta_value Meta value to update.
+ * @param string      $prev_value If specified, only update existing metadata entries with
+ * 		                          the specified value. Otherwise, update all entries.
+ *
+ * @return mixed
+ */
+function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_value = '' ) {
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	$retval = update_metadata( 'message', $message_id, $meta_key, $meta_value, $prev_value );
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
+
+/**
+ * Add a piece of message metadata.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @see add_metadata() for full documentation excluding $meta_type variable.
+ *
+ * @param int         $message_id ID of the message to have meta deleted for.
+ * @param string|bool $meta_key   Meta key to update.
+ * @param string|bool $meta_value Meta value to update.
+ * @param bool        $unique     Whether the specified metadata key should be
+ * 		                          unique for the object. If true, and the object
+ * 		                          already has a value for the specified metadata key,
+ *                                no change will be made.
+ * @return mixed
+ */
+function bp_messages_add_meta( $message_id, $meta_key, $meta_value, $unique = false ) {
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	$retval = add_metadata( 'message', $message_id, $meta_key, $meta_value, $unique );
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
index 9ccc208e9f14259dbcde0a241f105c74aa1c2057..d8ba3abe7dbcd09d39c3704ab4cd8ee0b98c6904 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php
@@ -3,14 +3,14 @@
 /**
  * BuddyPress Messages Loader
  *
- * A private messages component, for users to send messages to each other
+ * A private messages component, for users to send messages to each other.
  *
  * @package BuddyPress
  * @subpackage MessagesLoader
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Implementation of BP_Component for the Messages component.
@@ -18,11 +18,12 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @since BuddyPress (1.5.0)
  */
 class BP_Messages_Component extends BP_Component {
+
 	/**
 	 * If this is true, the Message autocomplete will return friends only, unless
 	 * this is set to false, in which any matching users will be returned.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 * @var bool
 	 */
 	public $autocomplete_all;
@@ -38,7 +39,8 @@ class BP_Messages_Component extends BP_Component {
 			__( 'Private Messages', 'buddypress' ),
 			buddypress()->plugin_dir,
 			array(
-				'adminbar_myaccount_order' => 50
+				'adminbar_myaccount_order' => 50,
+				'features'                 => array( 'star' )
 			)
 		);
 	}
@@ -66,6 +68,11 @@ class BP_Messages_Component extends BP_Component {
 			'widgets',
 		);
 
+		// Conditional includes
+		if ( bp_is_active( $this->id, 'star' ) ) {
+			$includes[] = 'star';
+		}
+
 		parent::includes( $includes );
 	}
 
@@ -83,36 +90,42 @@ class BP_Messages_Component extends BP_Component {
 		$bp = buddypress();
 
 		// Define a slug, if necessary
-		if ( !defined( 'BP_MESSAGES_SLUG' ) )
+		if ( !defined( 'BP_MESSAGES_SLUG' ) ) {
 			define( 'BP_MESSAGES_SLUG', $this->id );
+		}
 
 		// Global tables for messaging component
 		$global_tables = array(
 			'table_name_notices'    => $bp->table_prefix . 'bp_messages_notices',
 			'table_name_messages'   => $bp->table_prefix . 'bp_messages_messages',
-			'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients'
+			'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients',
+			'table_name_meta'       => $bp->table_prefix . 'bp_messages_meta',
+		);
+
+		// Metadata tables for messaging component
+		$meta_tables = array(
+			'message' => $bp->table_prefix . 'bp_messages_meta',
 		);
 
+		$this->autocomplete_all = defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' );
+
 		// All globals for messaging component.
 		// Note that global_tables is included in this array.
-		$globals = array(
+		parent::setup_globals( array(
 			'slug'                  => BP_MESSAGES_SLUG,
 			'has_directory'         => false,
 			'notification_callback' => 'messages_format_notifications',
 			'search_string'         => __( 'Search Messages...', 'buddypress' ),
-			'global_tables'         => $global_tables
-		);
-
-		$this->autocomplete_all = defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' );
-
-		parent::setup_globals( $globals );
+			'global_tables'         => $global_tables,
+			'meta_tables'           => $meta_tables
+		) );
 	}
 
 	/**
 	 * Set up navigation for user pages.
 	 *
 	 * @param array $main_nav See {BP_Component::setup_nav()} for details.
-	 * @param array $sub_nav See {BP_Component::setup_nav()} for details.
+	 * @param array $sub_nav  See {BP_Component::setup_nav()} for details.
 	 */
 	public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
 
@@ -159,6 +172,18 @@ class BP_Messages_Component extends BP_Component {
 			'user_has_access' => bp_core_can_edit_settings()
 		);
 
+		if ( bp_is_active( $this->id, 'star' ) ) {
+			$sub_nav[] = array(
+				'name'            => __( 'Starred', 'buddypress' ),
+				'slug'            => bp_get_messages_starred_slug(),
+				'parent_url'      => $messages_link,
+				'parent_slug'     => $this->slug,
+				'screen_function' => 'bp_messages_star_screen',
+				'position'        => 11,
+				'user_has_access' => bp_core_can_edit_settings()
+			);
+		}
+
 		$sub_nav[] = array(
 			'name'            => __( 'Sent', 'buddypress' ),
 			'slug'            => 'sentbox',
@@ -198,7 +223,7 @@ class BP_Messages_Component extends BP_Component {
 	 * Set up the Toolbar.
 	 *
 	 * @param array $wp_admin_nav See {BP_Component::setup_admin_bar()}
-	 *        for details.
+	 *                            for details.
 	 */
 	public function setup_admin_bar( $wp_admin_nav = array() ) {
 		$bp = buddypress();
@@ -236,6 +261,16 @@ class BP_Messages_Component extends BP_Component {
 				'href'   => trailingslashit( $messages_link . 'inbox' )
 			);
 
+			// Starred
+			if ( bp_is_active( $this->id, 'star' ) ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-starred',
+					'title'  => __( 'Starred', 'buddypress' ),
+					'href'   => trailingslashit( $messages_link . bp_get_messages_starred_slug() )
+				);
+			}
+
 			// Sent Messages
 			$wp_admin_nav[] = array(
 				'parent' => 'my-account-' . $this->id,
@@ -287,6 +322,24 @@ class BP_Messages_Component extends BP_Component {
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_messages',
+			'bp_messages_threads',
+			'bp_messages_unread_count',
+			'message_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
index 2b14dec9daede33c1774b4f958e66940f1e96e2d..6cb091d2ec66d4fcb9c1d080c073f41b608110b9 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Email *********************************************************************/
 
@@ -19,10 +19,10 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @param array|BP_Messages_Message $raw_args {
  *     Array of arguments. Also accepts a BP_Messages_Message object.
- *     @type array $recipients User IDs of recipients.
+ *     @type array  $recipients    User IDs of recipients.
  *     @type string $email_subject Subject line of message.
  *     @type string $email_content Content of message.
- *     @type int $sender_id User ID of sender.
+ *     @type int    $sender_id     User ID of sender.
  * }
  */
 function messages_notification_new_message( $raw_args = array() ) {
@@ -92,15 +92,56 @@ To view and read your messages please log in and visit: %4$s
 				$email_content .= sprintf( __( 'To disable these notifications, please log in and go to: %s', 'buddypress' ), $settings_link );
 			}
 
-			// Send the message
+			/**
+			 * Filters the user email that the message notification will be sent to.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @param string  $email_to User email the notification is being sent to.
+			 * @param WP_User $ud       WP_User object of who is receiving the message.
+			 */
 			$email_to      = apply_filters( 'messages_notification_new_message_to',      $email_to, $ud );
+
+			/**
+			 * Filters the message notification subject that will be sent to user.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @param string  $email_subject Email notification subject text.
+			 * @param string  $sender_name   Name of the person who sent the message.
+			 * @param WP_User $ud            WP_User object of who is receiving the message.
+			 */
 			$email_subject = apply_filters( 'messages_notification_new_message_subject', $email_subject, $sender_name, $ud );
+
+			/**
+			 * Filters the message notification message that will be sent to user.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 *
+			 * @param string  $email_content Email notification message text.
+			 * @param string  $sender_name   Name of the person who sent the message.
+			 * @param string  $subject       Email notification subject text.
+			 * @param string  $content       Content of the message.
+			 * @param string  $message_link  URL permalink for the message.
+			 * @param string  $settings_link URL permalink for the user's notification settings area.
+			 * @param WP_User $ud            WP_User object of who is receiving the message.
+			 */
 			$email_content = apply_filters( 'messages_notification_new_message_message', $email_content, $sender_name, $subject, $content, $message_link, $settings_link, $ud );
 
 			wp_mail( $email_to, $email_subject, $email_content );
 		}
 	}
 
+	/**
+	 * Fires after the sending of a new message email notification.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array  $recipients    User IDs of recipients.
+	 * @param string $email_subject Email notification subject text.
+	 * @param string $email_content Email notification message text.
+	 * @param array  $$args         Array of originally provided arguments.
+	 */
 	do_action( 'bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args );
 }
 add_action( 'messages_message_sent', 'messages_notification_new_message', 10 );
@@ -112,25 +153,29 @@ add_action( 'messages_message_sent', 'messages_notification_new_message', 10 );
  *
  * @since BuddyPress (1.0.0)
  *
- * @param string $action The kind of notification being rendered.
- * @param int $item_id The primary item id.
- * @param int $secondary_item_id The secondary item id.
- * @param int $total_items The total number of messaging-related notifications
- *        waiting for the user
- * @param string $format Return value format. 'string' for BuddyBar-compatible
- *        notifications; 'array' for WP Toolbar. Default: 'string'.
+ * @param string $action            The kind of notification being rendered.
+ * @param int    $item_id           The primary item id.
+ * @param int    $secondary_item_id The secondary item id.
+ * @param int    $total_items       The total number of messaging-related notifications
+ *                                  waiting for the user.
+ * @param string $format            Return value format. 'string' for BuddyBar-compatible
+ *                                  notifications; 'array' for WP Toolbar. Default: 'string'.
+ *
  * @return string|array Formatted notifications.
  */
 function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
 	$total_items = (int) $total_items;
 	$link        = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox' );
 	$title       = __( 'Inbox', 'buddypress' );
+	$amount      = 'single';
 
 	if ( 'new_message' === $action ) {
 		if ( $total_items > 1 ) {
+			$amount = 'multiple';
 			$text   = sprintf( __( 'You have %d new messages', 'buddypress' ), $total_items );
-			$filter = 'bp_messages_multiple_new_message_notification';
 		} else {
+			$amount = 'single';
+
 			// get message thread ID
 			$message   = new BP_Messages_Message( $item_id );
 			$thread_id = $message->thread_id;
@@ -143,7 +188,6 @@ function messages_format_notifications( $action, $item_id, $secondary_item_id, $
 			} else {
 				$text = sprintf( _n( 'You have %s new private message', 'You have %s new private messages', $total_items, 'buddypress' ), bp_core_number_format( $total_items ) );
 			}
-			$filter = 'bp_messages_single_new_message_notification';
 		}
 	}
 
@@ -153,14 +197,39 @@ function messages_format_notifications( $action, $item_id, $secondary_item_id, $
 		} else {
 			$retval = esc_html( $text );
 		}
-		$return = apply_filters( $filter, $retval, (int) $total_items, $text, $link, $item_id, $secondary_item_id );
+
+		/**
+		 * Filters the new message notification text before the notification is created.
+		 *
+		 * This is a dynamic filter. Possible filter names are:
+		 *   - 'bp_messages_multiple_new_message_notification'.
+		 *   - 'bp_messages_single_new_message_notification'.
+		 *
+		 * @param string $retval            Notification text.
+		 * @param int    $total_items       Number of messages referred to by the notification.
+		 * @param string $text              The raw notification test (ie, not wrapped in a link).
+		 * @param int    $item_id           ID of the associated item.
+		 * @param int    $secondary_item_id ID of the secondary associated item.
+		 */
+		$return = apply_filters( 'bp_messages_' . $amount . '_new_message_notification', $retval, (int) $total_items, $text, $link, $item_id, $secondary_item_id );
 	} else {
-		$return = apply_filters( $filter, array(
+		/** This filter is documented in bp-messages/bp-messages-notifications.php */
+		$return = apply_filters( 'bp_messages_' . $amount . '_new_message_notification', array(
 			'text' => $text,
 			'link' => $link
 		), $link, (int) $total_items, $text, $link, $item_id, $secondary_item_id );
 	}
 
+	/**
+	 * Fires right before returning the formatted message notifications.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $action            The type of message notification.
+	 * @param int    $item_id           The primary item ID.
+	 * @param int    $secondary_item_id The secondary item ID.
+	 * @param int    $total_items       Total amount of items to format.
+	 */
 	do_action( 'messages_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
 
 	return $return;
@@ -229,11 +298,20 @@ add_action( 'thread_loop_start', 'bp_messages_screen_conversation_mark_notificat
  *
  * @since BuddyPress (2.0.0)
  *
- * @param int $message_id ID of the message.
+ * @param int   $thread_id   ID of the thread.
+ * @param array $message_ids IDs of the messages.
  */
-function bp_messages_message_delete_notifications( $message_id = 0 ) {
-	if ( bp_is_active( 'notifications' ) && ! empty( $message_id ) ) {
-		bp_notifications_delete_notifications_by_item_id( bp_loggedin_user_id(), (int) $message_id, buddypress()->messages->id, 'new_message' );
+function bp_messages_message_delete_notifications( $thread_id, $message_ids ) {
+	if ( ! bp_is_active( 'notifications' ) ) {
+		return;
+	}
+
+	// For each recipient, delete notifications corresponding to each message.
+	$thread = new BP_Messages_Thread( $thread_id );
+	foreach ( $thread->get_recipients() as $recipient ) {
+		foreach ( $message_ids as $message_id ) {
+			bp_notifications_delete_notifications_by_item_id( $recipient->user_id, (int) $message_id, buddypress()->messages->id, 'new_message' );
+		}
 	}
 }
-add_action( 'messages_thread_deleted_thread', 'bp_messages_message_delete_notifications', 10, 1 );
+add_action( 'bp_messages_thread_after_delete', 'bp_messages_message_delete_notifications', 10, 2 );
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
index f853ae4fb94e55096deced4ee9086399c1735e11..1fa275d85dd9fec694a5785a4a52cf7be9e451be 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * BuddyPress Messages Screens
+ * BuddyPress Messages Screens.
  *
  * Screen functions are the controllers of BuddyPress. They will execute when
  * their specific URL is caught. They will first save or manipulate data using
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Load the Messages > Inbox screen.
@@ -23,7 +23,20 @@ function messages_screen_inbox() {
 		return;
 	}
 
+	/**
+	 * Fires right before the loading of the Messages inbox screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'messages_screen_inbox' );
+
+	/**
+	 * Filters the template to load for the Messages inbox screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the messages template to load.
+	 */
 	bp_core_load_template( apply_filters( 'messages_template_inbox', 'members/single/home' ) );
 }
 
@@ -36,7 +49,20 @@ function messages_screen_sentbox() {
 		return;
 	}
 
+	/**
+	 * Fires right before the loading of the Messages sentbox screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'messages_screen_sentbox' );
+
+	/**
+	 * Filters the template to load for the Messages sentbox screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the messages template to load.
+	 */
 	bp_core_load_template( apply_filters( 'messages_template_sentbox', 'members/single/home' ) );
 }
 
@@ -61,7 +87,7 @@ function messages_screen_compose() {
 
 		// Check we have what we need
 		if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) {
-			bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
+			bp_core_add_message( __( 'There was an error sending that message. Please try again.', 'buddypress' ), 'error' );
 		} else {
 			// If this is a notice, send it
 			if ( isset( $_POST['send-notice'] ) ) {
@@ -69,13 +95,21 @@ function messages_screen_compose() {
 					bp_core_add_message( __( 'Notice sent successfully!', 'buddypress' ) );
 					bp_core_redirect( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox/' );
 				} else {
-					bp_core_add_message( __( 'There was an error sending that notice, please try again', 'buddypress' ), 'error' );
+					bp_core_add_message( __( 'There was an error sending that notice. Please try again.', 'buddypress' ), 'error' );
 				}
 			} else {
 				// Filter recipients into the format we need - array( 'username/userid', 'username/userid' )
 				$autocomplete_recipients = explode( ',', $_POST['send-to-input'] );
 				$typed_recipients        = explode( ' ', $_POST['send_to_usernames'] );
 				$recipients              = array_merge( (array) $autocomplete_recipients, (array) $typed_recipients );
+
+				/**
+				 * Filters the array of recipients to receive the composed message.
+				 *
+				 * @since BuddyPress (1.2.10)
+				 *
+				 * @param array $recipients Array of recipients to receive message.
+				 */
 				$recipients              = apply_filters( 'bp_messages_recipients', $recipients );
 				$thread_id               = messages_new_message( array(
 					'recipients' => $recipients,
@@ -88,14 +122,26 @@ function messages_screen_compose() {
 					bp_core_add_message( __( 'Message sent successfully!', 'buddypress' ) );
 					bp_core_redirect( bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' );
 				} else {
-					bp_core_add_message( __( 'There was an error sending that message, please try again', 'buddypress' ), 'error' );
+					bp_core_add_message( __( 'There was an error sending that message. Please try again.', 'buddypress' ), 'error' );
 				}
 			}
 		}
 	}
 
+	/**
+	 * Fires right before the loading of the Messages compose screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'messages_screen_compose' );
 
+	/**
+	 * Filters the template to load for the Messages compose screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the messages template to load.
+	 */
 	bp_core_load_template( apply_filters( 'messages_template_compose', 'members/single/home' ) );
 }
 
@@ -123,8 +169,20 @@ function messages_screen_conversation() {
 	// Decrease the unread count in the nav before it's rendered
 	$bp->bp_nav[$bp->messages->slug]['name'] = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() );
 
+	/**
+	 * Fires right before the loading of the Messages view screen template file.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 */
 	do_action( 'messages_screen_conversation' );
 
+	/**
+	 * Filters the template to load for the Messages view screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the messages template to load.
+	 */
 	bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) );
 }
 add_action( 'bp_screens', 'messages_screen_conversation' );
@@ -152,13 +210,13 @@ function messages_screen_notices() {
 			} else {
 				bp_core_add_message( __('Notice deactivated.', 'buddypress') );
 			}
-		} else if ( bp_is_action_variable( 'activate', 0 ) ) {
+		} elseif ( bp_is_action_variable( 'activate', 0 ) ) {
 			if ( !$notice->activate() ) {
 				bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' );
 			} else {
 				bp_core_add_message( __('Notice activated.', 'buddypress') );
 			}
-		} else if ( bp_is_action_variable( 'delete' ) ) {
+		} elseif ( bp_is_action_variable( 'delete' ) ) {
 			if ( !$notice->delete() ) {
 				bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' );
 			} else {
@@ -173,8 +231,20 @@ function messages_screen_notices() {
 		return;
 	}
 
+	/**
+	 * Fires right before the loading of the Messages notices screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'messages_screen_notices' );
 
+	/**
+	 * Filters the template to load for the Messages notices screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the messages template to load.
+	 */
 	bp_core_load_template( apply_filters( 'messages_template_notices', 'members/single/home' ) );
 }
 
@@ -209,7 +279,14 @@ function messages_screen_notification_settings() {
 				<td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php checked( $new_messages, 'no', true ) ?>/></td>
 			</tr>
 
-			<?php do_action( 'messages_screen_notification_settings' ) ?>
+			<?php
+
+			/**
+			 * Fires inside the closing </tbody> tag for messages screen notification settings.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 */
+			do_action( 'messages_screen_notification_settings' ); ?>
 		</tbody>
 	</table>
 
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php
new file mode 100644
index 0000000000000000000000000000000000000000..84f2ce52295ff385b30bdcdcc196de125854ceda
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php
@@ -0,0 +1,523 @@
+<?php
+/**
+ * Functions related to starring private messages.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+
+/** UTILITY **************************************************************/
+
+/**
+ * Return the starred messages slug. Defaults to 'starred'.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @return string
+ */
+function bp_get_messages_starred_slug() {
+	/**
+	 * Filters the starred message slug.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param string
+	 */
+	return sanitize_title( apply_filters( 'bp_get_messages_starred_slug', 'starred' ) );
+}
+
+/**
+ * Function to determine if a message ID is starred.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  int $mid     The message ID. Please note that this isn't the message thread ID.
+ * @param  int $user_id The user ID
+ * @return bool
+ */
+function bp_messages_is_message_starred( $mid = 0, $user_id = 0 ) {
+	if ( empty( $user_id ) ) {
+		$user_id = bp_loggedin_user_id();
+	}
+
+	if ( empty( $mid ) ) {
+		return false;
+	}
+
+	$starred = array_flip( (array) bp_messages_get_meta( $mid, 'starred_by_user', false ) );
+
+	if ( isset( $starred[$user_id] ) ) {
+		return true;
+	} else {
+		return false;
+	}
+}
+
+/**
+ * Output the link or raw URL for starring or unstarring a message.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param array $args See bp_get_the_message_star_action_link() for full documentation.
+ */
+function bp_the_message_star_action_link( $args = array() ) {
+	echo bp_get_the_message_star_action_link( $args );
+}
+	/**
+	 * Return the link or raw URL for starring or unstarring a message.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $args {
+	 *     Array of arguments.
+	 *     @type int    $user_id       The user ID. Defaults to the logged-in user ID.
+	 *     @type int    $thread_id     The message thread ID. Default: 0. If not zero, this takes precedence over
+	 *                                 $message_id.
+	 *     @type int    $message_id    The individual message ID. If on a single thread page, defaults to the
+	 *                                 current message ID in the message loop.
+	 *     @type bool   $url_only      Whether to return the URL only. If false, returns link with markup.
+	 *                                 Default: false.
+	 *     @type string $text_unstar   Link text for the 'unstar' action. Only applicable if $url_only is false.
+	 *     @type string $text_star     Link text for the 'star' action. Only applicable if $url_only is false.
+	 *     @type string $title_unstar  Link title for the 'unstar' action. Only applicable if $url_only is false.
+	 *     @type string $title_star    Link title for the 'star' action. Only applicable if $url_only is false.
+	 *     @type string $title_unstar_thread Link title for the 'unstar' action when displayed in a thread loop.
+	 *                                       Only applicable if $message_id is set and if $url_only is false.
+	 *     @type string $title_star_thread   Link title for the 'star' action when displayed in a thread loop.
+	 *                                       Only applicable if $message_id is set and if $url_only is false.
+	 * }
+	 * @return string
+	 */
+	function bp_get_the_message_star_action_link( $args = array() ) {
+
+		// Default user ID
+		$user_id = bp_displayed_user_id()
+			? bp_displayed_user_id()
+			: bp_loggedin_user_id();
+
+		$r = bp_parse_args( $args, array(
+			'user_id'             => (int) $user_id,
+			'thread_id'           => 0,
+			'message_id'          => (int) bp_get_the_thread_message_id(),
+			'url_only'            => false,
+			'text_unstar'         => __( 'Unstar',      'buddypress' ),
+			'text_star'           => __( 'Star',        'buddypress' ),
+			'title_unstar'        => __( 'Starred',     'buddypress' ),
+			'title_star'          => __( 'Not starred', 'buddypress' ),
+			'title_unstar_thread' => __( 'Remove all starred messages in this thread', 'buddypress' ),
+			'title_star_thread'   => __( 'Star the first message in this thread',      'buddypress' ),
+		), 'messages_star_action_link' );
+
+		// Check user ID and determine base user URL
+		switch ( $r['user_id'] ) {
+
+			// Current user
+			case bp_loggedin_user_id() :
+				$user_domain = bp_loggedin_user_domain();
+				break;
+
+			// Displayed user
+			case bp_displayed_user_id() :
+				$user_domain = bp_displayed_user_domain();
+				break;
+
+			// Empty or other
+			default :
+				$user_domain = bp_core_get_user_domain( $r['user_id'] );
+				break;
+		}
+
+		// Bail if no user domain was calculated
+		if ( empty( $user_domain ) ) {
+			return '';
+		}
+
+		// Define local variables
+		$retval = $bulk_attr = '';
+
+		// thread ID
+		if ( (int) $r['thread_id'] > 0 ) {
+
+			// see if we're in the loop
+			if ( bp_get_message_thread_id() == $r['thread_id'] ) {
+
+				// grab all message ids
+				$mids = wp_list_pluck( $GLOBALS['messages_template']->thread->messages, 'id' );
+
+				// make sure order is ASC
+				// order is DESC when used in the thread loop by default
+				$mids = array_reverse( $mids );
+
+			// pull up the thread
+			} else {
+				$thread = new BP_Messages_Thread( $r['thread_id'] );
+				$mids   = wp_list_pluck( $thread->messages, 'id' );
+			}
+
+			$is_starred = false;
+			$message_id = 0;
+			foreach ( $mids as $mid ) {
+
+				// try to find the first msg that is starred in a thread
+				if ( true === bp_messages_is_message_starred( $mid ) ) {
+					$is_starred = true;
+					$message_id = $mid;
+					break;
+				}
+			}
+
+			// no star, so default to first message in thread
+			if ( empty( $message_id ) ) {
+				$message_id = $mids[0];
+			}
+
+			$message_id = (int) $message_id;
+
+			// nonce
+			$nonce = wp_create_nonce( "bp-messages-star-{$message_id}" );
+
+			if ( true === $is_starred ) {
+				$action    = 'unstar';
+				$bulk_attr = ' data-star-bulk="1"';
+				$retval    = $user_domain . bp_get_messages_slug() . '/unstar/' . $message_id . '/' . $nonce . '/all/';
+			} else {
+				$action    = 'star';
+				$retval    = $user_domain . bp_get_messages_slug() . '/star/' . $message_id . '/' . $nonce . '/';
+			}
+
+			$title = $r["title_{$action}_thread"];
+
+		// message ID
+		} else {
+			$message_id = (int) $r['message_id'];
+			$is_starred = bp_messages_is_message_starred( $message_id );
+			$nonce      = wp_create_nonce( "bp-messages-star-{$message_id}" );
+
+			if ( true === $is_starred ) {
+				$action = 'unstar';
+				$retval = $user_domain . bp_get_messages_slug() . '/unstar/' . $message_id . '/' . $nonce . '/';
+			} else {
+				$action = 'star';
+				$retval = $user_domain . bp_get_messages_slug() . '/star/' . $message_id . '/' . $nonce . '/';
+			}
+
+			$title = $r["title_{$action}"];
+		}
+
+		/**
+		 * Filters the star action URL for starring / unstarring a message.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param string $retval URL for starring / unstarring a message.
+		 * @param array  $r      Parsed link arguments. See $args in bp_get_the_message_star_action_link().
+		 */
+		$retval = esc_url( apply_filters( 'bp_get_the_message_star_action_urlonly', $retval, $r ) );
+		if ( true === (bool) $r['url_only'] ) {
+			return $retval;
+		}
+
+		/**
+		 * Filters the star action link, including markup.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param string $retval Link for starring / unstarring a message, including markup.
+		 * @param array  $r      Parsed link arguments. See $args in bp_get_the_message_star_action_link().
+		 */
+		return apply_filters( 'bp_get_the_message_star_action_link', '<a title="' . esc_attr( $title ) . '" class="message-action-' . esc_attr( $action ) . '" data-star-status="' . esc_attr( $action ) .'" data-star-nonce="' . esc_attr( $nonce ) . '"' . $bulk_attr . ' data-message-id="' . esc_attr( (int) $message_id ) . '" href="' . $retval . '"><span class="icon"></span> <span class="bp-screen-reader-text">' . $r['text_' . $action] . '</span></a>', $r );
+	}
+
+/**
+ * Save or delete star message meta according to a message's star status.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param array $args {
+ *     Array of arguments.
+ *     @type string $action     The star action. Either 'star' or 'unstar'. Default: 'star'.
+ *     @type int    $thread_id  The message thread ID. Default: 0. If not zero, this takes precedence over
+ *                              $message_id.
+ *     @type int    $message_id The indivudal message ID to star or unstar.  Default: 0.
+ *     @type int    $user_id    The user ID. Defaults to the logged-in user ID.
+ *     @type bool   $bulk       Whether to mark all messages in a thread as a certain action. Only relevant
+ *                              when $action is 'unstar' at the moment. Default: false.
+ * }
+ * @return bool
+ */
+function bp_messages_star_set_action( $args = array() ) {
+	$r = wp_parse_args( $args, array(
+		'action'     => 'star',
+		'thread_id'  => 0,
+		'message_id' => 0,
+		'user_id'    => bp_loggedin_user_id(),
+		'bulk'       => false
+	) );
+
+	// Set thread ID
+	if ( ! empty( $r['thread_id'] ) ) {
+		$thread_id = (int) $r['thread_id'];
+	} else {
+		$thread_id = messages_get_message_thread_id( $r['message_id'] );
+	}
+	if ( empty( $thread_id ) ) {
+		return false;
+	}
+
+	// Check if user has access to thread
+	if( ! messages_check_thread_access( $thread_id, $r['user_id'] ) ) {
+		return false;
+	}
+
+	$is_starred = bp_messages_is_message_starred( $r['message_id'], $r['user_id'] );
+
+	// star
+	if ( 'star' == $r['action'] ) {
+		if ( true === $is_starred ) {
+			return true;
+		} else {
+			bp_messages_add_meta( $r['message_id'], 'starred_by_user', $r['user_id'] );
+			return true;
+		}
+	// unstar
+	} else {
+		// unstar one message
+		if ( false === $r['bulk'] ) {
+			if ( false === $is_starred ) {
+				return true;
+			} else {
+				bp_messages_delete_meta( $r['message_id'], 'starred_by_user', $r['user_id'] );
+				return true;
+			}
+
+		// unstar all messages in a thread
+		} else {
+			$thread = new BP_Messages_Thread( $thread_id );
+			$mids = wp_list_pluck( $thread->messages, 'id' );
+
+			foreach ( $mids as $mid ) {
+				if ( true === bp_messages_is_message_starred( $mid, $r['user_id'] ) ) {
+					bp_messages_delete_meta( $mid, 'starred_by_user', $r['user_id'] );
+				}
+			}
+
+			return true;
+		}
+	}
+}
+
+/** SCREENS **************************************************************/
+
+/**
+ * Screen handler to display a user's "Starred" private messages page.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_messages_star_screen() {
+	add_action( 'bp_template_content', 'bp_messages_star_content' );
+
+	/**
+	 * Fires right before the loading of the "Starred" messages box.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 */
+	do_action( 'bp_messages_screen_star' );
+
+	bp_core_load_template( 'members/single/plugins' );
+}
+
+/**
+ * Screen content callback to display a user's "Starred" messages page.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_messages_star_content() {
+	// add our message thread filter
+	add_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_filter_starred_message_threads' );
+
+	// load the message loop template part
+	bp_get_template_part( 'members/single/messages/messages-loop' );
+
+	// remove our filter
+	remove_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_filter_starred_message_threads' );
+}
+
+/**
+ * Filter message threads by those starred by the logged-in user.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  array $r Current message thread arguments.
+ * @return array
+ */
+function bp_messages_filter_starred_message_threads( $r = array() ) {
+	$r['box'] = 'starred';
+	$r['meta_query'] = array( array(
+		'key'   => 'starred_by_user',
+		'value' => $r['user_id']
+	) );
+
+	return $r;
+}
+
+/** ACTIONS **************************************************************/
+
+/**
+ * Action handler to set a message's star status for those not using JS.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_messages_star_action_handler() {
+	if ( ! bp_is_user_messages() ) {
+		return;
+	}
+
+	if ( false === ( bp_is_current_action( 'unstar' ) || bp_is_current_action( 'star' ) ) ) {
+		return;
+	}
+
+	if ( ! wp_verify_nonce( bp_action_variable( 1 ), 'bp-messages-star-' . bp_action_variable( 0 ) ) ) {
+		wp_die( "Oops!  That's a no-no!" );
+	}
+
+	// Check capability
+	if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) {
+		return;
+	}
+
+	// mark the star
+	bp_messages_star_set_action( array(
+		'action'     => bp_current_action(),
+		'message_id' => bp_action_variable(),
+		'bulk'       => (bool) bp_action_variable( 2 )
+	) );
+
+	// redirect back to previous screen
+	$redirect = wp_get_referer() ? wp_get_referer() : bp_loggedin_user_domain() . bp_get_messages_slug();
+	bp_core_redirect( $redirect );
+	die();
+}
+add_action( 'bp_actions', 'bp_messages_star_action_handler' );
+
+/**
+ * Bulk manage handler to set the star status for multiple messages.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_messages_star_bulk_manage_handler() {
+	if ( empty( $_POST['messages_bulk_nonce' ] ) ) {
+		return;
+	}
+
+	// Check the nonce.
+	if ( ! wp_verify_nonce( $_POST['messages_bulk_nonce'], 'messages_bulk_nonce' ) ) {
+		return;
+	}
+
+	// Check capability
+	if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) {
+		return;
+	}
+
+	$action  = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : '';
+	$threads = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : '';
+	$threads = wp_parse_id_list( $threads );
+
+	// Bail if action doesn't match our star actions or no IDs.
+	if ( false === in_array( $action, array( 'star', 'unstar' ), true ) || empty( $threads ) ) {
+		return;
+	}
+
+	// It's star time!
+	switch ( $action ) {
+		case 'star' :
+			$count = count( $threads );
+
+			// if we're starring a thread, we only star the first message in the thread
+			foreach ( $threads as $thread ) {
+				$thread = new BP_Messages_thread( $thread );
+				$mids = wp_list_pluck( $thread->messages, 'id' );
+
+				bp_messages_star_set_action( array(
+					'action'     => 'star',
+					'message_id' => $mids[0],
+				) );
+			}
+
+			bp_core_add_message( sprintf( _n( '%s message was successfully starred', '%s messages were successfully starred', $count, 'buddypress' ), $count ) );
+			break;
+
+		case 'unstar' :
+			$count = count( $threads );
+
+			foreach ( $threads as $thread ) {
+				bp_messages_star_set_action( array(
+					'action'    => 'unstar',
+					'thread_id' => $thread,
+					'bulk'      => true
+				) );
+			}
+
+			bp_core_add_message( sprintf( _n( '%s message was successfully unstarred', '%s messages were successfully unstarred', $count, 'buddypress' ), $count ) );
+			break;
+	}
+
+	// Redirect back to message box.
+	bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' );
+	die();
+}
+add_action( 'bp_actions', 'bp_messages_star_bulk_manage_handler', 5 );
+
+/** HOOKS ****************************************************************/
+
+/**
+ * Enqueues the dashicons font.
+ *
+ * The dashicons font is used for the star / unstar icon.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_messages_star_enqueue_scripts() {
+	if ( ! bp_is_user_messages() ) {
+		return;
+	}
+
+	wp_enqueue_style( 'dashicons' );
+}
+add_action( 'bp_enqueue_scripts', 'bp_messages_star_enqueue_scripts' );
+
+/**
+ * Add the "Add star" and "Remove star" options to the bulk management list.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_messages_star_bulk_management_dropdown() {
+?>
+
+	<option value="star"><?php _e( 'Add star', 'buddypress' ); ?></option>
+	<option value="unstar"><?php _e( 'Remove star', 'buddypress' ); ?></option>
+
+<?php
+}
+add_action( 'bp_messages_bulk_management_dropdown', 'bp_messages_star_bulk_management_dropdown', 1 );
+
+/**
+ * Add CSS class for the current message depending on starred status.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  array $retval Current CSS classes
+ * @return array
+ */
+function bp_messages_star_message_css_class( $retval = array() ) {
+	if ( true === bp_messages_is_message_starred( bp_get_the_thread_message_id() ) ) {
+		$status = 'starred';
+	} else {
+		$status = 'not-starred';
+	}
+
+	// add css class based on star status for the current message
+	$retval[] = "message-{$status}";
+
+	return $retval;
+}
+add_filter( 'bp_get_the_thread_message_css_class', 'bp_messages_star_message_css_class' );
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
index 90ed2f61cdaa614a60f1238c4274ce862f155f51..c1df3db167bb3b9fb7ea1f1407be371b6c20ec97 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php
@@ -1,14 +1,14 @@
 <?php
 
 /**
- * BuddyPress Messages Template Tags
+ * BuddyPress Messages Template Tags.
  *
  * @package BuddyPress
  * @subpackage MessagesTemplate
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Message Box Template Class
@@ -72,7 +72,7 @@ class BP_Messages_Box_Template {
 	public $user_id = 0;
 
 	/**
-	 * The current "box" view ('notices', 'sentbox', 'inbox')
+	 * The current "box" view ('notices', 'sentbox', 'inbox').
 	 *
 	 * @access public
 	 * @var string
@@ -114,34 +114,65 @@ class BP_Messages_Box_Template {
 	/**
 	 * Constructor method.
 	 *
-	 * @param int $user_id ID of the user whose Messages box is being
-	 *        viewed.
-	 * @param string $box Type of box being viewed ('notices', 'sentbox',
-	 *        'inbox').
-	 * @param int $per_page Number of thread to return per page of results.
-	 * @param int $max Max number of results to return.
-	 * @param string $type Type of results to return. 'unread', 'read',
-	 *        or 'all'.
-	 * @param string $search_terms Search terms for limiting results.
-	 * @param string $page_arg Optional. URL argument for pagination
-	 *        parameter. Default: 'mpage'.
-	 */
-	public function __construct( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg = 'mpage' ) {
-		$this->pag_page = isset( $_GET[$page_arg] ) ? intval( $_GET[$page_arg] ) : 1;
-		$this->pag_num  = isset( $_GET['num'] )   ? intval( $_GET['num'] )   : $per_page;
-
-		$this->user_id      = $user_id;
-		$this->box          = $box;
-		$this->type         = $type;
-		$this->search_terms = $search_terms;
-
-		if ( 'notices' == $this->box ) {
+	 * @param array $args {
+	 *     Array of arguments. See bp_has_message_threads() for full description.
+	 * }
+	 */
+	public function __construct( $args = array() ) {
+
+		// Backward compatibility with old method of passing arguments
+		if ( ! is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '2.2.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__ ) );
+
+			$old_args_keys = array(
+				0 => 'user_id',
+				1 => 'box',
+				2 => 'per_page',
+				3 => 'max',
+				4 => 'type',
+				5 => 'search_terms',
+				6 => 'page_arg'
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$r = wp_parse_args( $args, array(
+			'page'         => 1,
+			'per_page'     => 10,
+			'page_arg'     => 'mpage',
+			'box'          => 'inbox',
+			'type'         => 'all',
+			'user_id'      => bp_loggedin_user_id(),
+			'max'          => false,
+			'search_terms' => '',
+			'meta_query'   => array(),
+		) );
+
+		$this->pag_arg      = sanitize_key( $r['page_arg'] );
+		$this->pag_page     = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num      = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
+		$this->user_id      = $r['user_id'];
+		$this->box          = $r['box'];
+		$this->type         = $r['type'];
+		$this->search_terms = $r['search_terms'];
+
+		if ( 'notices' === $this->box ) {
 			$this->threads = BP_Messages_Notice::get_notices( array(
 				'pag_num'  => $this->pag_num,
 				'pag_page' => $this->pag_page
 			) );
 		} else {
-			$threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page, $this->search_terms );
+			$threads = BP_Messages_Thread::get_current_threads_for_user( array(
+				'user_id'      => $this->user_id,
+				'box'          => $this->box,
+				'type'         => $this->type,
+				'limit'        => $this->pag_num,
+				'page'         => $this->pag_page,
+				'search_terms' => $this->search_terms,
+				'meta_query'   => $r['meta_query'],
+			) );
 
 			$this->threads            = $threads['threads'];
 			$this->total_thread_count = $threads['total'];
@@ -153,19 +184,19 @@ class BP_Messages_Box_Template {
 		} else {
 			$total_notice_count = BP_Messages_Notice::get_total_notice_count();
 
-			if ( !$max || $max >= (int) $total_notice_count ) {
-				if ( 'notices' == $this->box ) {
+			if ( empty( $r['max'] ) || ( (int) $r['max'] >= (int) $total_notice_count ) ) {
+				if ( 'notices' === $this->box ) {
 					$this->total_thread_count = (int) $total_notice_count;
 				}
 			} else {
-				$this->total_thread_count = (int) $max;
+				$this->total_thread_count = (int) $r['max'];
 			}
 
-			if ( $max ) {
-				if ( $max >= count( $this->threads ) ) {
+			if ( ! empty( $r['max'] ) ) {
+				if ( (int) $r['max'] >= count( $this->threads ) ) {
 					$this->thread_count = count( $this->threads );
 				} else {
-					$this->thread_count = (int) $max;
+					$this->thread_count = (int) $r['max'];
 				}
 			} else {
 				$this->thread_count = count( $this->threads );
@@ -174,7 +205,7 @@ class BP_Messages_Box_Template {
 
 		if ( (int) $this->total_thread_count && (int) $this->pag_num ) {
 			$pag_args = array(
-				$page_arg => '%#%',
+				$r['page_arg'] => '%#%',
 			);
 
 			if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) {
@@ -183,8 +214,10 @@ class BP_Messages_Box_Template {
 				$base = '';
 			}
 
+			$add_args = array();
+
 			if ( ! empty( $this->search_terms ) ) {
-				$pag_args['s'] = $this->search_terms;
+				$add_args['s'] = $this->search_terms;
 			}
 
 			$this->pag_links = paginate_links( array(
@@ -194,7 +227,8 @@ class BP_Messages_Box_Template {
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Message pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Message pagination next text', 'buddypress' ),
-				'mid_size'  => 1
+				'mid_size'  => 1,
+				'add_args'  => $add_args,
 			) );
 		}
 	}
@@ -251,7 +285,13 @@ class BP_Messages_Box_Template {
 		if ( $this->current_thread + 1 < $this->thread_count ) {
 			return true;
 		} elseif ( $this->current_thread + 1 == $this->thread_count ) {
-			do_action('messages_box_loop_end');
+
+			/**
+			 * Fires when at the end of threads to iterate over.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'messages_box_loop_end' );
 			// Do some cleaning up after the loop
 			$this->rewind_threads();
 		}
@@ -307,6 +347,12 @@ class BP_Messages_Box_Template {
 
 		// loop has just started
 		if ( 0 == $this->current_thread ) {
+
+			/**
+			 * Fires if at the start of the message thread loop.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
 			do_action( 'messages_box_loop_start' );
 		}
 	}
@@ -323,18 +369,20 @@ class BP_Messages_Box_Template {
  *
  * @global BP_Messages_Box_Template $messages_template
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of arguments. All are optional.
- *     @type int $user_id ID of the user whose threads are being loaded.
- *           Default: ID of the logged-in user.
- *     @type string $box Current "box" view. If not provided here, the current
- *           view will be inferred from the URL.
- *     @type int $per_page Number of results to return per page. Default: 10.
- *     @type int $max Max results to return. Default: false.
+ *     @type int    $user_id      ID of the user whose threads are being loaded.
+ *                                Default: ID of the logged-in user.
+ *     @type string $box          Current "box" view. If not provided here, the current
+ *                                view will be inferred from the URL.
+ *     @type int    $per_page     Number of results to return per page. Default: 10.
+ *     @type int    $max          Max results to return. Default: false.
  *     @type string $search_terms Terms to which to limit results. Default:
- *           the value of $_REQUEST['s'].
- *     @type string $page_arg URL argument used for the pagination param.
- *           Default: 'mpage'.
+ *                                the value of $_REQUEST['s'].
+ *     @type string $page_arg     URL argument used for the pagination param.
+ *                                Default: 'mpage'.
+ *     @type array  $meta_query   Meta query arguments. Only applicable if $box is
+ *                                not 'notices'. See WP_Meta_Query more details.
  * }
  * @return bool True if there are threads to display, otherwise false.
  */
@@ -359,6 +407,7 @@ function bp_has_message_threads( $args = '' ) {
 		'type'         => 'all',
 		'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '',
 		'page_arg'     => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679
+		'meta_query'   => array()
 	), 'has_message_threads' );
 
 	// If trying to access notices without capabilities, redirect to root domain
@@ -367,16 +416,17 @@ function bp_has_message_threads( $args = '' ) {
 	}
 
 	// Load the messages loop global up with messages
-	$messages_template = new BP_Messages_Box_Template(
-		$r['user_id'],
-		$r['box'],
-		$r['per_page'],
-		$r['max'],
-		$r['type'],
-		$r['search_terms'],
-		$r['page_arg']
-	);
+	$messages_template = new BP_Messages_Box_Template( $r );
 
+	/**
+	 * Filters if there are any message threads to display in inbox/sentbox/notices.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool                     $value             Whether or not the message has threads.
+	 * @param BP_Messages_Box_Template $messages_template Current message box template object.
+	 * @param array                    $r                 Array of parsed arguments passed into function.
+	 */
 	return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), $messages_template, $r );
 }
 
@@ -414,6 +464,13 @@ function bp_message_thread_id() {
 	function bp_get_message_thread_id() {
 		global $messages_template;
 
+		/**
+		 * Filters the ID of the current thread in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $thread_id ID of the current thread in the loop.
+		 */
 		return apply_filters( 'bp_get_message_thread_id', $messages_template->thread->thread_id );
 	}
 
@@ -431,6 +488,13 @@ function bp_message_thread_subject() {
 	function bp_get_message_thread_subject() {
 		global $messages_template;
 
+		/**
+		 * Filters the subject of the current thread in the loop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Subject of the current thread in the loop.
+		 */
 		return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) );
 	}
 
@@ -448,11 +512,18 @@ function bp_message_thread_excerpt() {
 	function bp_get_message_thread_excerpt() {
 		global $messages_template;
 
+		/**
+		 * Filters the excerpt of the current thread in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Excerpt of the current thread in the loop.
+		 */
 		return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $messages_template->thread->last_message_content, 75 ) ) );
 	}
 
 /**
- * Output the thread's last message content
+ * Output the thread's last message content.
  *
  * When viewing your Inbox, the last message is the most recent message in
  * the thread of which you are *not* the author.
@@ -466,7 +537,7 @@ function bp_message_thread_content() {
 	echo bp_get_message_thread_content();
 }
 	/**
-	 * Return the thread's last message content
+	 * Return the thread's last message content.
 	 *
 	 * When viewing your Inbox, the last message is the most recent message in
 	 * the thread of which you are *not* the author.
@@ -475,11 +546,18 @@ function bp_message_thread_content() {
 	 * the thread of which you *are* the member.
 	 *
 	 * @since BuddyPress (2.0.0)
-	 * @return string The raw content of the last message in the thread
+	 * @return string The raw content of the last message in the thread.
 	 */
 	function bp_get_message_thread_content() {
 		global $messages_template;
 
+		/**
+		 * Filters the content of the last message in the thread.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $last_message_content Content of the last message in the thread.
+		 */
 		return apply_filters( 'bp_get_message_thread_content', $messages_template->thread->last_message_content );
 	}
 
@@ -497,6 +575,13 @@ function bp_message_thread_from() {
 	function bp_get_message_thread_from() {
 		global $messages_template;
 
+		/**
+		 * Filters the link to the page of the current thread's last author.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Link to the page of the current thread's last author.
+		 */
 		return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink( $messages_template->thread->last_sender_id ) );
 	}
 
@@ -513,6 +598,14 @@ function bp_message_thread_to() {
 	 */
 	function bp_get_message_thread_to() {
 		global $messages_template;
+
+		/**
+		 * Filters the HTML links to the pages of the current thread's recipients.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value HTML links to the pages of the current thread's recipients.
+		 */
 		return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients ) );
 	}
 
@@ -520,7 +613,7 @@ function bp_message_thread_to() {
  * Output the permalink for a particular thread.
  *
  * @param int $thread_id Optional. ID of the thread. Default: current thread
- *        being iterated on in the loop.
+ *                       being iterated on in the loop.
  */
 function bp_message_thread_view_link( $thread_id = 0 ) {
 	echo bp_get_message_thread_view_link( $thread_id );
@@ -529,7 +622,7 @@ function bp_message_thread_view_link( $thread_id = 0 ) {
 	 * Get the permalink of a particular thread.
 	 *
 	 * @param int $thread_id Optional. ID of the thread. Default: current
-	 *        thread being iterated on in the loop.
+	 *                       thread being iterated on in the loop.
 	 * @return string
 	 */
 	function bp_get_message_thread_view_link( $thread_id = 0 ) {
@@ -541,6 +634,13 @@ function bp_message_thread_view_link( $thread_id = 0 ) {
 			$thread_id = $messages_template->thread->thread_id;
 		}
 
+		/**
+		 * Filters the permalink of a particular thread.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value permalink of a particular thread.
+		 */
 		return apply_filters( 'bp_get_message_thread_view_link', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id ) );
 	}
 
@@ -557,9 +657,112 @@ function bp_message_thread_delete_link() {
 	 */
 	function bp_get_message_thread_delete_link() {
 		global $messages_template;
+
+		/**
+		 * Filters the URL for deleting the current thread.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for deleting the current thread.
+		 * @param string $value Text indicating action being executed.
+		 */
 		return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
 	}
 
+/**
+ * Output the URL used for marking a single message thread as unread.
+ *
+ * Since this function directly outputs a URL, it is escaped.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_the_message_thread_mark_unread_url() {
+	echo esc_url( bp_get_the_message_thread_mark_unread_url() );
+}
+	/**
+	 * Return the URL used for marking a single message thread as unread.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @return string
+	 */
+	function bp_get_the_message_thread_mark_unread_url() {
+
+		// Get the message ID.
+		$id = bp_get_message_thread_id();
+
+		// Get the args to add to the URL.
+		$args = array(
+			'action'     => 'unread',
+			'message_id' => $id
+		);
+
+		// Base unread URL.
+		$url = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/unread' );
+
+		// Add the args to the URL.
+		$url = add_query_arg( $args, $url );
+
+		// Add the nonce.
+		$url = wp_nonce_url( $url, 'bp_message_thread_mark_unread_' . $id );
+
+		/**
+		 * Filters the URL used for marking a single message thread as unread.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param string $url URL used for marking a single message thread as unread.
+		 */
+		return apply_filters( 'bp_get_the_message_thread_mark_unread_url', $url );
+	}
+
+/**
+ * Output the URL used for marking a single message thread as read.
+ *
+ * Since this function directly outputs a URL, it is escaped.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_the_message_thread_mark_read_url() {
+	echo esc_url( bp_get_the_message_thread_mark_read_url() );
+}
+	/**
+	 * Return the URL used for marking a single message thread as read.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @return string
+	 */
+	function bp_get_the_message_thread_mark_read_url() {
+
+		// Get the message ID.
+		$id = bp_get_message_thread_id();
+
+		// Get the args to add to the URL.
+		$args = array(
+			'action'     => 'read',
+			'message_id' => $id
+		);
+
+		// Base read URL.
+		$url = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/read' );
+
+		// Add the args to the URL.
+		$url = add_query_arg( $args, $url );
+
+		// Add the nonce.
+		$url = wp_nonce_url( $url, 'bp_message_thread_mark_read_' . $id );
+
+		/**
+		 * Filters the URL used for marking a single message thread as read.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param string $url URL used for marking a single message thread as read.
+		 */
+		return apply_filters( 'bp_get_the_message_thread_mark_read_url', $url );
+	}
+
 /**
  * Output the CSS class for the current thread.
  */
@@ -580,6 +783,13 @@ function bp_message_css_class() {
 			$class .= 'alt';
 		}
 
+		/**
+		 * Filters the CSS class for the current thread.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param string $class Class string to be added to the list of classes.
+		 */
 		return apply_filters( 'bp_get_message_css_class', trim( $class ) );
 	}
 
@@ -595,6 +805,13 @@ function bp_message_thread_has_unread() {
 		? true
 		: false;
 
+	/**
+	 * Filters whether or not a message thread has unread items.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not a message thread has unread items.
+	 */
 	return apply_filters( 'bp_message_thread_has_unread', $retval );
 }
 
@@ -616,9 +833,92 @@ function bp_message_thread_unread_count() {
 			? (int) $messages_template->thread->unread_count
 			: false;
 
+		/**
+		 * Filters the current thread's unread count.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $count Current thread unread count.
+		 */
 		return apply_filters( 'bp_get_message_thread_unread_count', $count );
 	}
 
+/**
+ * Output a thread's total message count.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int|bool $thread_id Optional. ID of the thread. Defaults to current thread ID.
+ */
+function bp_message_thread_total_count( $thread_id = false ) {
+	echo bp_get_message_thread_total_count( $thread_id );
+}
+	/**
+	 * Get the current thread's total message count.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param int|bool $thread_id Optional. ID of the thread.
+	 *                            Defaults to current thread ID.
+	 *
+	 * @return int
+	 */
+	function bp_get_message_thread_total_count( $thread_id = false ) {
+		if ( false === $thread_id ) {
+			$thread_id = bp_get_message_thread_id();
+		}
+
+		$thread_template = new BP_Messages_Thread_Template( $thread_id, 'ASC', array(
+			'update_meta_cache' => false
+		) );
+
+		$count = 0;
+		if ( ! empty( $thread_template->message_count ) ) {
+			$count = intval( $thread_template->message_count );
+		}
+
+		/**
+		 * Filters the current thread's total message count.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int $count Current thread total message count.
+		 */
+		return apply_filters( 'bp_get_message_thread_total_count', $count );
+	}
+
+/**
+ * Output markup for the current thread's total and unread count.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID.
+ */
+function bp_message_thread_total_and_unread_count( $thread_id = false ) {
+	echo bp_get_message_thread_total_and_unread_count( $thread_id );
+}
+	/**
+	 * Get markup for the current thread's total and unread count.
+	 *
+	 * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID.
+	 *
+	 * @return string Markup displaying the total and unread count for the thread.
+	 */
+	function bp_get_message_thread_total_and_unread_count( $thread_id = false ) {
+		if ( false === $thread_id ) {
+			$thread_id = bp_get_message_thread_id();
+		}
+
+		$total  = bp_get_message_thread_total_count( $thread_id );
+		$unread = bp_get_message_thread_unread_count( $thread_id );
+
+		return sprintf(
+			'<span class="thread-count">(%1$s)</span> <span class="bp-screen-reader-text">%2$s</span>',
+			number_format_i18n( $total ),
+			sprintf( _n( '%d unread', '%d unread', $unread, 'buddypress' ), number_format_i18n( $unread ) )
+		);
+	}
+
 /**
  * Output the unformatted date of the last post in the current thread.
  */
@@ -633,6 +933,13 @@ function bp_message_thread_last_post_date_raw() {
 	function bp_get_message_thread_last_post_date_raw() {
 		global $messages_template;
 
+		/**
+		 * Filters the unformatted date of the last post in the current thread.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $last_message_date Unformatted date of the last post in the current thread.
+		 */
 		return apply_filters( 'bp_get_message_thread_last_message_date', $messages_template->thread->last_message_date );
 	}
 
@@ -648,6 +955,14 @@ function bp_message_thread_last_post_date() {
 	 * @return string
 	 */
 	function bp_get_message_thread_last_post_date() {
+
+		/**
+		 * Filters the nicely formatted date of the last post in the current thread.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $value Formatted date of the last post in the current thread.
+		 */
 		return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( bp_get_message_thread_last_post_date_raw() ) ) );
 	}
 
@@ -656,7 +971,7 @@ function bp_message_thread_last_post_date() {
  *
  * @see bp_get_message_thread_avatar() for a description of arguments.
  *
- * @param array $args See {@link bp_get_message_thread_avatar()}.
+ * @param array|string $args See {@link bp_get_message_thread_avatar()}.
  */
 function bp_message_thread_avatar( $args = '' ) {
 	echo bp_get_message_thread_avatar( $args );
@@ -667,18 +982,18 @@ function bp_message_thread_avatar( $args = '' ) {
 	 * @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()}.
-	 *     @type string $type Default: 'thumb'.
-	 *     @type int|bool $width Default: false.
-	 *     @type int|bool $height Default: false.
-	 *     @type string $class Default: 'avatar'.
-	 *     @type string|bool $id Default: false.
-	 *     @type string $alt Default: 'Profile picture of [display name]'.
+	 *     @type string      $type   Default: 'thumb'.
+	 *     @type int|bool    $width  Default: false.
+	 *     @type int|bool    $height Default: false.
+	 *     @type string      $class  Default: 'avatar'.
+	 *     @type string|bool $id     Default: false.
+	 *     @type string      $alt    Default: 'Profile picture of [display name]'.
 	 * }
-	 * @return User avatar string.
+	 * @return string User avatar string.
 	 */
 	function bp_get_message_thread_avatar( $args = '' ) {
 		global $messages_template;
@@ -695,6 +1010,13 @@ function bp_message_thread_avatar( $args = '' ) {
 			'alt'    => $alt
 		) );
 
+		/**
+		 * Filters the avatar for the last sender in the current message thread.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value User avatar string.
+		 */
 		return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array(
 			'item_id' => $messages_template->thread->last_sender_id,
 			'type'    => $r['type'],
@@ -718,6 +1040,14 @@ function bp_total_unread_messages_count() {
 	 * @return int
 	 */
 	function bp_get_total_unread_messages_count() {
+
+		/**
+		 * Filters the unread messages count for the current inbox.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $value Unread messages count for the current inbox.
+		 */
 		return apply_filters( 'bp_get_total_unread_messages_count', BP_Messages_Thread::get_inbox_count() );
 	}
 
@@ -734,6 +1064,14 @@ function bp_messages_pagination() {
 	 */
 	function bp_get_messages_pagination() {
 		global $messages_template;
+
+		/**
+		 * Filters the pagination HTML for the current thread loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param int $pag_links Pagination HTML for the current thread loop.
+		 */
 		return apply_filters( 'bp_get_messages_pagination', $messages_template->pag_links );
 	}
 
@@ -750,25 +1088,53 @@ function bp_messages_pagination_count() {
 	$to_num    = bp_core_number_format( ( $start_num + ( $messages_template->pag_num - 1 ) > $messages_template->total_thread_count ) ? $messages_template->total_thread_count : $start_num + ( $messages_template->pag_num - 1 ) );
 	$total     = bp_core_number_format( $messages_template->total_thread_count );
 
-	echo sprintf( _n( 'Viewing 1 message', 'Viewing %1$s - %2$s of %3$s messages', $total, 'buddypress' ), $from_num, $to_num, number_format_i18n( $total ) );
+	if ( 1 == $messages_template->total_thread_count ) {
+		$message = __( 'Viewing 1 message', 'buddypress' );
+	} else {
+		$message = sprintf( _n( 'Viewing %1$s - %2$s of %3$s message', 'Viewing %1$s - %2$s of %3$s messages', $messages_template->total_thread_count, 'buddypress' ), $from_num, $to_num, $total );
+	}
+
+	echo $message;
 }
 
 /**
  * Output the Private Message search form.
  *
+ * @todo  Move markup to template part in: /members/single/messages/search.php
  * @since BuddyPress (1.6.0)
  */
 function bp_message_search_form() {
 
+	// Get the default search text
 	$default_search_value = bp_get_search_default_text( 'messages' );
-	$search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?>
+
+	// Setup a few values based on what's being searched for
+	$search_submitted     = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value;
+	$search_placeholder   = ( $search_submitted === $default_search_value ) ? ' placeholder="' .  esc_attr( $search_submitted ) . '"' : '';
+	$search_value         = ( $search_submitted !== $default_search_value ) ? ' value="'       .  esc_attr( $search_submitted ) . '"' : '';
+
+	// Start the output buffer, so form can be filtered
+	ob_start(); ?>
 
 	<form action="" method="get" id="search-message-form">
-		<label><input type="text" name="s" id="messages_search" <?php if ( $search_value === $default_search_value ) : ?>placeholder="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> <?php if ( $search_value !== $default_search_value ) : ?>value="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> /></label>
-		<input type="submit" id="messages_search_submit" name="messages_search_submit" value="<?php esc_attr_e( 'Search', 'buddypress' ) ?>" />
+		<label for="messages_search" class="bp-screen-reader-text"><?php esc_html_e( 'Search Messages', 'buddypress' ); ?></label>
+		<input type="text" name="s" id="messages_search"<?php echo $search_placeholder . $search_value; ?> />
+		<input type="submit" class="button" id="messages_search_submit" name="messages_search_submit" value="<?php esc_html_e( 'Search', 'buddypress' ); ?>" />
 	</form>
 
-<?php
+	<?php
+
+	// Get the search form from the above output buffer
+	$search_form_html = ob_get_clean();
+
+	/**
+	 * Filters the private message component search form.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param string $search_form_html HTML markup for the message search form.
+	 */
+	echo apply_filters( 'bp_message_search_form', $search_form_html );
 }
 
 /**
@@ -780,9 +1146,17 @@ function bp_messages_form_action() {
 	/**
 	 * Return the form action for Messages HTML forms.
 	 *
-	 * @return string The form action
+	 * @return string The form action.
 	 */
 	function bp_get_messages_form_action() {
+
+		/**
+		 * Filters the form action for Messages HTML forms.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value The form action.
+		 */
 		return apply_filters( 'bp_get_messages_form_action', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' . bp_action_variable( 0 ) ) );
 	}
 
@@ -799,8 +1173,20 @@ function bp_messages_username_value() {
 	 */
 	function bp_get_messages_username_value() {
 		if ( isset( $_COOKIE['bp_messages_send_to'] ) ) {
+
+			/**
+			 * Filters the default username for the recipient box.
+			 *
+			 * Value passed into filter is dependent on if the 'bp_messages_send_to'
+			 * cookie or 'r' $_GET parameter is set.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param string $value Default user name.
+			 */
 			return apply_filters( 'bp_get_messages_username_value', $_COOKIE['bp_messages_send_to'] );
-		} else if ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) {
+		} elseif ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) {
+			/** This filter is documented in bp-messages-template.php */
 			return apply_filters( 'bp_get_messages_username_value', $_GET['r'] );
 		}
 	}
@@ -824,6 +1210,13 @@ function bp_messages_subject_value() {
 			? $_POST['subject']
 			: '';
 
+		/**
+		 * Filters the default value for the subject field.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $subject The default value for the subject field.
+		 */
 		return apply_filters( 'bp_get_messages_subject_value', $subject );
 	}
 
@@ -847,6 +1240,13 @@ function bp_messages_content_value() {
 			? $_POST['content']
 			: '';
 
+		/**
+		 * Filters the default value for the content field.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $content The default value for the content field.
+		 */
 		return apply_filters( 'bp_get_messages_content_value', $content );
 	}
 
@@ -856,16 +1256,18 @@ function bp_messages_content_value() {
 function bp_messages_options() {
 ?>
 
-	<?php _e( 'Select:', 'buddypress' ) ?>
+	<label for="message-type-select" class="bp-screen-reader-text">
+		<?php _e( 'Select:', 'buddypress' ) ?>
+	 </label>
 
 	<select name="message-type-select" id="message-type-select">
-		<option value=""></option>
+		<option value=""><?php _e( 'Select', 'buddypress' ); ?></option>
 		<option value="read"><?php _ex('Read', 'Message dropdown filter', 'buddypress') ?></option>
 		<option value="unread"><?php _ex('Unread', 'Message dropdown filter', 'buddypress') ?></option>
 		<option value="all"><?php _ex('All', 'Message dropdown filter', 'buddypress') ?></option>
 	</select> &nbsp;
 
-	<?php if ( ! bp_is_current_action( 'sentbox' ) && bp_is_current_action( 'notices' ) ) : ?>
+	<?php if ( ! bp_is_current_action( 'sentbox' ) && ! bp_is_current_action( 'notices' ) ) : ?>
 
 		<a href="#" id="mark_as_read"><?php _ex('Mark as Read', 'Message management markup', 'buddypress') ?></a> &nbsp;
 		<a href="#" id="mark_as_unread"><?php _ex('Mark as Unread', 'Message management markup', 'buddypress') ?></a> &nbsp;
@@ -877,6 +1279,32 @@ function bp_messages_options() {
 <?php
 }
 
+/**
+ * Output the dropdown for bulk management of messages.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_messages_bulk_management_dropdown() {
+	?>
+	<label class="bp-screen-reader-text" for="messages-select"><?php _e( 'Select Bulk Action', 'buddypress' ); ?></label>
+	<select name="messages_bulk_action" id="messages-select">
+		<option value="" selected="selected"><?php _e( 'Bulk Actions', 'buddypress' ); ?></option>
+		<option value="read"><?php _e( 'Mark read', 'buddypress' ); ?></option>
+		<option value="unread"><?php _e( 'Mark unread', 'buddypress' ); ?></option>
+		<option value="delete"><?php _e( 'Delete', 'buddypress' ); ?></option>
+		<?php
+			/**
+			 * Action to add additional options to the messages bulk management dropdown.
+			 *
+			 * @since BuddyPress (2.3.0)
+			 */
+			do_action( 'bp_messages_bulk_management_dropdown' );
+		?>
+	</select>
+	<input type="submit" id="messages-bulk-manage" class="button action" value="<?php esc_attr_e( 'Apply', 'buddypress' ); ?>">
+	<?php
+}
+
 /**
  * Return whether or not the notice is currently active.
  *
@@ -889,6 +1317,13 @@ function bp_messages_is_active_notice() {
 		? true
 		: false;
 
+	/**
+	 * Filters whether or not the notice is currently active.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $retval Whether or not the notice is currently active.
+	 */
 	return apply_filters( 'bp_messages_is_active_notice', $retval );
 }
 
@@ -936,6 +1371,14 @@ function bp_message_notice_id() {
 	 */
 	function bp_get_message_notice_id() {
 		global $messages_template;
+
+		/**
+		 * Filters the ID of the current notice in the loop.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param int $id ID of the current notice in the loop.
+		 */
 		return apply_filters( 'bp_get_message_notice_id', $messages_template->thread->id );
 	}
 
@@ -952,6 +1395,14 @@ function bp_message_notice_post_date() {
 	 */
 	function bp_get_message_notice_post_date() {
 		global $messages_template;
+
+		/**
+		 * Filters the post date of the current notice in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Formatted post date of the current notice in the loop.
+		 */
 		return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime( $messages_template->thread->date_sent ) ) );
 	}
 
@@ -968,6 +1419,14 @@ function bp_message_notice_subject() {
 	 */
 	function bp_get_message_notice_subject() {
 		global $messages_template;
+
+		/**
+		 * Filters the subject of the current notice in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $subject Subject of the current notice in the loop.
+		 */
 		return apply_filters( 'bp_get_message_notice_subject', $messages_template->thread->subject );
 	}
 
@@ -984,6 +1443,14 @@ function bp_message_notice_text() {
 	 */
 	function bp_get_message_notice_text() {
 		global $messages_template;
+
+		/**
+		 * Filters the text of the current notice in the loop.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $message Text for the current notice in the loop.
+		 */
 		return apply_filters( 'bp_get_message_notice_text', $messages_template->thread->message );
 	}
 
@@ -1001,6 +1468,14 @@ function bp_message_notice_delete_link() {
 	function bp_get_message_notice_delete_link() {
 		global $messages_template;
 
+		/**
+		 * Filters the URL for deleting the current notice.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for deleting the current notice.
+		 * @param string $value Text indicating action being executed.
+		 */
 		return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) );
 	}
 
@@ -1023,6 +1498,14 @@ function bp_message_activate_deactivate_link() {
 		} else {
 			$link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' );
 		}
+
+		/**
+		 * Filters the URL for deactivating the current notice.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $link URL for deactivating the current notice.
+		 */
 		return apply_filters( 'bp_get_message_activate_deactivate_link', $link );
 	}
 
@@ -1033,7 +1516,7 @@ function bp_message_activate_deactivate_text() {
 	echo bp_get_message_activate_deactivate_text();
 }
 	/**
-	 * Generate the text ('Deactivate' or 'Activate' for the notice action link.
+	 * Generate the text ('Deactivate' or 'Activate') for the notice action link.
 	 *
 	 * @return string
 	 */
@@ -1045,6 +1528,14 @@ function bp_message_activate_deactivate_text() {
 		} else {
 			$text = __('Activate', 'buddypress');
 		}
+
+		/**
+		 * Filters the "Deactivate" or "Activate" text for notice action links.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $text Text used for notice action links.
+		 */
 		return apply_filters( 'bp_message_activate_deactivate_text', $text );
 	}
 
@@ -1066,6 +1557,14 @@ function bp_messages_slug() {
 	 * @return string
 	 */
 	function bp_get_messages_slug() {
+
+		/**
+		 * Filters the messages component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Messages component slug.
+		 */
 		return apply_filters( 'bp_get_messages_slug', buddypress()->messages->slug );
 	}
 
@@ -1117,6 +1616,13 @@ function bp_send_private_message_link() {
 			return false;
 		}
 
+		/**
+		 * Filters the URL for the Private Message link in member profile headers.
+		 *
+		 * @since BuddyPress (1.2.10)
+		 *
+		 * @param string $value URL for the Private Message link in member profile headers.
+		 */
 		return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id() ) ) );
 	}
 
@@ -1148,6 +1654,14 @@ function bp_send_message_button() {
 		// Note: 'bp_get_send_message_button' is a legacy filter. Use
 		// 'bp_get_send_message_button_args' instead. See #4536
 		return apply_filters( 'bp_get_send_message_button',
+
+			/**
+			 * Filters the "Private Message" button for member profile headers.
+			 *
+			 * @since BuddyPress (1.8.0)
+			 *
+			 * @param array $value See {@link BP_Button}.
+			 */
 			bp_get_button( apply_filters( 'bp_get_send_message_button_args', array(
 				'id'                => 'private_message',
 				'component'         => 'messages',
@@ -1174,6 +1688,14 @@ function bp_message_loading_image_src() {
 	 * @return string
 	 */
 	function bp_get_message_loading_image_src() {
+
+		/**
+		 * Filters the URL of the Messages AJAX loader gif.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL of the Messages AJAX loader gif.
+		 */
 		return apply_filters( 'bp_get_message_loading_image_src', buddypress()->messages->image_base . '/ajax-loader.gif' );
 	}
 
@@ -1216,6 +1738,13 @@ function bp_message_get_recipient_usernames() {
 	function bp_get_message_get_recipient_usernames() {
 		$recipients = isset( $_GET['r'] ) ? stripslashes( $_GET['r'] ) : '';
 
+		/**
+		 * Filters the recipients usernames for prefilling the 'To' field on the Compose screen.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $recipients Recipients usernames for 'To' field prefilling.
+		 */
 		return apply_filters( 'bp_get_message_get_recipient_usernames', $recipients );
 	}
 
@@ -1300,11 +1829,14 @@ class BP_Messages_Thread_Template {
 	/**
 	 * Constructor method.
 	 *
-	 * @param int $thread_id ID of the message thread.
-	 * @param string $order 'ASC' or 'DESC'.
+	 * @see BP_Messages_Thread::populate() for full parameter info.
+	 *
+	 * @param int    $thread_id
+	 * @param string $order
+	 * @param array  $args
 	 */
-	public function __construct( $thread_id, $order ) {
-		$this->thread        = new BP_Messages_Thread( $thread_id, $order );
+	public function __construct( $thread_id = 0, $order = 'ASC', $args = array() ) {
+		$this->thread        = new BP_Messages_Thread( $thread_id, $order, $args );
 		$this->message_count = count( $this->thread->messages );
 
 		$last_message_index                 = $this->message_count - 1;
@@ -1367,6 +1899,12 @@ class BP_Messages_Thread_Template {
 		if ( ( $this->current_message + 1 ) < $this->message_count ) {
 			return true;
 		} elseif ( ( $this->current_message + 1 ) === $this->message_count ) {
+
+			/**
+			 * Fires when at the end of messages to iterate over.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'thread_loop_end' );
 			// Do some cleaning up after the loop
 			$this->rewind_messages();
@@ -1391,6 +1929,12 @@ class BP_Messages_Thread_Template {
 
 		// loop has just started
 		if ( 0 === $this->current_message ) {
+
+			/**
+			 * Fires if at the start of the message loop.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'thread_loop_start' );
 		}
 	}
@@ -1399,12 +1943,14 @@ class BP_Messages_Thread_Template {
 /**
  * Initialize the messages template loop for a specific thread.
  *
- * @param array $args {
+ * @param array|string $args {
  *     Array of arguments. All are optional.
- *     @type int $thread_id ID of the thread whose messages you are displaying.
- *           Default: if viewing a thread, the thread ID will be parsed from
- *           the URL (bp_action_variable( 0 )).
- *     @type string $order 'ASC' or 'DESC'. Default: 'ASC'.
+ *     @type int    $thread_id         ID of the thread whose messages you are displaying.
+ *                                     Default: if viewing a thread, the thread ID will be parsed from
+ *                                     the URL (bp_action_variable( 0 )).
+ *     @type string $order             'ASC' or 'DESC'. Default: 'ASC'.
+ *     @type bool   $update_meta_cache Whether to pre-fetch metadata for
+ *                                     queried message items. Default: true.
  * }
  * @return bool True if there are messages to display, otherwise false.
  */
@@ -1412,15 +1958,20 @@ function bp_thread_has_messages( $args = '' ) {
 	global $thread_template;
 
 	$r = bp_parse_args( $args, array(
-		'thread_id' => false,
-		'order'     => 'ASC'
+		'thread_id'         => false,
+		'order'             => 'ASC',
+		'update_meta_cache' => true,
 	), 'thread_has_messages' );
 
 	if ( empty( $r['thread_id'] ) && bp_is_messages_component() && bp_is_current_action( 'view' ) ) {
 		$r['thread_id'] = (int) bp_action_variable( 0 );
 	}
 
-	$thread_template = new BP_Messages_Thread_Template( $r['thread_id'], $r['order'] );
+	// Set up extra args
+	$extra_args = $r;
+	unset( $extra_args['thread_id'], $extra_args['order'] );
+
+	$thread_template = new BP_Messages_Thread_Template( $r['thread_id'], $r['order'], $extra_args );
 
 	return $thread_template->has_messages();
 }
@@ -1477,6 +2028,13 @@ function bp_the_thread_id() {
 	function bp_get_the_thread_id() {
 		global $thread_template;
 
+		/**
+		 * Filters the ID of the thread that the current loop belongs to.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $thread_id ID of the thread.
+		 */
 		return apply_filters( 'bp_get_the_thread_id', $thread_template->thread->thread_id );
 	}
 
@@ -1494,29 +2052,85 @@ function bp_the_thread_subject() {
 	function bp_get_the_thread_subject() {
 		global $thread_template;
 
+		/**
+		 * Filters the subject of the thread currently being iterated over.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @return string $last_message_subject Subject of the thread currently being iterated over.
+		 */
 		return apply_filters( 'bp_get_the_thread_subject', $thread_template->thread->last_message_subject );
 	}
 
+/**
+ * Get a list of thread recipients or a "x recipients" string.
+ *
+ * In BuddyPress 2.2.0, this parts of this functionality were moved into the
+ * members/single/messages/single.php template. This function is no longer used
+ * by BuddyPress.
+ *
+ * @return string
+ */
+function bp_get_the_thread_recipients(){
+	if ( 5 <= bp_get_thread_recipients_count() ) {
+		$recipients = sprintf( __( '%s recipients', 'buddypress' ), number_format_i18n( bp_get_thread_recipients_count() ) );
+	} else {
+		$recipients = bp_get_thread_recipients_list();
+	}
+
+	return apply_filters( 'bp_get_the_thread_recipients', $recipients );
+}
+
+/**
+ * Get the number of recipients in the current thread.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return int
+ */
+function bp_get_thread_recipients_count() {
+	global $thread_template;
+	return count( $thread_template->thread->recipients );
+}
+
+/**
+ * Get the max number of recipients to list in the 'Conversation between...' gloss.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @return int
+ */
+function bp_get_max_thread_recipients_to_list() {
+	/**
+	 * Filters the max number of recipients to list in the 'Conversation between...' gloss.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param int $count Recipient count. Default: 5.
+	 */
+	return (int) apply_filters( 'bp_get_max_thread_recipients_to_list', 5 );
+}
+
 /**
  * Output HTML links to recipients in the current thread.
+ *
+ * @since BuddyPress (2.2.0)
  */
-function bp_the_thread_recipients() {
-	echo bp_get_the_thread_recipients();
+function bp_the_thread_recipients_list() {
+	echo bp_get_thread_recipients_list();
 }
 	/**
 	 * Generate HTML links to the profiles of recipients in the current thread.
 	 *
+	 * @since BuddyPress (2.2.0)
+	 *
 	 * @return string
 	 */
-	function bp_get_the_thread_recipients() {
+	function bp_get_thread_recipients_list() {
 		global $thread_template;
 
 		$recipient_links = array();
 
-		if ( count( $thread_template->thread->recipients ) >= 5 ) {
-			return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count( $thread_template->thread->recipients ) ) );
-		}
-
 		foreach( (array) $thread_template->thread->recipients as $recipient ) {
 			if ( (int) $recipient->user_id !== bp_loggedin_user_id() ) {
 				$recipient_link = bp_core_get_userlink( $recipient->user_id );
@@ -1529,7 +2143,14 @@ function bp_the_thread_recipients() {
 			}
 		}
 
-		return apply_filters( 'bp_get_the_thread_recipients', implode( ', ', $recipient_links ) );
+		/**
+		 * Filters the HTML links to the profiles of recipients in the current thread.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param string $value Comma-separated list of recipient HTML links for current thread.
+		 */
+		return apply_filters( 'bp_get_the_thread_recipients_list', implode( ', ', $recipient_links ) );
 	}
 
 /**
@@ -1554,6 +2175,13 @@ function bp_the_thread_message_id() {
 			? (int) $thread_template->message->id
 			: null;
 
+		/**
+		 * Filters the ID of the current message in the thread.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int $thread_message_id ID of the current message in the thread.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_id', $thread_message_id );
 	}
 
@@ -1588,6 +2216,13 @@ function bp_the_thread_message_css_class() {
 			$classes[] = 'sent-by-me';
 		}
 
+		/**
+		 * Filters the CSS classes for messages within a single thread.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param array $classes Array of classes to add to the HTML class attribute.
+		 */
 		$classes = apply_filters( 'bp_get_the_thread_message_css_class', $classes );
 
 		return implode( ' ', $classes );
@@ -1613,11 +2248,18 @@ function bp_the_thread_message_alt_class() {
 			$class = 'odd';
 		}
 
+		/**
+		 * Filters the CSS class used for message zebra striping.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $class Class determined to be next for zebra striping effect.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_alt_class', $class );
 	}
 
 /**
- * Output the ID for message sender within a single thread
+ * Output the ID for message sender within a single thread.
  *
  * @since BuddyPress (2.1.0)
  */
@@ -1625,7 +2267,7 @@ function bp_the_thread_message_sender_id() {
 	echo bp_get_the_thread_message_sender_id();
 }
 	/**
-	 * Return the ID for message sender within a single thread
+	 * Return the ID for message sender within a single thread.
 	 *
 	 * @since BuddyPress (2.1.0)
 	 *
@@ -1638,14 +2280,21 @@ function bp_the_thread_message_sender_id() {
 			? $thread_template->message->sender_id
 			: 0;
 
+		/**
+		 * Filters the ID for message sender within a single thread.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param int $user_id ID of the message sender.
+		 */
 		return (int) apply_filters( 'bp_get_the_thread_message_css_class', (int) $user_id );
 	}
 
 /**
  * Output the avatar for the current message sender.
  *
- * @param array $args See {@link bp_get_the_thread_message_sender_avatar_thumb()}
- *        for a description.
+ * @param array|string $args See {@link bp_get_the_thread_message_sender_avatar_thumb()}
+ *                           for a description.
  */
 function bp_the_thread_message_sender_avatar( $args = '' ) {
 	echo bp_get_the_thread_message_sender_avatar_thumb( $args );
@@ -1653,12 +2302,12 @@ function bp_the_thread_message_sender_avatar( $args = '' ) {
 	/**
 	 * Get the avatar for the current message sender.
 	 *
-	 * @param array $args {
+	 * @param array|string $args {
 	 *     Array of arguments. See {@link bp_core_fetch_avatar()} for more
 	 *     complete details. All arguments are optional.
-	 *     @type string $type Avatar type. Default: 'thumb'.
-	 *     @type int $width Avatar width. Default: default for your $type.
-	 *     @type int $height Avatar height. Default: default for your $type.
+	 *     @type string $type   Avatar type. Default: 'thumb'.
+	 *     @type int    $width  Avatar width. Default: default for your $type.
+	 *     @type int    $height Avatar height. Default: default for your $type.
 	 * }
 	 * @return string <img> tag containing the avatar.
 	 */
@@ -1671,6 +2320,13 @@ function bp_the_thread_message_sender_avatar( $args = '' ) {
 			'height' => false,
 		) );
 
+		/**
+		 * Filters the avatar for the current message sender.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value <img> tag containing the avatar value.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array(
 			'item_id' => $thread_template->message->sender_id,
 			'type'    => $r['type'],
@@ -1694,6 +2350,13 @@ function bp_the_thread_message_sender_link() {
 	function bp_get_the_thread_message_sender_link() {
 		global $thread_template;
 
+		/**
+		 * Filters the link to the sender of the current message.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Link to the sender of the current message.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_sender_link', bp_core_get_userlink( $thread_template->message->sender_id, false, true ) );
 	}
 
@@ -1717,6 +2380,13 @@ function bp_the_thread_message_sender_name() {
 			$display_name = __( 'Deleted User', 'buddypress' );
 		}
 
+		/**
+		 * Filters the display name of the sender of the current message.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $display_name Display name of the sender of the current message.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_sender_name', $display_name );
 	}
 
@@ -1732,6 +2402,15 @@ function bp_the_thread_delete_link() {
 	 * @return string URL
 	 */
 	function bp_get_the_thread_delete_link() {
+
+		/**
+		 * Filters the URL for deleting the current thread.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value URL for deleting the current thread.
+		 * @param string $value Text indicating action being executed.
+		 */
 		return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread' ) );
 	}
 
@@ -1747,6 +2426,14 @@ function bp_the_thread_message_time_since() {
 	 * @return string
 	 */
 	function bp_get_the_thread_message_time_since() {
+
+		/**
+		 * Filters the 'Sent x hours ago' string for the current message.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Default text of 'Sent x hours ago'.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_time_since', sprintf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_get_the_thread_message_date_sent() ) ) );
 	}
 
@@ -1763,12 +2450,20 @@ function bp_the_thread_message_date_sent() {
 	 *
 	 * @since BuddyPress (2.1.0)
 	 *
-	 * @uses strtotime() To convert the message string into a usable timestamp
+	 * @uses strtotime() To convert the message string into a usable timestamp.
+	 *
 	 * @return int
 	 */
 	function bp_get_the_thread_message_date_sent() {
 		global $thread_template;
 
+		/**
+		 * Filters the date sent value for the current message as a timestamp.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $value Timestamp of the date sent value for the current message.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_date_sent', strtotime( $thread_template->message->date_sent ) );
 	}
 
@@ -1786,6 +2481,13 @@ function bp_the_thread_message_content() {
 	function bp_get_the_thread_message_content() {
 		global $thread_template;
 
+		/**
+		 * Filters the content of the current message in the loop.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $message The content of the current message in the loop.
+		 */
 		return apply_filters( 'bp_get_the_thread_message_content', $thread_template->message->message );
 	}
 
@@ -1794,15 +2496,49 @@ function bp_the_thread_message_content() {
 /**
  * Enable oEmbed support for Messages.
  *
- * There's no caching as BP 1.5 does not have a Messages meta API.
- *
  * @since BuddyPress (1.5.0)
  *
  * @see BP_Embed
- *
- * @todo Add Messages meta?
  */
 function bp_messages_embed() {
-	add_filter( 'embed_post_id', 'bp_get_message_thread_id' );
+	add_filter( 'embed_post_id',         'bp_get_the_thread_message_id' );
+	add_filter( 'bp_embed_get_cache',    'bp_embed_message_cache',      10, 3 );
+	add_action( 'bp_embed_update_cache', 'bp_embed_message_save_cache', 10, 3 );
+}
+add_action( 'thread_loop_start', 'bp_messages_embed' );
+
+/**
+ * Fetch a private message item's cached embeds.
+ *
+ * Used during {@link BP_Embed::parse_oembed()} via {@link bp_messages_embed()}.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
+ *                         functions like this one to filter.
+ * @param int    $id       The ID of the message item.
+ * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
+ *
+ * @return mixed The cached embeds for this message item.
+ */
+function bp_embed_message_cache( $cache, $id, $cachekey ) {
+	return bp_messages_get_meta( $id, $cachekey );
+}
+
+/**
+ * Set a private message item's embed cache.
+ *
+ * Used during {@link BP_Embed::parse_oembed()} via {@link bp_messages_embed()}.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
+ *                         functions like this one to filter.
+ * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
+ * @param int    $id       The ID of the message item.
+ *
+ * @return bool True on success, false on failure.
+ */
+function bp_embed_message_save_cache( $cache, $cachekey, $id ) {
+	bp_messages_update_meta( $id, $cachekey, $cache );
 }
-add_action( 'messages_box_loop_start', 'bp_messages_embed' );
diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-widgets.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-widgets.php
index 4893c5bcc29a815273216446af268b825755d744..bee180b92e31b965618825e6ebff8b83e100fa7f 100644
--- a/wp-content/plugins/buddypress/bp-messages/bp-messages-widgets.php
+++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-widgets.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * BuddyPress Messages Widgets
+ * BuddyPress Messages Widgets.
  *
  * @package BuddyPress
  * @subpackage Messages
@@ -44,8 +44,8 @@ class BP_Messages_Sitewide_Notices_Widget extends WP_Widget {
 	 *
 	 * @see WP_Widget::widget() for a description of parameters.
 	 *
-	 * @param array $args See {@WP_Widget::widget()}.
-	 * @param array $args See {@WP_Widget::widget()}.
+	 * @param array $args     See {@WP_Widget::widget()}.
+	 * @param array $instance See {@WP_Widget::widget()}.
 	 */
 	public function widget( $args, $instance ) {
 
@@ -62,7 +62,18 @@ class BP_Messages_Sitewide_Notices_Widget extends WP_Widget {
 		extract( $args );
 
 		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
-		$title = apply_filters( 'widget_title', $title, $instance );
+
+		/**
+		 * Filters the title of the Messages widget.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
+		 *
+		 * @param string $title    The widget title.
+		 * @param array  $instance The settings for the particular instance of the widget.
+		 * @param string $id_base  Root ID for all widgets of this type.
+		 */
+		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
 
 		echo $before_widget;
 		echo $before_title . $title . $after_title; ?>
@@ -84,6 +95,7 @@ class BP_Messages_Sitewide_Notices_Widget extends WP_Widget {
 	 *
 	 * @param array $new_instance See {@WP_Widget::update()}.
 	 * @param array $old_instance See {@WP_Widget::update()}.
+	 *
 	 * @return array $instance See {@WP_Widget::update()}.
 	 */
 	public function update( $new_instance, $old_instance ) {
@@ -98,6 +110,8 @@ class BP_Messages_Sitewide_Notices_Widget extends WP_Widget {
 	 * @see WP_Widget::form() for a description of parameters.
 	 *
 	 * @param array $instance See {@WP_Widget::form()}.
+	 *
+	 * @return string Widget form output.
 	 */
 	public function form( $instance ) {
 		$instance = wp_parse_args( (array) $instance, array(
diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-message.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-message.php
new file mode 100644
index 0000000000000000000000000000000000000000..4617f8af91fac9db944459b0d37e8209a1d74444
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-message.php
@@ -0,0 +1,259 @@
+<?php
+/**
+ * BuddyPress Messages Classes
+ *
+ * @package BuddyPress
+ * @subpackage MessagesClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Single message class.
+ */
+class BP_Messages_Message {
+	/**
+	 * ID of the message.
+	 *
+	 * @var int
+	 */
+	public $id;
+
+	/**
+	 * ID of the message thread.
+	 *
+	 * @var int
+	 */
+	public $thread_id;
+
+	/**
+	 * ID of the sender.
+	 *
+	 * @var int
+	 */
+	public $sender_id;
+
+	/**
+	 * Subject line of the message.
+	 *
+	 * @var string
+	 */
+	public $subject;
+
+	/**
+	 * Content of the message.
+	 *
+	 * @var string
+	 */
+	public $message;
+
+	/**
+	 * Date the message was sent.
+	 *
+	 * @var string
+	 */
+	public $date_sent;
+
+	/**
+	 * Message recipients.
+	 *
+	 * @var bool|array
+	 */
+	public $recipients = false;
+
+	/**
+	 * Constructor.
+	 *
+	 * @param int $id Optional. ID of the message.
+	 */
+	public function __construct( $id = null ) {
+		$this->date_sent = bp_core_current_time();
+		$this->sender_id = bp_loggedin_user_id();
+
+		if ( !empty( $id ) ) {
+			$this->populate( $id );
+		}
+	}
+
+	/**
+	 * Set up data related to a specific message object.
+	 *
+	 * @param int $id ID of the message.
+	 */
+	public function populate( $id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( $message = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE id = %d", $id ) ) ) {
+			$this->id        = $message->id;
+			$this->thread_id = $message->thread_id;
+			$this->sender_id = $message->sender_id;
+			$this->subject   = $message->subject;
+			$this->message   = $message->message;
+			$this->date_sent = $message->date_sent;
+		}
+	}
+
+	/**
+	 * Send a message.
+	 *
+	 * @return int|bool ID of the newly created message on success, false
+	 *                  on failure.
+	 */
+	public function send() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->sender_id = apply_filters( 'messages_message_sender_id_before_save', $this->sender_id, $this->id );
+		$this->thread_id = apply_filters( 'messages_message_thread_id_before_save', $this->thread_id, $this->id );
+		$this->subject   = apply_filters( 'messages_message_subject_before_save',   $this->subject,   $this->id );
+		$this->message   = apply_filters( 'messages_message_content_before_save',   $this->message,   $this->id );
+		$this->date_sent = apply_filters( 'messages_message_date_sent_before_save', $this->date_sent, $this->id );
+
+		/**
+		 * Fires before the current message item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Messages_Message $this Current instance of the message item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'messages_message_before_save', array( &$this ) );
+
+		// Make sure we have at least one recipient before sending.
+		if ( empty( $this->recipients ) )
+			return false;
+
+		$new_thread = false;
+
+		// If we have no thread_id then this is the first message of a new thread.
+		if ( empty( $this->thread_id ) ) {
+			$this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1;
+			$new_thread = true;
+		}
+
+		// First insert the message into the messages table
+		if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, %s )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) )
+			return false;
+
+		$this->id = $wpdb->insert_id;
+
+		$recipient_ids = array();
+
+		if ( $new_thread ) {
+			// Add an recipient entry for all recipients
+			foreach ( (array) $this->recipients as $recipient ) {
+				$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient->user_id, $this->thread_id ) );
+				$recipient_ids[] = $recipient->user_id;
+			}
+
+			// Add a sender recipient entry if the sender is not in the list of recipients
+			if ( !in_array( $this->sender_id, $recipient_ids ) )
+				$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, sender_only ) VALUES ( %d, %d, 1 )", $this->sender_id, $this->thread_id ) );
+		} else {
+			// Update the unread count for all recipients
+			$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = unread_count + 1, sender_only = 0, is_deleted = 0 WHERE thread_id = %d AND user_id != %d", $this->thread_id, $this->sender_id ) );
+		}
+
+		messages_remove_callback_values();
+
+		/**
+		 * Fires after the current message item has been saved.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Messages_Message $this Current instance of the message item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'messages_message_after_save', array( &$this ) );
+
+		return $this->id;
+	}
+
+	/**
+	 * Get a list of recipients for a message.
+	 *
+	 * @return array
+	 */
+	public function get_recipients() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) );
+	}
+
+	/** Static Functions **************************************************/
+
+	/**
+	 * Get list of recipient IDs from their usernames.
+	 *
+	 * @param array $recipient_usernames Usernames of recipients.
+	 *
+	 * @return array
+	 */
+	public static function get_recipient_ids( $recipient_usernames ) {
+		if ( !$recipient_usernames )
+			return false;
+
+		if ( is_array( $recipient_usernames ) ) {
+			for ( $i = 0, $count = count( $recipient_usernames ); $i < $count; ++$i ) {
+				if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) ) {
+					$recipient_ids[] = $rid;
+				}
+			}
+		}
+
+		return $recipient_ids;
+	}
+
+	/**
+	 * Get the ID of the message last sent by the logged-in user for a given thread.
+	 *
+	 * @param int $thread_id ID of the thread.
+	 *
+	 * @return int|null ID of the message if found, otherwise null.
+	 */
+	public static function get_last_sent_for_user( $thread_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND thread_id = %d ORDER BY date_sent DESC LIMIT 1", bp_loggedin_user_id(), $thread_id ) );
+	}
+
+	/**
+	 * Check whether a user is the sender of a message.
+	 *
+	 * @param int $user_id    ID of the user.
+	 * @param int $message_id ID of the message.
+	 *
+	 * @return int|null Returns the ID of the message if the user is the
+	 *                  sender, otherwise null.
+	 */
+	public static function is_user_sender( $user_id, $message_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE sender_id = %d AND id = %d", $user_id, $message_id ) );
+	}
+
+	/**
+	 * Get the ID of the sender of a message.
+	 *
+	 * @param int $message_id ID of the message.
+	 *
+	 * @return int|null The ID of the sender if found, otherwise null.
+	 */
+	public static function get_message_sender( $message_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE id = %d", $message_id ) );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-notice.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-notice.php
new file mode 100644
index 0000000000000000000000000000000000000000..eb2e504f1304786e7639cf2fb3bf0fcb81c83653
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-notice.php
@@ -0,0 +1,276 @@
+<?php
+/**
+ * BuddyPress Messages Classes
+ *
+ * @package BuddyPress
+ * @subpackage MessagesClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Notices class.
+ *
+ * Use this class to create, activate, deactivate or delete notices.
+ *
+ * @since BuddyPress (1.0.0)
+ */
+class BP_Messages_Notice {
+	/**
+	 * The notice ID.
+	 *
+	 * @var int
+	 */
+	public $id = null;
+
+	/**
+	 * The subject line for the notice.
+	 *
+	 * @var string
+	 */
+	public $subject;
+
+	/**
+	 * The content of the notice.
+	 *
+	 * @var string
+	 */
+	public $message;
+
+	/**
+	 * The date the notice was created.
+	 *
+	 * @var string
+	 */
+	public $date_sent;
+
+	/**
+	 * Whether the notice is active or not.
+	 *
+	 * @var int
+	 */
+	public $is_active;
+
+	/**
+	 * Constructor.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @param int $id Optional. The ID of the current notice.
+	 */
+	public function __construct( $id = null ) {
+		if ( $id ) {
+			$this->id = $id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Populate method.
+	 *
+	 * Runs during constructor.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$notice = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id ) );
+
+		if ( $notice ) {
+			$this->subject   = $notice->subject;
+			$this->message   = $notice->message;
+			$this->date_sent = $notice->date_sent;
+			$this->is_active = $notice->is_active;
+		}
+	}
+
+	/**
+	 * Saves a notice.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @return bool
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->subject = apply_filters( 'messages_notice_subject_before_save', $this->subject, $this->id );
+		$this->message = apply_filters( 'messages_notice_message_before_save', $this->message, $this->id );
+
+		/**
+		 * Fires before the current message notice item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Messages_Notice $this Current instance of the message notice item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'messages_notice_before_save', array( &$this ) );
+
+		if ( empty( $this->id ) ) {
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, %s, %d)", $this->subject, $this->message, $this->date_sent, $this->is_active );
+		} else {
+			$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET subject = %s, message = %s, is_active = %d WHERE id = %d", $this->subject, $this->message, $this->is_active, $this->id );
+		}
+
+		if ( ! $wpdb->query( $sql ) ) {
+			return false;
+		}
+
+		if ( ! $id = $this->id ) {
+			$id = $wpdb->insert_id;
+		}
+
+		// Now deactivate all notices apart from the new one.
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET is_active = 0 WHERE id != %d", $id ) );
+
+		bp_update_user_last_activity( bp_loggedin_user_id(), bp_core_current_time() );
+
+		/**
+		 * Fires after the current message notice item has been saved.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Messages_Notice $this Current instance of the message item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'messages_notice_after_save', array( &$this ) );
+
+		return true;
+	}
+
+	/**
+	 * Activates a notice.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @return bool
+	 */
+	public function activate() {
+		$this->is_active = 1;
+		return (bool) $this->save();
+	}
+
+	/**
+	 * Deactivates a notice.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @return bool
+	 */
+	public function deactivate() {
+		$this->is_active = 0;
+		return (bool) $this->save();
+	}
+
+	/**
+	 * Deletes a notice.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @return bool
+	 */
+	public function delete() {
+		global $wpdb;
+
+		/**
+		 * Fires before the current message item has been deleted.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_Messages_Notice $this Current instance of the message notice item being deleted.
+		 */
+		do_action( 'messages_notice_before_delete', $this );
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_notices} WHERE id = %d", $this->id );
+
+		if ( ! $wpdb->query( $sql ) ) {
+			return false;
+		}
+
+		return true;
+	}
+
+	/** Static Methods ********************************************************/
+
+	/**
+	 * Pulls up a list of notices.
+	 *
+	 * To get all notices, pass a value of -1 to pag_num.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $args {
+	 *     Array of parameters.
+	 *     @type int $pag_num  Number of notices per page. Defaults to 20.
+	 *     @type int $pag_page The page number.  Defaults to 1.
+	 * }
+	 * @return array
+	 */
+	public static function get_notices( $args = array() ) {
+		global $wpdb;
+
+		$r = wp_parse_args( $args, array(
+			'pag_num'  => 20, // Number of notices per page
+			'pag_page' => 1   // Page number
+		) );
+
+		$limit_sql = '';
+		if ( (int) $r['pag_num'] >= 0 ) {
+			$limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $r['pag_page'] - 1 ) * $r['pag_num'] ), (int) $r['pag_num'] );
+		}
+
+		$bp = buddypress();
+
+		$notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" );
+
+		return $notices;
+	}
+
+	/**
+	 * Returns the total number of recorded notices.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @return int
+	 */
+	public static function get_total_notice_count() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->messages->table_name_notices}" );
+
+		return $notice_count;
+	}
+
+	/**
+	 * Returns the active notice that should be displayed on the frontend.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @return object The BP_Messages_Notice object.
+	 */
+	public static function get_active() {
+		$notice = wp_cache_get( 'active_notice', 'bp_messages' );
+
+		if ( false === $notice ) {
+			global $wpdb;
+
+			$bp = buddypress();
+
+			$notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" );
+			$notice    = new BP_Messages_Notice( $notice_id );
+
+			wp_cache_set( 'active_notice', $notice, 'bp_messages' );
+		}
+
+		return $notice;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-thread.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-thread.php
new file mode 100644
index 0000000000000000000000000000000000000000..117bdfa765bc854c877b76815cd0476a648db620
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-thread.php
@@ -0,0 +1,835 @@
+<?php
+/**
+ * BuddyPress Messages Classes
+ *
+ * @package BuddyPress
+ * @subpackage MessagesClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Message Thread class.
+ *
+ * @since BuddyPress (1.0.0)
+ */
+class BP_Messages_Thread {
+	/**
+	 * The message thread ID.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @var int
+	 */
+	public $thread_id;
+
+	/**
+	 * The current messages.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @var object
+	 */
+	public $messages;
+
+	/**
+	 * The current recipients in the message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @var object
+	 */
+	public $recipients;
+
+	/**
+	 * The user IDs of all messages in the message thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var array
+	 */
+	public $sender_ids;
+
+	/**
+	 * The unread count for the logged-in user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var int
+	 */
+	public $unread_count;
+
+	/**
+	 * The content of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_message_content;
+
+	/**
+	 * The date of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_message_date;
+
+	/**
+	 * The ID of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var int
+	 */
+	public $last_message_id;
+
+	/**
+	 * The subject of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_message_subject;
+
+	/**
+	 * The user ID of the author of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var int
+	 */
+	public $last_sender_id;
+
+	/**
+	 * Sort order of the messages in this thread (ASC or DESC).
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @var string
+	 */
+	public $messages_order;
+
+	/**
+	 * Constructor.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @see BP_Messages_Thread::populate() for full description of parameters.
+	 *
+	 * @param bool   $thread_id
+	 * @param string $order
+	 * @param array  $args
+	 */
+	public function __construct( $thread_id = false, $order = 'ASC', $args = array() ) {
+		if ( $thread_id ) {
+			$this->populate( $thread_id, $order, $args );
+		}
+	}
+
+	/**
+	 * Populate method.
+	 *
+	 * Used in constructor.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int    $thread_id The message thread ID.
+	 * @param string $order     The order to sort the messages. Either 'ASC' or 'DESC'.
+	 * @param array $args {
+	 *     Array of arguments.
+	 *     @type bool $update_meta_cache Whether to pre-fetch metadata for
+	 *                                   queried message items. Default: true.
+	 * }
+	 * @return bool False on failure.
+	 */
+	public function populate( $thread_id = 0, $order = 'ASC', $args = array() ) {
+		global $wpdb;
+
+		if( 'ASC' != $order && 'DESC' != $order ) {
+			$order = 'ASC';
+		}
+
+		// merge $args with our defaults
+		$r = wp_parse_args( $args, array(
+			'update_meta_cache' => true
+		) );
+
+		$this->messages_order = $order;
+		$this->thread_id      = $thread_id;
+
+		// get messages for thread
+		$this->messages = self::get_messages( $thread_id );
+
+		if ( empty( $this->messages ) || is_wp_error( $this->messages ) ) {
+			return false;
+		}
+
+		// flip if order is DESC
+		if ( 'DESC' === $order ) {
+			$this->messages = array_reverse( $this->messages );
+		}
+
+		foreach ( (array) $this->messages as $key => $message ) {
+			$this->sender_ids[$message->sender_id] = $message->sender_id;
+		}
+
+		// Fetch the recipients
+		$this->recipients = $this->get_recipients();
+
+		// Get the unread count for the logged in user
+		if ( isset( $this->recipients[bp_loggedin_user_id()] ) ) {
+			$this->unread_count = $this->recipients[bp_loggedin_user_id()]->unread_count;
+		}
+
+		// Grab all message meta
+		if ( true === (bool) $r['update_meta_cache'] ) {
+			bp_messages_update_meta_cache( wp_list_pluck( $this->messages, 'id' ) );
+		}
+
+		/**
+		 * Fires after a BP_Messages_Thread object has been populated.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param BP_Messages_Thread $this Message thread object.
+		 */
+		do_action( 'bp_messages_thread_post_populate', $this );
+	}
+
+	/**
+	 * Mark a thread initialized in this class as read.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @see BP_Messages_Thread::mark_as_read()
+	 */
+	public function mark_read() {
+		BP_Messages_Thread::mark_as_read( $this->thread_id );
+	}
+
+	/**
+	 * Mark a thread initialized in this class as unread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @see BP_Messages_Thread::mark_as_unread()
+	 */
+	public function mark_unread() {
+		BP_Messages_Thread::mark_as_unread( $this->thread_id );
+	}
+
+	/**
+	 * Returns recipients for a message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @since BuddyPress (2.3.0) Added $thread_id as a parameter.
+	 *
+	 * @param int $thread_id The thread ID.
+	 *
+	 * @return array
+	 */
+	public function get_recipients( $thread_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $thread_id ) ) {
+			$thread_id = $this->thread_id;
+		}
+
+		$recipients = wp_cache_get( 'thread_recipients_' . $thread_id, 'bp_messages' );
+		if ( false === $recipients ) {
+			$bp = buddypress();
+
+			$recipients = array();
+			$results    = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ) );
+
+			foreach ( (array) $results as $recipient ) {
+				$recipients[ $recipient->user_id ] = $recipient;
+			}
+
+			wp_cache_set( 'thread_recipients_' . $thread_id, $recipients, 'bp_messages' );
+		}
+
+		/**
+		 * Filters the recipients of a message thread.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param array $recipients Array of recipient objects.
+		 * @param int   $thread_id  ID of the current thread.
+		 */
+		return apply_filters( 'bp_messages_thread_get_recipients', $recipients, $thread_id );
+	}
+
+	/** Static Functions ******************************************************/
+
+	/**
+	 * Get all messages associated with a thread.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return array
+	 */
+	public static function get_messages( $thread_id = 0 ) {
+		$messages = wp_cache_get( $thread_id, 'bp_messages_threads' );
+
+		if ( false === $messages ) {
+			global $wpdb;
+
+			$bp = buddypress();
+
+			// always sort by ASC by default
+			$messages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE thread_id = %d ORDER BY date_sent ASC", $thread_id ) );
+
+			wp_cache_set( $thread_id, (array) $messages, 'bp_messages_threads' );
+		}
+
+		return $messages;
+	}
+
+	/**
+	 * Static method to get message recipients by thread ID.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  int $thread_id The thread ID.
+	 *
+	 * @return array
+	 */
+	public static function get_recipients_for_thread( $thread_id = 0 ) {
+		$thread = new self( false );
+		return $thread->get_recipients( $thread_id );
+	}
+
+	/**
+	 * Mark messages in a thread as deleted or delete all messages in a thread.
+	 *
+	 * Note: All messages in a thread are deleted once every recipient in a thread
+	 * has marked the thread as deleted.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return bool
+	 */
+	public static function delete( $thread_id ) {
+		global $wpdb;
+
+		/**
+		 * Fires before a message thread is marked as deleted.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int $thread_id ID of the thread being deleted.
+		 */
+		do_action( 'bp_messages_thread_before_mark_delete', $thread_id );
+
+		$bp = buddypress();
+
+		// Mark messages as deleted
+		//
+		// @todo the reliance on bp_loggedin_user_id() sucks for plugins
+		//       refactor this method to accept a $user_id parameter
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET is_deleted = 1 WHERE thread_id = %d AND user_id = %d", $thread_id, bp_loggedin_user_id() ) );
+
+		// Get the message ids in order to pass to the action
+		$message_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
+
+		// Check to see if any more recipients remain for this message
+		$recipients = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND is_deleted = 0", $thread_id ) );
+
+		// No more recipients so delete all messages associated with the thread
+		if ( empty( $recipients ) ) {
+
+			/**
+			 * Fires before an entire message thread is deleted.
+			 *
+			 * @since BuddyPress (2.2.0)
+			 *
+			 * @param int   $thread_id   ID of the thread being deleted.
+			 * @param array $message_ids IDs of messages being deleted.
+			 */
+			do_action( 'bp_messages_thread_before_delete', $thread_id, $message_ids );
+
+			// Delete all the messages
+			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
+
+			// Do something for each message ID
+			foreach ( $message_ids as $message_id ) {
+				// Delete message meta
+				bp_messages_delete_meta( $message_id );
+
+				/**
+				 * Fires after a message is deleted. This hook is poorly named.
+				 *
+				 * @since BuddyPress (1.0.0)
+				 *
+				 * @param int $message_id ID of the message.
+				 */
+				do_action( 'messages_thread_deleted_thread', $message_id );
+			}
+
+			// Delete all the recipients
+			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ) );
+		}
+
+		/**
+		 * Fires after a message thread is either marked as deleted or deleted.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int   $thread_id   ID of the thread being deleted.
+		 * @param array $message_ids IDs of messages being deleted.
+		 */
+		do_action( 'bp_messages_thread_after_delete', $thread_id, $message_ids );
+
+		return true;
+	}
+
+	/**
+	 * Get current message threads for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $args {
+	 *     Array of arguments.
+	 *     @type int    $user_id      The user ID.
+	 *     @type string $box          The type of mailbox to get. Either 'inbox' or 'sentbox'.
+	 *                                Defaults to 'inbox'.
+	 *     @type string $type         The type of messages to get. Either 'all' or 'unread'
+	 *                                or 'read'. Defaults to 'all'.
+	 *     @type int    $limit        The number of messages to get. Defaults to null.
+	 *     @type int    $page         The page number to get. Defaults to null.
+	 *     @type string $search_terms The search term to use. Defaults to ''.
+	 *     @type array  $meta_query   Meta query arguments. See WP_Meta_Query for more details.
+	 * }
+	 * @return array|bool Array on success. Boolean false on failure.
+	 */
+	public static function get_current_threads_for_user( $args = array() ) {
+		global $wpdb;
+
+		// Backward compatibility with old method of passing arguments
+		if ( ! is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '2.2.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__ ) );
+
+			$old_args_keys = array(
+				0 => 'user_id',
+				1 => 'box',
+				2 => 'type',
+				3 => 'limit',
+				4 => 'page',
+				5 => 'search_terms',
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$defaults = array(
+			'user_id'      => false,
+			'box'          => 'inbox',
+			'type'         => 'all',
+			'limit'        => null,
+			'page'         => null,
+			'search_terms' => '',
+			'meta_query'   => array()
+		);
+		$r = wp_parse_args( $args, $defaults );
+
+		$pag_sql = $type_sql = $search_sql = $user_id_sql = $sender_sql = '';
+		$meta_query_sql = array(
+			'join'  => '',
+			'where' => ''
+		);
+
+		if ( $r['limit'] && $r['page'] ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['limit'] ), intval( $r['limit'] ) );
+		}
+
+		if ( $r['type'] == 'unread' ) {
+			$type_sql = " AND r.unread_count != 0 ";
+		} elseif ( $r['type'] == 'read' ) {
+			$type_sql = " AND r.unread_count = 0 ";
+		}
+
+		if ( ! empty( $r['search_terms'] ) ) {
+			$search_terms_like = '%' . bp_esc_like( $r['search_terms'] ) . '%';
+			$search_sql        = $wpdb->prepare( "AND ( subject LIKE %s OR message LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		$r['user_id'] = (int) $r['user_id'];
+
+		// Default deleted SQL
+		$deleted_sql = 'r.is_deleted = 0';
+
+		switch ( $r['box'] ) {
+			case 'sentbox' :
+				$user_id_sql = 'AND ' . $wpdb->prepare( 'm.sender_id = %d', $r['user_id'] );
+				$sender_sql  = 'AND m.sender_id = r.user_id';
+				break;
+
+			case 'inbox' :
+				$user_id_sql = 'AND ' . $wpdb->prepare( 'r.user_id = %d', $r['user_id'] );
+				$sender_sql  = 'AND r.sender_only = 0';
+				break;
+
+			// Omit user-deleted threads from all other custom message boxes
+			default :
+				$deleted_sql = $wpdb->prepare( '( r.user_id = %d AND r.is_deleted = 0 )', $r['user_id'] );
+				break;
+		}
+
+		// Process meta query into SQL
+		$meta_query = self::get_meta_query_sql( $r['meta_query'] );
+		if ( ! empty( $meta_query['join'] ) ) {
+			$meta_query_sql['join'] = $meta_query['join'];
+		}
+		if ( ! empty( $meta_query['where'] ) ) {
+			$meta_query_sql['where'] = $meta_query['where'];
+		}
+
+		$bp = buddypress();
+
+		// set up SQL array
+		$sql = array();
+		$sql['select'] = 'SELECT m.thread_id, MAX(m.date_sent) AS date_sent';
+		$sql['from']   = "FROM {$bp->messages->table_name_recipients} r INNER JOIN {$bp->messages->table_name_messages} m ON m.thread_id = r.thread_id {$meta_query_sql['join']}";
+		$sql['where']  = "WHERE {$deleted_sql} {$user_id_sql} {$sender_sql} {$type_sql} {$search_sql} {$meta_query_sql['where']}";
+		$sql['misc']   = "GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}";
+
+		// get thread IDs
+		$thread_ids = $wpdb->get_results( implode( ' ', $sql ) );
+		if ( empty( $thread_ids ) ) {
+			return false;
+		}
+
+		// adjust $sql to work for thread total
+		$sql['select'] = 'SELECT COUNT( DISTINCT m.thread_id )';
+		unset( $sql['misc'] );
+		$total_threads = $wpdb->get_var( implode( ' ', $sql ) );
+
+		// Sort threads by date_sent
+		foreach( (array) $thread_ids as $thread ) {
+			$sorted_threads[$thread->thread_id] = strtotime( $thread->date_sent );
+		}
+
+		arsort( $sorted_threads );
+
+		$threads = false;
+		foreach ( (array) $sorted_threads as $thread_id => $date_sent ) {
+			$threads[] = new BP_Messages_Thread( $thread_id, 'ASC', array(
+				'update_meta_cache' => false
+			) );
+		}
+
+		/**
+		 * Filters the results of the query for a user's message threads.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param array $value {
+		 *     @type array $threads       Array of threads. Passed by reference.
+		 *     @type int   $total_threads Number of threads found by the query.
+		 * }
+		 */
+		return apply_filters( 'bp_messages_thread_current_threads', array( 'threads' => &$threads, 'total' => (int) $total_threads ) );
+	}
+
+	/**
+	 * Get the SQL for the 'meta_query' param in BP_Messages_Thread::get_current_threads_for_user().
+	 *
+	 * We use WP_Meta_Query to do the heavy lifting of parsing the meta_query array
+	 * and creating the necessary SQL clauses.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $meta_query An array of meta_query filters. See the
+	 *                          documentation for WP_Meta_Query for details.
+	 *
+	 * @return array $sql_array 'join' and 'where' clauses.
+	 */
+	public static function get_meta_query_sql( $meta_query = array() ) {
+		global $wpdb;
+
+		$sql_array = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		if ( ! empty( $meta_query ) ) {
+			$meta_query = new WP_Meta_Query( $meta_query );
+
+			// WP_Meta_Query expects the table name at
+			// $wpdb->messagemeta
+			$wpdb->messagemeta = buddypress()->messages->table_name_meta;
+
+			return $meta_query->get_sql( 'message', 'm', 'id' );
+		}
+
+		return $sql_array;
+	}
+
+	/**
+	 * Mark a thread as read.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 */
+	public static function mark_as_read( $thread_id ) {
+		global $wpdb;
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
+		$wpdb->query($sql);
+
+		wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' );
+		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+	}
+
+	/**
+	 * Mark a thread as unread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 */
+	public static function mark_as_unread( $thread_id ) {
+		global $wpdb;
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
+		$wpdb->query($sql);
+
+		wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' );
+		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+	}
+
+	/**
+	 * Returns the total number of message threads for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int    $user_id The user ID.
+	 * @param string $box     The type of mailbox to get. Either 'inbox' or 'sentbox'.
+	 *                        Defaults to 'inbox'.
+	 * @param string $type    The type of messages to get. Either 'all' or 'unread'.
+	 *                        or 'read'. Defaults to 'all'.
+	 * @return int
+	 */
+	public static function get_total_threads_for_user( $user_id, $box = 'inbox', $type = 'all' ) {
+		global $wpdb;
+
+		$exclude_sender = '';
+		if ( $box != 'sentbox' )
+			$exclude_sender = ' AND sender_only != 1';
+
+		if ( $type == 'unread' )
+			$type_sql = " AND unread_count != 0 ";
+		elseif ( $type == 'read' )
+			$type_sql = " AND unread_count = 0 ";
+
+		$bp = buddypress();
+
+		return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0{$exclude_sender} {$type_sql}", $user_id ) );
+	}
+
+	/**
+	 * Determine if the logged-in user is a sender of any message in a thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return bool
+	 */
+	public static function user_is_sender( $thread_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$sender_ids = $wpdb->get_col( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
+
+		if ( ! $sender_ids ) {
+			return false;
+		}
+
+		return in_array( bp_loggedin_user_id(), $sender_ids );
+	}
+
+	/**
+	 * Returns the userlink of the last sender in a message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return string|bool The user link on success. Boolean false on failure.
+	 */
+	public static function get_last_sender( $thread_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( ! $sender_id = $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d GROUP BY sender_id ORDER BY date_sent LIMIT 1", $thread_id ) ) ) {
+			return false;
+		}
+
+		return bp_core_get_userlink( $sender_id, true );
+	}
+
+	/**
+	 * Gets the unread message count for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id The user ID.
+	 *
+	 * @return int
+	 */
+	public static function get_inbox_count( $user_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) ) {
+			$user_id = bp_loggedin_user_id();
+		}
+
+		$unread_count = wp_cache_get( $user_id, 'bp_messages_unread_count' );
+
+		if ( false === $unread_count ) {
+			$bp = buddypress();
+
+			$unread_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM(unread_count) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0 AND sender_only = 0", $user_id ) );
+
+			wp_cache_set( $user_id, $unread_count, 'bp_messages_unread_count' );
+		}
+
+		/**
+		 * Filters a user's unread message count.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int $unread_count Unread message count.
+		 * @param int $user_id      ID of the user.
+		 */
+		return apply_filters( 'messages_thread_get_inbox_count', (int) $unread_count, $user_id );
+	}
+
+	/**
+	 * Checks whether a user is a part of a message thread discussion.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 * @param int $user_id   The user ID.
+	 *
+	 * @return int|null The recorded recipient ID on success, null on failure.
+	 */
+	public static function check_access( $thread_id, $user_id = 0 ) {
+		if ( empty( $user_id ) ) {
+			$user_id = bp_loggedin_user_id();
+		}
+
+		$recipients = self::get_recipients_for_thread( $thread_id );
+
+		if ( isset( $recipients[$user_id] ) && 0 == $recipients[$user_id]->is_deleted ) {
+			return $recipients[$user_id]->id;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Checks whether a message thread exists.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return int|null The message thread ID on success, null on failure.
+	 */
+	public static function is_valid( $thread_id = 0 ) {
+		// Bail if no thread ID is passed
+		if ( empty( $thread_id ) ) {
+			return false;
+		}
+
+		$thread = self::get_messages( $thread_id );
+
+		if ( ! empty( $thread ) ) {
+			return $thread_id;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Returns a string containing all the message recipient userlinks.
+	 *
+	 * String is comma-delimited.
+	 *
+	 * If a message thread has more than four users, the returned string is simply
+	 * "X Recipients" where "X" is the number of recipients in the message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $recipients Array containing the message recipients (array of objects).
+	 *
+	 * @return string
+	 */
+	public static function get_recipient_links( $recipients ) {
+		if ( count( $recipients ) >= 5 )
+			return sprintf( __( '%s Recipients', 'buddypress' ), number_format_i18n( count( $recipients ) ) );
+
+		$recipient_links = array();
+
+		foreach ( (array) $recipients as $recipient ) {
+			$recipient_link = bp_core_get_userlink( $recipient->user_id );
+
+			if ( empty( $recipient_link ) ) {
+				$recipient_link = __( 'Deleted User', 'buddypress' );
+			}
+
+			$recipient_links[] = $recipient_link;
+		}
+
+		return implode( ', ', (array) $recipient_links );
+	}
+
+	/**
+	 * Upgrade method for the older BP message thread DB table.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @todo We should remove this.  No one is going to upgrade from v1.1, right?
+	 * @return bool
+	 */
+	public static function update_tables() {
+		global $wpdb;
+
+		$bp_prefix = bp_core_get_table_prefix();
+		$errors    = false;
+		$threads   = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" );
+
+		// Nothing to update, just return true to remove the table
+		if ( empty( $threads ) ) {
+			return true;
+		}
+
+		$bp = buddypress();
+
+		foreach( (array) $threads as $thread ) {
+			$message_ids = maybe_unserialize( $thread->message_ids );
+
+			if ( !empty( $message_ids ) ) {
+				$message_ids = implode( ',', $message_ids );
+
+				// Add the thread_id to the messages table
+				if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_messages} SET thread_id = %d WHERE id IN ({$message_ids})", $thread->id ) ) )
+					$errors = true;
+			}
+		}
+
+		if ( $errors ) {
+			return false;
+		}
+
+		return true;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp_messages-thread.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp_messages-thread.php
new file mode 100644
index 0000000000000000000000000000000000000000..e5bbf9eb92438307a4f5a06a1c47846add5079e2
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp_messages-thread.php
@@ -0,0 +1,823 @@
+<?php
+/**
+ * BuddyPress Messages Classes
+ *
+ * @package BuddyPress
+ * @subpackage MessagesClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Message Thread class.
+ *
+ * @since BuddyPress (1.0.0)
+ */
+class BP_Messages_Thread {
+	/**
+	 * The message thread ID.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @var int
+	 */
+	public $thread_id;
+
+	/**
+	 * The current messages.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @var object
+	 */
+	public $messages;
+
+	/**
+	 * The current recipients in the message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @var object
+	 */
+	public $recipients;
+
+	/**
+	 * The user IDs of all messages in the message thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var array
+	 */
+	public $sender_ids;
+
+	/**
+	 * The unread count for the logged-in user.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var int
+	 */
+	public $unread_count;
+
+	/**
+	 * The content of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_message_content;
+
+	/**
+	 * The date of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_message_date;
+
+	/**
+	 * The ID of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var int
+	 */
+	public $last_message_id;
+
+	/**
+	 * The subject of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var string
+	 */
+	public $last_message_subject;
+
+	/**
+	 * The user ID of the author of the last message in this thread.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 * @var int
+	 */
+	public $last_sender_id;
+
+	/**
+	 * Sort order of the messages in this thread (ASC or DESC).
+	 *
+	 * @since BuddyPress (1.5.0)
+	 * @var string
+	 */
+	public $messages_order;
+
+	/**
+	 * Constructor.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @see BP_Messages_Thread::populate() for full description of parameters.
+	 *
+	 * @param bool   $thread_id
+	 * @param string $order
+	 * @param array  $args
+	 */
+	public function __construct( $thread_id = false, $order = 'ASC', $args = array() ) {
+		if ( $thread_id ) {
+			$this->populate( $thread_id, $order, $args );
+		}
+	}
+
+	/**
+	 * Populate method.
+	 *
+	 * Used in constructor.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int    $thread_id The message thread ID.
+	 * @param string $order     The order to sort the messages. Either 'ASC' or 'DESC'.
+	 * @param array $args {
+	 *     Array of arguments.
+	 *     @type bool $update_meta_cache Whether to pre-fetch metadata for
+	 *                                   queried message items. Default: true.
+	 * }
+	 * @return bool False on failure.
+	 */
+	public function populate( $thread_id = 0, $order = 'ASC', $args = array() ) {
+		global $wpdb;
+
+		if( 'ASC' != $order && 'DESC' != $order ) {
+			$order = 'ASC';
+		}
+
+		// merge $args with our defaults
+		$r = wp_parse_args( $args, array(
+			'update_meta_cache' => true
+		) );
+
+		$this->messages_order = $order;
+		$this->thread_id      = $thread_id;
+
+		// get messages for thread
+		$this->messages = self::get_messages( $thread_id );
+
+		if ( empty( $this->messages ) || is_wp_error( $this->messages ) ) {
+			return false;
+		}
+
+		// flip if order is DESC
+		if ( 'DESC' === $order ) {
+			$this->messages = array_reverse( $this->messages );
+		}
+
+		foreach ( (array) $this->messages as $key => $message ) {
+			$this->sender_ids[$message->sender_id] = $message->sender_id;
+		}
+
+		// Fetch the recipients
+		$this->recipients = $this->get_recipients();
+
+		// Get the unread count for the logged in user
+		if ( isset( $this->recipients[bp_loggedin_user_id()] ) ) {
+			$this->unread_count = $this->recipients[bp_loggedin_user_id()]->unread_count;
+		}
+
+		// Grab all message meta
+		if ( true === (bool) $r['update_meta_cache'] ) {
+			bp_messages_update_meta_cache( wp_list_pluck( $this->messages, 'id' ) );
+		}
+
+		/**
+		 * Fires after a BP_Messages_Thread object has been populated.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param BP_Messages_Thread $this Message thread object.
+		 */
+		do_action( 'bp_messages_thread_post_populate', $this );
+	}
+
+	/**
+	 * Mark a thread initialized in this class as read.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @see BP_Messages_Thread::mark_as_read()
+	 */
+	public function mark_read() {
+		BP_Messages_Thread::mark_as_read( $this->thread_id );
+	}
+
+	/**
+	 * Mark a thread initialized in this class as unread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @see BP_Messages_Thread::mark_as_unread()
+	 */
+	public function mark_unread() {
+		BP_Messages_Thread::mark_as_unread( $this->thread_id );
+	}
+
+	/**
+	 * Returns recipients for a message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 * @since BuddyPress (2.3.0) Added $thread_id as a parameter.
+	 *
+	 * @param int $thread_id The thread ID.
+	 *
+	 * @return array
+	 */
+	public function get_recipients( $thread_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $thread_id ) ) {
+			$thread_id = $this->thread_id;
+		}
+
+		$recipients = wp_cache_get( 'thread_recipients_' . $thread_id, 'bp_messages' );
+		if ( false === $recipients ) {
+			$bp = buddypress();
+
+			$recipients = array();
+			$results    = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ) );
+
+			foreach ( (array) $results as $recipient ) {
+				$recipients[ $recipient->user_id ] = $recipient;
+			}
+
+			wp_cache_set( 'thread_recipients_' . $thread_id, $recipients, 'bp_messages' );
+		}
+
+		/**
+		 * Filters the recipients of a message thread.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param array $recipients Array of recipient objects.
+		 * @param int   $thread_id  ID of the current thread.
+		 */
+		return apply_filters( 'bp_messages_thread_get_recipients', $recipients, $thread_id );
+	}
+
+	/** Static Functions ******************************************************/
+
+	/**
+	 * Get all messages associated with a thread.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return array
+	 */
+	public static function get_messages( $thread_id = 0 ) {
+		$messages = wp_cache_get( $thread_id, 'bp_messages_threads' );
+
+		if ( false === $messages ) {
+			global $wpdb;
+
+			$bp = buddypress();
+
+			// always sort by ASC by default
+			$messages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_messages} WHERE thread_id = %d ORDER BY date_sent ASC", $thread_id ) );
+
+			wp_cache_set( $thread_id, (array) $messages, 'bp_messages_threads' );
+		}
+
+		return $messages;
+	}
+
+	/**
+	 * Static method to get message recipients by thread ID.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  int $thread_id The thread ID.
+	 *
+	 * @return array
+	 */
+	public static function get_recipients_for_thread( $thread_id = 0 ) {
+		$thread = new self( false );
+		return $thread->get_recipients( $thread_id );
+	}
+
+	/**
+	 * Mark messages in a thread as deleted or delete all messages in a thread.
+	 *
+	 * Note: All messages in a thread are deleted once every recipient in a thread
+	 * has marked the thread as deleted.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return bool
+	 */
+	public static function delete( $thread_id ) {
+		global $wpdb;
+
+		/**
+		 * Fires before a message thread is marked as deleted.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int $thread_id ID of the thread being deleted.
+		 */
+		do_action( 'bp_messages_thread_before_mark_delete', $thread_id );
+
+		$bp = buddypress();
+
+		// Mark messages as deleted
+		//
+		// @todo the reliance on bp_loggedin_user_id() sucks for plugins
+		//       refactor this method to accept a $user_id parameter
+		$wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET is_deleted = 1 WHERE thread_id = %d AND user_id = %d", $thread_id, bp_loggedin_user_id() ) );
+
+		// Get the message ids in order to pass to the action
+		$message_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
+
+		// Check to see if any more recipients remain for this message
+		$recipients = $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND is_deleted = 0", $thread_id ) );
+
+		// No more recipients so delete all messages associated with the thread
+		if ( empty( $recipients ) ) {
+
+			/**
+			 * Fires before an entire message thread is deleted.
+			 *
+			 * @since BuddyPress (2.2.0)
+			 *
+			 * @param int   $thread_id   ID of the thread being deleted.
+			 * @param array $message_ids IDs of messages being deleted.
+			 */
+			do_action( 'bp_messages_thread_before_delete', $thread_id, $message_ids );
+
+			// Delete all the messages
+			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
+
+			// Do something for each message ID
+			foreach ( $message_ids as $message_id ) {
+				// Delete message meta
+				bp_messages_delete_meta( $message_id );
+
+				/**
+				 * Fires after a message is deleted. This hook is poorly named.
+				 *
+				 * @since BuddyPress (1.0.0)
+				 *
+				 * @param int $message_id ID of the message.
+				 */
+				do_action( 'messages_thread_deleted_thread', $message_id );
+			}
+
+			// Delete all the recipients
+			$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ) );
+		}
+
+		/**
+		 * Fires after a message thread is either marked as deleted or deleted.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int   $thread_id   ID of the thread being deleted.
+		 * @param array $message_ids IDs of messages being deleted.
+		 */
+		do_action( 'bp_messages_thread_after_delete', $thread_id, $message_ids );
+
+		return true;
+	}
+
+	/**
+	 * Get current message threads for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $args {
+	 *     Array of arguments.
+	 *     @type int    $user_id      The user ID.
+	 *     @type string $box          The type of mailbox to get. Either 'inbox' or 'sentbox'.
+	 *                                Defaults to 'inbox'.
+	 *     @type string $type         The type of messages to get. Either 'all' or 'unread'
+	 *                                or 'read'. Defaults to 'all'.
+	 *     @type int    $limit        The number of messages to get. Defaults to null.
+	 *     @type int    $page         The page number to get. Defaults to null.
+	 *     @type string $search_terms The search term to use. Defaults to ''.
+	 *     @type array  $meta_query   Meta query arguments. See WP_Meta_Query for more details.
+	 * }
+	 * @return array|bool Array on success. Boolean false on failure.
+	 */
+	public static function get_current_threads_for_user( $args = array() ) {
+		global $wpdb;
+
+		// Backward compatibility with old method of passing arguments
+		if ( ! is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '2.2.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__ ) );
+
+			$old_args_keys = array(
+				0 => 'user_id',
+				1 => 'box',
+				2 => 'type',
+				3 => 'limit',
+				4 => 'page',
+				5 => 'search_terms',
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$defaults = array(
+			'user_id'      => false,
+			'box'          => 'inbox',
+			'type'         => 'all',
+			'limit'        => null,
+			'page'         => null,
+			'search_terms' => '',
+			'meta_query'   => array()
+		);
+		$r = wp_parse_args( $args, $defaults );
+
+		$pag_sql = $type_sql = $search_sql = $user_id_sql = $sender_sql = '';
+		$meta_query_sql = array(
+			'join'  => '',
+			'where' => ''
+		);
+
+		if ( $r['limit'] && $r['page'] ) {
+			$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $r['page'] - 1 ) * $r['limit'] ), intval( $r['limit'] ) );
+		}
+
+		if ( $r['type'] == 'unread' ) {
+			$type_sql = " AND r.unread_count != 0 ";
+		} elseif ( $r['type'] == 'read' ) {
+			$type_sql = " AND r.unread_count = 0 ";
+		}
+
+		if ( ! empty( $r['search_terms'] ) ) {
+			$search_terms_like = '%' . bp_esc_like( $r['search_terms'] ) . '%';
+			$search_sql        = $wpdb->prepare( "AND ( subject LIKE %s OR message LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		if ( ! empty( $r['user_id'] ) ) {
+			if ( 'sentbox' == $r['box'] ) {
+				$user_id_sql = 'AND ' . $wpdb->prepare( 'm.sender_id = %d', $r['user_id'] );
+				$sender_sql  = ' AND m.sender_id = r.user_id';
+			} else {
+				$user_id_sql = 'AND ' . $wpdb->prepare( 'r.user_id = %d', $r['user_id'] );
+				$sender_sql  = ' AND r.sender_only = 0';
+			}
+		}
+
+		// Process meta query into SQL
+		$meta_query = self::get_meta_query_sql( $r['meta_query'] );
+		if ( ! empty( $meta_query['join'] ) ) {
+			$meta_query_sql['join'] = $meta_query['join'];
+		}
+		if ( ! empty( $meta_query['where'] ) ) {
+			$meta_query_sql['where'] = $meta_query['where'];
+		}
+
+		$bp = buddypress();
+
+		// set up SQL array
+		$sql = array();
+		$sql['select'] = 'SELECT m.thread_id, MAX(m.date_sent) AS date_sent';
+		$sql['from']   = "FROM {$bp->messages->table_name_recipients} r INNER JOIN {$bp->messages->table_name_messages} m ON m.thread_id = r.thread_id {$meta_query_sql['join']}";
+		$sql['where']  = "WHERE r.is_deleted = 0 {$user_id_sql} {$sender_sql} {$type_sql} {$search_sql} {$meta_query_sql['where']}";
+		$sql['misc']   = "GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}";
+
+		// get thread IDs
+		$thread_ids = $wpdb->get_results( implode( ' ', $sql ) );
+		if ( empty( $thread_ids ) ) {
+			return false;
+		}
+
+		// adjust $sql to work for thread total
+		$sql['select'] = 'SELECT COUNT( DISTINCT m.thread_id )';
+		unset( $sql['misc'] );
+		$total_threads = $wpdb->get_var( implode( ' ', $sql ) );
+
+		// Sort threads by date_sent
+		foreach( (array) $thread_ids as $thread ) {
+			$sorted_threads[$thread->thread_id] = strtotime( $thread->date_sent );
+		}
+
+		arsort( $sorted_threads );
+
+		$threads = false;
+		foreach ( (array) $sorted_threads as $thread_id => $date_sent ) {
+			$threads[] = new BP_Messages_Thread( $thread_id, 'ASC', array(
+				'update_meta_cache' => false
+			) );
+		}
+
+		/**
+		 * Filters the results of the query for a user's message threads.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param array $value {
+		 *     @type array $threads       Array of threads. Passed by reference.
+		 *     @type int   $total_threads Number of threads found by the query.
+		 * }
+		 */
+		return apply_filters( 'bp_messages_thread_current_threads', array( 'threads' => &$threads, 'total' => (int) $total_threads ) );
+	}
+
+	/**
+	 * Get the SQL for the 'meta_query' param in BP_Messages_Thread::get_current_threads_for_user().
+	 *
+	 * We use WP_Meta_Query to do the heavy lifting of parsing the meta_query array
+	 * and creating the necessary SQL clauses.
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param array $meta_query An array of meta_query filters. See the
+	 *                          documentation for WP_Meta_Query for details.
+	 *
+	 * @return array $sql_array 'join' and 'where' clauses.
+	 */
+	public static function get_meta_query_sql( $meta_query = array() ) {
+		global $wpdb;
+
+		$sql_array = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		if ( ! empty( $meta_query ) ) {
+			$meta_query = new WP_Meta_Query( $meta_query );
+
+			// WP_Meta_Query expects the table name at
+			// $wpdb->messagemeta
+			$wpdb->messagemeta = buddypress()->messages->table_name_meta;
+
+			return $meta_query->get_sql( 'message', 'm', 'id' );
+		}
+
+		return $sql_array;
+	}
+
+	/**
+	 * Mark a thread as read.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 */
+	public static function mark_as_read( $thread_id ) {
+		global $wpdb;
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 0 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
+		$wpdb->query($sql);
+
+		wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' );
+		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+	}
+
+	/**
+	 * Mark a thread as unread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 */
+	public static function mark_as_unread( $thread_id ) {
+		global $wpdb;
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = 1 WHERE user_id = %d AND thread_id = %d", bp_loggedin_user_id(), $thread_id );
+		$wpdb->query($sql);
+
+		wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' );
+		wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' );
+	}
+
+	/**
+	 * Returns the total number of message threads for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int    $user_id The user ID.
+	 * @param string $box     The type of mailbox to get. Either 'inbox' or 'sentbox'.
+	 *                        Defaults to 'inbox'.
+	 * @param string $type    The type of messages to get. Either 'all' or 'unread'.
+	 *                        or 'read'. Defaults to 'all'.
+	 * @return int
+	 */
+	public static function get_total_threads_for_user( $user_id, $box = 'inbox', $type = 'all' ) {
+		global $wpdb;
+
+		$exclude_sender = '';
+		if ( $box != 'sentbox' )
+			$exclude_sender = ' AND sender_only != 1';
+
+		if ( $type == 'unread' )
+			$type_sql = " AND unread_count != 0 ";
+		elseif ( $type == 'read' )
+			$type_sql = " AND unread_count = 0 ";
+
+		$bp = buddypress();
+
+		return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0{$exclude_sender} {$type_sql}", $user_id ) );
+	}
+
+	/**
+	 * Determine if the logged-in user is a sender of any message in a thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return bool
+	 */
+	public static function user_is_sender( $thread_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$sender_ids = $wpdb->get_col( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d", $thread_id ) );
+
+		if ( ! $sender_ids ) {
+			return false;
+		}
+
+		return in_array( bp_loggedin_user_id(), $sender_ids );
+	}
+
+	/**
+	 * Returns the userlink of the last sender in a message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return string|bool The user link on success. Boolean false on failure.
+	 */
+	public static function get_last_sender( $thread_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( ! $sender_id = $wpdb->get_var( $wpdb->prepare( "SELECT sender_id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d GROUP BY sender_id ORDER BY date_sent LIMIT 1", $thread_id ) ) ) {
+			return false;
+		}
+
+		return bp_core_get_userlink( $sender_id, true );
+	}
+
+	/**
+	 * Gets the unread message count for a user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $user_id The user ID.
+	 *
+	 * @return int
+	 */
+	public static function get_inbox_count( $user_id = 0 ) {
+		global $wpdb;
+
+		if ( empty( $user_id ) ) {
+			$user_id = bp_loggedin_user_id();
+		}
+
+		$unread_count = wp_cache_get( $user_id, 'bp_messages_unread_count' );
+
+		if ( false === $unread_count ) {
+			$bp = buddypress();
+
+			$unread_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT SUM(unread_count) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0 AND sender_only = 0", $user_id ) );
+
+			wp_cache_set( $user_id, $unread_count, 'bp_messages_unread_count' );
+		}
+
+		/**
+		 * Filters a user's unread message count.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param int $unread_count Unread message count.
+		 * @param int $user_id      ID of the user.
+		 */
+		return apply_filters( 'messages_thread_get_inbox_count', (int) $unread_count, $user_id );
+	}
+
+	/**
+	 * Checks whether a user is a part of a message thread discussion.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 * @param int $user_id   The user ID.
+	 *
+	 * @return int|null The recorded recipient ID on success, null on failure.
+	 */
+	public static function check_access( $thread_id, $user_id = 0 ) {
+		if ( empty( $user_id ) ) {
+			$user_id = bp_loggedin_user_id();
+		}
+
+		$recipients = self::get_recipients_for_thread( $thread_id );
+
+		if ( isset( $recipients[$user_id] ) && 0 == $recipients[$user_id]->is_deleted ) {
+			return $recipients[$user_id]->id;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Checks whether a message thread exists.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param int $thread_id The message thread ID.
+	 *
+	 * @return int|null The message thread ID on success, null on failure.
+	 */
+	public static function is_valid( $thread_id = 0 ) {
+		// Bail if no thread ID is passed
+		if ( empty( $thread_id ) ) {
+			return false;
+		}
+
+		$thread = self::get_messages( $thread_id );
+
+		if ( ! empty( $thread ) ) {
+			return $thread_id;
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * Returns a string containing all the message recipient userlinks.
+	 *
+	 * String is comma-delimited.
+	 *
+	 * If a message thread has more than four users, the returned string is simply
+	 * "X Recipients" where "X" is the number of recipients in the message thread.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $recipients Array containing the message recipients (array of objects).
+	 *
+	 * @return string
+	 */
+	public static function get_recipient_links( $recipients ) {
+		if ( count( $recipients ) >= 5 )
+			return sprintf( __( '%s Recipients', 'buddypress' ), number_format_i18n( count( $recipients ) ) );
+
+		$recipient_links = array();
+
+		foreach ( (array) $recipients as $recipient ) {
+			$recipient_link = bp_core_get_userlink( $recipient->user_id );
+
+			if ( empty( $recipient_link ) ) {
+				$recipient_link = __( 'Deleted User', 'buddypress' );
+			}
+
+			$recipient_links[] = $recipient_link;
+		}
+
+		return implode( ', ', (array) $recipient_links );
+	}
+
+	/**
+	 * Upgrade method for the older BP message thread DB table.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @todo We should remove this.  No one is going to upgrade from v1.1, right?
+	 * @return bool
+	 */
+	public static function update_tables() {
+		global $wpdb;
+
+		$bp_prefix = bp_core_get_table_prefix();
+		$errors    = false;
+		$threads   = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" );
+
+		// Nothing to update, just return true to remove the table
+		if ( empty( $threads ) ) {
+			return true;
+		}
+
+		$bp = buddypress();
+
+		foreach( (array) $threads as $thread ) {
+			$message_ids = maybe_unserialize( $thread->message_ids );
+
+			if ( !empty( $message_ids ) ) {
+				$message_ids = implode( ',', $message_ids );
+
+				// Add the thread_id to the messages table
+				if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_messages} SET thread_id = %d WHERE id IN ({$message_ids})", $thread->id ) ) )
+					$errors = true;
+			}
+		}
+
+		if ( $errors ) {
+			return false;
+		}
+
+		return true;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php
index 0ca3b810232bcaf5d80fb7d2ee35116cc6208368..a1009675c9719300f61e5da6d9e3dad835327cd3 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Handle marking single notifications as read.
@@ -121,3 +121,64 @@ function bp_notifications_action_delete() {
 	bp_core_redirect( bp_displayed_user_domain() . bp_get_notifications_slug() . '/' . bp_current_action() . '/' );
 }
 add_action( 'bp_actions', 'bp_notifications_action_delete' );
+
+/**
+ * Handles bulk management (mark as read/unread, delete) of notifications.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @return bool
+ */
+function bp_notifications_action_bulk_manage() {
+
+	// Bail if not the read or unread screen.
+	if ( ! bp_is_notifications_component() || ! ( bp_is_current_action( 'read' ) || bp_is_current_action( 'unread' ) ) ) {
+		return false;
+	}
+
+	// Get the action
+	$action = !empty( $_POST['notification_bulk_action'] ) ? $_POST['notification_bulk_action'] : '';
+	$nonce  = !empty( $_POST['notifications_bulk_nonce'] ) ? $_POST['notifications_bulk_nonce'] : '';
+	$notifications = !empty( $_POST['notifications'] ) ? $_POST['notifications'] : '';
+
+	// Bail if no action or no IDs.
+	if ( ( ! in_array( $action, array( 'delete', 'read', 'unread' ) ) ) || empty( $notifications ) || empty( $nonce ) ) {
+		return false;
+	}
+
+	// Check the nonce.
+	if ( ! wp_verify_nonce( $nonce, 'notifications_bulk_nonce' ) ) {
+		bp_core_add_message( __( 'There was a problem managing your notifications.', 'buddypress' ), 'error' );
+		return false;
+	}
+
+	$notifications = wp_parse_id_list( $notifications );
+
+	// Delete, mark as read or unread depending on the user 'action'.
+	switch ( $action ) {
+		case 'delete' :
+			foreach ( $notifications as $notification ) {
+				bp_notifications_delete_notification( $notification );
+			}
+			bp_core_add_message( __( 'Notifications deleted.', 'buddypress' ) );
+		break;
+
+		case 'read' :
+			foreach ( $notifications as $notification ) {
+				bp_notifications_mark_notification( $notification, false );
+			}
+			bp_core_add_message( __( 'Notifications marked as read', 'buddypress' ) );
+		break;
+
+		case 'unread' :
+			foreach ( $notifications as $notification ) {
+				bp_notifications_mark_notification( $notification, true );
+			}
+			bp_core_add_message( __( 'Notifications marked as unread.', 'buddypress' ) );
+		break;
+	}
+
+	// Redirect
+	bp_core_redirect( bp_displayed_user_domain() . bp_get_notifications_slug() . '/' . bp_current_action() . '/' );
+}
+add_action( 'bp_actions', 'bp_notifications_action_bulk_manage' );
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-adminbar.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-adminbar.php
index 14a2697ff9eda05c5cd287558b25784e546c9fd2..bd2f8785470db80b0496cc24a94e0cc72ff1ab54 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-adminbar.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-adminbar.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Build the "Notifications" dropdown.
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-cache.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-cache.php
index 0196f41993401d9cf25f7d22abbebd54cd3f123e..d4b0c639d20ffb7b627791a4500d64957db774a1 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-cache.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-cache.php
@@ -6,15 +6,50 @@
  * @since BuddyPress (2.0.0)
  */
 
+/**
+ * Slurp up metadata for a set of notifications.
+ *
+ * It grabs all notification meta associated with all of the notifications
+ * passed in $notification_ids and adds it to WP cache. This improves efficiency
+ * when using notification meta within a loop context.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param int|str|array $notification_ids Accepts a single notification_id, or a
+ *                                        comma-separated list or array of
+ *                                        notification ids.
+ */
+function bp_notifications_update_meta_cache( $notification_ids = false ) {
+	bp_update_meta_cache( array(
+		'object_ids' 	   => $notification_ids,
+		'object_type' 	   => buddypress()->notifications->id,
+		'cache_group'      => 'notification_meta',
+		'object_column'    => 'notification_id',
+		'meta_table' 	   => buddypress()->notifications->table_name_meta,
+		'cache_key_prefix' => 'bp_notifications_meta'
+	) );
+}
+
+/**
+ * Clear all notifications cache for a given user ID
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param int $user_id The user ID's cache to clear
+ */
+function bp_notifications_clear_all_for_user_cache( $user_id = 0 ) {
+	wp_cache_delete( 'all_for_user_' . $user_id, 'bp_notifications' );
+}
+
 /**
  * Invalidate 'all_for_user_' cache when saving.
  *
  * @since BuddyPress (2.0.0)
  *
- * @param BP_Notification_Notification $n Notification object.
+ * @param BP_Notifications_Notification $n Notification object.
  */
 function bp_notifications_clear_all_for_user_cache_after_save( BP_Notifications_Notification $n ) {
-	wp_cache_delete( 'all_for_user_' . $n->user_id, 'bp_notifications' );
+	bp_notifications_clear_all_for_user_cache( $n->user_id );
 }
 add_action( 'bp_notification_after_save', 'bp_notifications_clear_all_for_user_cache_after_save' );
 
@@ -26,6 +61,7 @@ add_action( 'bp_notification_after_save', 'bp_notifications_clear_all_for_user_c
  * @param int $args Notification deletion arguments.
  */
 function bp_notifications_clear_all_for_user_cache_before_delete( $args ) {
+
 	// Pull up a list of items matching the args (those about te be deleted)
 	$ns = BP_Notifications_Notification::get( $args );
 
@@ -34,8 +70,31 @@ function bp_notifications_clear_all_for_user_cache_before_delete( $args ) {
 		$user_ids[] = $n->user_id;
 	}
 
-	foreach ( array_unique( $user_ids ) as $user_id ) {
-		wp_cache_delete( 'all_for_user_' . $user_id, 'bp_notifications' );
+	$user_ids = array_unique( $user_ids );
+	foreach ( $user_ids as $user_id ) {
+		bp_notifications_clear_all_for_user_cache( $user_id );
 	}
 }
 add_action( 'bp_notification_before_delete', 'bp_notifications_clear_all_for_user_cache_before_delete' );
+
+/**
+ * Invalidates 'all_for_user_' cache when updating.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param array $update_args See BP_Notifications_Notification::update() for description.
+ * @param array $where_args  See BP_Notifications_Notification::update() for description.
+ */
+function bp_notifications_clear_all_for_user_cache_before_update( $update_args, $where_args ) {
+
+	// User ID is passed in where arugments
+	if ( ! empty( $where_args['user_id'] ) ) {
+		bp_notifications_clear_all_for_user_cache( $where_args['user_id'] );
+
+	// Get user ID from Notification ID
+	} elseif ( ! empty( $where_args['id'] ) ) {
+		$n = bp_notifications_get_notification( $where_args['id'] );
+		bp_notifications_clear_all_for_user_cache( $n->user_id );
+	}
+}
+add_action( 'bp_notification_before_update', 'bp_notifications_clear_all_for_user_cache_before_update', 10, 2 );
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-classes.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-classes.php
index 95cd127cc376a19a917f7d2c35a2131eac487f42..b96a6cc8f45cc87e3494acbbb24b0109e043e938 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-classes.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-classes.php
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * BuddyPress Notifications Classes
  *
@@ -12,931 +11,6 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
-
-/**
- * BuddyPress Notification items.
- *
- * Use this class to create, access, edit, or delete BuddyPress Notifications.
- *
- * @since BuddyPress (1.9.0)
- */
-class BP_Notifications_Notification {
-
-	/**
-	 * The notification ID.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var int
-	 */
-	public $id;
-
-	/**
-	 * The ID of the item associated with the notification.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var int
-	 */
-	public $item_id;
-
-	/**
-	 * The ID of the secondary item associated with the notification.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var int
-	 */
-	public $secondary_item_id = null;
-
-	/**
-	 * The ID of the user the notification is associated with.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var int
-	 */
-	public $user_id;
-
-	/**
-	 * The name of the component that the notification is for.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var string
-	 */
-	public $component_name;
-
-	/**
-	 * The component action which the notification is related to.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var string
-	 */
-	public $component_action;
-
-	/**
-	 * The date the notification was created.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var string
-	 */
-	public $date_notified;
-
-	/**
-	 * Is the notification new, or has it already been read.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 * @access public
-	 * @var bool
-	 */
-	public $is_new;
-
-	/** Public Methods ****************************************************/
-
-	/**
-	 * Constructor method.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $id Optional. Provide an ID to access an existing
-	 *        notification item.
-	 */
-	public function __construct( $id = 0 ) {
-		if ( ! empty( $id ) ) {
-			$this->id = $id;
-			$this->populate();
-		}
-	}
-
-	/**
-	 * Update or insert notification details into the database.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @global wpdb $wpdb WordPress database object.
-	 *
-	 * @return bool True on success, false on failure.
-	 */
-	public function save() {
-
-		// Return value
-		$retval = false;
-
-		// Default data and format
-		$data = array(
-			'user_id'           => $this->user_id,
-			'item_id'           => $this->item_id,
-			'secondary_item_id' => $this->secondary_item_id,
-			'component_name'    => $this->component_name,
-			'component_action'  => $this->component_action,
-			'date_notified'     => $this->date_notified,
-			'is_new'            => $this->is_new,
-		);
-		$data_format = array( '%d', '%d', '%d', '%s', '%s', '%s', '%d' );
-
-		do_action_ref_array( 'bp_notification_before_save', array( &$this ) );
-
-		// Update
-		if ( ! empty( $this->id ) ) {
-			$result = self::_update( $data, array( 'ID' => $this->id ), $data_format, array( '%d' ) );
-
-		// Insert
-		} else {
-			$result = self::_insert( $data, $data_format );
-		}
-
-		// Set the notification ID if successful
-		if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
-			global $wpdb;
-
-			$this->id = $wpdb->insert_id;
-			$retval   = $wpdb->insert_id;
-		}
-
-		do_action_ref_array( 'bp_notification_after_save', array( &$this ) );
-
-		// Return the result
-		return $retval;
-	}
-
-	/**
-	 * Fetch data for an existing notification from the database.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @global BuddyPress $bp The one true BuddyPress instance.
-	 * @global wpdb $wpdb WordPress database object.
-	 */
-	public function populate() {
-		global $wpdb;
-
-		$bp = buddypress();
-
-		// Look for a notification
-		$notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->notifications->table_name} WHERE id = %d", $this->id ) );
-
-		// Setup the notification data
-		if ( ! empty( $notification ) && ! is_wp_error( $notification ) ) {
-			$this->item_id           = $notification->item_id;
-			$this->secondary_item_id = $notification->secondary_item_id;
-			$this->user_id           = $notification->user_id;
-			$this->component_name    = $notification->component_name;
-			$this->component_action  = $notification->component_action;
-			$this->date_notified     = $notification->date_notified;
-			$this->is_new            = $notification->is_new;
-		}
-	}
-
-	/** Protected Static Methods ******************************************/
-
-	/**
-	 * Create a notification entry.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param array $data {
-	 *     Array of notification data, passed to {@link wpdb::insert()}.
-	 *     @type int $user_id ID of the associated user.
-	 *     @type int $item_id ID of the associated item.
-	 *     @type int $secondary_item_id ID of the secondary associated item.
-	 *     @type string $component_name Name of the associated component.
-	 *     @type string $component_action Name of the associated component
-	 *           action.
-	 *     @type string $date_notified Timestamp of the notification.
-	 *     @type bool $is_new True if the notification is unread, otherwise
-	 *           false.
-	 * }
-	 * @param array $data_format See {@link wpdb::insert()}.
-	 * @return int|false The number of rows inserted, or false on error.
-	 */
-	protected static function _insert( $data = array(), $data_format = array() ) {
-		global $wpdb;
-		return $wpdb->insert( buddypress()->notifications->table_name, $data, $data_format );
-	}
-
-	/**
-	 * Update notifications.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @see wpdb::update() for further description of paramater formats.
-	 *
-	 * @param array $data Array of notification data to update, passed to
-	 *        {@link wpdb::update()}. Accepts any property of a
-	 *        BP_Notification_Notification object.
-	 * @param array $where The WHERE params as passed to wpdb::update().
-	 *        Typically consists of array( 'ID' => $id ) to specify the ID
-	 *        of the item being updated. See {@link wpdb::update()}.
-	 * @param array $data_format See {@link wpdb::insert()}.
-	 * @param array $where_format See {@link wpdb::insert()}.
-	 * @return int|false The number of rows updated, or false on error.
-	 */
-	protected static function _update( $data = array(), $where = array(), $data_format = array(), $where_format = array() ) {
-		global $wpdb;
-		return $wpdb->update( buddypress()->notifications->table_name, $data, $where, $data_format, $where_format );
-	}
-
-	/**
-	 * Delete notifications.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @see wpdb::update() for further description of paramater formats.
-	 *
-	 * @param array $where Array of WHERE clauses to filter by, passed to
-	 *        {@link wpdb::delete()}. Accepts any property of a
-	 *        BP_Notification_Notification object.
-	 * @param array $where_format See {@link wpdb::insert()}.
-	 * @return int|false The number of rows updated, or false on error.
-	 */
-	protected static function _delete( $where = array(), $where_format = array() ) {
-		global $wpdb;
-		return $wpdb->delete( buddypress()->notifications->table_name, $where, $where_format );
-	}
-
-	/**
-	 * Assemble the WHERE clause of a get() SQL statement.
-	 *
-	 * Used by BP_Notifications_Notification::get() to create its WHERE
-	 * clause.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param array $args See {@link BP_Notifications_Notification::get()}
-	 *        for more details.
-	 * @return string WHERE clause.
-	 */
-	protected static function get_where_sql( $args = array() ) {
-		global $wpdb;
-
-		$where_conditions = array();
-		$where            = '';
-
-		// id
-		if ( ! empty( $args['id'] ) ) {
-			$id_in = implode( ',', wp_parse_id_list( $args['id'] ) );
-			$where_conditions['id'] = "id IN ({$id_in})";
-		}
-
-		// user_id
-		if ( ! empty( $args['user_id'] ) ) {
-			$user_id_in = implode( ',', wp_parse_id_list( $args['user_id'] ) );
-			$where_conditions['user_id'] = "user_id IN ({$user_id_in})";
-		}
-
-		// item_id
-		if ( ! empty( $args['item_id'] ) ) {
-			$item_id_in = implode( ',', wp_parse_id_list( $args['item_id'] ) );
-			$where_conditions['item_id'] = "item_id IN ({$item_id_in})";
-		}
-
-		// secondary_item_id
-		if ( ! empty( $args['secondary_item_id'] ) ) {
-			$secondary_item_id_in = implode( ',', wp_parse_id_list( $args['secondary_item_id'] ) );
-			$where_conditions['secondary_item_id'] = "secondary_item_id IN ({$secondary_item_id_in})";
-		}
-
-		// component_name
-		if ( ! empty( $args['component_name'] ) ) {
-			if ( ! is_array( $args['component_name'] ) ) {
-				$component_names = explode( ',', $args['component_name'] );
-			} else {
-				$component_names = $args['component_name'];
-			}
-
-			$cn_clean = array();
-			foreach ( $component_names as $cn ) {
-				$cn_clean[] = $wpdb->prepare( '%s', $cn );
-			}
-
-			$cn_in = implode( ',', $cn_clean );
-			$where_conditions['component_name'] = "component_name IN ({$cn_in})";
-		}
-
-		// component_action
-		if ( ! empty( $args['component_action'] ) ) {
-			if ( ! is_array( $args['component_action'] ) ) {
-				$component_actions = explode( ',', $args['component_action'] );
-			} else {
-				$component_actions = $args['component_action'];
-			}
-
-			$ca_clean = array();
-			foreach ( $component_actions as $ca ) {
-				$ca_clean[] = $wpdb->prepare( '%s', $ca );
-			}
-
-			$ca_in = implode( ',', $ca_clean );
-			$where_conditions['component_action'] = "component_action IN ({$ca_in})";
-		}
-
-		// is_new
-		if ( ! empty( $args['is_new'] ) && 'both' !== $args['is_new'] ) {
-			$where_conditions['is_new'] = "is_new = 1";
-		} elseif ( isset( $args['is_new'] ) && ( 0 === $args['is_new'] || false === $args['is_new'] ) ) {
-			$where_conditions['is_new'] = "is_new = 0";
-		}
-
-		// search_terms
-		if ( ! empty( $args['search_terms'] ) ) {
-			$search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
-			$where_conditions['search_terms'] = $wpdb->prepare( "( component_name LIKE %s OR component_action LIKE %s )", $search_terms_like, $search_terms_like );
-		}
-
-		// Custom WHERE
-		if ( ! empty( $where_conditions ) ) {
-			$where = 'WHERE ' . implode( ' AND ', $where_conditions );
-		}
-
-		return $where;
-	}
-
-	/**
-	 * Assemble the ORDER BY clause of a get() SQL statement.
-	 *
-	 * Used by BP_Notifications_Notification::get() to create its ORDER BY
-	 * clause.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param array $args See {@link BP_Notifications_Notification::get()}
-	 *        for more details.
-	 * @return string ORDER BY clause.
-	 */
-	protected static function get_order_by_sql( $args = array() ) {
-
-		// Setup local variable
-		$conditions = array();
-		$retval     = '';
-
-		// Order by
-		if ( ! empty( $args['order_by'] ) ) {
-			$order_by               = implode( ', ', (array) $args['order_by'] );
-			$conditions['order_by'] = "{$order_by}";
-		}
-
-		// Sort order direction
-		if ( ! empty( $args['sort_order'] ) && in_array( $args['sort_order'], array( 'ASC', 'DESC' ) ) ) {
-			$sort_order               = $args['sort_order'];
-			$conditions['sort_order'] = "{$sort_order}";
-		}
-
-		// Custom ORDER BY
-		if ( ! empty( $conditions ) ) {
-			$retval = 'ORDER BY ' . implode( ' ', $conditions );
-		}
-
-		return $retval;
-	}
-
-	/**
-	 * Assemble the LIMIT clause of a get() SQL statement.
-	 *
-	 * Used by BP_Notifications_Notification::get() to create its LIMIT clause.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param array $args See {@link BP_Notifications_Notification::get()}
-	 *        for more details.
-	 * @return string LIMIT clause.
-	 */
-	protected static function get_paged_sql( $args = array() ) {
-		global $wpdb;
-
-		// Setup local variable
-		$retval = '';
-
-		// Custom LIMIT
-		if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) {
-			$page     = absint( $args['page']     );
-			$per_page = absint( $args['per_page'] );
-			$offset   = $per_page * ( $page - 1 );
-			$retval   = $wpdb->prepare( "LIMIT %d, %d", $offset, $per_page );
-		}
-
-		return $retval;
-	}
-
-	/**
-	 * Assemble query clauses, based on arrguments, to pass to $wpdb methods.
-	 *
-	 * The insert(), update(), and delete() methods of {@link wpdb} expect
-	 * arguments of the following forms:
-	 *
-	 * - associative arrays whose key/value pairs are column => value, to
-	 *   be used in WHERE, SET, or VALUES clauses
-	 * - arrays of "formats", which tell $wpdb->prepare() which type of
-	 *   value to expect when sanitizing (eg, array( '%s', '%d' ))
-	 *
-	 * This utility method can be used to assemble both kinds of params,
-	 * out of a single set of associative array arguments, such as:
-	 *
-	 *     $args = array(
-	 *         'user_id' => 4,
-	 *         'component_name' => 'groups',
-	 *     );
-	 *
-	 * This will be converted to:
-	 *
-	 *     array(
-	 *         'data' => array(
-	 *             'user_id' => 4,
-	 *             'component_name' => 'groups',
-	 *         ),
-	 *         'format' => array(
-	 *             '%d',
-	 *             '%s',
-	 *         ),
-	 *     )
-	 *
-	 * which can easily be passed as arguments to the $wpdb methods.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param $args Associative array of filter arguments.
-	 *        See {@BP_Notifications_Notification::get()} for a breakdown.
-	 * @return array Associative array of 'data' and 'format' args.
-	 */
-	protected static function get_query_clauses( $args = array() ) {
-		$where_clauses = array(
-			'data'   => array(),
-			'format' => array(),
-		);
-
-		// id
-		if ( ! empty( $args['id'] ) ) {
-			$where_clauses['data']['id'] = absint( $args['id'] );
-			$where_clauses['format'][] = '%d';
-		}
-
-		// user_id
-		if ( ! empty( $args['user_id'] ) ) {
-			$where_clauses['data']['user_id'] = absint( $args['user_id'] );
-			$where_clauses['format'][] = '%d';
-		}
-
-		// item_id
-		if ( ! empty( $args['item_id'] ) ) {
-			$where_clauses['data']['item_id'] = absint( $args['item_id'] );
-			$where_clauses['format'][] = '%d';
-		}
-
-		// secondary_item_id
-		if ( ! empty( $args['secondary_item_id'] ) ) {
-			$where_clauses['data']['secondary_item_id'] = absint( $args['secondary_item_id'] );
-			$where_clauses['format'][] = '%d';
-		}
-
-		// component_name
-		if ( ! empty( $args['component_name'] ) ) {
-			$where_clauses['data']['component_name'] = $args['component_name'];
-			$where_clauses['format'][] = '%s';
-		}
-
-		// component_action
-		if ( ! empty( $args['component_action'] ) ) {
-			$where_clauses['data']['component_action'] = $args['component_action'];
-			$where_clauses['format'][] = '%s';
-		}
-
-		// is_new
-		if ( isset( $args['is_new'] ) ) {
-			$where_clauses['data']['is_new'] = ! empty( $args['is_new'] ) ? 1 : 0;
-			$where_clauses['format'][] = '%d';
-		}
-
-		return $where_clauses;
-	}
-
-	/** Public Static Methods *********************************************/
-
-	/**
-	 * Check that a specific notification is for a specific user.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $user_id ID of the user being checked.
-	 * @param int $notification_id ID of the notification being checked.
-	 * @return bool True if the notification belongs to the user, otherwise
-	 *         false.
-	 */
-	public static function check_access( $user_id, $notification_id ) {
-		global $wpdb;
-
-		$bp = buddypress();
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
-	}
-
-	/**
-	 * Get notifications, based on provided filter parameters.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param array $args {
-	 *     Associative array of arguments. All arguments but $page and
-	 *     $per_page can be treated as filter values for get_where_sql()
-	 *     and get_query_clauses(). All items are optional.
-	 *     @type int|array $id ID of notification being updated. Can be an
-	 *           array of IDs.
-	 *     @type int|array $user_id ID of user being queried. Can be an
-	 *           array of user IDs.
-	 *     @type int|array $item_id ID of associated item. Can be an array
-	 *           of multiple item IDs.
-	 *     @type int|array $secondary_item_id ID of secondary associated
-	 *           item. Can be an array of multiple IDs.
-	 *     @type string|array $component_name Name of the component to
-	 *           filter by. Can be an array of component names.
-	 *     @type string|array $component_action Name of the action to
-	 *           filter by. Can be an array of actions.
-	 *     @type bool $is_new Whether to limit to new notifications. True
-	 *           returns only new notifications, false returns only non-new
-	 *           notifications. 'both' returns all. Default: true.
-	 *     @type string $search_terms Term to match against component_name
-	 *           or component_action fields.
-	 *     @type string $order_by Database column to order notifications by.
-	 *     @type string $sort_order Either 'ASC' or 'DESC'.
-	 *     @type string $order_by Field to order results by.
-	 *     @type string $sort_order ASC or DESC.
-	 *     @type int $page Number of the current page of results. Default:
-	 *           false (no pagination - all items).
-	 *     @type int $per_page Number of items to show per page. Default:
-	 *           false (no pagination - all items).
-	 * }
-	 * @return array Located notifications.
-	 */
-	public static function get( $args = array() ) {
-		global $wpdb;
-
-		// Parse the arguments
-		$r  = wp_parse_args( $args, array(
-			'id'                => false,
-			'user_id'           => false,
-			'item_id'           => false,
-			'secondary_item_id' => false,
-			'component_name'    => bp_notifications_get_registered_components(),
-			'component_action'  => false,
-			'is_new'            => true,
-			'search_terms'      => '',
-			'order_by'          => false,
-			'sort_order'        => false,
-			'page'              => false,
-			'per_page'          => false,
-		) );
-
-		// SELECT
-		$select_sql = "SELECT *";
-
-		// FROM
-		$from_sql   = "FROM " . buddypress()->notifications->table_name;
-
-		// WHERE
-		$where_sql  = self::get_where_sql( array(
-			'id'                => $r['id'],
-			'user_id'           => $r['user_id'],
-			'item_id'           => $r['item_id'],
-			'secondary_item_id' => $r['secondary_item_id'],
-			'component_name'    => $r['component_name'],
-			'component_action'  => $r['component_action'],
-			'is_new'            => $r['is_new'],
-			'search_terms'      => $r['search_terms'],
-		) );
-
-		// ORDER BY
-		$order_sql  = self::get_order_by_sql( array(
-			'order_by'   => $r['order_by'],
-			'sort_order' => $r['sort_order']
-		) );
-
-		// LIMIT %d, %d
-		$pag_sql    = self::get_paged_sql( array(
-			'page'     => $r['page'],
-			'per_page' => $r['per_page'],
-		) );
-
-		$sql = "{$select_sql} {$from_sql} {$where_sql} {$order_sql} {$pag_sql}";
-
-		return $wpdb->get_results( $sql );
-	}
-
-	/**
-	 * Get a count of total notifications matching a set of arguments.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @see BP_Notifications_Notification::get() for a description of
-	 *      arguments.
-	 *
-	 * @param array $args See {@link BP_Notifications_Notification::get()}.
-	 * @return int Count of located items.
-	 */
-	public static function get_total_count( $args ) {
-		global $wpdb;
-
-		/**
-		 * Default component_name to active_components
-		 *
-		 * @see http://buddypress.trac.wordpress.org/ticket/5300
-		 */
-		$args = wp_parse_args( $args, array(
-			'component_name' => bp_notifications_get_registered_components()
-		) );
-
-		// Load BuddyPress
-		$bp = buddypress();
-
-		// Build the query
-		$select_sql = "SELECT COUNT(*)";
-		$from_sql   = "FROM {$bp->notifications->table_name}";
-		$where_sql  = self::get_where_sql( $args );
-		$sql        = "{$select_sql} {$from_sql} {$where_sql}";
-
-		// Return the queried results
-		return $wpdb->get_var( $sql );
-	}
-
-	/**
-	 * Update notifications.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @see BP_Notifications_Notification::get() for a description of
-	 *      accepted update/where arguments.
-	 *
-	 * @param array $update_args Associative array of fields to update,
-	 *        and the values to update them to. Of the format
-	 *            array( 'user_id' => 4, 'component_name' => 'groups', )
-	 * @param array $where_args Associative array of columns/values, to
-	 *        determine which rows should be updated. Of the format
-	 *            array( 'item_id' => 7, 'component_action' => 'members', )
-	 * @return int|bool Number of rows updated on success, false on failure.
-	 */
-	public static function update( $update_args = array(), $where_args = array() ) {
-		$update = self::get_query_clauses( $update_args );
-		$where  = self::get_query_clauses( $where_args  );
-
-		// make sure we delete the notification cache for the user on update
-		if ( ! empty( $where_args['user_id'] ) ) {
-			wp_cache_delete( 'all_for_user_' . $where_args['user_id'], 'bp_notifications' );
-		}
-
-		return self::_update( $update['data'], $where['data'], $update['format'], $where['format'] );
-	}
-
-	/**
-	 * Delete notifications.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @see BP_Notifications_Notification::get() for a description of
-	 *      accepted update/where arguments.
-	 *
-	 * @param array $args Associative array of columns/values, to determine
-	 *        which rows should be deleted.  Of the format
-	 *            array( 'item_id' => 7, 'component_action' => 'members', )
-	 * @return int|bool Number of rows deleted on success, false on failure.
-	 */
-	public static function delete( $args = array() ) {
-		$where = self::get_query_clauses( $args );
-
-		do_action( 'bp_notification_before_delete', $args );
-
-		return self::_delete( $where['data'], $where['format'] );
-	}
-
-	/** Convenience methods ***********************************************/
-
-	/**
-	 * Delete a single notification by ID.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @see BP_Notifications_Notification::delete() for explanation of
-	 *      return value.
-	 *
-	 * @param int $id ID of the notification item to be deleted.
-	 * @return bool True on success, false on failure.
-	 */
-	public static function delete_by_id( $id ) {
-		return self::delete( array(
-			'id' => $id,
-		) );
-	}
-
-	/**
-	 * Fetch all the notifications in the database for a specific user.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $user_id ID of the user whose notifications are being
-	 *        fetched.
-	 * @param string $status Optional. Status of notifications to fetch.
-	 *        'is_new' to get only unread items, 'all' to get all.
-	 * @return array Associative array of notification items.
-	 */
-	public static function get_all_for_user( $user_id, $status = 'is_new' ) {
-		return self::get( array(
-			'user_id' => $user_id,
-			'is_new'  => 'is_new' === $status,
-		) );
-	}
-
-	/**
-	 * Fetch all the unread notifications in the database for a specific user.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $user_id ID of the user whose notifications are being
-	 *        fetched.
-	 * @return array Associative array of unread notification items.
-	 */
-	public static function get_unread_for_user( $user_id = 0 ) {
-		return self::get( array(
-			'user_id' => $user_id,
-			'is_new'  => true,
-		) );
-	}
-
-	/**
-	 * Fetch all the read notifications in the database for a specific user.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $user_id ID of the user whose notifications are being
-	 *        fetched.
-	 * @return array Associative array of unread notification items.
-	 */
-	public static function get_read_for_user( $user_id = 0 ) {
-		return self::get( array(
-			'user_id' => $user_id,
-			'is_new'  => false,
-		) );
-	}
-
-	/**
-	 * Get unread notifications for a user, in a pagination-friendly format.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param array $args {
-	 *     Array of arguments.
-	 *     @type int $user_id ID of the user for whom the notifications are
-	 *           being fetched. Default: logged-in user ID.
-	 *     @type bool $is_new Whether to limit the query to unread
-	 *           notifications. Default: true.
-	 *     @type int $page Number of the page to return. Default: 1.
-	 *     @type int $per_page Number of results to display per page.
-	 *           Default: 10.
-	 *     @type string $search_terms Optional. A term to search against in
-	 *           the 'component_name' and 'component_action' columns.
-	 * }
-	 * @return array {
-	 *     @type array $notifications Array of notification results.
-	 *     @type int $total Count of all located notifications matching
-	 *           the query params.
-	 * }
-	 */
-	public static function get_current_notifications_for_user( $args = array() ) {
-		$r = wp_parse_args( $args, array(
-			'user_id'      => bp_loggedin_user_id(),
-			'is_new'       => true,
-			'page'         => 1,
-			'per_page'     => 25,
-			'search_terms' => '',
-		) );
-
-		$notifications = self::get( $r );
-
-		// Bail if no notifications
-		if ( empty( $notifications ) ) {
-			return false;
-		}
-
-		$total_count = self::get_total_count( $r );
-
-		return array( 'notifications' => &$notifications, 'total' => $total_count );
-	}
-
-	/** Mark **************************************************************/
-
-	/**
-	 * Mark all user notifications as read.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $user_id The ID of the user who the notifications
-	 *        are for.
-	 * @param int $is_new Mark as read (1) or unread (0).
-	 */
-	public static function mark_all_for_user( $user_id, $is_new = 0, $item_id = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
-
-		// Values to be updated
-		$update_args = array(
-			'is_new' => $is_new,
-		);
-
-		// WHERE clauses
-		$where_args = array(
-			'user_id' => $user_id,
-		);
-
-		if ( ! empty( $item_id ) ) {
-			$where_args['item_id'] = $item_id;
-		}
-
-		if ( ! empty( $component_name ) ) {
-			$where_args['component_name'] = $component_name;
-		}
-
-		if ( ! empty( $component_action ) ) {
-			$where_args['component_action'] = $component_action;
-		}
-
-		if ( ! empty( $secondary_item_id ) ) {
-			$where_args['secondary_item_id'] = $secondary_item_id;
-		}
-
-		return self::update( $update_args, $where_args );
-	}
-
-	/**
-	 * Mark all notifications from a user as read.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $user_id The ID of the user who the notifications are from.
-	 * @param int $is_new Mark as read (1) or unread (0).
-	 */
-	public static function mark_all_from_user( $user_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
-
-		// Values to be updated
-		$update_args = array(
-			'is_new' => $is_new,
-		);
-
-		// WHERE clauses
-		$where_args = array(
-			'item_id' => $user_id,
-		);
-
-		if ( ! empty( $component_name ) ) {
-			$where_args['component_name'] = $component_name;
-		}
-
-		if ( ! empty( $component_action ) ) {
-			$where_args['component_action'] = $component_action;
-		}
-
-		if ( ! empty( $secondary_item_id ) ) {
-			$where_args['secondary_item_id'] = $secondary_item_id;
-		}
-
-		return self::update( $update_args, $where_args );
-	}
-
-	/**
-	 * Mark all notifications for all users as read by item id, and optional
-	 * secondary item id, and component name and action.
-	 *
-	 * @since BuddyPress (1.9.0)
-	 *
-	 * @param int $item_id The ID of the item associated with the
-	 *        notifications.
-	 * @param string $component_name The component that the notifications
-	 *        are associated with.
-	 * @param string $component_action The action that the notifications
-	 *        are associated with.
-	 * @param string $secondary_item_id Optional. ID of the secondary
-	 *        associated item.
-	 */
-	public static function mark_all_by_type( $item_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
-
-		// Values to be updated
-		$update_args = array(
-			'is_new' => $is_new,
-		);
-
-		// WHERE clauses
-		$where_args = array(
-			'item_id' => $item_id,
-		);
-
-		if ( ! empty( $component_name ) ) {
-			$where_args['component_name'] = $component_name;
-		}
-
-		if ( ! empty( $component_action ) ) {
-			$where_args['component_action'] = $component_action;
-		}
-
-		if ( ! empty( $secondary_item_id ) ) {
-			$where_args['secondary_item_id'] = $secondary_item_id;
-		}
+defined( 'ABSPATH' ) || exit;
 
-		return self::update( $update_args, $where_args );
-	}
-}
+require dirname( __FILE__ ) . '/classes/class-bp-notifications-notification.php';
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php
index f8bdc96b25ce114cb05044e8d703c2f938286991..75228d79d1e2d5173806d128dc557083341f6a4b 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Add a notification for a specific user, from a specific component.
@@ -19,7 +19,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
  *
  * @param array $args {
  *     Array of arguments describing the notification. All are optional.
- *     @type int $user_id ID of the user to associate the notificiton with.
+ *     @type int $user_id ID of the user to associate the notification with.
  *     @type int $item_id ID of the item to associate the notification with.
  *     @type int $secondary_item_id ID of the secondary item to associate the
  *           notification with.
@@ -151,7 +151,14 @@ function bp_notifications_get_all_notifications_for_user( $user_id = 0 ) {
 		wp_cache_set( 'all_for_user_' . $user_id, $notifications, 'bp_notifications' );
 	}
 
-	// Filter and return
+	/**
+	 * Filters all notifications for a user.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $notifications Array of notifications for user.
+	 * @param int   $user_id       ID of the user being fetched.
+	 */
 	return apply_filters( 'bp_notifications_get_all_notifications_for_user', $notifications, $user_id );
 }
 
@@ -261,7 +268,13 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin
 				// Function should return an object
 				if ( 'object' === $format ) {
 
-					// Retrieve the content of the notification using the callback
+					/**
+					 * Filters the notifications for a user.
+					 *
+					 * @since BuddyPress (1.9.0)
+					 *
+					 * @param array $ref_array Array of properties for the current notification being rendered.
+					 */
 					$content = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', $ref_array );
 
 					// Create the object to be returned
@@ -281,6 +294,8 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin
 
 				// Return an array of content strings
 				} else {
+
+					/** This filters is documented in bp-notifications/bp-notifications-functions.php */
 					$renderable[] = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', $ref_array );
 				}
 			}
@@ -292,7 +307,15 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin
 		$renderable = false;
 	}
 
-	// Filter and return
+	/**
+	 * Filters the final array of notifications to be displayed for a user.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param Array|Bool $renderable Array of notifications to render or false if no notifications.
+	 * @param int        $user_id    ID of the user whose notifications are being displayed.
+	 * @param string     $format     Display format requested for the notifications.
+	 */
 	return apply_filters( 'bp_core_get_notifications_for_user', $renderable, $user_id, $format );
 }
 
@@ -377,7 +400,7 @@ function bp_notifications_delete_all_notifications_by_type( $item_id, $component
  *
  * @since BuddyPress (1.9.0)
  *
- * @param int $user_id ID of the user whose associated items are beind deleted.
+ * @param int $user_id ID of the user whose associated items are being deleted.
  * @param string $component_name Name of the associated component.
  * @param string $component_action Name of the associated action.
  * @return bool True on success, false on failure.
@@ -490,7 +513,7 @@ function bp_notifications_mark_all_notifications_by_type( $item_id, $component_n
  *
  * @since BuddyPress (1.9.0)
  *
- * @param int $user_id ID of the user whose associated items are beind deleted.
+ * @param int $user_id ID of the user whose associated items are being deleted.
  * @param int $is_new 0 for read, 1 for unread
  * @param string $component_name Name of the associated component.
  * @param string $component_action Name of the associated action.
@@ -540,6 +563,13 @@ function bp_notifications_get_unread_notification_count( $user_id = 0 ) {
 	$notifications = bp_notifications_get_all_notifications_for_user( $user_id );
 	$count         = ! empty( $notifications ) ? count( $notifications ) : 0;
 
+	/**
+	 * Filters the count of unread notification items for a user.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $count Count of unread notification items for a user.
+	 */
 	return apply_filters( 'bp_notifications_get_total_notification_count', (int) $count );
 }
 
@@ -571,6 +601,144 @@ function bp_notifications_get_registered_components() {
 		}
 	}
 
-	// Return active components with registered notifications callbacks
+	/**
+	 * Filters active components with registered notifications callbacks.
+	 *
+	 * @since BuddyPress (1.9.1)
+	 *
+	 * @param array $component_names   Array of registered component names.
+	 * @param array $active_components Array of active components.
+	 */
 	return apply_filters( 'bp_notifications_get_registered_components', $component_names, $active_components );
 }
+
+/** Meta **********************************************************************/
+
+/**
+ * Delete a meta entry from the DB for a notification item.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @global object $wpdb WordPress database access object.
+ *
+ * @param int    $notification_id ID of the notification item whose metadata is being deleted.
+ * @param string $meta_key        Optional. The key of the metadata being deleted. If
+ *                                omitted, all metadata associated with the notification
+ *                                item will be deleted.
+ * @param string $meta_value      Optional. If present, the metadata will only be
+ *                                deleted if the meta_value matches this parameter.
+ * @param bool   $delete_all      Optional. If true, delete matching metadata entries
+ * 	                              for all objects, ignoring the specified object_id. Otherwise,
+ * 	                              only delete matching metadata entries for the specified
+ * 	                              notification item. Default: false.
+ *
+ * @return bool                   True on success, false on failure.
+ */
+function bp_notifications_delete_meta( $notification_id, $meta_key = '', $meta_value = '', $delete_all = false ) {
+
+	// Legacy - if no meta_key is passed, delete all for the item
+	if ( empty( $meta_key ) ) {
+		$all_meta = bp_notifications_get_meta( $notification_id );
+		$keys     = ! empty( $all_meta )
+			? array_keys( $all_meta )
+			: array();
+
+		// With no meta_key, ignore $delete_all
+		$delete_all = false;
+	} else {
+		$keys = array( $meta_key );
+	}
+
+	$retval = true;
+
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	foreach ( $keys as $key ) {
+		$retval = delete_metadata( 'notifications', $notification_id, $key, $meta_value, $delete_all );
+	}
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
+
+/**
+ * Get metadata for a given notification item.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @uses apply_filters() To call the 'bp_notifications_get_meta' hook.
+ *
+ * @param int    $notification_id ID of the notification item whose metadata is being requested.
+ * @param string $meta_key        Optional. If present, only the metadata matching
+ *                                that meta key will be returned. Otherwise, all metadata for the
+ *                                notification item will be fetched.
+ * @param bool   $single          Optional. If true, return only the first value of the
+ *	                              specified meta_key. This parameter has no effect if meta_key is not
+ *	                              specified. Default: true.
+ *
+ * @return mixed                  The meta value(s) being requested.
+ */
+function bp_notifications_get_meta( $notification_id = 0, $meta_key = '', $single = true ) {
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	$retval = get_metadata( 'notifications', $notification_id, $meta_key, $single );
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	/**
+	 * Filters the metadata for a specified notification item.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param mixed  $retval          The meta values for the notification item.
+	 * @param int    $notification_id ID of the notification item.
+	 * @param string $meta_key        Meta key for the value being requested.
+	 * @param bool   $single          Whether to return one matched meta key row or all.
+	 */
+	return apply_filters( 'bp_notifications_get_meta', $retval, $notification_id, $meta_key, $single );
+}
+
+/**
+ * Update a piece of notification meta.
+ *
+ * @since BuddyPress (1.2.0)
+ *
+ * @param  int    $notification_id ID of the notification item whose metadata is being
+ *                                 updated.
+ * @param  string $meta_key        Key of the metadata being updated.
+ * @param  mixed  $meta_value      Value to be set.
+ * @param  mixed  $prev_value      Optional. If specified, only update existing
+ *                                 metadata entries with the specified value.
+ *                                 Otherwise, update all entries.
+ *
+ * @return bool|int                Returns false on failure. On successful
+ *                                 update of existing metadata, returns true. On
+ *                                 successful creation of new metadata,  returns
+ *                                 the integer ID of the new metadata row.
+ */
+function bp_notifications_update_meta( $notification_id, $meta_key, $meta_value, $prev_value = '' ) {
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	$retval = update_metadata( 'notifications', $notification_id, $meta_key, $meta_value, $prev_value );
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
+
+/**
+ * Add a piece of notification metadata.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param int    $notification_id ID of the notification item.
+ * @param string $meta_key        Metadata key.
+ * @param mixed  $meta_value      Metadata value.
+ * @param bool   $unique          Optional. Whether to enforce a single metadata value
+ *                                for the given key. If true, and the object already 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.
+ */
+function bp_notifications_add_meta( $notification_id, $meta_key, $meta_value, $unique = false ) {
+	add_filter( 'query', 'bp_filter_metaid_column_name' );
+	$retval = add_metadata( 'notifications', $notification_id, $meta_key, $meta_value, $unique );
+	remove_filter( 'query', 'bp_filter_metaid_column_name' );
+
+	return $retval;
+}
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-loader.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-loader.php
index c801220d56373c49f73030129865a521ed9dbcb9..8c52a6880235d4507bb3d3cc835315796cb542cb 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-loader.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-loader.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Notifications_Component extends BP_Component {
 
@@ -64,6 +64,8 @@ class BP_Notifications_Component extends BP_Component {
 	 * @param array $args See BP_Component::setup_globals() for a description.
 	 */
 	public function setup_globals( $args = array() ) {
+		$bp = buddypress();
+
 		// Define a slug, if necessary
 		if ( !defined( 'BP_NOTIFICATIONS_SLUG' ) ) {
 			define( 'BP_NOTIFICATIONS_SLUG', $this->id );
@@ -71,7 +73,8 @@ class BP_Notifications_Component extends BP_Component {
 
 		// Global tables for the notifications component
 		$global_tables = array(
-			'table_name' => bp_core_get_table_prefix() . 'bp_notifications'
+			'table_name'      => $bp->table_prefix . 'bp_notifications',
+			'table_name_meta' => $bp->table_prefix . 'bp_notifications_meta',
 		);
 
 		// All globals for the notifications component.
@@ -205,7 +208,7 @@ class BP_Notifications_Component extends BP_Component {
 			$wp_admin_nav[] = array(
 				'parent' => 'my-account-' . $this->id,
 				'id'     => 'my-account-' . $this->id . '-read',
-				'title'  => __( 'Read', 'buddypress' ),
+				'title'  => _x( 'Read', 'My Account Notification sub nav', 'buddypress' ),
 				'href'   => trailingslashit( $notifications_link . 'read' ),
 			);
 		}
@@ -237,6 +240,22 @@ class BP_Notifications_Component extends BP_Component {
 
 		parent::setup_title();
 	}
+
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_notifications',
+			'notification_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
 }
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-screens.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-screens.php
index cb65c88f50fcb49b5c93c9f49584360453d671fb..1971ed7b72e0e14026accd220a3200e868348392 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-screens.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-screens.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( ! defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Catch and route the 'unread' notifications screen.
@@ -20,8 +20,21 @@ if ( ! defined( 'ABSPATH' ) ) exit;
  * @since BuddyPress (1.9.0)
  */
 function bp_notifications_screen_unread() {
+
+	/**
+	 * Fires right before the loading of the notifications unread screen template file.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 */
 	do_action( 'bp_notifications_screen_unread' );
 
+	/**
+	 * Filters the template to load for the notifications unread screen.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $template Path to the notifications unread template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_notifications_template_unread', 'members/single/home' ) );
 }
 
@@ -31,8 +44,21 @@ function bp_notifications_screen_unread() {
  * @since BuddyPress (1.9.0)
  */
 function bp_notifications_screen_read() {
+
+	/**
+	 * Fires right before the loading of the notifications read screen template file.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 */
 	do_action( 'bp_notifications_screen_read' );
 
+	/**
+	 * Filters the template to load for the notifications read screen.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param string $template Path to the notifications read template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_notifications_template_read', 'members/single/home' ) );
 }
 
diff --git a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-template.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-template.php
index 52f138ed73c4bb8f97a5584baa6eaeee8625a86e..027250a56236164fa2f0fc2c6131304c9ac82497 100644
--- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-template.php
+++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-template.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the notifications component slug.
@@ -26,6 +26,14 @@ function bp_notifications_slug() {
 	 * @return string Slug of the Notifications component.
 	 */
 	function bp_get_notifications_slug() {
+
+		/**
+		 * Filters the notifications component slug.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $slug Notifications component slug.
+		 */
 		return apply_filters( 'bp_get_notifications_slug', buddypress()->notifications->slug );
 	}
 
@@ -46,6 +54,14 @@ function bp_notifications_permalink() {
 	 */
 	function bp_get_notifications_permalink() {
 		$retval = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() );
+
+		/**
+		 * Filters the notifications permalink.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval Permalink for the notifications.
+		 */
 		return apply_filters( 'bp_get_notifications_permalink', $retval );
 	}
 
@@ -66,6 +82,14 @@ function bp_notifications_unread_permalink() {
 	 */
 	function bp_get_notifications_unread_permalink() {
 		$retval = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() . '/unread' );
+
+		/**
+		 * Filters the unread notifications permalink.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval Permalink for the unread notifications.
+		 */
 		return apply_filters( 'bp_get_notifications_unread_permalink', $retval );
 	}
 
@@ -86,6 +110,14 @@ function bp_notifications_read_permalink() {
 	 */
 	function bp_get_notifications_read_permalink() {
 		$retval = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() . '/read' );
+
+		/**
+		 * Filters the read notifications permalink.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval Permalink for the read notifications.
+		 */
 		return apply_filters( 'bp_get_notifications_unread_permalink', $retval );
 	}
 
@@ -172,6 +204,15 @@ class BP_Notifications_Template {
 	 */
 	public $pag_page;
 
+	/**
+	 * The $_GET argument used in URLs for determining pagination
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var int
+	 */
+	public $pag_arg;
+
 	/**
 	 * The number of items to display per page of results.
 	 *
@@ -217,6 +258,14 @@ class BP_Notifications_Template {
 	 */
 	public $sort_order;
 
+	/**
+	 * Array of variables used in this notification query
+	 *
+	 * @since BuddyPress (2.2.2)
+	 * @var array
+	 */
+	public $query_vars;
+
 	/**
 	 * Constructor method.
 	 *
@@ -235,6 +284,7 @@ class BP_Notifications_Template {
 		$r = wp_parse_args( $args, array(
 			'id'                => false,
 			'user_id'           => 0,
+			'item_id'           => false,
 			'secondary_item_id' => false,
 			'component_name'    => bp_notifications_get_registered_components(),
 			'component_action'  => false,
@@ -242,26 +292,16 @@ class BP_Notifications_Template {
 			'search_terms'      => '',
 			'order_by'          => 'date_notified',
 			'sort_order'        => 'DESC',
+			'page_arg'          => 'npage',
 			'page'              => 1,
 			'per_page'          => 25,
 			'max'               => null,
-			'page_arg'          => 'npage',
+			'meta_query'        => false,
+			'date_query'        => false
 		) );
 
 		// Overrides
 
-		// Set which pagination page
-		if ( isset( $_GET[ $r['page_arg'] ] ) ) {
-			$r['page'] = intval( $_GET[ $r['page_arg'] ] );
-		}
-
-		// Set the number to show per page
-		if ( isset( $_GET['num'] ) ) {
-			$r['per_page'] = intval( $_GET['num'] );
-		} else {
-			$r['per_page'] = intval( $r['per_page'] );
-		}
-
 		// Sort order direction
 		$orders = array( 'ASC', 'DESC' );
 		if ( ! empty( $_GET['sort_order'] ) && in_array( $_GET['sort_order'], $orders ) ) {
@@ -271,18 +311,34 @@ class BP_Notifications_Template {
 		}
 
 		// Setup variables
-		$this->pag_page     = $r['page'];
-		$this->pag_num      = $r['per_page'];
+		$this->pag_arg      = sanitize_key( $r['page_arg'] );
+		$this->pag_page     = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
+		$this->pag_num      = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
 		$this->user_id      = $r['user_id'];
 		$this->is_new       = $r['is_new'];
 		$this->search_terms = $r['search_terms'];
-		$this->page_arg     = $r['page_arg'];
 		$this->order_by     = $r['order_by'];
 		$this->sort_order   = $r['sort_order'];
+		$this->query_vars   = array(
+			'id'                => $r['id'],
+			'user_id'           => $this->user_id,
+			'item_id'           => $r['item_id'],
+			'secondary_item_id' => $r['secondary_item_id'],
+			'component_name'    => $r['component_name'],
+			'component_action'  => $r['component_action'],
+			'meta_query'        => $r['meta_query'],
+			'date_query'        => $r['date_query'],
+			'is_new'            => $this->is_new,
+			'search_terms'      => $this->search_terms,
+			'order_by'          => $this->order_by,
+			'sort_order'        => $this->sort_order,
+			'page'              => $this->pag_page,
+			'per_page'          => $this->pag_num,
+		);
 
 		// Setup the notifications to loop through
-		$this->notifications            = BP_Notifications_Notification::get( $r );
-		$this->total_notification_count = BP_Notifications_Notification::get_total_count( $r );
+		$this->notifications            = BP_Notifications_Notification::get( $this->query_vars );
+		$this->total_notification_count = BP_Notifications_Notification::get_total_count( $this->query_vars );
 
 		if ( empty( $this->notifications ) ) {
 			$this->notification_count       = 0;
@@ -301,19 +357,20 @@ class BP_Notifications_Template {
 		}
 
 		if ( (int) $this->total_notification_count && (int) $this->pag_num ) {
+			$add_args = array(
+				'sort_order' => $this->sort_order,
+			);
+
 			$this->pag_links = paginate_links( array(
-				'base'      => add_query_arg( $this->page_arg, '%#%' ),
+				'base'      => add_query_arg( $this->pag_arg, '%#%' ),
 				'format'    => '',
 				'total'     => ceil( (int) $this->total_notification_count / (int) $this->pag_num ),
 				'current'   => $this->pag_page,
 				'prev_text' => _x( '&larr;', 'Notifications pagination previous text', 'buddypress' ),
 				'next_text' => _x( '&rarr;', 'Notifications pagination next text',     'buddypress' ),
 				'mid_size'  => 1,
+				'add_args'  => $add_args,
 			) );
-
-			// Remove first page from pagination
-			$this->pag_links = str_replace( '?'      . $r['page_arg'] . '=1', '', $this->pag_links );
-			$this->pag_links = str_replace( '&#038;' . $r['page_arg'] . '=1', '', $this->pag_links );
 		}
 	}
 
@@ -384,6 +441,12 @@ class BP_Notifications_Template {
 			return true;
 
 		} elseif ( $this->current_notification + 1 == $this->notification_count ) {
+
+			/**
+			 * Fires right before the rewinding of notification posts.
+			 *
+			 * @since BuddyPress (1.9.0)
+			 */
 			do_action( 'notifications_loop_end');
 
 			$this->rewind_notifications();
@@ -410,6 +473,12 @@ class BP_Notifications_Template {
 
 		// loop has just started
 		if ( 0 === $this->current_notification ) {
+
+			/**
+			 * Fires if the current notification item is the first in the notification loop.
+			 *
+			 * @since BuddyPress (1.9.0)
+			 */
 			do_action( 'notifications_loop_start' );
 		}
 	}
@@ -469,6 +538,8 @@ function bp_has_notifications( $args = '' ) {
 		'search_terms'      => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '',
 		'order_by'          => 'date_notified',
 		'sort_order'        => 'DESC',
+		'meta_query'        => false,
+		'date_query'        => false,
 		'page'              => 1,
 		'per_page'          => 25,
 
@@ -484,6 +555,14 @@ function bp_has_notifications( $args = '' ) {
 	// Setup the global query loop
 	buddypress()->notifications->query_loop = $query_loop;
 
+	/**
+	 * Filters whether or not the user has notifications to display.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param bool                      $value      Whether or not there are notifications to display.
+	 * @param BP_Notifications_Template $query_loop BP_Notifications_Template object instance.
+	 */
 	return apply_filters( 'bp_has_notifications', $query_loop->has_notifications(), $query_loop );
 }
 
@@ -527,6 +606,14 @@ function bp_the_notification_id() {
 	 * @return int ID of the current notification.
 	 */
 	function bp_get_the_notification_id() {
+
+		/**
+		 * Filters the ID of the notification currently being iterated on.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int $id ID of the notification being iterated on.
+		 */
 		return apply_filters( 'bp_get_the_notification_id', buddypress()->notifications->query_loop->notification->id );
 	}
 
@@ -546,6 +633,14 @@ function bp_the_notification_item_id() {
 	 * @return int ID of the item associated with the current notification.
 	 */
 	function bp_get_the_notification_item_id() {
+
+		/**
+		 * Filters the associated item ID of the notification currently being iterated on.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int $item_id ID of the associated item.
+		 */
 		return apply_filters( 'bp_get_the_notification_item_id', buddypress()->notifications->query_loop->notification->item_id );
 	}
 
@@ -565,6 +660,14 @@ function bp_the_notification_secondary_item_id() {
 	 * @return int ID of the secondary item associated with the current notification.
 	 */
 	function bp_get_the_notification_secondary_item_id() {
+
+		/**
+		 * Filters the secondary associated item ID of the notification currently being iterated on.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int $secondary_item_id ID of the secondary associated item.
+		 */
 		return apply_filters( 'bp_get_the_notification_secondary_item_id', buddypress()->notifications->query_loop->notification->secondary_item_id );
 	}
 
@@ -584,6 +687,14 @@ function bp_the_notification_component_name() {
 	 * @return int Name of the component associated with the current notification.
 	 */
 	function bp_get_the_notification_component_name() {
+
+		/**
+		 * Filters the name of the component associated with the notification currently being iterated on.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int $component_name Name of the component associated with the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_component_name', buddypress()->notifications->query_loop->notification->component_name );
 	}
 
@@ -603,6 +714,14 @@ function bp_the_notification_component_action() {
 	 * @return int Name of the action associated with the current notification.
 	 */
 	function bp_get_the_notification_component_action() {
+
+		/**
+		 * Filters the name of the action associated with the notification currently being iterated on.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param int $component_action Name of the action associated with the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_component_action', buddypress()->notifications->query_loop->notification->component_action );
 	}
 
@@ -622,6 +741,14 @@ function bp_the_notification_date_notified() {
 	 * @return string Timestamp of the current notification.
 	 */
 	function bp_get_the_notification_date_notified() {
+
+		/**
+		 * Filters the timestamp of the current notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $date_notified Timestamp of the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_date_notified', buddypress()->notifications->query_loop->notification->date_notified );
 	}
 
@@ -654,6 +781,13 @@ function bp_the_notification_time_since() {
 			$retval = __( 'Date not found', 'buddypress' );
 		}
 
+		/**
+		 * Filters the time since value of the current notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval Time since value for current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_time_since', $retval );
 	}
 
@@ -674,9 +808,6 @@ function bp_the_notification_description() {
 	 * @return string
 	 */
 	function bp_get_the_notification_description() {
-
-		// Setup local variables
-		$description  = '';
 		$bp           = buddypress();
 		$notification = $bp->notifications->query_loop->notification;
 
@@ -690,11 +821,21 @@ function bp_the_notification_description() {
 
 		// Allow non BuddyPress components to hook in
 		} else {
+
+			/** This filter is documented in bp-notifications/bp-notifications-functions.php */
 			$description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1 ) );
 		}
 
-		// Filter and return
-		return apply_filters( 'bp_get_the_notification_description', $description );
+		/**
+		 * Filters the full-text description for a specific notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 * @since BuddyPress (2.3.0) Added the `$notification` parameter.
+		 *
+		 * @param string $description  Full-text description for a specific notification.
+		 * @param object $notification Notification object.
+		 */
+		return apply_filters( 'bp_get_the_notification_description', $description, $notification );
 	}
 
 /**
@@ -721,6 +862,13 @@ function bp_the_notification_mark_read_link() {
 
 		<?php $retval = ob_get_clean();
 
+		/**
+		 * Filters the mark read link for the current notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval HTML for the mark read link for the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_mark_read_link', $retval );
 	}
 
@@ -758,12 +906,18 @@ function bp_the_notification_mark_read_url() {
 		// Add the nonce
 		$url = wp_nonce_url( $url, 'bp_notification_mark_read_' . $id );
 
-		// Filter and return
+		/**
+		 * Filters the URL used for marking a single notification as read.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $url URL to use for marking the single notification as read.
+		 */
 		return apply_filters( 'bp_get_the_notification_mark_read_url', $url );
 	}
 
 /**
- * Output the mark read link for the current notification.
+ * Output the mark unread link for the current notification.
  *
  * @since BuddyPress (1.9.0)
  *
@@ -773,7 +927,7 @@ function bp_the_notification_mark_unread_link() {
 	echo bp_get_the_notification_mark_unread_link();
 }
 	/**
-	 * Return the mark read link for the current notification.
+	 * Return the mark unread link for the current notification.
 	 *
 	 * @since BuddyPress (1.9.0)
 	 */
@@ -786,6 +940,13 @@ function bp_the_notification_mark_unread_link() {
 
 		<?php $retval = ob_get_clean();
 
+		/**
+		 * Filters the link used for marking a single notification as unread.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval HTML for the mark unread link for the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_mark_unread_link', $retval );
 	}
 
@@ -823,7 +984,13 @@ function bp_the_notification_mark_unread_url() {
 		// Add the nonce
 		$url = wp_nonce_url( $url, 'bp_notification_mark_unread_' . $id );
 
-		// Filter and return
+		/**
+		 * Filters the URL used for marking a single notification as unread.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $url URL to use for marking the single notification as unread.
+		 */
 		return apply_filters( 'bp_get_the_notification_mark_unread_url', $url );
 	}
 
@@ -850,6 +1017,13 @@ function bp_the_notification_mark_link() {
 			$retval = bp_get_the_notification_mark_read_link();
 		}
 
+		/**
+		 * Filters the mark link for the current notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval The mark link for the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_mark_link', $retval );
 	}
 
@@ -877,6 +1051,13 @@ function bp_the_notification_delete_link() {
 
 		<?php $retval = ob_get_clean();
 
+		/**
+		 * Filters the delete link for the current notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval HTML for the delete link for the current notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_delete_link', $retval );
 	}
 
@@ -924,7 +1105,13 @@ function bp_the_notification_delete_url() {
 		// Add the nonce
 		$url = wp_nonce_url( $url, 'bp_notification_delete_' . $id );
 
-		// Filter and return
+		/**
+		 * Filters the URL used for deleting a single notification.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $url URL used for deleting a single notification.
+		 */
 		return apply_filters( 'bp_get_the_notification_delete_url', $url );
 	}
 
@@ -966,6 +1153,13 @@ function bp_the_notification_action_links( $args = '' ) {
 		// Build the links
 		$retval = $r['before'] . implode( $r['links'], $r['sep'] ) . $r['after'];
 
+		/**
+		 * Filters the action links for the current notification.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $retval HTML links for actions to take on single notifications.
+		 */
 		return apply_filters( 'bp_get_the_notification_action_links', $retval );
 	}
 
@@ -990,8 +1184,20 @@ function bp_notifications_pagination_count() {
 		$from_num   = bp_core_number_format( $start_num );
 		$to_num     = bp_core_number_format( ( $start_num + ( $query_loop->pag_num - 1 ) > $query_loop->total_notification_count ) ? $query_loop->total_notification_count : $start_num + ( $query_loop->pag_num - 1 ) );
 		$total      = bp_core_number_format( $query_loop->total_notification_count );
-		$pag        = sprintf( _n( 'Viewing 1 notification', 'Viewing %1$s - %2$s of %3$s notifications', $total, 'buddypress' ), $from_num, $to_num, $total );
 
+		if ( 1 == $query_loop->total_notification_count ) {
+			$pag = __( 'Viewing 1 notification', 'buddypress' );
+		} else {
+			$pag = sprintf( _n( 'Viewing %1$s - %2$s of %3$s notification', 'Viewing %1$s - %2$s of %3$s notifications', $query_loop->total_notification_count, 'buddypress' ), $from_num, $to_num, $total );
+		}
+
+		/**
+		 * Filters the pagination count for the current notification loop.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $pag HTML for the pagination count.
+		 */
 		return apply_filters( 'bp_notifications_pagination_count', $pag );
 	}
 
@@ -1011,6 +1217,14 @@ function bp_notifications_pagination_links() {
 	 * @return string HTML for the pagination links.
 	 */
 	function bp_get_notifications_pagination_links() {
+
+		/**
+		 * Filters the pagination links for the current notification loop.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param string $pag_links HTML for the pagination links.
+		 */
 		return apply_filters( 'bp_get_notifications_pagination_links', buddypress()->notifications->query_loop->pag_links );
 	}
 
@@ -1049,3 +1263,25 @@ function bp_notifications_sort_order_form() {
 
 <?php
 }
+
+/**
+ * Output the dropdown for bulk management of notifications.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_notifications_bulk_management_dropdown() {
+	?>
+	<label class="bp-screen-reader-text" for="notification-select"><?php _e( 'Select Bulk Action', 'buddypress' ); ?></label>
+	<select name="notification_bulk_action" id="notification-select">
+		<option value="" selected="selected"><?php _e( 'Bulk Actions', 'buddypress' ); ?></option>
+
+		<?php if ( bp_is_current_action( 'unread' ) ) : ?>
+			<option value="read"><?php _e( 'Mark read', 'buddypress' ); ?></option>
+		<?php elseif ( bp_is_current_action( 'read' ) ) : ?>
+			<option value="unread"><?php _e( 'Mark unread', 'buddypress' ); ?></option>
+		<?php endif; ?>
+		<option value="delete"><?php _e( 'Delete', 'buddypress' ); ?></option>
+	</select>
+	<input type="submit" id="notification-bulk-manage" class="button action" value="<?php esc_attr_e( 'Apply', 'buddypress' ); ?>">
+	<?php
+}
diff --git a/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-notification.php b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-notification.php
new file mode 100644
index 0000000000000000000000000000000000000000..9b43bd859fca01ee2256e855b57742a4016b6b4a
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-notification.php
@@ -0,0 +1,1112 @@
+<?php
+/**
+ * BuddyPress Notifications Classes
+ *
+ * Classes used for the Notifications component.
+ *
+ * @package BuddyPress
+ * @subpackage NotificationsClasses
+ *
+ * @since BuddyPress (1.9.0)
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * BuddyPress Notification items.
+ *
+ * Use this class to create, access, edit, or delete BuddyPress Notifications.
+ *
+ * @since BuddyPress (1.9.0)
+ */
+class BP_Notifications_Notification {
+
+	/**
+	 * The notification ID.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var int
+	 */
+	public $id;
+
+	/**
+	 * The ID of the item associated with the notification.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var int
+	 */
+	public $item_id;
+
+	/**
+	 * The ID of the secondary item associated with the notification.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var int
+	 */
+	public $secondary_item_id = null;
+
+	/**
+	 * The ID of the user the notification is associated with.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var int
+	 */
+	public $user_id;
+
+	/**
+	 * The name of the component that the notification is for.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var string
+	 */
+	public $component_name;
+
+	/**
+	 * The component action which the notification is related to.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var string
+	 */
+	public $component_action;
+
+	/**
+	 * The date the notification was created.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var string
+	 */
+	public $date_notified;
+
+	/**
+	 * Is the notification new, or has it already been read.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 * @access public
+	 * @var bool
+	 */
+	public $is_new;
+
+	/** Public Methods ********************************************************/
+
+	/**
+	 * Constructor method.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $id Optional. Provide an ID to access an existing
+	 *        notification item.
+	 */
+	public function __construct( $id = 0 ) {
+		if ( ! empty( $id ) ) {
+			$this->id = $id;
+			$this->populate();
+		}
+	}
+
+	/**
+	 * Update or insert notification details into the database.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @global wpdb $wpdb WordPress database object.
+	 *
+	 * @return bool True on success, false on failure.
+	 */
+	public function save() {
+
+		// Return value
+		$retval = false;
+
+		// Default data and format
+		$data = array(
+			'user_id'           => $this->user_id,
+			'item_id'           => $this->item_id,
+			'secondary_item_id' => $this->secondary_item_id,
+			'component_name'    => $this->component_name,
+			'component_action'  => $this->component_action,
+			'date_notified'     => $this->date_notified,
+			'is_new'            => $this->is_new,
+		);
+		$data_format = array( '%d', '%d', '%d', '%s', '%s', '%s', '%d' );
+
+		/**
+		 * Fires before the current notification item gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_notification_before_save', array( &$this ) );
+
+		// Update
+		if ( ! empty( $this->id ) ) {
+			$result = self::_update( $data, array( 'ID' => $this->id ), $data_format, array( '%d' ) );
+
+		// Insert
+		} else {
+			$result = self::_insert( $data, $data_format );
+		}
+
+		// Set the notification ID if successful
+		if ( ! empty( $result ) && ! is_wp_error( $result ) ) {
+			global $wpdb;
+
+			$this->id = $wpdb->insert_id;
+			$retval   = $wpdb->insert_id;
+		}
+
+		/**
+		 * Fires after the current notification item gets saved.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'bp_notification_after_save', array( &$this ) );
+
+		// Return the result
+		return $retval;
+	}
+
+	/**
+	 * Fetch data for an existing notification from the database.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @global BuddyPress $bp The one true BuddyPress instance.
+	 * @global wpdb $wpdb WordPress database object.
+	 */
+	public function populate() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		// Look for a notification
+		$notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->notifications->table_name} WHERE id = %d", $this->id ) );
+
+		// Setup the notification data
+		if ( ! empty( $notification ) && ! is_wp_error( $notification ) ) {
+			$this->item_id           = $notification->item_id;
+			$this->secondary_item_id = $notification->secondary_item_id;
+			$this->user_id           = $notification->user_id;
+			$this->component_name    = $notification->component_name;
+			$this->component_action  = $notification->component_action;
+			$this->date_notified     = $notification->date_notified;
+			$this->is_new            = $notification->is_new;
+		}
+	}
+
+	/** Protected Static Methods **********************************************/
+
+	/**
+	 * Create a notification entry.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $data {
+	 *     Array of notification data, passed to {@link wpdb::insert()}.
+	 *     @type int $user_id ID of the associated user.
+	 *     @type int $item_id ID of the associated item.
+	 *     @type int $secondary_item_id ID of the secondary associated item.
+	 *     @type string $component_name Name of the associated component.
+	 *     @type string $component_action Name of the associated component
+	 *           action.
+	 *     @type string $date_notified Timestamp of the notification.
+	 *     @type bool $is_new True if the notification is unread, otherwise
+	 *           false.
+	 * }
+	 * @param array $data_format See {@link wpdb::insert()}.
+	 * @return int|false The number of rows inserted, or false on error.
+	 */
+	protected static function _insert( $data = array(), $data_format = array() ) {
+		global $wpdb;
+		return $wpdb->insert( buddypress()->notifications->table_name, $data, $data_format );
+	}
+
+	/**
+	 * Update notifications.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @see wpdb::update() for further description of paramater formats.
+	 *
+	 * @param array $data Array of notification data to update, passed to
+	 *        {@link wpdb::update()}. Accepts any property of a
+	 *        BP_Notification_Notification object.
+	 * @param array $where The WHERE params as passed to wpdb::update().
+	 *        Typically consists of array( 'ID' => $id ) to specify the ID
+	 *        of the item being updated. See {@link wpdb::update()}.
+	 * @param array $data_format See {@link wpdb::insert()}.
+	 * @param array $where_format See {@link wpdb::insert()}.
+	 * @return int|false The number of rows updated, or false on error.
+	 */
+	protected static function _update( $data = array(), $where = array(), $data_format = array(), $where_format = array() ) {
+		global $wpdb;
+		return $wpdb->update( buddypress()->notifications->table_name, $data, $where, $data_format, $where_format );
+	}
+
+	/**
+	 * Delete notifications.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @see wpdb::update() for further description of paramater formats.
+	 *
+	 * @param array $where Array of WHERE clauses to filter by, passed to
+	 *        {@link wpdb::delete()}. Accepts any property of a
+	 *        BP_Notification_Notification object.
+	 * @param array $where_format See {@link wpdb::insert()}.
+	 * @return int|false The number of rows updated, or false on error.
+	 */
+	protected static function _delete( $where = array(), $where_format = array() ) {
+		global $wpdb;
+		return $wpdb->delete( buddypress()->notifications->table_name, $where, $where_format );
+	}
+
+	/**
+	 * Assemble the WHERE clause of a get() SQL statement.
+	 *
+	 * Used by BP_Notifications_Notification::get() to create its WHERE
+	 * clause.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $args See {@link BP_Notifications_Notification::get()}
+	 *                    for more details.
+	 * @return string WHERE clause.
+	 */
+	protected static function get_where_sql( $args = array(), $select_sql = '', $from_sql = '', $join_sql = '', $meta_query_sql = '' ) {
+		global $wpdb;
+
+		$where_conditions = array();
+		$where            = '';
+
+		// id
+		if ( ! empty( $args['id'] ) ) {
+			$id_in = implode( ',', wp_parse_id_list( $args['id'] ) );
+			$where_conditions['id'] = "id IN ({$id_in})";
+		}
+
+		// user_id
+		if ( ! empty( $args['user_id'] ) ) {
+			$user_id_in = implode( ',', wp_parse_id_list( $args['user_id'] ) );
+			$where_conditions['user_id'] = "user_id IN ({$user_id_in})";
+		}
+
+		// item_id
+		if ( ! empty( $args['item_id'] ) ) {
+			$item_id_in = implode( ',', wp_parse_id_list( $args['item_id'] ) );
+			$where_conditions['item_id'] = "item_id IN ({$item_id_in})";
+		}
+
+		// secondary_item_id
+		if ( ! empty( $args['secondary_item_id'] ) ) {
+			$secondary_item_id_in = implode( ',', wp_parse_id_list( $args['secondary_item_id'] ) );
+			$where_conditions['secondary_item_id'] = "secondary_item_id IN ({$secondary_item_id_in})";
+		}
+
+		// component_name
+		if ( ! empty( $args['component_name'] ) ) {
+			if ( ! is_array( $args['component_name'] ) ) {
+				$component_names = explode( ',', $args['component_name'] );
+			} else {
+				$component_names = $args['component_name'];
+			}
+
+			$cn_clean = array();
+			foreach ( $component_names as $cn ) {
+				$cn_clean[] = $wpdb->prepare( '%s', $cn );
+			}
+
+			$cn_in = implode( ',', $cn_clean );
+			$where_conditions['component_name'] = "component_name IN ({$cn_in})";
+		}
+
+		// component_action
+		if ( ! empty( $args['component_action'] ) ) {
+			if ( ! is_array( $args['component_action'] ) ) {
+				$component_actions = explode( ',', $args['component_action'] );
+			} else {
+				$component_actions = $args['component_action'];
+			}
+
+			$ca_clean = array();
+			foreach ( $component_actions as $ca ) {
+				$ca_clean[] = $wpdb->prepare( '%s', $ca );
+			}
+
+			$ca_in = implode( ',', $ca_clean );
+			$where_conditions['component_action'] = "component_action IN ({$ca_in})";
+		}
+
+		// is_new
+		if ( ! empty( $args['is_new'] ) && 'both' !== $args['is_new'] ) {
+			$where_conditions['is_new'] = "is_new = 1";
+		} elseif ( isset( $args['is_new'] ) && ( 0 === $args['is_new'] || false === $args['is_new'] ) ) {
+			$where_conditions['is_new'] = "is_new = 0";
+		}
+
+		// search_terms
+		if ( ! empty( $args['search_terms'] ) ) {
+			$search_terms_like = '%' . bp_esc_like( $args['search_terms'] ) . '%';
+			$where_conditions['search_terms'] = $wpdb->prepare( "( component_name LIKE %s OR component_action LIKE %s )", $search_terms_like, $search_terms_like );
+		}
+
+		// date query
+		if ( ! empty( $args['date_query'] ) ) {
+			$where_conditions['date_query'] = self::get_date_query_sql( $args['date_query'] );
+		}
+
+		// meta query
+		if ( ! empty( $meta_query_sql['where'] ) ) {
+			$where_conditions['meta_query'] = $meta_query_sql['where'];
+		}
+
+		/**
+		 * Filters the MySQL WHERE conditions for the Notifications items get method.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array  $where_conditions Current conditions for MySQL WHERE statement.
+		 * @param array  $args             Parsed arguments passed into method.
+		 * @param string $select_sql       Current SELECT MySQL statement at point of execution.
+		 * @param string $from_sql         Current FROM MySQL statement at point of execution.
+		 * @param string $join_sql         Current INNER JOIN MySQL statement at point of execution.
+		 * @param string $meta_query_sql   Current meta query WHERE statement at point of execution.
+		 */
+		$where_conditions = apply_filters( 'bp_notifications_get_where_conditions', $where_conditions, $args, $select_sql, $from_sql, $join_sql, $meta_query_sql );
+
+		// Custom WHERE
+		if ( ! empty( $where_conditions ) ) {
+			$where = 'WHERE ' . implode( ' AND ', $where_conditions );
+		}
+
+		return $where;
+	}
+
+	/**
+	 * Assemble the ORDER BY clause of a get() SQL statement.
+	 *
+	 * Used by BP_Notifications_Notification::get() to create its ORDER BY
+	 * clause.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $args See {@link BP_Notifications_Notification::get()}
+	 *        for more details.
+	 * @return string ORDER BY clause.
+	 */
+	protected static function get_order_by_sql( $args = array() ) {
+
+		// Setup local variable
+		$conditions = array();
+		$retval     = '';
+
+		// Order by
+		if ( ! empty( $args['order_by'] ) ) {
+			$order_by               = implode( ', ', (array) $args['order_by'] );
+			$conditions['order_by'] = "{$order_by}";
+		}
+
+		// Sort order direction
+		if ( ! empty( $args['sort_order'] ) && in_array( $args['sort_order'], array( 'ASC', 'DESC' ) ) ) {
+			$sort_order               = $args['sort_order'];
+			$conditions['sort_order'] = "{$sort_order}";
+		}
+
+		// Custom ORDER BY
+		if ( ! empty( $conditions ) ) {
+			$retval = 'ORDER BY ' . implode( ' ', $conditions );
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Assemble the LIMIT clause of a get() SQL statement.
+	 *
+	 * Used by BP_Notifications_Notification::get() to create its LIMIT clause.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $args See {@link BP_Notifications_Notification::get()}
+	 *        for more details.
+	 * @return string LIMIT clause.
+	 */
+	protected static function get_paged_sql( $args = array() ) {
+		global $wpdb;
+
+		// Setup local variable
+		$retval = '';
+
+		// Custom LIMIT
+		if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) {
+			$page     = absint( $args['page']     );
+			$per_page = absint( $args['per_page'] );
+			$offset   = $per_page * ( $page - 1 );
+			$retval   = $wpdb->prepare( "LIMIT %d, %d", $offset, $per_page );
+		}
+
+		return $retval;
+	}
+
+	/**
+	 * Assemble query clauses, based on arguments, to pass to $wpdb methods.
+	 *
+	 * The insert(), update(), and delete() methods of {@link wpdb} expect
+	 * arguments of the following forms:
+	 *
+	 * - associative arrays whose key/value pairs are column => value, to
+	 *   be used in WHERE, SET, or VALUES clauses
+	 * - arrays of "formats", which tell $wpdb->prepare() which type of
+	 *   value to expect when sanitizing (eg, array( '%s', '%d' ))
+	 *
+	 * This utility method can be used to assemble both kinds of params,
+	 * out of a single set of associative array arguments, such as:
+	 *
+	 *     $args = array(
+	 *         'user_id' => 4,
+	 *         'component_name' => 'groups',
+	 *     );
+	 *
+	 * This will be converted to:
+	 *
+	 *     array(
+	 *         'data' => array(
+	 *             'user_id' => 4,
+	 *             'component_name' => 'groups',
+	 *         ),
+	 *         'format' => array(
+	 *             '%d',
+	 *             '%s',
+	 *         ),
+	 *     )
+	 *
+	 * which can easily be passed as arguments to the $wpdb methods.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param $args Associative array of filter arguments.
+	 *        See {@BP_Notifications_Notification::get()} for a breakdown.
+	 * @return array Associative array of 'data' and 'format' args.
+	 */
+	protected static function get_query_clauses( $args = array() ) {
+		$where_clauses = array(
+			'data'   => array(),
+			'format' => array(),
+		);
+
+		// id
+		if ( ! empty( $args['id'] ) ) {
+			$where_clauses['data']['id'] = absint( $args['id'] );
+			$where_clauses['format'][] = '%d';
+		}
+
+		// user_id
+		if ( ! empty( $args['user_id'] ) ) {
+			$where_clauses['data']['user_id'] = absint( $args['user_id'] );
+			$where_clauses['format'][] = '%d';
+		}
+
+		// item_id
+		if ( ! empty( $args['item_id'] ) ) {
+			$where_clauses['data']['item_id'] = absint( $args['item_id'] );
+			$where_clauses['format'][] = '%d';
+		}
+
+		// secondary_item_id
+		if ( ! empty( $args['secondary_item_id'] ) ) {
+			$where_clauses['data']['secondary_item_id'] = absint( $args['secondary_item_id'] );
+			$where_clauses['format'][] = '%d';
+		}
+
+		// component_name
+		if ( ! empty( $args['component_name'] ) ) {
+			$where_clauses['data']['component_name'] = $args['component_name'];
+			$where_clauses['format'][] = '%s';
+		}
+
+		// component_action
+		if ( ! empty( $args['component_action'] ) ) {
+			$where_clauses['data']['component_action'] = $args['component_action'];
+			$where_clauses['format'][] = '%s';
+		}
+
+		// is_new
+		if ( isset( $args['is_new'] ) ) {
+			$where_clauses['data']['is_new'] = ! empty( $args['is_new'] ) ? 1 : 0;
+			$where_clauses['format'][] = '%d';
+		}
+
+		return $where_clauses;
+	}
+
+	/** Public Static Methods *************************************************/
+
+	/**
+	 * Check that a specific notification is for a specific user.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id ID of the user being checked.
+	 * @param int $notification_id ID of the notification being checked.
+	 * @return bool True if the notification belongs to the user, otherwise
+	 *         false.
+	 */
+	public static function check_access( $user_id, $notification_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
+	}
+
+	/**
+	 * Parse notifications query arguments
+	 *
+	 * @since BuddyPress 2.3.0
+	 *
+	 * @param  mixed $args
+	 * @return array
+	 */
+	public static function parse_args( $args = '' ) {
+		return wp_parse_args( $args, array(
+			'id'                => false,
+			'user_id'           => false,
+			'item_id'           => false,
+			'secondary_item_id' => false,
+			'component_name'    => bp_notifications_get_registered_components(),
+			'component_action'  => false,
+			'is_new'            => true,
+			'search_terms'      => '',
+			'order_by'          => false,
+			'sort_order'        => false,
+			'page'              => false,
+			'per_page'          => false,
+			'meta_query'        => false,
+			'date_query'        => false,
+			'update_meta_cache' => true
+		) );
+	}
+
+	/**
+	 * Get notifications, based on provided filter parameters.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $args {
+	 *     Associative array of arguments. All arguments but $page and
+	 *     $per_page can be treated as filter values for get_where_sql()
+	 *     and get_query_clauses(). All items are optional.
+	 *     @type int|array $id ID of notification being updated. Can be an
+	 *           array of IDs.
+	 *     @type int|array $user_id ID of user being queried. Can be an
+	 *           array of user IDs.
+	 *     @type int|array $item_id ID of associated item. Can be an array
+	 *           of multiple item IDs.
+	 *     @type int|array $secondary_item_id ID of secondary associated
+	 *           item. Can be an array of multiple IDs.
+	 *     @type string|array $component_name Name of the component to
+	 *           filter by. Can be an array of component names.
+	 *     @type string|array $component_action Name of the action to
+	 *           filter by. Can be an array of actions.
+	 *     @type bool $is_new Whether to limit to new notifications. True
+	 *           returns only new notifications, false returns only non-new
+	 *           notifications. 'both' returns all. Default: true.
+	 *     @type string $search_terms Term to match against component_name
+	 *           or component_action fields.
+	 *     @type string $order_by Database column to order notifications by.
+	 *     @type string $sort_order Either 'ASC' or 'DESC'.
+	 *     @type string $order_by Field to order results by.
+	 *     @type string $sort_order ASC or DESC.
+	 *     @type int $page Number of the current page of results. Default:
+	 *           false (no pagination - all items).
+	 *     @type int $per_page Number of items to show per page. Default:
+	 *           false (no pagination - all items).
+	 * }
+	 * @return array Located notifications.
+	 */
+	public static function get( $args = array() ) {
+		global $wpdb;
+
+		// Parse the arguments
+		$r = self::parse_args( $args );
+
+		// Get BuddyPress
+		$bp = buddypress();
+
+		// METADATA
+		$meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
+
+		// SELECT
+		$select_sql = "SELECT *";
+
+		// FROM
+		$from_sql   = "FROM {$bp->notifications->table_name} n ";
+
+		// JOIN
+		$join_sql   = $meta_query_sql['join'];
+
+		// WHERE
+		$where_sql  = self::get_where_sql( array(
+			'id'                => $r['id'],
+			'user_id'           => $r['user_id'],
+			'item_id'           => $r['item_id'],
+			'secondary_item_id' => $r['secondary_item_id'],
+			'component_name'    => $r['component_name'],
+			'component_action'  => $r['component_action'],
+			'is_new'            => $r['is_new'],
+			'search_terms'      => $r['search_terms'],
+			'date_query'        => $r['date_query']
+		), $select_sql, $from_sql, $join_sql, $meta_query_sql );
+
+		// ORDER BY
+		$order_sql  = self::get_order_by_sql( array(
+			'order_by'   => $r['order_by'],
+			'sort_order' => $r['sort_order']
+		) );
+
+		// LIMIT %d, %d
+		$pag_sql    = self::get_paged_sql( array(
+			'page'     => $r['page'],
+			'per_page' => $r['per_page']
+		) );
+
+		// Concatenate query parts
+		$sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} {$order_sql} {$pag_sql}";
+
+		return $wpdb->get_results( $sql );
+	}
+
+	/**
+	 * Get a count of total notifications matching a set of arguments.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @see BP_Notifications_Notification::get() for a description of
+	 *      arguments.
+	 *
+	 * @param array $args See {@link BP_Notifications_Notification::get()}.
+	 * @return int Count of located items.
+	 */
+	public static function get_total_count( $args ) {
+		global $wpdb;
+
+		// Parse the arguments
+		$r = self::parse_args( $args );
+
+		// Load BuddyPress
+		$bp = buddypress();
+
+		// METADATA
+		$meta_query_sql = self::get_meta_query_sql( $r['meta_query'] );
+
+		// SELECT
+		$select_sql = "SELECT COUNT(*)";
+
+		// FROM
+		$from_sql   = "FROM {$bp->notifications->table_name} n ";
+
+		// JOIN
+		$join_sql   = $meta_query_sql['join'];
+
+		// WHERE
+		$where_sql  = self::get_where_sql( array(
+			'id'                => $r['id'],
+			'user_id'           => $r['user_id'],
+			'item_id'           => $r['item_id'],
+			'secondary_item_id' => $r['secondary_item_id'],
+			'component_name'    => $r['component_name'],
+			'component_action'  => $r['component_action'],
+			'is_new'            => $r['is_new'],
+			'search_terms'      => $r['search_terms'],
+			'date_query'        => $r['date_query']
+		), $select_sql, $from_sql, $join_sql, $meta_query_sql );
+
+		// Concatenate query parts
+		$sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql}";
+
+		// Return the queried results
+		return $wpdb->get_var( $sql );
+	}
+
+	/**
+	 * Get the SQL for the 'meta_query' param in BP_Notifications_Notification::get().
+	 *
+	 * We use WP_Meta_Query to do the heavy lifting of parsing the
+	 * meta_query array and creating the necessary SQL clauses. However,
+	 * since BP_Notifications_Notification::get() builds its SQL differently than
+	 * WP_Query, we have to alter the return value (stripping the leading
+	 * AND keyword from the 'where' clause).
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  array $meta_query An array of meta_query filters. See the
+	 *                           documentation for WP_Meta_Query for details.
+	 * @return array $sql_array 'join' and 'where' clauses.
+	 */
+	public static function get_meta_query_sql( $meta_query = array() ) {
+
+		// Default array keys & empty values
+		$sql_array = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		// Bail if no meta query
+		if ( empty( $meta_query ) ) {
+			return $sql_array;
+		}
+
+		// WP_Meta_Query expects the table name at $wpdb->notificationmeta
+		$GLOBALS['wpdb']->notificationmeta = buddypress()->notifications->table_name_meta;
+
+		$n_meta_query = new WP_Meta_Query( $meta_query );
+		$meta_sql     = $n_meta_query->get_sql( 'notification', 'n', 'id' );
+
+		// Strip the leading AND - it's handled in get()
+		$sql_array['where'] = preg_replace( '/^\sAND/', '', $meta_sql['where'] );
+		$sql_array['join']  = $meta_sql['join'];
+
+		return $sql_array;
+	}
+
+	/**
+	 * Get the SQL for the 'date_query' param in BP_Notifications_Notification::get().
+	 *
+	 * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting
+	 * of parsing the date_query array and creating the necessary SQL clauses.
+	 * However, since BP_Notifications_Notification::get() builds its SQL
+	 * differently than WP_Query, we have to alter the return value (stripping
+	 * the leading AND keyword from the query).
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param array $date_query An array of date_query parameters. See the
+	 *                          documentation for the first parameter of WP_Date_Query.
+	 * @return string
+	 */
+	public static function get_date_query_sql( $date_query = array() ) {
+
+		// Bail if not a proper date query format
+		if ( empty( $date_query ) || ! is_array( $date_query ) || ! class_exists( 'BP_Date_Query' ) ) {
+			return '';
+		}
+
+		// Date query
+		$date_query = new BP_Date_Query( $date_query, 'date_recorded' );
+
+		// Strip the leading AND - it's handled in get()
+		return preg_replace( '/^\sAND/', '', $date_query->get_sql() );
+	}
+
+	/**
+	 * Update notifications.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @see BP_Notifications_Notification::get() for a description of
+	 *      accepted update/where arguments.
+	 *
+	 * @param array $update_args Associative array of fields to update,
+	 *        and the values to update them to. Of the format
+	 *            array( 'user_id' => 4, 'component_name' => 'groups', )
+	 * @param array $where_args Associative array of columns/values, to
+	 *        determine which rows should be updated. Of the format
+	 *            array( 'item_id' => 7, 'component_action' => 'members', )
+	 * @return int|bool Number of rows updated on success, false on failure.
+	 */
+	public static function update( $update_args = array(), $where_args = array() ) {
+		$update = self::get_query_clauses( $update_args );
+		$where  = self::get_query_clauses( $where_args  );
+
+		/**
+		 * Fires before the update of a notification item.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array $update_args See BP_Notifications_Notification::update().
+		 * @param array $where_args  See BP_Notifications_Notification::update().
+		 */
+		do_action( 'bp_notification_before_update', $update_args, $where_args );
+
+		return self::_update(
+			$update['data'],
+			$where['data'],
+			$update['format'],
+			$where['format']
+		);
+	}
+
+	/**
+	 * Delete notifications.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @see BP_Notifications_Notification::get() for a description of
+	 *      accepted update/where arguments.
+	 *
+	 * @param array $args Associative array of columns/values, to determine
+	 *        which rows should be deleted.  Of the format
+	 *            array( 'item_id' => 7, 'component_action' => 'members', )
+	 * @return int|bool Number of rows deleted on success, false on failure.
+	 */
+	public static function delete( $args = array() ) {
+		$where = self::get_query_clauses( $args );
+
+		/**
+		 * Fires before the deletion of a notification item.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $args Associative array of columns/values, to determine
+		 *                    which rows should be deleted. Of the format
+		 *                    array( 'item_id' => 7, 'component_action' => 'members' ).
+		 */
+		do_action( 'bp_notification_before_delete', $args );
+
+		return self::_delete( $where['data'], $where['format'] );
+	}
+
+	/** Convenience methods ***************************************************/
+
+	/**
+	 * Delete a single notification by ID.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @see BP_Notifications_Notification::delete() for explanation of
+	 *      return value.
+	 *
+	 * @param int $id ID of the notification item to be deleted.
+	 * @return bool True on success, false on failure.
+	 */
+	public static function delete_by_id( $id ) {
+		return self::delete( array(
+			'id' => $id,
+		) );
+	}
+
+	/**
+	 * Fetch all the notifications in the database for a specific user.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id ID of the user whose notifications are being
+	 *        fetched.
+	 * @param string $status Optional. Status of notifications to fetch.
+	 *        'is_new' to get only unread items, 'all' to get all.
+	 * @return array Associative array of notification items.
+	 */
+	public static function get_all_for_user( $user_id, $status = 'is_new' ) {
+		return self::get( array(
+			'user_id' => $user_id,
+			'is_new'  => 'is_new' === $status,
+		) );
+	}
+
+	/**
+	 * Fetch all the unread notifications in the database for a specific user.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id ID of the user whose notifications are being
+	 *        fetched.
+	 * @return array Associative array of unread notification items.
+	 */
+	public static function get_unread_for_user( $user_id = 0 ) {
+		return self::get( array(
+			'user_id' => $user_id,
+			'is_new'  => true,
+		) );
+	}
+
+	/**
+	 * Fetch all the read notifications in the database for a specific user.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id ID of the user whose notifications are being
+	 *        fetched.
+	 * @return array Associative array of unread notification items.
+	 */
+	public static function get_read_for_user( $user_id = 0 ) {
+		return self::get( array(
+			'user_id' => $user_id,
+			'is_new'  => false,
+		) );
+	}
+
+	/**
+	 * Get unread notifications for a user, in a pagination-friendly format.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param array $args {
+	 *     Array of arguments.
+	 *     @type int $user_id ID of the user for whom the notifications are
+	 *           being fetched. Default: logged-in user ID.
+	 *     @type bool $is_new Whether to limit the query to unread
+	 *           notifications. Default: true.
+	 *     @type int $page Number of the page to return. Default: 1.
+	 *     @type int $per_page Number of results to display per page.
+	 *           Default: 10.
+	 *     @type string $search_terms Optional. A term to search against in
+	 *           the 'component_name' and 'component_action' columns.
+	 * }
+	 * @return array {
+	 *     @type array $notifications Array of notification results.
+	 *     @type int $total Count of all located notifications matching
+	 *           the query params.
+	 * }
+	 */
+	public static function get_current_notifications_for_user( $args = array() ) {
+		$r = wp_parse_args( $args, array(
+			'user_id'      => bp_loggedin_user_id(),
+			'is_new'       => true,
+			'page'         => 1,
+			'per_page'     => 25,
+			'search_terms' => '',
+		) );
+
+		$notifications = self::get( $r );
+
+		// Bail if no notifications
+		if ( empty( $notifications ) ) {
+			return false;
+		}
+
+		$total_count = self::get_total_count( $r );
+
+		return array( 'notifications' => &$notifications, 'total' => $total_count );
+	}
+
+	/** Mark ******************************************************************/
+
+	/**
+	 * Mark all user notifications as read.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id The ID of the user who the notifications
+	 *        are for.
+	 * @param int $is_new Mark as read (1) or unread (0).
+	 */
+	public static function mark_all_for_user( $user_id, $is_new = 0, $item_id = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
+
+		// Values to be updated
+		$update_args = array(
+			'is_new' => $is_new,
+		);
+
+		// WHERE clauses
+		$where_args = array(
+			'user_id' => $user_id,
+		);
+
+		if ( ! empty( $item_id ) ) {
+			$where_args['item_id'] = $item_id;
+		}
+
+		if ( ! empty( $component_name ) ) {
+			$where_args['component_name'] = $component_name;
+		}
+
+		if ( ! empty( $component_action ) ) {
+			$where_args['component_action'] = $component_action;
+		}
+
+		if ( ! empty( $secondary_item_id ) ) {
+			$where_args['secondary_item_id'] = $secondary_item_id;
+		}
+
+		return self::update( $update_args, $where_args );
+	}
+
+	/**
+	 * Mark all notifications from a user as read.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $user_id The ID of the user who the notifications are from.
+	 * @param int $is_new Mark as read (1) or unread (0).
+	 */
+	public static function mark_all_from_user( $user_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
+
+		// Values to be updated
+		$update_args = array(
+			'is_new' => $is_new,
+		);
+
+		// WHERE clauses
+		$where_args = array(
+			'item_id' => $user_id,
+		);
+
+		if ( ! empty( $component_name ) ) {
+			$where_args['component_name'] = $component_name;
+		}
+
+		if ( ! empty( $component_action ) ) {
+			$where_args['component_action'] = $component_action;
+		}
+
+		if ( ! empty( $secondary_item_id ) ) {
+			$where_args['secondary_item_id'] = $secondary_item_id;
+		}
+
+		return self::update( $update_args, $where_args );
+	}
+
+	/**
+	 * Mark all notifications for all users as read by item id, and optional
+	 * secondary item id, and component name and action.
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param int $item_id The ID of the item associated with the
+	 *        notifications.
+	 * @param string $component_name The component that the notifications
+	 *        are associated with.
+	 * @param string $component_action The action that the notifications
+	 *        are associated with.
+	 * @param string $secondary_item_id Optional. ID of the secondary
+	 *        associated item.
+	 */
+	public static function mark_all_by_type( $item_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
+
+		// Values to be updated
+		$update_args = array(
+			'is_new' => $is_new,
+		);
+
+		// WHERE clauses
+		$where_args = array(
+			'item_id' => $item_id,
+		);
+
+		if ( ! empty( $component_name ) ) {
+			$where_args['component_name'] = $component_name;
+		}
+
+		if ( ! empty( $component_action ) ) {
+			$where_args['component_action'] = $component_action;
+		}
+
+		if ( ! empty( $secondary_item_id ) ) {
+			$where_args['secondary_item_id'] = $secondary_item_id;
+		}
+
+		return self::update( $update_args, $where_args );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
index a579b0ec93215bde55405652a3fa7ec72721800c..6eb9bc426adf5975489e7ac0189247587724dbe2 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php
@@ -9,15 +9,15 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
- * Handles the changing and saving of user email addressos and passwords
+ * Handles the changing and saving of user email addresses and passwords
  *
  * We do quite a bit of logic and error handling here to make sure that users
  * do not accidentally lock themselves out of their accounts. We also try to
  * provide as accurate of feedback as possible without exposing anyone else's
- * inforation to them.
+ * information to them.
  *
  * Special considerations are made for super admins that are able to edit any
  * users accounts already, without knowing their existing password.
@@ -128,12 +128,12 @@ Regards,
 					 *
 					 * @since BuddyPress (2.1.0)
 					 *
-					 * @param string $email_text Text of the email.
-					 * @param string $new_user_email New user email that
-					 *        the current user has changed to.
-					 * @param string $old_user_email Existing email addres
-					 *        for the current user.
-					 * @param object $update_user Userdata for the current user.
+					 * @param string  $email_text     Text of the email.
+					 * @param string  $new_user_email New user email that the
+					 *                                current user has changed to.
+					 * @param string  $old_user_email Existing email address
+					 *                                for the current user.
+					 * @param WP_User $update_user    Userdata object for the current user.
 					 */
 					$content = apply_filters( 'bp_new_user_email_content', $email_text, $user_email, $old_user_email, $update_user );
 
@@ -142,7 +142,7 @@ Regards,
 
 					// We mark that the change has taken place so as to ensure a
 					// success message, even though verification is still required
-					$_POST['email'] = $current_user->user_email;
+					$_POST['email'] = $update_user->user_email;
 					$email_changed = true;
 				}
 
@@ -160,10 +160,17 @@ Regards,
 
 		if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
 
-			// Password change attempt is successful
 			if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . $_POST['pass1'], "\\" ) ) {
-				$update_user->user_pass = $_POST['pass1'];
-				$pass_changed = true;
+
+				// Password change attempt is successful
+				if ( ( ! empty( $_POST['pwd'] ) && $_POST['pwd'] != $_POST['pass1'] ) || is_super_admin() )  {
+					$update_user->user_pass = $_POST['pass1'];
+					$pass_changed = true;
+
+				// The new password is the same as the current password
+				} else {
+					$pass_error = 'same';
+				}
 
 			// Password change attempt was unsuccessful
 			} else {
@@ -235,6 +242,9 @@ Regards,
 		case 'empty' :
 			$feedback['pass_empty']    = __( 'One of the password fields was empty.', 'buddypress' );
 			break;
+		case 'same' :
+			$feedback['pass_same'] 	   = __( 'The new password must be different from the current password.', 'buddypress' );
+			break;
 		case false :
 			// No change
 			break;
@@ -255,9 +265,13 @@ Regards,
 	}
 
 	// Set the feedback
-	bp_core_add_message( implode( '</p><p>', $feedback ), $feedback_type );
+	bp_core_add_message( implode( "\n", $feedback ), $feedback_type );
 
-	// Execute additional code
+	/**
+	 * Fires after the general settings have been saved, and before redirect.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_core_general_settings_after_save' );
 
 	// Redirect to prevent issues with browser back button
@@ -303,6 +317,11 @@ function bp_settings_action_notifications() {
 		bp_core_add_message( __( "This user's notification settings have been saved.", 'buddypress' ), 'success' );
 	}
 
+	/**
+	 * Fires after the notification settings have been saved, and before redirect.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_core_notification_settings_after_save' );
 
 	bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications/' );
@@ -341,6 +360,11 @@ function bp_settings_action_capabilities() {
 	// Nonce check
 	check_admin_referer( 'capabilities' );
 
+	/**
+	 * Fires before the capabilities settings have been saved.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_settings_capabilities_before_save' );
 
 	/** Spam **************************************************************/
@@ -350,11 +374,25 @@ function bp_settings_action_capabilities() {
 	if ( bp_is_user_spammer( bp_displayed_user_id() ) != $is_spammer ) {
 		$status = ( true == $is_spammer ) ? 'spam' : 'ham';
 		bp_core_process_spammer_status( bp_displayed_user_id(), $status );
+
+		/**
+		 * Fires after processing a user as a spammer.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int    $value  ID of the currently displayed user.
+		 * @param string $status Determined status of "spam" or "ham" for the displayed user.
+		 */
 		do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $status );
 	}
 
 	/** Other *************************************************************/
 
+	/**
+	 * Fires after the capabilities settings have been saved and before redirect.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
 	do_action( 'bp_settings_capabilities_after_save' );
 
 	// Redirect to the root domain
@@ -399,7 +437,7 @@ function bp_settings_action_delete_account() {
 	// delete the users account
 	if ( bp_core_delete_account( bp_displayed_user_id() ) ) {
 
-		// Add feedback ater deleting a user
+		// Add feedback after deleting a user
 		bp_core_add_message( sprintf( __( '%s was successfully deleted.', 'buddypress' ), $username ), 'success' );
 
 		// Redirect to the root domain
@@ -465,3 +503,15 @@ function bp_settings_verify_email_change(){
 	}
 }
 add_action( 'bp_actions', 'bp_settings_verify_email_change' );
+
+/**
+ * Removes 'Email' sub nav, if no component has registered options there.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+function bp_settings_remove_email_subnav() {
+	if ( ! has_action( 'bp_notification_settings' ) ) {
+		bp_core_remove_subnav_item( BP_SETTINGS_SLUG, 'notifications' );
+	}
+}
+add_action( 'bp_actions', 'bp_settings_remove_email_subnav' );
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
index 510fd7854b1f0798e1048e979ea41386b4327b1b..25a4058c448e6455b14543e030ea8976590b43ce 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php
@@ -8,4 +8,4 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
index ce07fbee8a8a19de863792c01cd6447af4492340..c310125e284e0d7fe98c668695309efdfe9ca7ce 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php
@@ -8,14 +8,14 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_Settings_Component extends BP_Component {
 
 	/**
 	 * Start the settings component creation process
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	public function __construct() {
 		parent::start(
@@ -48,7 +48,7 @@ class BP_Settings_Component extends BP_Component {
 	 * The BP_SETTINGS_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	public function setup_globals( $args = array() ) {
 
@@ -172,16 +172,18 @@ class BP_Settings_Component extends BP_Component {
 				'href'   => trailingslashit( $settings_link . 'general' )
 			);
 
-			// Notifications
-			$wp_admin_nav[] = array(
-				'parent' => 'my-account-' . $this->id,
-				'id'     => 'my-account-' . $this->id . '-notifications',
-				'title'  => __( 'Email', 'buddypress' ),
-				'href'   => trailingslashit( $settings_link . 'notifications' )
-			);
+			// Notifications - only add the tab when there is something to display there.
+			if ( has_action( 'bp_notification_settings' ) ) {
+				$wp_admin_nav[] = array(
+					'parent' => 'my-account-' . $this->id,
+					'id'     => 'my-account-' . $this->id . '-notifications',
+					'title'  => __( 'Email', 'buddypress' ),
+					'href'   => trailingslashit( $settings_link . 'notifications' )
+				);
+			}
 
 			// Delete Account
-			if ( !bp_current_user_can( 'bp_moderate' ) && empty( $bp->site_options['bp-disable-account-deletion'] ) ) {
+			if ( !bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) {
 				$wp_admin_nav[] = array(
 					'parent' => 'my-account-' . $this->id,
 					'id'     => 'my-account-' . $this->id . '-delete-account',
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
index 5d97321ad5e0bf82e976266ba9b0281a6f34e2e1..8ecc3b40a7e1b00f7c7dc9353ec2f08f281ed3bb 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php
@@ -8,12 +8,12 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Show the general settings template
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  */
 function bp_settings_screen_general() {
 
@@ -22,13 +22,20 @@ function bp_settings_screen_general() {
 		return;
 	}
 
+	/**
+	 * Filters the template file path to use for the general settings screen.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $value Directory path to look in for the template file.
+	 */
 	bp_core_load_template( apply_filters( 'bp_settings_screen_general_settings', 'members/single/settings/general' ) );
 }
 
 /**
  * Show the notifications settings template
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  */
 function bp_settings_screen_notification() {
 
@@ -37,13 +44,20 @@ function bp_settings_screen_notification() {
 		return;
 	}
 
+	/**
+	 * Filters the template file path to use for the notification settings screen.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $value Directory path to look in for the template file.
+	 */
 	bp_core_load_template( apply_filters( 'bp_settings_screen_notification_settings', 'members/single/settings/notifications' ) );
 }
 
 /**
  * Show the delete-account settings template
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  */
 function bp_settings_screen_delete_account() {
 
@@ -52,14 +66,20 @@ function bp_settings_screen_delete_account() {
 		return;
 	}
 
-	// Load the template
+	/**
+	 * Filters the template file path to use for the delete-account settings screen.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $value Directory path to look in for the template file.
+	 */
 	bp_core_load_template( apply_filters( 'bp_settings_screen_delete_account', 'members/single/settings/delete-account' ) );
 }
 
 /**
  * Show the capabilities settings template
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  */
 function bp_settings_screen_capabilities() {
 
@@ -68,6 +88,12 @@ function bp_settings_screen_capabilities() {
 		return;
 	}
 
-	// Load the template
+	/**
+	 * Filters the template file path to use for the capabilities settings screen.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param string $value Directory path to look in for the template file.
+	 */
 	bp_core_load_template( apply_filters( 'bp_settings_screen_capabilities', 'members/single/settings/capabilities' ) );
 }
diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
index 393ec4543fa2b3abd29e70375266a01908183b22..093a75b06d122eabeab67dc2e61059e958526440 100644
--- a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
+++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php
@@ -8,14 +8,14 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Output the settings component slug
  *
  * @package BuddyPress
  * @subpackage SettingsTemplate
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_settings_slug()
  */
@@ -27,9 +27,17 @@ function bp_settings_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage SettingsTemplate
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	function bp_get_settings_slug() {
+
+		/**
+		 * Filters the Settings component slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $slug Settings component slug.
+		 */
 		return apply_filters( 'bp_get_settings_slug', buddypress()->settings->slug );
 	}
 
@@ -38,7 +46,7 @@ function bp_settings_slug() {
  *
  * @package BuddyPress
  * @subpackage SettingsTemplate
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @uses bp_get_settings_root_slug()
  */
@@ -50,9 +58,17 @@ function bp_settings_root_slug() {
 	 *
 	 * @package BuddyPress
 	 * @subpackage SettingsTemplate
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	function bp_get_settings_root_slug() {
+
+		/**
+		 * Filters the Settings component root slug.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string $root_slug Settings component root slug.
+		 */
 		return apply_filters( 'bp_get_settings_root_slug', buddypress()->settings->root_slug );
 	}
 
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php
index b4da42472b97f6203140b9fe74a033452bdeed30..457e20ddaa921d901a65bafcc6486baddb7ad559 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php
@@ -9,7 +9,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /** Theme Setup ***************************************************************/
 
@@ -80,6 +80,9 @@ class BP_Legacy extends BP_Theme_Compat {
 		// Template Output
 		add_filter( 'bp_get_activity_action_pre_meta', array( $this, 'secondary_avatars' ), 10, 2 );
 
+		// Filter BuddyPress template hierarchy and look for page templates
+		add_filter( 'bp_get_buddypress_template', array( $this, 'theme_compat_page_templates' ), 10, 1 );
+
 		/** Scripts ***********************************************************/
 
 		add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles'   ) ); // Enqueue theme CSS
@@ -87,7 +90,8 @@ class BP_Legacy extends BP_Theme_Compat {
 		add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization
 		add_action( 'bp_head',            array( $this, 'head_scripts'     ) ); // Output some extra JS in the <head>
 
-		/** Body no-js Class ********************************************************/
+		/** Body no-js Class **************************************************/
+
 		add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 );
 
 		/** Buttons ***********************************************************/
@@ -108,17 +112,17 @@ class BP_Legacy extends BP_Theme_Compat {
 
 			// Group buttons
 			if ( bp_is_active( 'groups' ) ) {
-				add_action( 'bp_group_header_actions',     'bp_group_join_button',           5 );
-				add_action( 'bp_group_header_actions',     'bp_group_new_topic_button',      20 );
-				add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
-				add_filter( 'bp_groups_directory_header',  'bp_legacy_theme_group_create_button' );
-				add_filter( 'bp_blogs_directory_header',   'bp_legacy_theme_blog_create_button' );
+				add_action( 'bp_group_header_actions',          'bp_group_join_button',               5 );
+				add_action( 'bp_group_header_actions',          'bp_group_new_topic_button',         20 );
+				add_action( 'bp_directory_groups_actions',      'bp_group_join_button'                  );
+				add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 );
 			}
 
 			// Blog button
-			if ( bp_is_active( 'blogs' ) )
-				add_action( 'bp_directory_blogs_actions',  'bp_blogs_visit_blog_button' );
-
+			if ( bp_is_active( 'blogs' ) ) {
+				add_action( 'bp_directory_blogs_actions',    'bp_blogs_visit_blog_button'           );
+				add_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_nav', 999 );
+			}
 		}
 
 		/** Notices ***********************************************************/
@@ -173,6 +177,11 @@ class BP_Legacy extends BP_Theme_Compat {
 			'messages_send_reply'           => 'bp_legacy_theme_ajax_messages_send_reply',
 		);
 
+		// Conditional actions
+		if ( bp_is_active( 'messages', 'star' ) ) {
+			$actions['messages_star'] = 'bp_legacy_theme_ajax_messages_star_handler';
+		}
+
 		/**
 		 * Register all of these AJAX handlers
 		 *
@@ -188,6 +197,13 @@ class BP_Legacy extends BP_Theme_Compat {
 
 		/** Override **********************************************************/
 
+		/**
+		 * Fires after all of the BuddyPress theme compat actions have been added.
+		 *
+		 * @since BuddyPress (1.7.0)
+		 *
+		 * @param BP_Legacy $this Current BP_Legacy instance.
+		 */
 		do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) );
 	}
 
@@ -195,6 +211,7 @@ class BP_Legacy extends BP_Theme_Compat {
 	 * Load the theme CSS
 	 *
 	 * @since BuddyPress (1.7)
+	 * @since BuddyPress (2.3.0) Support custom CSS file named after the current theme or parent theme.
 	 *
 	 * @uses wp_enqueue_style() To enqueue the styles
 	 */
@@ -202,21 +219,60 @@ class BP_Legacy extends BP_Theme_Compat {
 		$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 
 		// Locate the BP stylesheet
-		$asset = $this->locate_asset_in_stack( "buddypress{$min}.css", 'css' );
+		$ltr = $this->locate_asset_in_stack( "buddypress{$min}.css",     'css' );
 
-		// Enqueue BuddyPress-specific styling, if found
-		if ( isset( $asset['location'], $asset['handle'] ) ) {
-			wp_enqueue_style( $asset['handle'], $asset['location'], array(), $this->version, 'screen' );
+		// LTR
+		if ( ! is_rtl() && isset( $ltr['location'], $ltr['handle'] ) ) {
+			wp_enqueue_style( $ltr['handle'], $ltr['location'], array(), $this->version, 'screen' );
+
+			if ( $min ) {
+				wp_style_add_data( $ltr['handle'], 'suffix', $min );
+			}
+		}
+
+		// RTL
+		if ( is_rtl() ) {
+			$rtl = $this->locate_asset_in_stack( "buddypress-rtl{$min}.css", 'css' );
+
+			if ( isset( $rtl['location'], $rtl['handle'] ) ) {
+				$rtl['handle'] = str_replace( '-css', '-css-rtl', $rtl['handle'] );  // Backwards compatibility
+				wp_enqueue_style( $rtl['handle'], $rtl['location'], array(), $this->version, 'screen' );
+
+				if ( $min ) {
+					wp_style_add_data( $rtl['handle'], 'suffix', $min );
+				}
+			}
+		}
+
+		// Compatibility stylesheets for specific themes.
+		$theme = $this->locate_asset_in_stack( get_template() . "{$min}.css", 'css' );
+		if ( ! is_rtl() && isset( $theme['location'] ) ) {
+			// use a unique handle
+			$theme['handle'] = 'bp-' . get_template();
+			wp_enqueue_style( $theme['handle'], $theme['location'], array(), $this->version, 'screen' );
 
-			wp_style_add_data( $asset['handle'], 'rtl', true );
 			if ( $min ) {
-				wp_style_add_data( $asset['handle'], 'suffix', $min );
+				wp_style_add_data( $theme['handle'], 'suffix', $min );
+			}
+		}
+
+		// Compatibility stylesheet for specific themes, RTL-version
+		if ( is_rtl() ) {
+			$theme_rtl = $this->locate_asset_in_stack( get_template() . "-rtl{$min}.css", 'css' );
+
+			if ( isset( $theme_rtl['location'] ) ) {
+				$theme_rtl['handle'] = $theme['handle'] . '-rtl';
+				wp_enqueue_style( $theme_rtl['handle'], $theme_rtl['location'], array(), $this->version, 'screen' );
+
+				if ( $min ) {
+					wp_style_add_data( $theme_rtl['handle'], 'suffix', $min );
+				}
 			}
 		}
 	}
 
 	/**
-	 * Enqueue the required Javascript files
+	 * Enqueue the required JavaScript files
 	 *
 	 * @since BuddyPress (1.7)
 	 */
@@ -232,8 +288,13 @@ class BP_Legacy extends BP_Theme_Compat {
 			wp_enqueue_script( $asset['handle'], $asset['location'], bp_core_get_js_dependencies(), $this->version );
 		}
 
-		// Add words that we need to use in JS to the end of the page
-		// so they can be translated and still used.
+		/**
+		 * Filters core JavaScript strings for internationalization before AJAX usage.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array $value Array of key/value pairs for AJAX usage.
+		 */
 		$params = apply_filters( 'bp_core_get_js_strings', array(
 			'accepted'            => __( 'Accepted', 'buddypress' ),
 			'close'               => __( 'Close', 'buddypress' ),
@@ -260,7 +321,7 @@ class BP_Legacy extends BP_Theme_Compat {
 		if ( bp_is_register_page() || ( function_exists( 'bp_is_user_settings_general' ) && bp_is_user_settings_general() ) ) {
 
 			// Locate the Register Page JS file
-			$asset = $this->locate_asset_in_stack( "password-verify{$min}.js", 'js' );
+			$asset = $this->locate_asset_in_stack( "password-verify{$min}.js", 'js', 'bp-legacy-password-verify' );
 
 			$dependencies = array_merge( bp_core_get_js_dependencies(), array(
 				'password-strength-meter',
@@ -269,6 +330,23 @@ class BP_Legacy extends BP_Theme_Compat {
 			// Enqueue script
 			wp_enqueue_script( $asset['handle'] . '-password-verify', $asset['location'], $dependencies, $this->version);
 		}
+
+		// Star private messages
+		if ( bp_is_active( 'messages', 'star' ) && bp_is_user_messages() ) {
+			wp_localize_script( $asset['handle'], 'BP_PM_Star', array(
+				'strings' => array(
+					'text_unstar'  => __( 'Unstar', 'buddypress' ),
+					'text_star'    => __( 'Star', 'buddypress' ),
+					'title_unstar' => __( 'Starred', 'buddypress' ),
+					'title_star'   => __( 'Not starred', 'buddypress' ),
+					'title_unstar_thread' => __( 'Remove all starred messages in this thread', 'buddypress' ),
+					'title_star_thread'   => __( 'Star the first message in this thread', 'buddypress' ),
+				),
+				'is_single_thread' => (int) bp_is_messages_conversation(),
+				'star_counter'     => 0,
+				'unstar_counter'   => 0
+			) );
+		}
 	}
 
 	/**
@@ -295,35 +373,40 @@ class BP_Legacy extends BP_Theme_Compat {
 	 *
 	 * @since BuddyPress (1.8)
 	 * @access private
-	 * @param string $file A filename like buddypress.cs
-	 * @param string $type css|js
+	 * @param string $file A filename like buddypress.css
+	 * @param string $type Optional. Either "js" or "css" (the default).
+	 * @param string $script_handle Optional. If set, used as the script name in `wp_enqueue_script`.
 	 * @return array An array of data for the wp_enqueue_* function:
 	 *   'handle' (eg 'bp-child-css') and a 'location' (the URI of the
 	 *   asset)
 	 */
-	private function locate_asset_in_stack( $file, $type = 'css' ) {
-		// Child, parent, theme compat
+	private function locate_asset_in_stack( $file, $type = 'css', $script_handle = '' ) {
 		$locations = array();
 
+		// Ensure the assets can be located when running from /src/.
+		if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src' ) {
+			$file = str_replace( '.min', '', $file );
+		}
+
 		// No need to check child if template == stylesheet
 		if ( is_child_theme() ) {
 			$locations['bp-child'] = array(
 				'dir'  => get_stylesheet_directory(),
 				'uri'  => get_stylesheet_directory_uri(),
-				'file' => str_replace( '.min', '', $file )
+				'file' => str_replace( '.min', '', $file ),
 			);
 		}
 
 		$locations['bp-parent'] = array(
 			'dir'  => get_template_directory(),
 			'uri'  => get_template_directory_uri(),
-			'file' => str_replace( '.min', '', $file )
+			'file' => str_replace( '.min', '', $file ),
 		);
 
 		$locations['bp-legacy'] = array(
 			'dir'  => bp_get_theme_compat_dir(),
 			'uri'  => bp_get_theme_compat_url(),
-			'file' => $file
+			'file' => $file,
 		);
 
 		// Subdirectories within the top-level $locations directories
@@ -339,7 +422,8 @@ class BP_Legacy extends BP_Theme_Compat {
 			foreach ( $subdirs as $subdir ) {
 				if ( file_exists( trailingslashit( $location['dir'] ) . trailingslashit( $subdir ) . $location['file'] ) ) {
 					$retval['location'] = trailingslashit( $location['uri'] ) . trailingslashit( $subdir ) . $location['file'];
-					$retval['handle']   = $location_type . '-' . $type;
+					$retval['handle']   = ( $script_handle ) ? $script_handle : "{$location_type}-{$type}";
+
 					break 2;
 				}
 			}
@@ -438,6 +522,81 @@ class BP_Legacy extends BP_Theme_Compat {
 
 		return $action;
 	}
+
+	/**
+	 * Filter the default theme compatibility root template hierarchy, and prepend
+	 * a page template to the front if it's set.
+	 *
+	 * @see https://buddypress.trac.wordpress.org/ticket/6065
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @param  array $templates
+	 * @uses   apply_filters() call 'bp_legacy_theme_compat_page_templates_directory_only' and return false
+	 *                         to use the defined page template for component's directory and its single items
+	 * @return array
+	 */
+	public function theme_compat_page_templates( $templates = array() ) {
+
+		/**
+		 * Filters whether or not we are looking at a directory to determine if to return early.
+		 *
+		 * @since BuddyPress (2.2.0)
+		 *
+		 * @param bool $value Whether or not we are viewing a directory.
+		 */
+		if ( true === (bool) apply_filters( 'bp_legacy_theme_compat_page_templates_directory_only', ! bp_is_directory() ) ) {
+			return $templates;
+		}
+
+		// No page ID yet
+		$page_id = 0;
+
+		// Get the WordPress Page ID for the current view.
+		foreach ( (array) buddypress()->pages as $component => $bp_page ) {
+
+			// Handles the majority of components.
+			if ( bp_is_current_component( $component ) ) {
+				$page_id = (int) $bp_page->id;
+			}
+
+			// Stop if not on a user page.
+			if ( ! bp_is_user() && ! empty( $page_id ) ) {
+				break;
+			}
+
+			// The Members component requires an explicit check due to overlapping components.
+			if ( bp_is_user() && ( 'members' === $component ) ) {
+				$page_id = (int) $bp_page->id;
+				break;
+			}
+		}
+
+		// Bail if no directory page set
+		if ( 0 === $page_id ) {
+			return $templates;
+		}
+
+		// Check for page template
+		$page_template = get_page_template_slug( $page_id );
+
+		// Add it to the beginning of the templates array so it takes precedence
+		// over the default hierarchy.
+		if ( ! empty( $page_template ) ) {
+
+			/**
+			 * Check for existence of template before adding it to template
+			 * stack to avoid accidentally including an unintended file.
+			 *
+			 * @see: https://buddypress.trac.wordpress.org/ticket/6190
+			 */
+			if ( '' !== locate_template( $page_template ) ) {
+				array_unshift( $templates, $page_template );
+			}
+		}
+
+		return $templates;
+	}
 }
 new BP_Legacy();
 endif;
@@ -449,6 +608,7 @@ endif;
  * the behavior of bp-default.
  *
  * @since BuddyPress (2.0.0)
+ * @todo Deprecate
  *
  * @param string $title Groups directory title.
  * @return string
@@ -457,6 +617,21 @@ function bp_legacy_theme_group_create_button( $title ) {
 	return $title . ' ' . bp_get_group_create_button();
 }
 
+/**
+ * Add the Create a Group nav to the Groups directory navigation.
+ *
+ * bp-legacy puts the Create a Group nav at the last position of
+ * the Groups directory navigation.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @uses   bp_group_create_nav_item() to output the create a Group nav item
+ * @return string
+ */
+function bp_legacy_theme_group_create_nav() {
+	bp_group_create_nav_item();
+}
+
 /**
  * Add the Create a Site button to the Sites directory title.
  *
@@ -464,6 +639,7 @@ function bp_legacy_theme_group_create_button( $title ) {
  * the behavior of bp-default.
  *
  * @since BuddyPress (2.0.0)
+ * @todo Deprecate
  *
  * @param string $title Sites directory title.
  * @return string
@@ -471,6 +647,22 @@ function bp_legacy_theme_group_create_button( $title ) {
 function bp_legacy_theme_blog_create_button( $title ) {
 	return $title . ' ' . bp_get_blog_create_button();
 }
+
+/**
+ * Add the Create a Site nav to the Sites directory navigation.
+ *
+ * bp-legacy puts the Create a Site nav at the last position of
+ * the Sites directory navigation.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @uses   bp_blog_create_nav_item() to output the Create a Site nav item
+ * @return string
+ */
+function bp_legacy_theme_blog_create_nav() {
+	bp_blog_create_nav_item();
+}
+
 /**
  * This function looks scarier than it actually is. :)
  * Each object loop (activity/members/groups/blogs/forums) contains default
@@ -526,7 +718,7 @@ function bp_legacy_theme_ajax_querystring( $query_string, $object ) {
 	if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
 		$qs[] = 'page=' . absint( $_POST['page'] );
 
-	// exludes activity just posted and avoids duplicate ids
+	// excludes activity just posted and avoids duplicate ids
 	if ( ! empty( $_POST['exclude_just_posted'] ) ) {
 		$just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
 		$qs[] = 'exclude=' . implode( ',', $just_posted );
@@ -564,6 +756,19 @@ function bp_legacy_theme_ajax_querystring( $query_string, $object ) {
 	if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) )
 		$object_extras = $_BP_COOKIE['bp-' . $object . '-extras'];
 
+	/**
+	 * Filters the AJAX query string for the component loops.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $query_string        The query string we are working with.
+	 * @param string $object              The type of page we are on.
+	 * @param string $object_filter       The current object filter.
+	 * @param string $object_scope        The current object scope.
+	 * @param string $object_page         The current object page.
+	 * @param string $object_search_terms The current object search terms.
+	 * @param string $object_extras       The current object extras.
+	 */
 	return apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );
 }
 
@@ -682,6 +887,15 @@ function bp_legacy_theme_activity_template_loader() {
 	ob_start();
 	bp_get_template_part( 'activity/activity-loop' );
 	$result['contents'] = ob_get_contents();
+
+	/**
+	 * Filters the feed URL for when activity is requested via AJAX.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $feed_url URL for the feed to be used.
+	 * @param string $scope    Scope for the activity request.
+	 */
 	$result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope );
 	ob_end_clean();
 
@@ -708,7 +922,7 @@ function bp_legacy_theme_post_update() {
 		exit( '-1' );
 
 	if ( empty( $_POST['content'] ) )
-		exit( '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' );
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' );
 
 	$activity_id = 0;
 	if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
@@ -719,11 +933,13 @@ function bp_legacy_theme_post_update() {
 			$activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
 
 	} else {
-		$activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
+
+		/** This filter is documented in bp-activity/bp-activity-actions.php */
+		$activity_id = apply_filters( 'bp_activity_custom_update', false, $_POST['object'], $_POST['item_id'], $_POST['content'] );
 	}
 
 	if ( empty( $activity_id ) )
-		exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update; please try again.', 'buddypress' ) . '</p></div>' );
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem posting your update. Please try again.', 'buddypress' ) . '</p></div>' );
 
 	$last_recorded = ! empty( $_POST['since'] ) ? date( 'Y-m-d H:i:s', intval( $_POST['since'] ) ) : 0;
 	if ( $last_recorded ) {
@@ -758,21 +974,29 @@ function bp_legacy_theme_post_update() {
 function bp_legacy_theme_new_activity_comment() {
 	global $activities_template;
 
+	$bp = buddypress();
+
 	// Bail if not a POST action
-	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
+	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
 		return;
+	}
 
 	// Check the nonce
 	check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
 
-	if ( ! is_user_logged_in() )
+	if ( ! is_user_logged_in() ) {
 		exit( '-1' );
+	}
 
-	if ( empty( $_POST['content'] ) )
-		exit( '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' );
+	$feedback = __( 'There was an error posting your reply. Please try again.', 'buddypress' );
 
-	if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) )
-		exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' );
+	if ( empty( $_POST['content'] ) ) {
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . esc_html__( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' );
+	}
+
+	if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) ) {
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . esc_html( $feedback ) . '</p></div>' );
+	}
 
 	$comment_id = bp_activity_new_comment( array(
 		'activity_id' => $_POST['form_id'],
@@ -780,8 +1004,14 @@ function bp_legacy_theme_new_activity_comment() {
 		'parent_id'   => $_POST['comment_id'],
 	) );
 
-	if ( ! $comment_id )
-		exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' );
+	if ( ! $comment_id ) {
+		if ( ! empty( $bp->activity->errors['new_comment'] ) && is_wp_error( $bp->activity->errors['new_comment'] ) ) {
+			$feedback = $bp->activity->errors['new_comment']->get_error_message();
+			unset( $bp->activity->errors['new_comment'] );
+		}
+
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . esc_html( $feedback ) . '</p></div>' );
+	}
 
 	// Load the new activity item into the $activities_template global
 	bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id );
@@ -837,12 +1067,13 @@ function bp_legacy_theme_delete_activity() {
 	if ( ! bp_activity_user_can_delete( $activity ) )
 		exit( '-1' );
 
-	// Call the action before the delete so plugins can still fetch information about it
+	/** This action is documented in bp-activity/bp-activity-actions.php */
 	do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id );
 
 	if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) )
-		exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
 
+	/** This action is documented in bp-activity/bp-activity-actions.php */
 	do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
 	exit;
 }
@@ -873,12 +1104,13 @@ function bp_legacy_theme_delete_activity_comment() {
 	if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) )
 		exit( '-1' );
 
-	// Call the action before the delete so plugins can still fetch information about it
+	/** This action is documented in bp-activity/bp-activity-actions.php */
 	do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
 
 	if ( ! bp_activity_delete_comment( $comment->item_id, $comment->id ) )
-		exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
+		exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
 
+	/** This action is documented in bp-activity/bp-activity-actions.php */
 	do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
 	exit;
 }
@@ -916,13 +1148,14 @@ function bp_legacy_theme_spam_activity() {
 	// Check nonce
 	check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
 
-	// Call an action before the spamming so plugins can modify things if they want to
+	/** This action is documented in bp-activity/bp-activity-actions.php */
 	do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
 
 	// Mark as spam
 	bp_activity_mark_as_spam( $activity );
 	$activity->save();
 
+	/** This action is documented in bp-activity/bp-activity-actions.php */
 	do_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id );
 	exit;
 }
@@ -966,7 +1199,7 @@ function bp_legacy_theme_unmark_activity_favorite() {
 }
 
 /**
- * Fetches full an activity's full, non-excerpted content via a POST request.
+ * Fetches an activity's full, non-excerpted content via a POST request.
  * Used for the 'Read More' link on long activity items.
  *
  * @return string HTML
@@ -987,10 +1220,19 @@ function bp_legacy_theme_get_single_activity_content() {
 	if ( empty( $activity ) )
 		exit; // @todo: error?
 
+	/**
+	 * Fires before the return of an activity's full, non-excerpted content via a POST request.
+	 *
+	 * @since BuddyPress (1.7.0)
+	 *
+	 * @param string $activity Activity content. Passed by reference.
+	 */
 	do_action_ref_array( 'bp_legacy_theme_get_single_activity_content', array( &$activity ) );
 
 	// Activity content retrieved through AJAX should run through normal filters, but not be truncated
 	remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
+
+	/** This filter is documented in bp-activity/bp-activity-template.php */
 	$content = apply_filters( 'bp_get_activity_content_body', $activity->content );
 
 	exit( $content );
@@ -1030,7 +1272,7 @@ function bp_legacy_theme_ajax_invite_user() {
 			$user_status = 'is_pending';
 
 		// Create the user invitation
-		} else if ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) {
+		} elseif ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) {
 			$user_status = 'is_invited';
 
 		// Miscellaneous failure
@@ -1040,9 +1282,11 @@ function bp_legacy_theme_ajax_invite_user() {
 
 		$user = new BP_Core_User( $friend_id );
 
-		$uninvite_url = bp_is_current_action( 'create' ) ? bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-invites/?user_id=' . $friend_id : bp_get_group_permalink( $group ) . 'send-invites/remove/' . $friend_id;
+		$uninvite_url = bp_is_current_action( 'create' )
+			? bp_get_groups_directory_permalink() . 'create/step/group-invites/?user_id=' . $friend_id
+			: bp_get_group_permalink( $group )    . 'send-invites/remove/' . $friend_id;
 
-		echo '<li id="uid-' . $user->id . '">';
+		echo '<li id="uid-' . esc_attr( $user->id ) . '">';
 		echo $user->avatar_thumb;
 		echo '<h4>' . $user->user_link . '</h4>';
 		echo '<span class="activity">' . esc_attr( $user->last_active ) . '</span>';
@@ -1279,38 +1523,78 @@ function bp_legacy_theme_ajax_messages_send_reply() {
 
 	if ( !empty( $result ) ) {
 
-		// Get the zebra line classes correct on ajax requests
+		// pretend we're in the message loop
 		global $thread_template;
 
 		bp_thread_has_messages( array( 'thread_id' => (int) $_REQUEST['thread_id'] ) );
 
-		if ( $thread_template->message_count % 2 == 1 ) {
-			$class = 'odd';
-		} else {
-			$class = 'even alt';
-		} ?>
+		// set the current message to the 2nd last
+		$thread_template->message = end( $thread_template->thread->messages );
+		$thread_template->message = prev( $thread_template->thread->messages );
+
+		// set current message to current key
+		$thread_template->current_message = key( $thread_template->thread->messages );
+
+		// now manually iterate message like we're in the loop
+		bp_thread_the_message();
 
-		<div class="message-box new-message <?php echo $class; ?>">
+		// manually call oEmbed
+		// this is needed because we're not at the beginning of the loop
+		bp_messages_embed()
+	?>
+
+		<div class="message-box new-message <?php bp_the_thread_message_css_class(); ?>">
 			<div class="message-metadata">
-				<?php do_action( 'bp_before_message_meta' ); ?>
+				<?php
+
+				/**
+				 * Fires before the single message header is displayed.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_before_message_meta' ); ?>
 				<?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
 
 				<strong><a href="<?php echo bp_loggedin_user_domain(); ?>"><?php bp_loggedin_user_fullname(); ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ); ?></span></strong>
 
-				<?php do_action( 'bp_after_message_meta' ); ?>
+				<?php
+
+				/**
+				 * Fires after the single message header is displayed.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_after_message_meta' ); ?>
 			</div>
 
-			<?php do_action( 'bp_before_message_content' ); ?>
+			<?php
+
+			/**
+			 * Fires before the message content for a private message.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_before_message_content' ); ?>
 
 			<div class="message-content">
-				<?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?>
+				<?php bp_the_thread_message_content(); ?>
 			</div>
 
-			<?php do_action( 'bp_after_message_content' ); ?>
+			<?php
+
+			/**
+			 * Fires after the message content for a private message.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_after_message_content' ); ?>
 
 			<div class="clear"></div>
 		</div>
 	<?php
+		// clean up the loop
+		bp_thread_messages();
+
 	} else {
 		echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>';
 	}
@@ -1402,6 +1686,14 @@ function bp_legacy_theme_ajax_messages_delete() {
  * @return string HTML.
  */
 function bp_legacy_theme_ajax_messages_autocomplete_results() {
+
+	/**
+	 * Filters the max results default value for ajax messages autocomplete results.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value Max results for autocomplete. Default 10.
+	 */
 	$limit = isset( $_GET['limit'] ) ? absint( $_GET['limit'] )          : (int) apply_filters( 'bp_autocomplete_max_results', 10 );
 	$term  = isset( $_GET['q'] )     ? sanitize_text_field( $_GET['q'] ) : '';
 
@@ -1423,7 +1715,7 @@ function bp_legacy_theme_ajax_messages_autocomplete_results() {
 		foreach ( $suggestions as $user ) {
 
 			// Note that the final line break acts as a delimiter for the
-			// autocomplete javascript and thus should not be removed
+			// autocomplete JavaScript and thus should not be removed
 			printf( '<span id="%s" href="#"></span><img src="%s" style="width: 15px"> &nbsp; %s (%s)' . "\n",
 				esc_attr( 'link-' . $user->ID ),
 				esc_url( $user->image ),
@@ -1435,3 +1727,34 @@ function bp_legacy_theme_ajax_messages_autocomplete_results() {
 
 	exit;
 }
+
+/**
+ * AJAX callback to set a message's star status.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_legacy_theme_ajax_messages_star_handler() {
+	if ( false === bp_is_active( 'messages', 'star' ) || empty( $_POST['message_id'] ) ) {
+		return;
+	}
+
+	// Check nonce
+	check_ajax_referer( 'bp-messages-star-' . (int) $_POST['message_id'], 'nonce' );
+
+	// Check capability
+	if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) {
+		return;
+	}
+
+	if ( true === bp_messages_star_set_action( array(
+		'action'     => $_POST['star_status'],
+		'message_id' => (int) $_POST['message_id'],
+		'bulk'       => ! empty( $_POST['bulk'] ) ? true : false
+	 ) ) ) {
+		echo '1';
+		die();
+	}
+
+	echo '-1';
+	die();
+}
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php
index 24ef579194b2ff8c84046e65b0a11273a14ed153..6a184cf3ba9abd2e61c8cebee51852cbb5761d3a 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_activity_loop' ); ?>
+<?php
+
+/**
+ * Fires before the start of the activity loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_activity_loop' ); ?>
 
 <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
 
@@ -36,7 +43,14 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_activity_loop' ); ?>
+<?php
+
+/**
+ * Fires after the finish of the activity loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_activity_loop' ); ?>
 
 <?php if ( empty( $_POST['page'] ) ) : ?>
 
@@ -46,4 +60,4 @@
 
 	</form>
 
-<?php endif; ?>
\ No newline at end of file
+<?php endif; ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php
index a4c9b60d9575abe746abdb38e42069a342f3bfb6..4bc1eaf59b512b8949b5edc3c1587475c0b2f18c 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php
@@ -12,7 +12,14 @@
 
 ?>
 
-<?php do_action( 'bp_before_activity_comment' ); ?>
+<?php
+
+/**
+ * Fires before the display of an activity comment.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_before_activity_comment' ); ?>
 
 <li id="acomment-<?php bp_activity_comment_id(); ?>">
 	<div class="acomment-avatar">
@@ -44,11 +51,25 @@
 
 		<?php endif; ?>
 
-		<?php do_action( 'bp_activity_comment_options' ); ?>
+		<?php
+
+		/**
+		 * Fires after the defualt comment action options display.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 */
+		do_action( 'bp_activity_comment_options' ); ?>
 
 	</div>
 
 	<?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?>
 </li>
 
-<?php do_action( 'bp_after_activity_comment' ); ?>
+<?php
+
+/**
+ * Fires after the display of an activity comment.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_after_activity_comment' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php
index 95bb3a5ac5e9925c6a447e145c32a0a65140c30d..d9f01a4ef0dcb2227b57b3ffa3b4374f5e30d83f 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php
@@ -12,7 +12,14 @@
 
 ?>
 
-<?php do_action( 'bp_before_activity_entry' ); ?>
+<?php
+
+/**
+ * Fires before the display of an activity entry.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_activity_entry' ); ?>
 
 <li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>">
 	<div class="activity-avatar">
@@ -41,7 +48,14 @@
 
 		<?php endif; ?>
 
-		<?php do_action( 'bp_activity_entry_content' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of an activity entry content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_activity_entry_content' ); ?>
 
 		<div class="activity-meta">
 
@@ -75,7 +89,14 @@
 
 				<?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
 
-				<?php do_action( 'bp_activity_entry_meta' ); ?>
+				<?php
+
+				/**
+				 * Fires at the end of the activity entry meta data area.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_activity_entry_meta' ); ?>
 
 			<?php endif; ?>
 
@@ -83,7 +104,14 @@
 
 	</div>
 
-	<?php do_action( 'bp_before_activity_entry_comments' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the activity entry comments.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_activity_entry_comments' ); ?>
 
 	<?php if ( ( bp_activity_get_comment_count() || bp_activity_can_comment() ) || bp_is_single_activity() ) : ?>
 
@@ -103,7 +131,14 @@
 						<input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
 					</div>
 
-					<?php do_action( 'bp_activity_entry_comments' ); ?>
+					<?php
+
+					/**
+					 * Fires after the activity entry comment form.
+					 *
+					 * @since BuddyPress (1.5.0)
+					 */
+					do_action( 'bp_activity_entry_comments' ); ?>
 
 					<?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
 
@@ -115,8 +150,22 @@
 
 	<?php endif; ?>
 
-	<?php do_action( 'bp_after_activity_entry_comments' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the activity entry comments.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_activity_entry_comments' ); ?>
 
 </li>
 
-<?php do_action( 'bp_after_activity_entry' ); ?>
+<?php
+
+/**
+ * Fires after the display of an activity entry.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_activity_entry' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php
index 40d7725f1dfd71623bdeb69de36aa3753a858592..acce864a56da52fbf31099af7c2f700f656660b1 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php
@@ -1,8 +1,22 @@
-<?php do_action( 'bp_before_directory_activity' ); ?>
+<?php
+
+/**
+ * Fires before the activity directory listing.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_before_directory_activity' ); ?>
 
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_directory_activity_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the activity directory display content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_directory_activity_content' ); ?>
 
 	<?php if ( is_user_logged_in() ) : ?>
 
@@ -10,17 +24,38 @@
 
 	<?php endif; ?>
 
-	<?php do_action( 'template_notices' ); ?>
+	<?php
+
+	/**
+	 * Fires towards the top of template pages for notice display.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
+	do_action( 'template_notices' ); ?>
 
 	<div class="item-list-tabs activity-type-tabs" role="navigation">
 		<ul>
-			<?php do_action( 'bp_before_activity_type_tab_all' ); ?>
+			<?php
+
+			/**
+			 * Fires before the listing of activity type tabs.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 */
+			do_action( 'bp_before_activity_type_tab_all' ); ?>
 
 			<li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
 
 			<?php if ( is_user_logged_in() ) : ?>
 
-				<?php do_action( 'bp_before_activity_type_tab_friends' ); ?>
+				<?php
+
+				/**
+				 * Fires before the listing of friends activity type tab.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_before_activity_type_tab_friends' ); ?>
 
 				<?php if ( bp_is_active( 'friends' ) ) : ?>
 
@@ -32,7 +67,14 @@
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_before_activity_type_tab_groups' ); ?>
+				<?php
+
+				/**
+				 * Fires before the listing of groups activity type tab.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_before_activity_type_tab_groups' ); ?>
 
 				<?php if ( bp_is_active( 'groups' ) ) : ?>
 
@@ -44,7 +86,14 @@
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_before_activity_type_tab_favorites' ); ?>
+				<?php
+
+				/**
+				 * Fires before the listing of favorites activity type tab.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_before_activity_type_tab_favorites' ); ?>
 
 				<?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
 
@@ -54,7 +103,14 @@
 
 				<?php if ( bp_activity_do_mentions() ) : ?>
 
-					<?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
+					<?php
+
+					/**
+					 * Fires before the listing of mentions activity type tab.
+					 *
+					 * @since BuddyPress (1.2.0)
+					 */
+					do_action( 'bp_before_activity_type_tab_mentions' ); ?>
 
 					<li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php esc_attr_e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><span><?php printf( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></span></strong><?php endif; ?></a></li>
 
@@ -62,7 +118,14 @@
 
 			<?php endif; ?>
 
-			<?php do_action( 'bp_activity_type_tabs' ); ?>
+			<?php
+
+			/**
+			 * Fires after the listing of activity type tabs.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 */
+			do_action( 'bp_activity_type_tabs' ); ?>
 		</ul>
 	</div><!-- .item-list-tabs -->
 
@@ -70,7 +133,14 @@
 		<ul>
 			<li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
 
-			<?php do_action( 'bp_activity_syndication_options' ); ?>
+			<?php
+
+			/**
+			 * Fires before the display of the activity syndication options.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 */
+			do_action( 'bp_activity_syndication_options' ); ?>
 
 			<li id="activity-filter-select" class="last">
 				<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
@@ -79,27 +149,67 @@
 
 					<?php bp_activity_show_filters(); ?>
 
-					<?php do_action( 'bp_activity_filter_options' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the select input for activity filter by options.
+					 *
+					 * @since BuddyPress (1.2.0)
+					 */
+					do_action( 'bp_activity_filter_options' ); ?>
 
 				</select>
 			</li>
 		</ul>
 	</div><!-- .item-list-tabs -->
 
-	<?php do_action( 'bp_before_directory_activity_list' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the activity list.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_before_directory_activity_list' ); ?>
 
-	<div class="activity" role="main">
+	<div class="activity">
 
 		<?php bp_get_template_part( 'activity/activity-loop' ); ?>
 
 	</div><!-- .activity -->
 
-	<?php do_action( 'bp_after_directory_activity_list' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the activity list.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_after_directory_activity_list' ); ?>
+
+	<?php
+
+	/**
+	 * Fires inside and displays the activity directory display content.
+	 */
+	do_action( 'bp_directory_activity_content' ); ?>
+
+	<?php
 
-	<?php do_action( 'bp_directory_activity_content' ); ?>
+	/**
+	 * Fires after the activity directory display content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_directory_activity_content' ); ?>
 
-	<?php do_action( 'bp_after_directory_activity_content' ); ?>
+	<?php
 
-	<?php do_action( 'bp_after_directory_activity' ); ?>
+	/**
+	 * Fires after the activity directory listing.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_after_directory_activity' ); ?>
 
 </div>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php
index a45213a158c58af543d65347d96fc67fb07afbdc..12023a8da17c2a51ab42c3959a132e1139cfd5d1 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php
@@ -11,7 +11,14 @@
 
 <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
 
-	<?php do_action( 'bp_before_activity_post_form' ); ?>
+	<?php
+
+	/**
+	 * Fires before the activity post form.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_activity_post_form' ); ?>
 
 	<div id="whats-new-avatar">
 		<a href="<?php echo bp_loggedin_user_domain(); ?>">
@@ -27,7 +34,9 @@
 
 	<div id="whats-new-content">
 		<div id="whats-new-textarea">
-			<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
+			<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
+				<?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?>
+			><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
 		</div>
 
 		<div id="whats-new-options">
@@ -63,12 +72,26 @@
 
 			<?php endif; ?>
 
-			<?php do_action( 'bp_activity_post_form_options' ); ?>
+			<?php
+
+			/**
+			 * Fires at the end of the activity post form markup.
+			 *
+			 * @since BuddyPress (1.2.0)
+			 */
+			do_action( 'bp_activity_post_form_options' ); ?>
 
 		</div><!-- #whats-new-options -->
 	</div><!-- #whats-new-content -->
 
 	<?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
-	<?php do_action( 'bp_after_activity_post_form' ); ?>
+	<?php
+
+	/**
+	 * Fires after the activity post form.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_activity_post_form' ); ?>
 
 </form><!-- #whats-new-form -->
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php
index 5b4eadd8ff8843e3da82ec4e39b9d4352d987e7b..2ba08a48580b0249ecb6819fcc698939fa6fa02e 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php
@@ -1,7 +1,10 @@
 <div id="buddypress">
-	<?php do_action( 'template_notices' ); ?>
+	<?php
 
-	<div class="activity no-ajax" role="main">
+	/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+	do_action( 'template_notices' ); ?>
+
+	<div class="activity no-ajax">
 		<?php if ( bp_has_activities( 'display_comments=threaded&show_hidden=true&include=' . bp_current_action() ) ) : ?>
 
 			<ul id="activity-stream" class="activity-list item-list">
@@ -14,4 +17,4 @@
 
 		<?php endif; ?>
 	</div>
-</div>
\ No newline at end of file
+</div>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php
new file mode 100644
index 0000000000000000000000000000000000000000..18f8145c43269bd387565c1dca4c4aba543f6393
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * BuddyPress Avatars camera template
+ *
+ * This template is used to create the camera Backbone views
+ *
+ * @since 2.3
+ *
+ * @package BuddyPress
+ * @subpackage bp-attachments
+ */
+?>
+<script id="tmpl-bp-avatar-webcam" type="text/html">
+	<# if ( ! data.user_media ) { #>
+		<div id="bp-webcam-message">
+			<p class="warning"><?php esc_html_e( 'Your browser does not support this feature.', 'buddypress' );?></p>
+		</div>
+	<# } else { #>
+		<div id="avatar-to-crop"></div>
+		<div class="avatar-crop-management">
+			<div id="avatar-crop-pane" class="avatar" style="width:{{data.w}}px; height:{{data.h}}px"></div>
+			<div id="avatar-crop-actions">
+				<a class="button avatar-webcam-capture" href="#"><?php esc_html_e( 'Capture', 'buddypress' );?></a>
+				<a class="button avatar-webcam-save" href="#"><?php esc_html_e( 'Save', 'buddypress' );?></a>
+			</div>
+		</div>
+	<# } #>
+</script>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php
new file mode 100644
index 0000000000000000000000000000000000000000..274e97ea7fe5c161ac3b3fd88f7036270fa28b9d
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * BuddyPress Avatars crop template
+ *
+ * This template is used to create the crop Backbone views
+ *
+ * @since 2.3
+ *
+ * @package BuddyPress
+ * @subpackage bp-attachments
+ */
+?>
+<script id="tmpl-bp-avatar-item" type="text/html">
+	<div id="avatar-to-crop">
+		<img src="{{data.url}}"/>
+	</div>
+	<div class="avatar-crop-management">
+		<div id="avatar-crop-pane" class="avatar" style="width:{{data.full_w}}px; height:{{data.full_h}}px">
+			<img src="{{data.url}}" id="avatar-crop-preview"/>
+		</div>
+		<div id="avatar-crop-actions">
+			<a class="button avatar-crop-submit" href="#"><?php esc_html_e( 'Crop Image', 'buddypress' ); ?></a>
+		</div>
+	</div>
+</script>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..82c401f831cc1b30ee2dc1d1403e84e1e356ada3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * BuddyPress Avatars main template
+ *
+ * This template is used to inject the BuddyPress Backbone views
+ * dealing with avatars.
+ * It's also used to create the common Backbone views
+ *
+ * @since 2.3
+ *
+ * @package BuddyPress
+ * @subpackage bp-attachments
+ */
+
+
+/**
+ * This action is for internal use, please do not use it
+ */
+do_action( 'bp_attachments_avatar_check_template' );
+?>
+<div class="bp-avatar-nav"></div>
+<div class="bp-avatar"></div>
+<div class="bp-avatar-status"></div>
+
+<script type="text/html" id="tmpl-bp-avatar-nav">
+	<a href="{{data.href}}" class="bp-avatar-nav-item" data-nav="{{data.id}}">{{data.name}}</a>
+</script>
+
+<?php bp_attachments_get_template_part( 'uploader' ); ?>
+
+<?php bp_attachments_get_template_part( 'avatars/crop' ); ?>
+
+<?php bp_attachments_get_template_part( 'avatars/camera' ); ?>
+
+<script id="tmpl-bp-avatar-delete" type="text/html">
+	<# if ( 'user' === data.object ) { #>
+		<p><?php _e( "If you'd like to delete your current profile photo but not upload a new one, please use the delete profile photo button.", 'buddypress' ); ?></p>
+		<p><a class="button edit" id="bp-delete-avatar" href="#" title="<?php esc_attr_e( 'Delete Profile Photo', 'buddypress' ); ?>"><?php esc_html_e( 'Delete My Profile Photo', 'buddypress' ); ?></a></p>
+	<# } else if ( 'group' === data.object ) { #>
+		<p><?php _e( "If you'd like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.", 'buddypress' ); ?></p>
+		<p><a class="button edit" id="bp-delete-avatar" href="#" title="<?php esc_attr_e( 'Delete Group Profile Photo', 'buddypress' ); ?>"><?php esc_html_e( 'Delete Group Profile Photo', 'buddypress' ); ?></a></p>
+	<# } else { #>
+		<?php do_action( 'bp_attachments_avatar_delete_template' ); ?>
+	<# } #>
+</script>
+
+<?php do_action( 'bp_attachments_avatar_main_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php
new file mode 100644
index 0000000000000000000000000000000000000000..79a1efee2dee095a5d56f4fd6442039a12f1773e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * BuddyPress Uploader templates
+ *
+ * This template is used to create the BuddyPress Uploader Backbone views
+ *
+ * @since 2.3
+ *
+ * @package BuddyPress
+ * @subpackage bp-attachments
+ */
+?>
+<script type="text/html" id="tmpl-upload-window">
+	<?php if ( ! _device_can_upload() ) : ?>
+		<h3 class="upload-instructions"><?php esc_html_e( 'The web browser on your device cannot be used to upload files.', 'buddypress' ); ?></h3>
+	<?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?>
+		<h3 class="upload-instructions"><?php esc_html_e( 'Upload Limit Exceeded', 'buddypress' ); ?></h3>
+	<?php else : ?>
+		<div id="{{data.container}}">
+			<div id="{{data.drop_element}}">
+				<div class="drag-drop-inside">
+					<p class="drag-drop-info"><?php esc_html_e( 'Drop your file here', 'buddypress' ); ?></p>
+					<p><?php _ex( 'or', 'Uploader: Drop your file here - or - Select your File', 'buddypress' ); ?></p>
+					<p class="drag-drop-buttons"><input id="{{data.browse_button}}" type="button" value="<?php esc_attr_e( 'Select your File', 'buddypress' ); ?>" class="button" /></p>
+				</div>
+			</div>
+		</div>
+	<?php endif; ?>
+</script>
+
+<script type="text/html" id="tmpl-progress-window">
+	<div id="{{data.id}}">
+		<div class="bp-progress">
+			<div class="bp-bar"></div>
+		</div>
+		<div class="filename">{{data.filename}}</div>
+	</div>
+</script>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php
index 09ce4e28b0f968d8c1c23f6d5d3eaeccab456e6d..ae8318382b65a7fa8abda57f1442d8fd395afdb3 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php
@@ -11,7 +11,14 @@
 
 ?>
 
-<?php do_action( 'bp_before_blogs_loop' ); ?>
+<?php
+
+/**
+ * Fires before the start of the blogs loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_blogs_loop' ); ?>
 
 <?php if ( bp_has_blogs( bp_ajax_querystring( 'blogs' ) ) ) : ?>
 
@@ -27,13 +34,20 @@
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_blogs_list' ); ?>
+	<?php
+
+	/**
+	 * Fires before the blogs directory list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_blogs_list' ); ?>
 
-	<ul id="blogs-list" class="item-list" role="main">
+	<ul id="blogs-list" class="item-list">
 
 	<?php while ( bp_blogs() ) : bp_the_blog(); ?>
 
-		<li>
+		<li <?php bp_blog_class() ?>>
 			<div class="item-avatar">
 				<a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_avatar( 'type=thumb' ); ?></a>
 			</div>
@@ -42,12 +56,26 @@
 				<div class="item-title"><a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_name(); ?></a></div>
 				<div class="item-meta"><span class="activity"><?php bp_blog_last_active(); ?></span></div>
 
-				<?php do_action( 'bp_directory_blogs_item' ); ?>
+				<?php
+
+				/**
+				 * Fires after the listing of a blog item in the blogs loop.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_directory_blogs_item' ); ?>
 			</div>
 
 			<div class="action">
 
-				<?php do_action( 'bp_directory_blogs_actions' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the blogs action listing area.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_blogs_actions' ); ?>
 
 				<div class="meta">
 
@@ -64,7 +92,14 @@
 
 	</ul>
 
-	<?php do_action( 'bp_after_directory_blogs_list' ); ?>
+	<?php
+
+	/**
+	 * Fires after the blogs directory list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_directory_blogs_list' ); ?>
 
 	<?php bp_blog_hidden_fields(); ?>
 
@@ -92,4 +127,11 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_blogs_loop' ); ?>
+<?php
+
+/**
+ * Fires after the display of the blogs loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_blogs_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php
index 8fcca78ce76e50700a8474617d34b782e71df5fa..c46632c68db87139a87b2a0ca1c991521bd7e671 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php
@@ -1,8 +1,25 @@
-<?php do_action( 'bp_before_create_blog_content_template' ); ?>
+<?php
 
-<?php do_action( 'template_notices' ); ?>
+/**
+ * Fires at the top of the blog creation template file.
+ *
+ * @since BuddyPress (1.6.0)
+ */
+do_action( 'bp_before_create_blog_content_template' ); ?>
 
-<?php do_action( 'bp_before_create_blog_content' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+do_action( 'template_notices' ); ?>
+
+<?php
+
+/**
+ * Fires before the display of the blog creation form.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_create_blog_content' ); ?>
 
 <?php if ( bp_blog_signup_enabled() ) : ?>
 
@@ -16,6 +33,20 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_create_blog_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of the blog creation form.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_create_blog_content' ); ?>
+
+<?php
 
-<?php do_action( 'bp_after_create_blog_content_template' ); ?>
\ No newline at end of file
+/**
+ * Fires at the bottom of the blog creation template file.
+ *
+ * @since BuddyPress (1.6.0)
+ */
+do_action( 'bp_after_create_blog_content_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php
index aa81ff2a2c07bae73e8aad72e59a9f2d2bedcceb..0c4a15c07ff0ccdb04561398ace7f833d8b521b5 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php
@@ -1,15 +1,46 @@
-<?php do_action( 'bp_before_directory_blogs' ); ?>
+<?php
+
+/**
+ * Fires at the top of the blogs directory template file.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+do_action( 'bp_before_directory_blogs_page' ); ?>
 
 <div id="buddypress">
-	<form action="" method="post" id="blogs-directory-form" class="dir-form">
 
-		<?php do_action( 'bp_before_directory_blogs_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the blogs
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_before_directory_blogs' ); ?>
+
+	<?php
 
-		<div id="blog-dir-search" class="dir-search" role="search">
+	/**
+	 * Fires before the display of the blogs listing content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_blogs_content' ); ?>
 
-			<?php bp_directory_blogs_search_form(); ?>
+	<div id="blog-dir-search" class="dir-search" role="search">
+		<?php bp_directory_blogs_search_form(); ?>
+	</div><!-- #blog-dir-search -->
 
-		</div><!-- #blog-dir-search -->
+	<?php
+
+	/**
+	 * Fires before the display of the blogs list tabs.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 */
+	do_action( 'bp_before_directory_blogs_tabs' ); ?>
+
+	<form action="" method="post" id="blogs-directory-form" class="dir-form">
 
 		<div class="item-list-tabs" role="navigation">
 			<ul>
@@ -21,7 +52,14 @@
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_blogs_directory_blog_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the unordered list displaying blog types.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_blogs_directory_blog_types' ); ?>
 
 			</ul>
 		</div><!-- .item-list-tabs -->
@@ -29,7 +67,14 @@
 		<div class="item-list-tabs" id="subnav" role="navigation">
 			<ul>
 
-				<?php do_action( 'bp_blogs_directory_blog_sub_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the unordered list displaying blog sub-types.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 */
+				do_action( 'bp_blogs_directory_blog_sub_types' ); ?>
 
 				<li id="blogs-order-select" class="last filter">
 
@@ -39,7 +84,14 @@
 						<option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option>
 						<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-						<?php do_action( 'bp_blogs_directory_order_options' ); ?>
+						<?php
+
+						/**
+						 * Fires inside the select input listing blogs orderby options.
+						 *
+						 * @since BuddyPress (1.2.0)
+						 */
+						do_action( 'bp_blogs_directory_order_options' ); ?>
 
 					</select>
 				</li>
@@ -52,14 +104,44 @@
 
 		</div><!-- #blogs-dir-list -->
 
-		<?php do_action( 'bp_directory_blogs_content' ); ?>
+		<?php
+
+		/**
+		 * Fires inside and displays the blogs content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_directory_blogs_content' ); ?>
 
 		<?php wp_nonce_field( 'directory_blogs', '_wpnonce-blogs-filter' ); ?>
 
-		<?php do_action( 'bp_after_directory_blogs_content' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of the blogs listing content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_after_directory_blogs_content' ); ?>
 
 	</form><!-- #blogs-directory-form -->
 
-	<?php do_action( 'bp_after_directory_blogs' ); ?>
+	<?php
+
+	/**
+	 * Fires at the bottom of the blogs directory template file.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_after_directory_blogs' ); ?>
+
+</div>
+
+<?php
 
-</div>
\ No newline at end of file
+/**
+ * Fires at the bottom of the blogs directory template file.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+do_action( 'bp_after_directory_blogs_page' );
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php
index 9d822667f296461a163b385e69da87de43e92604..b7ca247e999a01db69e0eaa3001507841d3f1fd8 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php
@@ -11,7 +11,14 @@
 
 ?>
 
-<?php do_action( 'bp_before_forums_loop' ); ?>
+<?php
+
+/**
+ * Fires at the start of the forums loop.
+ *
+ * @since BuddyPress (1.2.6)
+ */
+do_action( 'bp_before_forums_loop' ); ?>
 
 <?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?>
 
@@ -31,7 +38,14 @@
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_forums_list' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the forums list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_forums_list' ); ?>
 
 	<table class="forum">
 		<thead>
@@ -40,7 +54,14 @@
 				<th id="th-postcount"><?php _e( 'Posts', 'buddypress' ); ?></th>
 				<th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ); ?></th>
 
-				<?php do_action( 'bp_directory_forums_extra_cell_head' ); ?>
+				<?php
+
+				/**
+				 * Fires at the end of <tr> row holding the <th> tags.
+				 *
+				 * @since BuddyPress (1.2.4)
+				 */
+				do_action( 'bp_directory_forums_extra_cell_head' ); ?>
 
 			</tr>
 		</thead>
@@ -91,18 +112,39 @@
 					</p>
 				</td>
 
-				<?php do_action( 'bp_directory_forums_extra_cell' ); ?>
+				<?php
+
+				/**
+				 * Fires at the end of <tr> row holding the <td> tags.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_forums_extra_cell' ); ?>
 
 			</tr>
 
-			<?php do_action( 'bp_directory_forums_extra_row' ); ?>
+			<?php
+
+				/**
+				 * Fires after the <tr> for a forum listing display.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_forums_extra_row' ); ?>
 
 			<?php endwhile; ?>
 
 		</tbody>
 	</table>
 
-	<?php do_action( 'bp_after_directory_forums_list' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the forums list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_directory_forums_list' ); ?>
 
 	<div id="pag-bottom" class="pagination">
 
@@ -124,4 +166,11 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_forums_loop' ); ?>
+<?php
+
+/**
+ * Fires at the end of the forums loop.
+ *
+ * @since BuddyPress (1.2.6)
+ */
+do_action( 'bp_after_forums_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php
index 0f5544386ee0e039e5aa614b32ac8fa0f5623a34..0d175426e46df26661afb47b988269baf47db10a 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php
@@ -1,10 +1,24 @@
 <div id="buddypress">
-	
-	<?php do_action( 'bp_before_directory_forums' ); ?>
+
+	<?php
+
+	/**
+	 * Fires at the start of the forums template.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_before_directory_forums' ); ?>
 
 	<form action="" method="post" id="forums-search-form" class="dir-form">
 
-		<?php do_action( 'bp_before_directory_forums_content' ); ?>
+		<?php
+
+		/**
+		 * Fires before the display of the forums content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_before_directory_forums_content' ); ?>
 
 		<div id="forums-dir-search" class="dir-search" role="search">
 
@@ -13,7 +27,14 @@
 		</div>
 	</form>
 
-	<?php do_action( 'bp_before_topics' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the forum topics.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_before_topics' ); ?>
 
 	<form action="" method="post" id="forums-directory-form" class="dir-form">
 
@@ -27,7 +48,14 @@
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_forums_directory_group_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the forum group types list.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_forums_directory_group_types' ); ?>
 
 			</ul>
 		</div>
@@ -35,7 +63,14 @@
 		<div class="item-list-tabs" id="subnav" role="navigation">
 			<ul>
 
-				<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the forum group sub-types list.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 */
+				do_action( 'bp_forums_directory_group_sub_types' ); ?>
 
 				<li id="forums-order-select" class="last filter">
 
@@ -45,28 +80,56 @@
 						<option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
 						<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
 
-						<?php do_action( 'bp_forums_directory_order_options' ); ?>
+						<?php
+
+						/**
+						 * Fires inside the select input for forums order options.
+						 *
+						 * @since BuddyPress (1.2.0)
+						 */
+						do_action( 'bp_forums_directory_order_options' ); ?>
 
 					</select>
 				</li>
 			</ul>
 		</div>
 
-		<div id="forums-dir-list" class="forums dir-list" role="main">
+		<div id="forums-dir-list" class="forums dir-list">
 
 			<?php bp_get_template_part( 'forums/forums-loop' ); ?>
 
 		</div>
 
-		<?php do_action( 'bp_directory_forums_content' ); ?>
+		<?php
+
+		/**
+		 * Fires and displays the forums content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_directory_forums_content' ); ?>
 
 		<?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?>
 
 	</form>
 
-	<?php do_action( 'bp_after_directory_forums' ); ?>
+	<?php
 
-	<?php do_action( 'bp_before_new_topic_form' ); ?>
+	/**
+	 * Fires after the display of the forums.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_after_directory_forums' ); ?>
+
+	<?php
+
+	/**
+	 * Fires before the display of the new topic form.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_before_new_topic_form' ); ?>
 
 	<div id="new-topic-post">
 
@@ -76,12 +139,22 @@
 
 				<form action="" method="post" id="forum-topic-form" class="standard-form">
 
-					<?php do_action( 'groups_forum_new_topic_before' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the new topic form tag and before input display.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 */
+					do_action( 'groups_forum_new_topic_before' ); ?>
 
 					<a name="post-new"></a>
 					<h5><?php _e( 'Create New Topic:', 'buddypress' ); ?></h5>
 
-					<?php do_action( 'template_notices' ); ?>
+					<?php
+
+					/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+					do_action( 'template_notices' ); ?>
 
 					<label><?php _e( 'Title:', 'buddypress' ); ?></label>
 					<input type="text" name="topic_title" id="topic_title" value="" maxlength="100" />
@@ -109,7 +182,14 @@
 
 					</select><!-- #topic_group_id -->
 
-					<?php do_action( 'groups_forum_new_topic_after' ); ?>
+					<?php
+
+					/**
+					 * Fires before the new topic form submit actions.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 */
+					do_action( 'groups_forum_new_topic_after' ); ?>
 
 					<div class="submit">
 						<input type="submit" name="submit_topic" id="submit" value="<?php esc_attr_e( 'Post Topic', 'buddypress' ); ?>" />
@@ -124,7 +204,7 @@
 
 				<div id="message" class="info">
 
-					<p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), site_url( bp_get_groups_root_slug() . '/create/' ) ); ?></p>
+					<p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), trailingslashit( bp_get_groups_directory_permalink() . 'create' ) ); ?></p>
 
 				</div>
 
@@ -133,8 +213,22 @@
 		<?php endif; ?>
 	</div><!-- #new-topic-post -->
 
-	<?php do_action( 'bp_after_new_topic_form' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the new topic form.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_after_new_topic_form' ); ?>
+
+	<?php
+
+	/**
+	 * Fires before the display of the forums content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_directory_forums_content' ); ?>
 
-	<?php do_action( 'bp_after_directory_forums_content' ); ?>
-	
-</div>
\ No newline at end of file
+</div>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php
index 5741f1017595748dd9b6fd7b00e086bb3e906555..23deafc528e81d4437a96edbef5fddf449f3f559 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php
@@ -1,12 +1,33 @@
-<?php do_action( 'bp_before_create_group_page' ); ?>
+<?php
+
+/**
+ * Fires at the top of the groups creation template file.
+ *
+ * @since BuddyPress (1.7.0)
+ */
+do_action( 'bp_before_create_group_page' ); ?>
 
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_create_group_content_template' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of group creation content.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_before_create_group_content_template' ); ?>
 
 	<form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
 
-		<?php do_action( 'bp_before_create_group' ); ?>
+		<?php
+
+		/**
+		 * Fires before the display of group creation.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_before_create_group' ); ?>
 
 		<div class="item-list-tabs no-ajax" id="group-create-tabs" role="navigation">
 			<ul>
@@ -16,14 +37,24 @@
 			</ul>
 		</div>
 
-		<?php do_action( 'template_notices' ); ?>
+		<?php
+
+		/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+		do_action( 'template_notices' ); ?>
 
 		<div class="item-body" id="group-create-body">
 
 			<?php /* Group creation step 1: Basic group details */ ?>
 			<?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?>
 
-				<?php do_action( 'bp_before_group_details_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of the group details creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_before_group_details_creation_step' ); ?>
 
 				<div>
 					<label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
@@ -36,6 +67,12 @@
 				</div>
 
 				<?php
+
+				/**
+				 * Fires after the display of the group details creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
 				do_action( 'bp_after_group_details_creation_step' );
 				do_action( 'groups_custom_group_fields_editable' ); // @Deprecated
 
@@ -46,7 +83,14 @@
 			<?php /* Group creation step 2: Group settings */ ?>
 			<?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?>
 
-				<?php do_action( 'bp_before_group_settings_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of the group settings creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_before_group_settings_creation_step' ); ?>
 
 				<h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4>
 
@@ -60,7 +104,7 @@
 
 
 					<label>
-						<input type="radio" name="group-status" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> /> 
+						<input type="radio" name="group-status" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
 						<strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong>
 					</label>
 					<ul>
@@ -71,7 +115,7 @@
 
 
 					<label>
-						<input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> /> 
+						<input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
 						<strong><?php _e('This is a hidden group', 'buddypress' ); ?></strong>
 					</label>
 					<ul>
@@ -122,7 +166,14 @@
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_after_group_settings_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of the group settings creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_after_group_settings_creation_step' ); ?>
 
 				<?php wp_nonce_field( 'groups_create_save_group-settings' ); ?>
 
@@ -131,7 +182,14 @@
 			<?php /* Group creation step 3: Avatar Uploads */ ?>
 			<?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?>
 
-				<?php do_action( 'bp_before_group_avatar_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of the group avatar creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_before_group_avatar_creation_step' ); ?>
 
 				<?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
 
@@ -153,6 +211,14 @@
 						<p><?php _e( 'To skip the group profile photo upload process, hit the "Next Step" button.', 'buddypress' ); ?></p>
 					</div><!-- .main-column -->
 
+					<?php
+					/**
+					 * Load the Avatar UI templates
+					 *
+					 * @since  BuddyPress (2.3.0)
+					 */
+					bp_avatar_get_templates(); ?>
+
 				<?php endif; ?>
 
 				<?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
@@ -176,7 +242,14 @@
 
 				<?php endif; ?>
 
-				<?php do_action( 'bp_after_group_avatar_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of the group avatar creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_after_group_avatar_creation_step' ); ?>
 
 				<?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?>
 
@@ -185,7 +258,14 @@
 			<?php /* Group creation step 4: Invite friends to group */ ?>
 			<?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?>
 
-				<?php do_action( 'bp_before_group_invites_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of the group invites creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_before_group_invites_creation_step' ); ?>
 
 				<?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
 
@@ -208,7 +288,7 @@
 						</div>
 
 						<?php /* The ID 'friend-list' is important for AJAX support. */ ?>
-						<ul id="friend-list" class="item-list" role="main">
+						<ul id="friend-list" class="item-list">
 
 						<?php if ( bp_group_has_invites() ) : ?>
 
@@ -246,13 +326,36 @@
 
 				<?php wp_nonce_field( 'groups_create_save_group-invites' ); ?>
 
-				<?php do_action( 'bp_after_group_invites_creation_step' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of the group invites creation step.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_after_group_invites_creation_step' ); ?>
 
 			<?php endif; ?>
 
-			<?php do_action( 'groups_custom_create_steps' ); // Allow plugins to add custom group creation steps ?>
+			<?php
+
+			/**
+			 * Fires inside the group admin template.
+			 *
+			 * Allows plugins to add custom group creation steps.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'groups_custom_create_steps' ); ?>
 
-			<?php do_action( 'bp_before_group_creation_step_buttons' ); ?>
+			<?php
+
+			/**
+			 * Fires before the display of the group creation step buttons.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_before_group_creation_step_buttons' ); ?>
 
 			<?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?>
 
@@ -289,21 +392,56 @@
 
 			<?php endif;?>
 
-			<?php do_action( 'bp_after_group_creation_step_buttons' ); ?>
+			<?php
+
+			/**
+			 * Fires after the display of the group creation step buttons.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_after_group_creation_step_buttons' ); ?>
 
 			<?php /* Don't leave out this hidden field */ ?>
 			<input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" />
 
-			<?php do_action( 'bp_directory_groups_content' ); ?>
+			<?php
+
+			/**
+			 * Fires and displays the groups directory content.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_directory_groups_content' ); ?>
 
 		</div><!-- .item-body -->
 
-		<?php do_action( 'bp_after_create_group' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of group creation.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_create_group' ); ?>
 
 	</form>
 
-	<?php do_action( 'bp_after_create_group_content_template' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of group creation content.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_after_create_group_content_template' ); ?>
 
 </div>
 
-<?php do_action( 'bp_after_create_group_page' ); ?>
\ No newline at end of file
+<?php
+
+/**
+ * Fires at the bottom of the groups creation template file.
+ *
+ * @since BuddyPress (1.7.0)
+ */
+do_action( 'bp_after_create_group_page' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php
index 9302d1348dcfe0a248ede7c83e6c9ff1b4335c4d..4c8c2736e22c753937ccc09a0027afee6cc5728d 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php
@@ -11,7 +11,14 @@
 
 ?>
 
-<?php do_action( 'bp_before_groups_loop' ); ?>
+<?php
+
+/**
+ * Fires before the display of groups from the groups loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_groups_loop' ); ?>
 
 <?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) : ?>
 
@@ -31,16 +38,25 @@
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_groups_list' ); ?>
+	<?php
+
+	/**
+	 * Fires before the listing of the groups list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_groups_list' ); ?>
 
-	<ul id="groups-list" class="item-list" role="main">
+	<ul id="groups-list" class="item-list">
 
 	<?php while ( bp_groups() ) : bp_the_group(); ?>
 
 		<li <?php bp_group_class(); ?>>
-			<div class="item-avatar">
-				<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
-			</div>
+			<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
+				<div class="item-avatar">
+					<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
+				</div>
+			<?php endif; ?>
 
 			<div class="item">
 				<div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div>
@@ -48,13 +64,27 @@
 
 				<div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
 
-				<?php do_action( 'bp_directory_groups_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the listing of an individual group listing item.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_groups_item' ); ?>
 
 			</div>
 
 			<div class="action">
 
-				<?php do_action( 'bp_directory_groups_actions' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the action section of an individual group listing item.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_groups_actions' ); ?>
 
 				<div class="meta">
 
@@ -71,7 +101,14 @@
 
 	</ul>
 
-	<?php do_action( 'bp_after_directory_groups_list' ); ?>
+	<?php
+
+	/**
+	 * Fires after the listing of the groups list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_directory_groups_list' ); ?>
 
 	<div id="pag-bottom" class="pagination">
 
@@ -97,4 +134,11 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_groups_loop' ); ?>
+<?php
+
+/**
+ * Fires after the display of groups from the groups loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_groups_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php
index 8f421bbcdeb632c4520d0fb9e29585fbfd8a1037..2dbec7a9b76d8c31a2f0071447d623ba5a7b5e57 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php
@@ -1,10 +1,31 @@
-<?php do_action( 'bp_before_directory_groups_page' ); ?>
+<?php
+
+/**
+ * Fires at the top of the groups directory template file.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_before_directory_groups_page' ); ?>
 
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_directory_groups' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the groups.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_groups' ); ?>
+
+	<?php
 
-	<?php do_action( 'bp_before_directory_groups_content' ); ?>
+	/**
+	 * Fires before the display of the groups content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_groups_content' ); ?>
 
 	<div id="group-dir-search" class="dir-search" role="search">
 		<?php bp_directory_groups_search_form(); ?>
@@ -12,7 +33,10 @@
 
 	<form action="" method="post" id="groups-directory-form" class="dir-form">
 
-		<?php do_action( 'template_notices' ); ?>
+		<?php
+
+		/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+		do_action( 'template_notices' ); ?>
 
 		<div class="item-list-tabs" role="navigation">
 			<ul>
@@ -22,14 +46,28 @@
 					<li id="groups-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_groups_slug() . '/my-groups/'; ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
 				<?php endif; ?>
 
-				<?php do_action( 'bp_groups_directory_group_filter' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the groups directory group filter input.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 */
+				do_action( 'bp_groups_directory_group_filter' ); ?>
 
 			</ul>
 		</div><!-- .item-list-tabs -->
 
 		<div class="item-list-tabs" id="subnav" role="navigation">
 			<ul>
-				<?php do_action( 'bp_groups_directory_group_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the groups directory group types.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_groups_directory_group_types' ); ?>
 
 				<li id="groups-order-select" class="last filter">
 
@@ -41,7 +79,14 @@
 						<option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
 						<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-						<?php do_action( 'bp_groups_directory_order_options' ); ?>
+						<?php
+
+						/**
+						 * Fires inside the groups directory group order options.
+						 *
+						 * @since BuddyPress (1.2.0)
+						 */
+						do_action( 'bp_groups_directory_order_options' ); ?>
 					</select>
 				</li>
 			</ul>
@@ -51,16 +96,44 @@
 			<?php bp_get_template_part( 'groups/groups-loop' ); ?>
 		</div><!-- #groups-dir-list -->
 
-		<?php do_action( 'bp_directory_groups_content' ); ?>
+		<?php
+
+		/**
+ 		 * Fires and displays the group content.
+ 		 *
+ 		 * @since BuddyPress (1.1.0)
+ 		 */
+		do_action( 'bp_directory_groups_content' ); ?>
 
 		<?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?>
 
-		<?php do_action( 'bp_after_directory_groups_content' ); ?>
+		<?php
+
+		/**
+ 		 * Fires after the display of the groups content.
+ 		 *
+ 		 * @since BuddyPress (1.1.0)
+ 		 */
+		do_action( 'bp_after_directory_groups_content' ); ?>
 
 	</form><!-- #groups-directory-form -->
 
-	<?php do_action( 'bp_after_directory_groups' ); ?>
+	<?php
+
+	/**
+ 	 * Fires after the display of the groups.
+ 	 *
+ 	 * @since BuddyPress (1.1.0)
+ 	 */
+	do_action( 'bp_after_directory_groups' ); ?>
 
 </div><!-- #buddypress -->
 
-<?php do_action( 'bp_after_directory_groups_page' ); ?>
\ No newline at end of file
+<?php
+
+/**
+ * Fires at the bottom of the groups directory template file.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_after_directory_groups_page' );
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php
index e810cefc7631bbeec0f954469e6a484c19771e09..4c24fd29a4af908c1952a751f1caf98fcfa0bf82 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php
@@ -2,7 +2,14 @@
 	<ul>
 		<li class="feed"><a href="<?php bp_group_activity_feed_link(); ?>" title="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
 
-		<?php do_action( 'bp_group_activity_syndication_options' ); ?>
+		<?php
+
+		/**
+		 * Fires inside the syndication options list, after the RSS option.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_group_activity_syndication_options' ); ?>
 
 		<li id="activity-filter-select" class="last">
 			<label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
@@ -11,13 +18,27 @@
 
 				<?php bp_activity_show_filters( 'group' ); ?>
 
-				<?php do_action( 'bp_group_activity_filter_options' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the select input for group activity filter options.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_group_activity_filter_options' ); ?>
 			</select>
 		</li>
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php do_action( 'bp_before_group_activity_post_form' ); ?>
+<?php
+
+/**
+ * Fires before the display of the group activity post form.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_group_activity_post_form' ); ?>
 
 <?php if ( is_user_logged_in() && bp_group_is_member() ) : ?>
 
@@ -25,13 +46,34 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_activity_post_form' ); ?>
-<?php do_action( 'bp_before_group_activity_content' ); ?>
+<?php
 
-<div class="activity single-group" role="main">
+/**
+ * Fires after the display of the group activity post form.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_group_activity_post_form' ); ?>
+<?php
+
+/**
+ * Fires before the display of the group activities list.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_group_activity_content' ); ?>
+
+<div class="activity single-group">
 
 	<?php bp_get_template_part( 'activity/activity-loop' ); ?>
 
 </div><!-- .activity.single-group -->
 
-<?php do_action( 'bp_after_group_activity_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of the group activities list.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_group_activity_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php
index 67d5148755e7e32f6fd922b82e47c7862842c0a7..1473801c1197c2c6b0fb9b089aa6ae6a3c27169f 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php
@@ -4,14 +4,28 @@
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data" role="main">
+<form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data">
 
-<?php do_action( 'bp_before_group_admin_content' ); ?>
+<?php
+
+/**
+ * Fires inside the group admin form and before the content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_group_admin_content' ); ?>
 
 <?php /* Edit Group Details */ ?>
 <?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?>
 
-	<?php do_action( 'bp_before_group_details_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of group admin details.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_details_admin' ); ?>
 
 	<label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
 	<input type="text" name="group-name" id="group-name" value="<?php bp_group_name(); ?>" aria-required="true" />
@@ -19,15 +33,29 @@
 	<label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
 	<textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable(); ?></textarea>
 
-	<?php do_action( 'groups_custom_group_fields_editable' ); ?>
+	<?php
+
+	/**
+	 * Fires after the group description admin details.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
+	do_action( 'groups_custom_group_fields_editable' ); ?>
 
 	<p>
-		<label for="group-notifiy-members">
+		<label for="group-notify-members">
 			<input type="checkbox" name="group-notify-members" value="1" /> <?php _e( 'Notify group members of these changes via email', 'buddypress' ); ?>
 		</label>
 	</p>
 
-	<?php do_action( 'bp_after_group_details_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of group admin details.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_details_admin' ); ?>
 
 	<p><input type="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
 	<?php wp_nonce_field( 'groups_edit_group_details' ); ?>
@@ -37,7 +65,14 @@
 <?php /* Manage Group Settings */ ?>
 <?php if ( bp_is_group_admin_screen( 'group-settings' ) ) : ?>
 
-	<?php do_action( 'bp_before_group_settings_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires before the group settings admin display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_settings_admin' ); ?>
 
 	<?php if ( bp_is_active( 'forums' ) ) : ?>
 
@@ -112,7 +147,14 @@
 
 	<hr />
 
-	<?php do_action( 'bp_after_group_settings_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires after the group settings admin display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_settings_admin' ); ?>
 
 	<p><input type="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
 	<?php wp_nonce_field( 'groups_edit_group_settings' ); ?>
@@ -140,6 +182,14 @@
 
 			<?php endif; ?>
 
+			<?php
+			/**
+			 * Load the Avatar UI templates
+			 *
+			 * @since  BuddyPress (2.3.0)
+			 */
+			bp_avatar_get_templates(); ?>
+
 			<?php wp_nonce_field( 'bp_avatar_upload' ); ?>
 
 	<?php endif; ?>
@@ -171,7 +221,14 @@
 <?php /* Manage Group Members */ ?>
 <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?>
 
-	<?php do_action( 'bp_before_group_manage_members_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires before the group manage members admin display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_manage_members_admin' ); ?>
 
 	<div class="bp-widget">
 		<h4><?php _e( 'Administrators', 'buddypress' ); ?></h4>
@@ -230,7 +287,7 @@
 	<div class="bp-widget">
 		<h4><?php _e("Members", "buddypress"); ?></h4>
 
-		<?php if ( bp_group_has_members( 'per_page=15&exclude_banned=false' ) ) : ?>
+		<?php if ( bp_group_has_members( 'per_page=15&exclude_banned=0' ) ) : ?>
 
 			<?php if ( bp_group_member_needs_pagination() ) : ?>
 
@@ -275,7 +332,14 @@
 
 								<a href="<?php bp_group_member_remove_link(); ?>" class="button confirm" title="<?php esc_attr_e( 'Remove this member', 'buddypress' ); ?>"><?php _e( 'Remove from group', 'buddypress' ); ?></a>
 
-								<?php do_action( 'bp_group_manage_members_admin_item' ); ?>
+								<?php
+
+								/**
+								 * Fires inside the display of a member admin item in group management area.
+								 *
+								 * @since BuddyPress (1.1.0)
+								 */
+								do_action( 'bp_group_manage_members_admin_item' ); ?>
 
 							</span>
 						</h5>
@@ -294,14 +358,28 @@
 
 	</div>
 
-	<?php do_action( 'bp_after_group_manage_members_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires after the group manage members admin display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_manage_members_admin' ); ?>
 
 <?php endif; ?>
 
 <?php /* Manage Membership Requests */ ?>
 <?php if ( bp_is_group_admin_screen( 'membership-requests' ) ) : ?>
 
-	<?php do_action( 'bp_before_group_membership_requests_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of group membership requests admin.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_membership_requests_admin' ); ?>
 
 		<div class="requests">
 
@@ -309,16 +387,39 @@
 
 		</div>
 
-	<?php do_action( 'bp_after_group_membership_requests_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of group membership requests admin.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_membership_requests_admin' ); ?>
 
 <?php endif; ?>
 
-<?php do_action( 'groups_custom_edit_steps' ) // Allow plugins to add custom group edit screens ?>
+<?php
+
+/**
+ * Fires inside the group admin template.
+ *
+ * Allows plugins to add custom group edit screens.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'groups_custom_edit_steps' ); ?>
 
 <?php /* Delete Group Option */ ?>
 <?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?>
 
-	<?php do_action( 'bp_before_group_delete_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of group delete admin.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_delete_admin' ); ?>
 
 	<div id="message" class="info">
 		<p><?php _e( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p>
@@ -326,7 +427,14 @@
 
 	<label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'buddypress' ); ?></label>
 
-	<?php do_action( 'bp_after_group_delete_admin' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of group delete admin.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_delete_admin' ); ?>
 
 	<div class="submit">
 		<input type="submit" disabled="disabled" value="<?php esc_attr_e( 'Delete Group', 'buddypress' ); ?>" id="delete-group-button" name="delete-group-button" />
@@ -339,7 +447,14 @@
 <?php /* This is important, don't forget it */ ?>
 	<input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" />
 
-<?php do_action( 'bp_after_group_admin_content' ); ?>
+<?php
+
+/**
+ * Fires inside the group admin form and after the content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_group_admin_content' ); ?>
 
 </form><!-- #group-settings-form -->
 
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php
index f636732f393edad5f5179885f6c1f8bcbd2c368b..2557de1f55bd6823152c9a6a6f2466ead54ea4c9 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php
@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * Fires before the display of a group's forum content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
 do_action( 'bp_before_group_forum_content' );
 
 if ( bp_is_group_forum_topic_edit() ) :
@@ -29,7 +34,10 @@ else : ?>
 
 			<?php endif; ?>
 
-			<?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
+			<?php
+
+			/** This filter is documented in bp-templates/bp-legacy/buddypress/forums/index.php. */
+			do_action( 'bp_forums_directory_group_sub_types' ); ?>
 
 			<li id="forums-order-select" class="last filter">
 
@@ -39,14 +47,17 @@ else : ?>
 					<option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
 					<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
 
-					<?php do_action( 'bp_forums_directory_order_options' ); ?>
+					<?php
+
+					/** This filter is documented in bp-templates/bp-legacy/buddypress/forums/index.php. */
+					do_action( 'bp_forums_directory_order_options' ); ?>
 
 				</select>
 			</li>
 		</ul>
 	</div>
 
-	<div class="forums single-forum" role="main">
+	<div class="forums single-forum">
 
 		<?php bp_get_template_part( 'forums/forums-loop' ) ?>
 
@@ -54,7 +65,14 @@ else : ?>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_forum_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of a group's forum content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_group_forum_content' ); ?>
 
 <?php if ( !bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() ) : ?>
 
@@ -63,7 +81,14 @@ else : ?>
 		<form action="" method="post" id="forum-topic-form" class="standard-form">
 			<div id="new-topic-post">
 
-				<?php do_action( 'bp_before_group_forum_post_new' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of a group forum new post form.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_before_group_forum_post_new' ); ?>
 
 				<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
 					<p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ); ?></p>
@@ -81,7 +106,14 @@ else : ?>
 				<label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
 				<input type="text" name="topic_tags" id="topic_tags" value="" />
 
-				<?php do_action( 'bp_after_group_forum_post_new' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of a group forum new post form.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_after_group_forum_post_new' ); ?>
 
 				<div class="submit">
 					<input type="submit" name="submit_topic" id="submit" value="<?php esc_attr_e( 'Post Topic', 'buddypress' ); ?>" />
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php
index 1849a87052dccc89638cb06244ee4ffa24a5ea88..1f379c996d808fec20d9e83cb8a89fb6745bb7ce 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_group_forum_edit_form' ); ?>
+<?php
+
+/**
+ * Fires at the top of the group forum edit form.
+ *
+ * @since BuddyPress (1.2.4)
+ */
+do_action( 'bp_before_group_forum_edit_form' ); ?>
 
 <?php if ( bp_has_forum_topic_posts() ) : ?>
 
@@ -34,7 +41,14 @@
 
 			<?php endif; ?>
 
-			<?php do_action( 'bp_group_forum_topic_meta' ); ?>
+			<?php
+
+			/**
+			 * Fires at the end of the group forum topic meta section.
+			 *
+			 * @since BuddyPress (1.2.5)
+			 */
+			do_action( 'bp_group_forum_topic_meta' ); ?>
 
 		</div>
 
@@ -42,7 +56,14 @@
 
 			<div id="edit-topic">
 
-				<?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
+				<?php
+
+				/**
+				 * Fires before the group forum topic form fields.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_group_before_edit_forum_topic' ); ?>
 
 				<label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label>
 				<input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" maxlength="100" />
@@ -53,7 +74,14 @@
 				<label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
 				<input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list(); ?>" />
 
-				<?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
+				<?php
+
+				/**
+				 * Fires after the group forum topic form fields.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_group_after_edit_forum_topic' ); ?>
 
 				<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" /></p>
 
@@ -65,11 +93,25 @@
 
 			<div id="edit-post">
 
-				<?php do_action( 'bp_group_before_edit_forum_post' ); ?>
+				<?php
+
+				/**
+				 * Fires before the group edit forum textarea.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_group_before_edit_forum_post' ); ?>
 
 				<textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
 
-				<?php do_action( 'bp_group_after_edit_forum_post' ); ?>
+				<?php
+
+				/**
+				 * Fires after the group edit forum textarea.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_group_after_edit_forum_post' ); ?>
 
 				<p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" /></p>
 
@@ -89,4 +131,11 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_group_forum_edit_form' ); ?>
+<?php
+
+/**
+ * Fires at the end of the group forum edit form.
+ *
+ * @since BuddyPress (1.2.4)
+ */
+do_action( 'bp_after_group_forum_edit_form' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php
index 50494d575e998c786913c4717858a14947f5db4c..4f048098739aaeee00a1dce8937ec31044487da2 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php
@@ -1,52 +1,66 @@
-<?php do_action( 'bp_before_group_forum_topic' ); ?>
+<?php
+
+/**
+ * Fires at the top of the group forum topic template.
+ *
+ * @since BuddyPress (1.2.4)
+ */
+do_action( 'bp_before_group_forum_topic' ); ?>
 
 <form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
 	<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
 		<ul>
 			<?php if ( is_user_logged_in() ) : ?>
-	
+
 				<li>
 					<a href="<?php bp_forum_topic_new_reply_link(); ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ); ?></a>
 				</li>
-	
+
 			<?php endif; ?>
-	
+
 			<?php if ( bp_forums_has_directory() ) : ?>
-	
+
 				<li>
 					<a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a>
 				</li>
-	
+
 			<?php endif; ?>
-	
+
 		</ul>
 	</div>
-	
+
 	<div id="topic-meta">
 		<h3><?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
-	
+
 		<?php if ( bp_forum_topic_has_tags() ) : ?>
-	
+
 			<div class="topic-tags">
-	
+
 				<?php _e( 'Topic tags:', 'buddypress' ); ?> <?php bp_forum_topic_tag_list(); ?>
-	
+
 			</div>
-	
+
 		<?php endif; ?>
-	
+
 		<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
-	
+
 			<div class="last admin-links">
-	
+
 				<?php bp_the_topic_admin_links(); ?>
-	
+
 			</div>
-	
+
 		<?php endif; ?>
-	
-		<?php do_action( 'bp_group_forum_topic_meta' ); ?>
-	
+
+		<?php
+
+		/**
+		 * Fires at the end of the group forum topic meta markup.
+		 *
+		 * @since BuddyPress (1.2.5)
+		 */
+		do_action( 'bp_group_forum_topic_meta' ); ?>
+
 	</div>
 
 
@@ -68,9 +82,16 @@
 
 		</div>
 
-		<?php do_action( 'bp_before_group_forum_topic_posts' ); ?>
+		<?php
+
+		/**
+		 * Fires before the listing of the group forum topic posts.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 */
+		do_action( 'bp_before_group_forum_topic_posts' ); ?>
 
-		<ul id="topic-post-list" class="item-list" role="main">
+		<ul id="topic-post-list" class="item-list">
 			<?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
 
 				<li id="post-<?php bp_the_topic_post_id(); ?>" class="<?php bp_the_topic_post_css_class(); ?>">
@@ -90,7 +111,14 @@
 							<?php bp_the_topic_post_admin_links(); ?>
 						<?php endif; ?>
 
-						<?php do_action( 'bp_group_forum_post_meta' ); ?>
+						<?php
+
+						/**
+						 * Fires inside the group forum post meta markup.
+						 *
+						 * @since BuddyPress (1.2.5)
+						 */
+						do_action( 'bp_group_forum_post_meta' ); ?>
 
 						<a href="#post-<?php bp_the_topic_post_id(); ?>" title="<?php esc_attr_e( 'Permanent link to this post', 'buddypress' ); ?>">#</a>
 					</div>
@@ -99,7 +127,14 @@
 			<?php endwhile; ?>
 		</ul><!-- #topic-post-list -->
 
-		<?php do_action( 'bp_after_group_forum_topic_posts' ); ?>
+		<?php
+
+		/**
+		 * Fires before the listing of the group forum topic posts.
+		 *
+		 * @since BuddyPress (1.2.4)
+		 */
+		do_action( 'bp_after_group_forum_topic_posts' ); ?>
 
 		<div class="pagination no-ajax">
 
@@ -114,11 +149,11 @@
 		</div>
 
 	<?php else: ?>
-	
+
 		<div id="message" class="info">
 			<p><?php _e( 'There are no posts for this topic.', 'buddypress' ); ?></p>
 		</div>
-	
+
 	<?php endif;?>
 
 	<?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
@@ -134,7 +169,14 @@
 						<p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ); ?></p>
 					<?php endif; ?>
 
-					<?php do_action( 'groups_forum_new_reply_before' ); ?>
+					<?php
+
+					/**
+					 * Fires before the display of the group forum new reply section.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 */
+					do_action( 'groups_forum_new_reply_before' ); ?>
 
 					<h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4>
 
@@ -144,7 +186,14 @@
 						<input type="submit" name="submit_reply" id="submit" value="<?php esc_attr_e( 'Post Reply', 'buddypress' ); ?>" />
 					</div>
 
-					<?php do_action( 'groups_forum_new_reply_after' ); ?>
+					<?php
+
+					/**
+					 * Fires after the display of the group forum new reply section.
+					 *
+					 * @since BuddyPress (1.0.0)
+					 */
+					do_action( 'groups_forum_new_reply_after' ); ?>
 
 					<?php wp_nonce_field( 'bp_forums_new_reply' ); ?>
 				</div>
@@ -163,4 +212,11 @@
 
 </form><!-- #forum-topic-form -->
 
-<?php do_action( 'bp_after_group_forum_topic' ); ?>
+<?php
+
+/**
+ * Fires at the end of the group forum topic template.
+ *
+ * @since BuddyPress (1.2.4)
+ */
+do_action( 'bp_after_group_forum_topic' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php
index 9954be3c0d1e3659c3fc2dde18f13754f7fcab81..513a9e376ff58d7af69de964b94ae9a90f2bfccd 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php
@@ -1,5 +1,10 @@
 <?php
 
+/**
+ * Fires before the display of a group's header.
+ *
+ * @since BuddyPress (1.2.0)
+ */
 do_action( 'bp_before_group_header' );
 
 ?>
@@ -12,15 +17,31 @@ do_action( 'bp_before_group_header' );
 
 		<?php bp_group_list_admins();
 
+		/**
+		 * Fires after the display of the group's administrators.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
 		do_action( 'bp_after_group_menu_admins' );
 
 		if ( bp_group_has_moderators() ) :
+
+			/**
+			 * Fires before the display of the group's moderators, if there are any.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'bp_before_group_menu_mods' ); ?>
 
 			<h3><?php _e( 'Group Mods' , 'buddypress' ); ?></h3>
 
 			<?php bp_group_list_mods();
 
+			/**
+			 * Fires after the display of the group's moderators, if there are any.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'bp_after_group_menu_mods' );
 
 		endif;
@@ -29,19 +50,28 @@ do_action( 'bp_before_group_header' );
 
 </div><!-- #item-actions -->
 
-<div id="item-header-avatar">
-	<a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
+<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
+	<div id="item-header-avatar">
+		<a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
 
-		<?php bp_group_avatar(); ?>
+			<?php bp_group_avatar(); ?>
 
-	</a>
-</div><!-- #item-header-avatar -->
+		</a>
+	</div><!-- #item-header-avatar -->
+<?php endif; ?>
 
 <div id="item-header-content">
 	<span class="highlight"><?php bp_group_type(); ?></span>
 	<span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
 
-	<?php do_action( 'bp_before_group_header_meta' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the group's header meta.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_group_header_meta' ); ?>
 
 	<div id="item-meta">
 
@@ -49,16 +79,38 @@ do_action( 'bp_before_group_header' );
 
 		<div id="item-buttons">
 
-			<?php do_action( 'bp_group_header_actions' ); ?>
+			<?php
+
+			/**
+			 * Fires in the group header actions section.
+			 *
+			 * @since BuddyPress (1.2.6)
+			 */
+			do_action( 'bp_group_header_actions' ); ?>
 
 		</div><!-- #item-buttons -->
 
-		<?php do_action( 'bp_group_header_meta' ); ?>
+		<?php
+
+		/**
+		 * Fires after the group header actions section.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_group_header_meta' ); ?>
 
 	</div>
 </div><!-- #item-header-content -->
 
 <?php
+
+/**
+ * Fires after the display of a group's header.
+ *
+ * @since BuddyPress (1.2.0)
+ */
 do_action( 'bp_after_group_header' );
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
 do_action( 'template_notices' );
-?>
\ No newline at end of file
+?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php
index f22e339046526e2d22bb2c1d52f64596e6839e39..6e2727c847282bde275d71884799cc9fcdf7da72 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php
@@ -2,7 +2,14 @@
 
 	<?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
 
-	<?php do_action( 'bp_before_group_home_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the group home content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_group_home_content' ); ?>
 
 	<div id="item-header" role="complementary">
 
@@ -16,7 +23,14 @@
 
 				<?php bp_get_options_nav(); ?>
 
-				<?php do_action( 'bp_group_options_nav' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of group options navigation.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_group_options_nav' ); ?>
 
 			</ul>
 		</div>
@@ -24,7 +38,14 @@
 
 	<div id="item-body">
 
-		<?php do_action( 'bp_before_group_body' );
+		<?php
+
+		/**
+		 * Fires before the display of the group home body.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_before_group_body' );
 
 		/**
 		 * Does this next bit look familiar? If not, go check out WordPress's
@@ -52,13 +73,25 @@
 
 				} else {
 
+					/**
+					 * Fires before the display of the group status message.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
 					do_action( 'bp_before_group_status_message' ); ?>
 
 					<div id="message" class="info">
 						<p><?php bp_group_status_message(); ?></p>
 					</div>
 
-					<?php do_action( 'bp_after_group_status_message' );
+					<?php
+
+					/**
+					 * Fires after the display of the group status message.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_after_group_status_message' );
 
 				}
 
@@ -90,11 +123,23 @@
 
 			endif;
 
+		/**
+		 * Fires after the display of the group home body.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_after_group_body' ); ?>
 
 	</div><!-- #item-body -->
 
-	<?php do_action( 'bp_after_group_home_content' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the group home content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_group_home_content' ); ?>
 
 	<?php endwhile; endif; ?>
 
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php
index ffc11644280d042e4b2cefcca3fcaafeaf8e1151..c37922aa55add95f9923a056a8cc6751e246ce70 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php
@@ -1,3 +1,4 @@
+
 <div class="left-menu">
 
 	<div id="invite-list">
@@ -14,7 +15,14 @@
 
 <div class="main-column">
 
-	<?php do_action( 'bp_before_group_send_invites_list' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the group send invites list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_send_invites_list' ); ?>
 
 	<?php if ( bp_group_has_invites( bp_ajax_querystring( 'invite' ) . '&per_page=10' ) ) : ?>
 
@@ -45,12 +53,26 @@
 				<h4><?php bp_group_invite_user_link(); ?></h4>
 				<span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
 
-				<?php do_action( 'bp_group_send_invites_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the invite item listing.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_group_send_invites_item' ); ?>
 
 				<div class="action">
 					<a class="button remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a>
 
-					<?php do_action( 'bp_group_send_invites_item_action' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the action area for a send invites item.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_group_send_invites_item_action' ); ?>
 				</div>
 			</li>
 
@@ -75,19 +97,20 @@
 		</div>
 
 	<?php else : ?>
+
 		<div id="message" class="info">
-			<p><?php _e( 'Select people to invite from your friends list.', 'buddypress' ); ?></p>
+			<p><?php _e( 'Select friends to invite.', 'buddypress' ); ?></p>
 		</div>
-	<?php endif; ?>
-
-<?php do_action( 'bp_after_group_send_invites_list' ); ?>
 
-</div><!-- .main-column -->
+	<?php endif; ?>
 
-<div class="clear"></div>
+<?php
 
-<div class="submit">
-	<input type="submit" name="submit" id="submit" value="<?php esc_attr_e( 'Send Invites', 'buddypress' ); ?>" />
-</div>
+/**
+ * Fires after the display of the group send invites list.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_group_send_invites_list' ); ?>
 
-<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
+</div><!-- .main-column -->
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php
index f1714a5ae24a842fb7c7f6a51743ef8ce907f63e..0f7b6621b0fe1b1d37b6b1542d9d66459fa8215b 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php
@@ -1,6 +1,13 @@
 <?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) ) ) : ?>
 
-	<?php do_action( 'bp_before_group_members_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the group members content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_members_content' ); ?>
 
 	<div id="pag-top" class="pagination">
 
@@ -18,9 +25,16 @@
 
 	</div>
 
-	<?php do_action( 'bp_before_group_members_list' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the group members list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_group_members_list' ); ?>
 
-	<ul id="member-list" class="item-list" role="main">
+	<ul id="member-list" class="item-list">
 
 		<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
 
@@ -34,7 +48,14 @@
 				<h5><?php bp_group_member_link(); ?></h5>
 				<span class="activity"><?php bp_group_member_joined_since(); ?></span>
 
-				<?php do_action( 'bp_group_members_list_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the listing of an individual group member listing item.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_group_members_list_item' ); ?>
 
 				<?php if ( bp_is_active( 'friends' ) ) : ?>
 
@@ -42,7 +63,14 @@
 
 						<?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ); ?>
 
-						<?php do_action( 'bp_group_members_list_item_action' ); ?>
+						<?php
+
+						/**
+						 * Fires inside the action section of an individual group member listing item.
+						 *
+						 * @since BuddyPress (1.1.0)
+						 */
+						do_action( 'bp_group_members_list_item_action' ); ?>
 
 					</div>
 
@@ -53,7 +81,14 @@
 
 	</ul>
 
-	<?php do_action( 'bp_after_group_members_list' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the group members list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_members_list' ); ?>
 
 	<div id="pag-bottom" class="pagination">
 
@@ -71,12 +106,19 @@
 
 	</div>
 
-	<?php do_action( 'bp_after_group_members_content' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the group members content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_group_members_content' ); ?>
 
 <?php else: ?>
 
 	<div id="message" class="info">
-		<p><?php _e( 'This group has no members.', 'buddypress' ); ?></p>
+		<p><?php _e( 'No members were found.', 'buddypress' ); ?></p>
 	</div>
 
 <?php endif; ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php
index c9d34f83d8be3aeeaecaf2fe6b8c59b56d1b58df..25647ee0d16d3e97cadf6b004852e4aba9b3b6a5 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php
@@ -1,5 +1,26 @@
-<?php do_action( 'bp_before_group_plugin_template' ); ?>
+<?php
 
-<?php do_action( 'bp_template_content' ); ?>
+/**
+ * Fires before the display of content for plugins using the BP_Group_Extension.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_group_plugin_template' ); ?>
 
-<?php do_action( 'bp_after_group_plugin_template' );
+<?php
+
+/**
+ * Fires and displays content for plugins using the BP_Group_Extension.
+ *
+ * @since BuddyPress (1.0.0)
+ */
+do_action( 'bp_template_content' ); ?>
+
+<?php
+
+/**
+ * Fires after the display of content for plugins using the BP_Group_Extension.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_group_plugin_template' );
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php
index 6af798b21100510beced0a56e2b0da9f31b54b78..de1b1c5ed5401cdaaf38616b343b2879ed1ea977 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_group_request_membership_content' ); ?>
+<?php
+
+/**
+ * Fires before the display of the group membership request form.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_group_request_membership_content' ); ?>
 
 <?php if ( !bp_group_has_requested_membership() ) : ?>
 	<p><?php printf( __( "You are requesting to become a member of the group '%s'.", "buddypress" ), bp_get_group_name( false ) ); ?></p>
@@ -7,7 +14,14 @@
 		<label for="group-request-membership-comments"><?php _e( 'Comments (optional)', 'buddypress' ); ?></label>
 		<textarea name="group-request-membership-comments" id="group-request-membership-comments"></textarea>
 
-		<?php do_action( 'bp_group_request_membership_content' ); ?>
+		<?php
+
+		/**
+		 * Fires after the textarea for the group membership request form.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_group_request_membership_content' ); ?>
 
 		<p><input type="submit" name="group-request-send" id="group-request-send" value="<?php esc_attr_e( 'Send Request', 'buddypress' ); ?>" />
 
@@ -15,4 +29,11 @@
 	</form><!-- #request-membership-form -->
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_request_membership_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of the group membership request form.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_group_request_membership_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php
index 0148cbb27104be7919f16ff17b100bb353bb36ac..51a5c37ef7d3a205f487d3fc062852546cefbe8a 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php
@@ -24,7 +24,14 @@
 				<h4><?php bp_group_request_user_link(); ?> <span class="comments"><?php bp_group_request_comment(); ?></span></h4>
 				<span class="activity"><?php bp_group_request_time_since_requested(); ?></span>
 
-				<?php do_action( 'bp_group_membership_requests_admin_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the groups membership request list loop.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_group_membership_requests_admin_item' ); ?>
 
 				<div class="action">
 
@@ -32,7 +39,14 @@
 
 					<?php bp_button( array( 'id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __( 'Reject', 'buddypress' ), 'link_text' => __( 'Reject', 'buddypress' ) ) ); ?>
 
-					<?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the list of membership request actions.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
 
 				</div>
 			</li>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php
index 6f3d9ef60899bb13ad24e1b149ffab0db72a3213..657c12d8a0e6a23b9dd1bfaac5c3c216724ace14 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php
@@ -1,21 +1,58 @@
-<?php do_action( 'bp_before_group_send_invites_content' ); ?>
+<?php
 
-<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
+/**
+ * Fires before the send invites content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_group_send_invites_content' ); ?>
+
+<?php
+/* Does the user have friends that could be invited to the group? */
+if ( bp_get_new_group_invite_friend_list() ) : ?>
 
 	<?php /* 'send-invite-form' is important for AJAX support */ ?>
-	<form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form" role="main">
+	<form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form">
 
 		<div class="invite">
-
 			<?php bp_get_template_part( 'groups/single/invites-loop' ); ?>
+		</div>
 
+		<div class="submit">
+			<input type="submit" name="submit" id="submit" value="<?php esc_attr_e( 'Send Invites', 'buddypress' ); ?>" />
 		</div>
 
+		<?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
+
 		<?php /* This is important, don't forget it */ ?>
 		<input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id(); ?>" />
 
 	</form><!-- #send-invite-form -->
 
+<?php
+/* No eligible friends? Maybe the user doesn't have any friends yet. */
+elseif ( 0 == bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
+
+	<div id="message" class="info">
+		<p class="notice"><?php _e( 'Group invitations can only be extended to friends.', 'buddypress' ); ?></p>
+		<p class="message-body"><?php _e( "Once you've made some friendships, you'll be able to invite those members to this group.", 'buddypress' ); ?></p>
+	</div>
+
+<?php
+/* The user does have friends, but none are eligible to be invited to this group. */
+else : ?>
+
+	<div id="message" class="info">
+		<p class="notice"><?php _e( 'All of your friends already belong to this group.', 'buddypress' ); ?></p>
+	</div>
+
 <?php endif; ?>
 
-<?php do_action( 'bp_after_group_send_invites_content' ); ?>
+<?php
+
+/**
+ * Fires after the send invites content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_group_send_invites_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php
index 859a26c779e75cfea4567391dda61ee855f2677f..66bac67fadec63177fb0761bbff1642115574fff 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php
@@ -1,12 +1,29 @@
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_activation_page' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the member activation page.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_activation_page' ); ?>
 
 	<div class="page" id="activate-page">
 
-		<?php do_action( 'template_notices' ); ?>
+		<?php
+
+		/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+		do_action( 'template_notices' ); ?>
+
+		<?php
 
-		<?php do_action( 'bp_before_activate_content' ); ?>
+		/**
+		 * Fires before the display of the member activation page content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_before_activate_content' ); ?>
 
 		<?php if ( bp_account_was_activated() ) : ?>
 
@@ -33,10 +50,24 @@
 
 		<?php endif; ?>
 
-		<?php do_action( 'bp_after_activate_content' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of the member activation page content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_after_activate_content' ); ?>
 
 	</div><!-- .page -->
 
-	<?php do_action( 'bp_after_activation_page' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the member activation page.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_activation_page' ); ?>
 
-</div><!-- #buddypress -->
\ No newline at end of file
+</div><!-- #buddypress -->
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php
index eef885794f387d59205565efe87e4c228ff27cbd..6dc173be563772c3d28f933ec983f119828683ff 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php
@@ -1,16 +1,44 @@
-<?php do_action( 'bp_before_directory_members_page' ); ?>
+<?php
+
+/**
+ * Fires at the top of the members directory template file.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_before_directory_members_page' ); ?>
 
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_directory_members' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the members.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_members' ); ?>
+
+	<?php
 
-	<?php do_action( 'bp_before_directory_members_content' ); ?>
+	/**
+	 * Fires before the display of the members content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_members_content' ); ?>
 
 	<div id="members-dir-search" class="dir-search" role="search">
 		<?php bp_directory_members_search_form(); ?>
 	</div><!-- #members-dir-search -->
 
-	<?php do_action( 'bp_before_directory_members_tabs' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the members list tabs.
+	 *
+	 * @since BuddyPress (1.8.0)
+	 */
+	do_action( 'bp_before_directory_members_tabs' ); ?>
 
 	<form action="" method="post" id="members-directory-form" class="dir-form">
 
@@ -22,14 +50,28 @@
 					<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
 				<?php endif; ?>
 
-				<?php do_action( 'bp_members_directory_member_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the members directory member types.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_members_directory_member_types' ); ?>
 
 			</ul>
 		</div><!-- .item-list-tabs -->
 
 		<div class="item-list-tabs" id="subnav" role="navigation">
 			<ul>
-				<?php do_action( 'bp_members_directory_member_sub_types' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the members directory member sub-types.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 */
+				do_action( 'bp_members_directory_member_sub_types' ); ?>
 
 				<li id="members-order-select" class="last filter">
 					<label for="members-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
@@ -41,7 +83,14 @@
 							<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 						<?php endif; ?>
 
-						<?php do_action( 'bp_members_directory_order_options' ); ?>
+						<?php
+
+						/**
+						 * Fires inside the members directory member order options.
+						 *
+						 * @since BuddyPress (1.2.0)
+						 */
+						do_action( 'bp_members_directory_order_options' ); ?>
 					</select>
 				</li>
 			</ul>
@@ -51,16 +100,44 @@
 			<?php bp_get_template_part( 'members/members-loop' ); ?>
 		</div><!-- #members-dir-list -->
 
-		<?php do_action( 'bp_directory_members_content' ); ?>
+		<?php
+
+		/**
+ 		 * Fires and displays the members content.
+ 		 *
+ 		 * @since BuddyPress (1.1.0)
+ 		 */
+		do_action( 'bp_directory_members_content' ); ?>
 
 		<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
 
-		<?php do_action( 'bp_after_directory_members_content' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of the members content.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_after_directory_members_content' ); ?>
 
 	</form><!-- #members-directory-form -->
 
-	<?php do_action( 'bp_after_directory_members' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the members.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_directory_members' ); ?>
 
 </div><!-- #buddypress -->
 
-<?php do_action( 'bp_after_directory_members_page' ); ?>
\ No newline at end of file
+<?php
+
+/**
+ * Fires at the bottom of the members directory template file.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_after_directory_members_page' );
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php
index deeb941779e6825932207210afc0f27ce4335840..e5f5ee03cbef7302548602d3c92a95385de887b0 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php
@@ -11,7 +11,18 @@
 
 ?>
 
-<?php do_action( 'bp_before_members_loop' ); ?>
+<?php
+
+/**
+ * Fires before the display of the members loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_members_loop' ); ?>
+
+<?php if ( bp_get_current_member_type() ) : ?>
+	<p class="current-member-type"><?php bp_current_member_type_message() ?></p>
+<?php endif; ?>
 
 <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
 
@@ -31,13 +42,20 @@
 
 	</div>
 
-	<?php do_action( 'bp_before_directory_members_list' ); ?>
+	<?php
 
-	<ul id="members-list" class="item-list" role="main">
+	/**
+	 * Fires before the display of the members list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_directory_members_list' ); ?>
+
+	<ul id="members-list" class="item-list">
 
 	<?php while ( bp_members() ) : bp_the_member(); ?>
 
-		<li>
+		<li <?php bp_member_class(); ?>>
 			<div class="item-avatar">
 				<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
 			</div>
@@ -56,7 +74,14 @@
 
 				<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
 
-				<?php do_action( 'bp_directory_members_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the display of a directory member item.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_members_item' ); ?>
 
 				<?php
 				 /***
@@ -71,7 +96,14 @@
 
 			<div class="action">
 
-				<?php do_action( 'bp_directory_members_actions' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the members action HTML markup to display actions.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_directory_members_actions' ); ?>
 
 			</div>
 
@@ -82,7 +114,14 @@
 
 	</ul>
 
-	<?php do_action( 'bp_after_directory_members_list' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the members list.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_directory_members_list' ); ?>
 
 	<?php bp_member_hidden_fields(); ?>
 
@@ -110,4 +149,11 @@
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_members_loop' ); ?>
+<?php
+
+/**
+ * Fires after the display of the members loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_members_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php
index 25121ae281e2f29db5a0de966bc177793e232d16..c131dbc5152e10ccb6b9a87ba36b7b579f22f5a4 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php
@@ -1,27 +1,61 @@
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_register_page' ); ?>
+	<?php
+
+	/**
+	 * Fires at the top of the BuddyPress member registration page template.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_register_page' ); ?>
 
 	<div class="page" id="register-page">
 
 		<form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
 
 		<?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
-			<?php do_action( 'template_notices' ); ?>
-			<?php do_action( 'bp_before_registration_disabled' ); ?>
+			<?php
+
+			/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+			do_action( 'template_notices' ); ?>
+			<?php
+
+			/**
+			 * Fires before the display of the registration disabled message.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'bp_before_registration_disabled' ); ?>
 
 				<p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
 
-			<?php do_action( 'bp_after_registration_disabled' ); ?>
-		<?php endif; // registration-disabled signup setp ?>
+			<?php
+
+			/**
+			 * Fires after the display of the registration disabled message.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'bp_after_registration_disabled' ); ?>
+		<?php endif; // registration-disabled signup step ?>
 
 		<?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
 
-			<?php do_action( 'template_notices' ); ?>
+			<?php
+
+			/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+			do_action( 'template_notices' ); ?>
 
 			<p><?php _e( 'Registering for this site is easy. Just fill in the fields below, and we\'ll get a new account set up for you in no time.', 'buddypress' ); ?></p>
 
-			<?php do_action( 'bp_before_account_details_fields' ); ?>
+			<?php
+
+			/**
+			 * Fires before the display of member registration account details fields.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_before_account_details_fields' ); ?>
 
 			<div class="register-section" id="basic-details-section">
 
@@ -30,33 +64,82 @@
 				<h4><?php _e( 'Account Details', 'buddypress' ); ?></h4>
 
 				<label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
-				<?php do_action( 'bp_signup_username_errors' ); ?>
-				<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />
+				<?php
+
+				/**
+				 * Fires and displays any member registration username errors.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_signup_username_errors' ); ?>
+				<input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" <?php bp_form_field_attributes( 'username' ); ?>/>
 
 				<label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
-				<?php do_action( 'bp_signup_email_errors' ); ?>
-				<input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />
+				<?php
+
+				/**
+				 * Fires and displays any member registration email errors.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_signup_email_errors' ); ?>
+				<input type="email" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" <?php bp_form_field_attributes( 'email' ); ?>/>
 
 				<label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
-				<?php do_action( 'bp_signup_password_errors' ); ?>
-				<input type="password" name="signup_password" id="signup_password" value="" class="password-entry" />
+				<?php
+
+				/**
+				 * Fires and displays any member registration password errors.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_signup_password_errors' ); ?>
+				<input type="password" name="signup_password" id="signup_password" value="" class="password-entry" <?php bp_form_field_attributes( 'password' ); ?>/>
 				<div id="pass-strength-result"></div>
 
 				<label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
-				<?php do_action( 'bp_signup_password_confirm_errors' ); ?>
-				<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" />
+				<?php
+
+				/**
+				 * Fires and displays any member registration password confirmation errors.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_signup_password_confirm_errors' ); ?>
+				<input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" class="password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/>
 
-				<?php do_action( 'bp_account_details_fields' ); ?>
+				<?php
+
+				/**
+				 * Fires and displays any extra member registration details fields.
+				 *
+				 * @since BuddyPress (1.9.0)
+				 */
+				do_action( 'bp_account_details_fields' ); ?>
 
 			</div><!-- #basic-details-section -->
 
-			<?php do_action( 'bp_after_account_details_fields' ); ?>
+			<?php
+
+			/**
+			 * Fires after the display of member registration account details fields.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_after_account_details_fields' ); ?>
 
 			<?php /***** Extra Profile Details ******/ ?>
 
 			<?php if ( bp_is_active( 'xprofile' ) ) : ?>
 
-				<?php do_action( 'bp_before_signup_profile_fields' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of member registration xprofile fields.
+				 *
+				 * @since BuddyPress (1.2.4)
+				 */
+				do_action( 'bp_before_signup_profile_fields' ); ?>
 
 				<div class="register-section" id="profile-details-section">
 
@@ -73,6 +156,11 @@
 							$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
 							$field_type->edit_field_html();
 
+							/**
+							 * Fires before the display of the visibility options for xprofile fields.
+							 *
+							 * @since BuddyPress (1.7.0)
+							 */
 							do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
 
 							if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
@@ -96,7 +184,14 @@
 								</p>
 							<?php endif ?>
 
-							<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
+							<?php
+
+							/**
+							 * Fires after the display of the visibility options for xprofile fields.
+							 *
+							 * @since BuddyPress (1.1.0)
+							 */
+							do_action( 'bp_custom_profile_edit_fields' ); ?>
 
 							<p class="description"><?php bp_the_profile_field_description(); ?></p>
 
@@ -108,17 +203,38 @@
 
 					<?php endwhile; endif; endif; ?>
 
-					<?php do_action( 'bp_signup_profile_fields' ); ?>
+					<?php
+
+					/**
+					 * Fires and displays any extra member registration xprofile fields.
+					 *
+					 * @since BuddyPress (1.9.0)
+					 */
+					do_action( 'bp_signup_profile_fields' ); ?>
 
 				</div><!-- #profile-details-section -->
 
-				<?php do_action( 'bp_after_signup_profile_fields' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of member registration xprofile fields.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_after_signup_profile_fields' ); ?>
 
 			<?php endif; ?>
 
 			<?php if ( bp_get_blog_signup_allowed() ) : ?>
 
-				<?php do_action( 'bp_before_blog_details_fields' ); ?>
+				<?php
+
+				/**
+				 * Fires before the display of member registration blog details fields.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_before_blog_details_fields' ); ?>
 
 				<?php /***** Blog Creation Details ******/ ?>
 
@@ -131,7 +247,14 @@
 					<div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
 
 						<label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
-						<?php do_action( 'bp_signup_blog_url_errors' ); ?>
+						<?php
+
+						/**
+						 * Fires and displays any member registration blog URL errors.
+						 *
+						 * @since BuddyPress (1.1.0)
+						 */
+						do_action( 'bp_signup_blog_url_errors' ); ?>
 
 						<?php if ( is_subdomain_install() ) : ?>
 							http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_signup_subdomain_base(); ?>
@@ -140,32 +263,74 @@
 						<?php endif; ?>
 
 						<label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
-						<?php do_action( 'bp_signup_blog_title_errors' ); ?>
+						<?php
+
+						/**
+						 * Fires and displays any member registration blog title errors.
+						 *
+						 * @since BuddyPress (1.1.0)
+						 */
+						do_action( 'bp_signup_blog_title_errors' ); ?>
 						<input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" />
 
 						<span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?></span>
-						<?php do_action( 'bp_signup_blog_privacy_errors' ); ?>
+						<?php
+
+						/**
+						 * Fires and displays any member registration blog privacy errors.
+						 *
+						 * @since BuddyPress (1.1.0)
+						 */
+						do_action( 'bp_signup_blog_privacy_errors' ); ?>
 
 						<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'buddypress' ); ?></label>
 						<label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'buddypress' ); ?></label>
 
-						<?php do_action( 'bp_blog_details_fields' ); ?>
+						<?php
+
+						/**
+						 * Fires and displays any extra member registration blog details fields.
+						 *
+						 * @since BuddyPress (1.9.0)
+						 */
+						do_action( 'bp_blog_details_fields' ); ?>
 
 					</div>
 
 				</div><!-- #blog-details-section -->
 
-				<?php do_action( 'bp_after_blog_details_fields' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of member registration blog details fields.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_after_blog_details_fields' ); ?>
 
 			<?php endif; ?>
 
-			<?php do_action( 'bp_before_registration_submit_buttons' ); ?>
+			<?php
+
+			/**
+			 * Fires before the display of the registration submit buttons.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_before_registration_submit_buttons' ); ?>
 
 			<div class="submit">
 				<input type="submit" name="signup_submit" id="signup_submit" value="<?php esc_attr_e( 'Complete Sign Up', 'buddypress' ); ?>" />
 			</div>
 
-			<?php do_action( 'bp_after_registration_submit_buttons' ); ?>
+			<?php
+
+			/**
+			 * Fires after the display of the registration submit buttons.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'bp_after_registration_submit_buttons' ); ?>
 
 			<?php wp_nonce_field( 'bp_new_signup' ); ?>
 
@@ -173,8 +338,18 @@
 
 		<?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
 
-			<?php do_action( 'template_notices' ); ?>
-			<?php do_action( 'bp_before_registration_confirmed' ); ?>
+			<?php
+
+			/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+			do_action( 'template_notices' ); ?>
+			<?php
+
+			/**
+			 * Fires before the display of the registration confirmed messages.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'bp_before_registration_confirmed' ); ?>
 
 			<?php if ( bp_registration_needs_activation() ) : ?>
 				<p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ); ?></p>
@@ -182,16 +357,37 @@
 				<p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ); ?></p>
 			<?php endif; ?>
 
-			<?php do_action( 'bp_after_registration_confirmed' ); ?>
+			<?php
+
+			/**
+			 * Fires after the display of the registration confirmed messages.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 */
+			do_action( 'bp_after_registration_confirmed' ); ?>
 
 		<?php endif; // completed-confirmation signup step ?>
 
-		<?php do_action( 'bp_custom_signup_steps' ); ?>
+		<?php
+
+		/**
+		 * Fires and displays any custom signup steps.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_custom_signup_steps' ); ?>
 
 		</form>
 
 	</div>
 
-	<?php do_action( 'bp_after_register_page' ); ?>
+	<?php
+
+	/**
+	 * Fires at the bottom of the BuddyPress member registration page template.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_register_page' ); ?>
 
 </div><!-- #buddypress -->
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php
index af4ea66d47a423db667f06ee545a3b1d73c23c29..384472a30246cb97b1662a811d04e3570e41d695 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php
@@ -21,26 +21,58 @@
 
 				<?php bp_activity_show_filters(); ?>
 
-				<?php do_action( 'bp_member_activity_filter_options' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the select input for member activity filter options.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_member_activity_filter_options' ); ?>
 
 			</select>
 		</li>
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php do_action( 'bp_before_member_activity_post_form' ); ?>
+<?php
+
+/**
+ * Fires before the display of the member activity post form.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_member_activity_post_form' ); ?>
 
 <?php
 if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) )
 	bp_get_template_part( 'activity/post-form' );
 
+/**
+ * Fires after the display of the member activity post form.
+ *
+ * @since BuddyPress (1.2.0)
+ */
 do_action( 'bp_after_member_activity_post_form' );
+
+/**
+ * Fires before the display of the member activities list.
+ *
+ * @since BuddyPress (1.2.0)
+ */
 do_action( 'bp_before_member_activity_content' ); ?>
 
-<div class="activity" role="main">
+<div class="activity">
 
 	<?php bp_get_template_part( 'activity/activity-loop' ) ?>
 
 </div><!-- .activity -->
 
-<?php do_action( 'bp_after_member_activity_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of the member activities list.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_member_activity_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php
index 27b767802840949659dfcd7bcc99978f405beba7..3de9dc366c7cd0b48bb72f3847480dcee7f821cb 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php
@@ -16,13 +16,20 @@
 
 		<li id="blogs-order-select" class="last filter">
 
-			<label for="blogs-all"><?php _e( 'Order By:', 'buddypress' ); ?></label>
-			<select id="blogs-all">
+			<label for="blogs-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+			<select id="blogs-order-by">
 				<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
 				<option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option>
 				<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-				<?php do_action( 'bp_member_blog_order_options' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the members blogs order options select input.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_member_blog_order_options' ); ?>
 
 			</select>
 		</li>
@@ -34,19 +41,32 @@ switch ( bp_current_action() ) :
 
 	// Home/My Blogs
 	case 'my-sites' :
+
+		/**
+		 * Fires before the display of member blogs content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_before_member_blogs_content' ); ?>
 
-		<div class="blogs myblogs" role="main">
+		<div class="blogs myblogs">
 
 			<?php bp_get_template_part( 'blogs/blogs-loop' ) ?>
 
 		</div><!-- .blogs.myblogs -->
 
-		<?php do_action( 'bp_after_member_blogs_content' );
+		<?php
+
+		/**
+		 * Fires after the display of member blogs content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_member_blogs_content' );
 		break;
 
 	// Any other
 	default :
 		bp_get_template_part( 'members/single/plugins' );
 		break;
-endswitch;
\ No newline at end of file
+endswitch;
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php
index d40180af2402681bea1f99b82a7a2a25a0299c59..93b1ae9426477f4b8cb9cd81b97aa020d66b7baa 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php
@@ -21,7 +21,14 @@
 				<option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
 				<option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
 
-				<?php do_action( 'bp_forums_directory_order_options' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the members forums order options select input.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_forums_directory_order_options' ); ?>
 
 			</select>
 		</li>
@@ -34,6 +41,12 @@ if ( bp_is_current_action( 'favorites' ) ) :
 	bp_get_template_part( 'members/single/forums/topics' );
 
 else :
+
+	/**
+	 * Fires before the display of member forums content.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
 	do_action( 'bp_before_member_forums_content' ); ?>
 
 	<div class="forums myforums">
@@ -42,6 +55,13 @@ else :
 
 	</div>
 
-	<?php do_action( 'bp_after_member_forums_content' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of member forums content.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_after_member_forums_content' ); ?>
 
 <?php endif; ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php
index e49bf5bf6ba10ab948c5a97b584cd9ed9a5f3f75..c58e2f1d1100a1e8bdba61dd4c5da6f069ef3c63 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php
@@ -23,7 +23,14 @@
 					<option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option>
 					<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-					<?php do_action( 'bp_member_friends_order_options' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the members friends order options select input.
+					 *
+					 * @since BuddyPress (2.0.0)
+					 */
+					do_action( 'bp_member_friends_order_options' ); ?>
 
 				</select>
 			</li>
@@ -38,6 +45,12 @@ switch ( bp_current_action() ) :
 
 	// Home/My Friends
 	case 'my-friends' :
+
+		/**
+		 * Fires before the display of member friends content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_before_member_friends_content' ); ?>
 
 		<div class="members friends">
@@ -46,7 +59,14 @@ switch ( bp_current_action() ) :
 
 		</div><!-- .members.friends -->
 
-		<?php do_action( 'bp_after_member_friends_content' );
+		<?php
+
+		/**
+		 * Fires after the display of member friends content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_member_friends_content' );
 		break;
 
 	case 'requests' :
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php
index a47f6bc5ecada19723b56a5e5796634e79330be0..20e199c972a4ba0820ffc407d7c07b2acb3fb53e 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_member_friend_requests_content' ); ?>
+<?php
+
+/**
+ * Fires before the display of member friend requests content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_member_friend_requests_content' ); ?>
 
 <?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?>
 
@@ -18,7 +25,7 @@
 
 	</div>
 
-	<ul id="friend-list" class="item-list" role="main">
+	<ul id="friend-list" class="item-list">
 		<?php while ( bp_members() ) : bp_the_member(); ?>
 
 			<li id="friendship-<?php bp_friend_friendship_id(); ?>">
@@ -31,20 +38,41 @@
 					<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
 				</div>
 
-				<?php do_action( 'bp_friend_requests_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the display of a member friend request item.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_friend_requests_item' ); ?>
 
 				<div class="action">
 					<a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
 					<a class="button reject" href="<?php bp_friend_reject_request_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
 
-					<?php do_action( 'bp_friend_requests_item_action' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the member friend request actions markup.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_friend_requests_item_action' ); ?>
 				</div>
 			</li>
 
 		<?php endwhile; ?>
 	</ul>
 
-	<?php do_action( 'bp_friend_requests_content' ); ?>
+	<?php
+
+	/**
+	 * Fires and displays the member friend requests content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_friend_requests_content' ); ?>
 
 	<div id="pag-bottom" class="pagination no-ajax">
 
@@ -70,4 +98,11 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_member_friend_requests_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of member friend requests content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_member_friend_requests_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php
index 252f9297d8b4af11c8efb28b72596c3303b7176f..f9dfdc23cf2232a861b225abd92d704fbfb967fe 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php
@@ -17,14 +17,21 @@
 
 			<li id="groups-order-select" class="last filter">
 
-				<label for="groups-sort-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
-				<select id="groups-sort-by">
+				<label for="groups-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
+				<select id="groups-order-by">
 					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
 					<option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option>
 					<option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
 					<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
 
-					<?php do_action( 'bp_member_group_order_options' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the members group order options select input.
+					 *
+					 * @since BuddyPress (1.2.0)
+					 */
+					do_action( 'bp_member_group_order_options' ); ?>
 
 				</select>
 			</li>
@@ -40,6 +47,12 @@ switch ( bp_current_action() ) :
 
 	// Home/My Groups
 	case 'my-groups' :
+
+		/**
+		 * Fires before the display of member groups content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_before_member_groups_content' ); ?>
 
 		<div class="groups mygroups">
@@ -48,7 +61,14 @@ switch ( bp_current_action() ) :
 
 		</div>
 
-		<?php do_action( 'bp_after_member_groups_content' );
+		<?php
+
+		/**
+		 * Fires after the display of member groups content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_member_groups_content' );
 		break;
 
 	// Group Invitations
@@ -60,4 +80,4 @@ switch ( bp_current_action() ) :
 	default :
 		bp_get_template_part( 'members/single/plugins' );
 		break;
-endswitch;
\ No newline at end of file
+endswitch;
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php
index e41210cbab7cc23e3e371ef169135f49fd610a03..54877b24dbb643df0780e8aa7ff11fc75b1e9114 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php
@@ -1,29 +1,52 @@
-<?php do_action( 'bp_before_group_invites_content' ); ?>
+<?php
+
+/**
+ * Fires before the display of member group invites content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_group_invites_content' ); ?>
 
 <?php if ( bp_has_groups( 'type=invites&user_id=' . bp_loggedin_user_id() ) ) : ?>
 
-	<ul id="group-list" class="invites item-list" role="main">
+	<ul id="group-list" class="invites item-list">
 
 		<?php while ( bp_groups() ) : bp_the_group(); ?>
 
 			<li>
-				<div class="item-avatar">
-					<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
-				</div>
+				<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
+					<div class="item-avatar">
+						<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
+					</div>
+				<?php endif; ?>
 
-				<h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( _nx( '1 member', '%d members', bp_get_group_total_members( false ),'Group member count', 'buddypress' ), bp_get_group_total_members( false )  ); ?></span></h4>
+				<h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( _nx( '%d member', '%d members', bp_get_group_total_members( false ),'Group member count', 'buddypress' ), bp_get_group_total_members( false )  ); ?></span></h4>
 
 				<p class="desc">
 					<?php bp_group_description_excerpt(); ?>
 				</p>
 
-				<?php do_action( 'bp_group_invites_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the display of a member group invite item.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_group_invites_item' ); ?>
 
 				<div class="action">
 					<a class="button accept" href="<?php bp_group_accept_invite_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
 					<a class="button reject confirm" href="<?php bp_group_reject_invite_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
 
-					<?php do_action( 'bp_group_invites_item_action' ); ?>
+					<?php
+
+					/**
+					 * Fires inside the member group item action markup.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_group_invites_item_action' ); ?>
 
 				</div>
 			</li>
@@ -33,10 +56,17 @@
 
 <?php else: ?>
 
-	<div id="message" class="info" role="main">
+	<div id="message" class="info">
 		<p><?php _e( 'You have no outstanding group invites.', 'buddypress' ); ?></p>
 	</div>
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_group_invites_content' ); ?>
\ No newline at end of file
+<?php
+
+/**
+ * Fires after the display of member group invites content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_group_invites_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php
index 0022cb30f53b8e36cc7c81e3c1ed82eb3e9eddcc..6b9f04cb8a3b8155c67d332d6f5731aea6ecafe9 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php
@@ -1,6 +1,13 @@
 <div id="buddypress">
 
-	<?php do_action( 'bp_before_member_home_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of member home content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_member_home_content' ); ?>
 
 	<div id="item-header" role="complementary">
 
@@ -14,15 +21,29 @@
 
 				<?php bp_get_displayed_user_nav(); ?>
 
-				<?php do_action( 'bp_member_options_nav' ); ?>
+				<?php
+
+				/**
+				 * Fires after the display of member options navigation.
+				 *
+				 * @since BuddyPress (1.2.4)
+				 */
+				do_action( 'bp_member_options_nav' ); ?>
 
 			</ul>
 		</div>
 	</div><!-- #item-nav -->
 
-	<div id="item-body" role="main">
+	<div id="item-body">
 
-		<?php do_action( 'bp_before_member_body' );
+		<?php
+
+		/**
+		 * Fires before the display of member body content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_before_member_body' );
 
 		if ( bp_is_user_activity() || !bp_current_component() ) :
 			bp_get_template_part( 'members/single/activity' );
@@ -57,10 +78,22 @@
 
 		endif;
 
+		/**
+		 * Fires after the display of member body content.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_after_member_body' ); ?>
 
 	</div><!-- #item-body -->
 
-	<?php do_action( 'bp_after_member_home_content' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of member home content.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_member_home_content' ); ?>
 
 </div><!-- #buddypress -->
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php
index d7409b935386345140a8a45aba5521c4a8d2cf9f..ec3687e25558c2a37ad0a590d326cb92b1ea7657 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php
@@ -9,7 +9,14 @@
 
 ?>
 
-<?php do_action( 'bp_before_member_header' ); ?>
+<?php
+
+/**
+ * Fires before the display of a member's header.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_member_header' ); ?>
 
 <div id="item-header-avatar">
 	<a href="<?php bp_displayed_user_link(); ?>">
@@ -27,7 +34,14 @@
 
 	<span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span>
 
-	<?php do_action( 'bp_before_member_header_meta' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the member's header meta.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_member_header_meta' ); ?>
 
 	<div id="item-meta">
 
@@ -43,15 +57,27 @@
 
 		<div id="item-buttons">
 
-			<?php do_action( 'bp_member_header_actions' ); ?>
+			<?php
+
+			/**
+			 * Fires in the member header actions section.
+			 *
+			 * @since BuddyPress (1.2.6)
+			 */
+			do_action( 'bp_member_header_actions' ); ?>
 
 		</div><!-- #item-buttons -->
 
 		<?php
-		/***
-		 * If you'd like to show specific profile fields here use:
-		 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
-		 */
+
+		 /**
+		  * Fires after the group header actions section.
+		  *
+		  * If you'd like to show specific profile fields here use:
+		  * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
+		  *
+		  * @since BuddyPress (1.2.0)
+		  */
 		 do_action( 'bp_profile_header_meta' );
 
 		 ?>
@@ -60,6 +86,16 @@
 
 </div><!-- #item-header-content -->
 
-<?php do_action( 'bp_after_member_header' ); ?>
+<?php
+
+/**
+ * Fires after the display of a member's header.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_member_header' ); ?>
+
+<?php
 
-<?php do_action( 'template_notices' ); ?>
\ No newline at end of file
+/** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
+do_action( 'template_notices' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php
index 272c1b6205ab8848d123fb203a5fbf374dc317c3..d803d6831362fa1b9064c4ff2c3e59bfca8054cb 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php
@@ -30,13 +30,26 @@ switch ( bp_current_action() ) :
 	// Inbox/Sentbox
 	case 'inbox'   :
 	case 'sentbox' :
+
+		/**
+		 * Fires before the member messages content for inbox and sentbox.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_before_member_messages_content' ); ?>
 
-		<div class="messages" role="main">
+		<div class="messages">
 			<?php bp_get_template_part( 'members/single/messages/messages-loop' ); ?>
 		</div><!-- .messages -->
 
-		<?php do_action( 'bp_after_member_messages_content' );
+		<?php
+
+		/**
+		 * Fires after the member messages content for inbox and sentbox.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_member_messages_content' );
 		break;
 
 	// Single Message View
@@ -51,13 +64,26 @@ switch ( bp_current_action() ) :
 
 	// Sitewide Notices
 	case 'notices' :
+
+		/**
+		 * Fires before the member messages content for notices.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
 		do_action( 'bp_before_member_messages_content' ); ?>
 
-		<div class="messages" role="main">
+		<div class="messages">
 			<?php bp_get_template_part( 'members/single/messages/notices-loop' ); ?>
 		</div><!-- .messages -->
 
-		<?php do_action( 'bp_after_member_messages_content' );
+		<?php
+
+		/**
+		 * Fires after the member messages content for inbox and sentbox.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_member_messages_content' );
 		break;
 
 	// Any other
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php
index 4190b8454162a6f53353a4c660608651a79aec93..54a78220b28c4d9f767da6997b4ac4416d877e7c 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php
@@ -1,6 +1,13 @@
-<form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" role="main" enctype="multipart/form-data">
+<form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" enctype="multipart/form-data">
 
-	<?php do_action( 'bp_before_messages_compose_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of message compose content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_messages_compose_content' ); ?>
 
 	<label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress' ); ?></label>
 	<ul class="first acfb-holder">
@@ -22,7 +29,14 @@
 
 	<input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" />
 
-	<?php do_action( 'bp_after_messages_compose_content' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of message compose content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_messages_compose_content' ); ?>
 
 	<div class="submit">
 		<input type="submit" value="<?php esc_attr_e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php
index 981a8d2397bc99aaec6e24b5d64aa7ed429c5420..538be488795d9956be301d6a47d767f19f18a480 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_member_messages_loop' ); ?>
+<?php
+
+/**
+ * Fires before the members messages loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_member_messages_loop' ); ?>
 
 <?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?>
 
@@ -14,54 +21,143 @@
 
 	</div><!-- .pagination -->
 
-	<?php do_action( 'bp_after_member_messages_pagination' ); ?>
-
-	<?php do_action( 'bp_before_member_messages_threads'   ); ?>
-
-	<table id="message-threads" class="messages-notices">
-		<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
-
-			<tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>">
-				<td width="1%" class="thread-count">
-					<span class="unread-count"><?php bp_message_thread_unread_count(); ?></span>
-				</td>
-				<td width="1%" class="thread-avatar"><?php bp_message_thread_avatar(); ?></td>
-
-				<?php if ( 'sentbox' != bp_current_action() ) : ?>
-					<td width="30%" class="thread-from">
-						<?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from(); ?><br />
-						<span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
-					</td>
-				<?php else: ?>
-					<td width="30%" class="thread-from">
-						<?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to(); ?><br />
-						<span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
-					</td>
-				<?php endif; ?>
-
-				<td width="50%" class="thread-info">
-					<p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php esc_attr_e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p>
-					<p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p>
-				</td>
-
-				<?php do_action( 'bp_messages_inbox_list_item' ); ?>
-
-				<td width="13%" class="thread-options">
-					<input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id(); ?>" />
-					<a class="button confirm" href="<?php bp_message_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> &nbsp;
-				</td>
-			</tr>
-
-		<?php endwhile; ?>
-	</table><!-- #message-threads -->
-
-	<div class="messages-options-nav">
-		<?php bp_messages_options(); ?>
-	</div><!-- .messages-options-nav -->
-
-	<?php do_action( 'bp_after_member_messages_threads' ); ?>
-
-	<?php do_action( 'bp_after_member_messages_options' ); ?>
+	<?php
+
+	/**
+	 * Fires after the members messages pagination display.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_member_messages_pagination' ); ?>
+
+	<?php
+
+	/**
+	 * Fires before the members messages threads.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_member_messages_threads' ); ?>
+
+	<form action="<?php echo bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ?>/bulk-manage/" method="post" id="messages-bulk-management">
+
+		<table id="message-threads" class="messages-notices">
+
+			<thead>
+				<tr>
+					<th scope="col" class="thread-checkbox bulk-select-all"><label class="bp-screen-reader-text" for="select-all-messages"><?php _e( 'Select all', 'buddypress' ); ?></label><input id="select-all-messages" type="checkbox"></th>
+					<th scope="col" class="thread-from"><?php _e( 'From', 'buddypress' ); ?></th>
+					<th scope="col" class="thread-info"><?php _e( 'Subject', 'buddypress' ); ?></th>
+
+					<?php
+
+					/**
+					 * Fires inside the messages box table header to add a new column.
+					 *
+					 * This is to primarily add a <th> cell to the messages box table header. Use
+					 * the related 'bp_messages_inbox_list_item' hook to add a <td> cell.
+					 *
+					 * @since BuddyPress (2.3.0)
+					 */
+					do_action( 'bp_messages_inbox_list_header' ); ?>
+
+					<?php if ( bp_is_active( 'messages', 'star' ) ) : ?>
+						<th scope="col" class="thread-star"><span class="message-action-star"><span class="icon"></span> <span class="screen-reader-text"><?php _e( 'Star', 'buddypress' ); ?></span></span></th>
+					<?php endif; ?>
+
+					<th scope="col" class="thread-options"><?php _e( 'Actions', 'buddypress' ); ?></th>
+				</tr>
+			</thead>
+
+			<tbody>
+
+				<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
+
+					<tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>">
+						<td class="bulk-select-check">
+							<input type="checkbox" name="message_ids[]" class="message-check" value="<?php bp_message_thread_id(); ?>" />
+						</td>
+
+						<?php if ( 'sentbox' != bp_current_action() ) : ?>
+							<td class="thread-from">
+								<?php bp_message_thread_avatar( array( 'width' => 25, 'height' => 25 ) ); ?>
+								<span class="from"><?php _e( 'From:', 'buddypress' ); ?></span> <?php bp_message_thread_from(); ?>
+								<?php bp_message_thread_total_and_unread_count(); ?>
+								<span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
+							</td>
+						<?php else: ?>
+							<td class="thread-from">
+								<?php bp_message_thread_avatar( array( 'width' => 25, 'height' => 25 ) ); ?>
+								<span class="to"><?php _e( 'To:', 'buddypress' ); ?></span> <?php bp_message_thread_to(); ?>
+								<?php bp_message_thread_total_and_unread_count(); ?>
+								<span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
+							</td>
+						<?php endif; ?>
+
+						<td class="thread-info">
+							<p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php esc_attr_e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p>
+							<p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p>
+						</td>
+
+						<?php
+
+						/**
+						 * Fires inside the messages box table row to add a new column.
+						 *
+						 * This is to primarily add a <td> cell to the message box table. Use the
+						 * related 'bp_messages_inbox_list_header' hook to add a <th> header cell.
+						 *
+						 * @since BuddyPress (1.1.0)
+						 */
+						do_action( 'bp_messages_inbox_list_item' ); ?>
+
+						<?php if ( bp_is_active( 'messages', 'star' ) ) : ?>
+							<td class="thread-star">
+								<?php bp_the_message_star_action_link( array( 'thread_id' => bp_get_message_thread_id() ) ); ?>
+							</td>
+						<?php endif; ?>
+
+						<td class="thread-options">
+							<?php if ( bp_message_thread_has_unread() ) : ?>
+								<a class="read" href="<?php bp_the_message_thread_mark_read_url();?>"><?php _e( 'Read', 'buddypress' ); ?></a>
+							<?php else : ?>
+								<a class="unread" href="<?php bp_the_message_thread_mark_unread_url();?>"><?php _e( 'Unread', 'buddypress' ); ?></a>
+							<?php endif; ?>
+							 |
+							<a class="delete" href="<?php bp_message_thread_delete_link(); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a>
+						</td>
+					</tr>
+
+				<?php endwhile; ?>
+
+			</tbody>
+
+		</table><!-- #message-threads -->
+
+		<div class="messages-options-nav">
+			<?php bp_messages_bulk_management_dropdown(); ?>
+		</div><!-- .messages-options-nav -->
+
+		<?php wp_nonce_field( 'messages_bulk_nonce', 'messages_bulk_nonce' ); ?>
+	</form>
+
+	<?php
+
+	/**
+	 * Fires after the members messages threads.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_member_messages_threads' ); ?>
+
+	<?php
+
+	/**
+	 * Fires and displays member messages options.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_member_messages_options' ); ?>
 
 <?php else: ?>
 
@@ -71,4 +167,11 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_member_messages_loop' ); ?>
+<?php
+
+/**
+ * Fires after the members messages loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_member_messages_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php
index 7f7ba2d3d1de3c432bae5300757cfb8bae880de2..86c2617e1431e17a51451b1cfd47b2df52a66430 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_notices_loop' ); ?>
+<?php
+
+/**
+ * Fires before the members notices loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_notices_loop' ); ?>
 
 <?php if ( bp_has_message_threads() ) : ?>
 
@@ -14,10 +21,24 @@
 
 	</div><!-- .pagination -->
 
-	<?php do_action( 'bp_after_notices_pagination' ); ?>
-	<?php do_action( 'bp_before_notices' ); ?>
+	<?php
+
+	/**
+	 * Fires after the members notices pagination display.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_notices_pagination' ); ?>
+	<?php
+
+	/**
+	 * Fires before the members notice items.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_before_notices' ); ?>
 
-	<table id="message-threads" class="messages-notices">
+	<table id="message-threads" class="messages-notices sitewide-notices">
 		<?php while ( bp_message_threads() ) : bp_message_thread(); ?>
 			<tr id="notice-<?php bp_message_notice_id(); ?>" class="<?php bp_message_css_class(); ?>">
 				<td width="1%"></td>
@@ -36,7 +57,14 @@
 					<span class="activity"><?php _e( 'Sent:', 'buddypress' ); ?> <?php bp_message_notice_post_date(); ?></span>
 				</td>
 
-				<?php do_action( 'bp_notices_list_item' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the display of a member notice list item.
+				 *
+				 * @since BuddyPress (1.2.0)
+				 */
+				do_action( 'bp_notices_list_item' ); ?>
 
 				<td width="10%">
 					<a class="button" href="<?php bp_message_activate_deactivate_link(); ?>" class="confirm"><?php bp_message_activate_deactivate_text(); ?></a>
@@ -46,7 +74,14 @@
 		<?php endwhile; ?>
 	</table><!-- #message-threads -->
 
-	<?php do_action( 'bp_after_notices' ); ?>
+	<?php
+
+	/**
+	 * Fires after the members notice items.
+	 *
+	 * @since BuddyPress (1.2.0)
+	 */
+	do_action( 'bp_after_notices' ); ?>
 
 <?php else: ?>
 
@@ -56,4 +91,11 @@
 
 <?php endif;?>
 
-<?php do_action( 'bp_after_notices_loop' ); ?>
\ No newline at end of file
+<?php
+
+/**
+ * Fires after the members notices loop.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_notices_loop' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php
index 8588f3b6bdfe16a90c71d86d227abd713d62424f..d4b08e5a39c74ddedb1bc9ddb219a1a71da68f9f 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php
@@ -1,6 +1,13 @@
-<div id="message-thread" role="main">
+<div id="message-thread">
 
-	<?php do_action( 'bp_before_message_thread_content' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of a single member message thread content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_message_thread_content' ); ?>
 
 	<?php if ( bp_thread_has_messages() ) : ?>
 
@@ -9,22 +16,33 @@
 		<p id="message-recipients">
 			<span class="highlight">
 
-				<?php if ( !bp_get_the_thread_recipients() ) : ?>
+				<?php if ( bp_get_thread_recipients_count() <= 1 ) : ?>
 
 					<?php _e( 'You are alone in this conversation.', 'buddypress' ); ?>
 
+				<?php elseif ( bp_get_max_thread_recipients_to_list() <= bp_get_thread_recipients_count() ) : ?>
+
+					<?php printf( __( 'Conversation between %s recipients.', 'buddypress' ), number_format_i18n( bp_get_thread_recipients_count() ) ); ?>
+
 				<?php else : ?>
 
-					<?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_the_thread_recipients() ); ?>
+					<?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_thread_recipients_list() ); ?>
 
 				<?php endif; ?>
 
 			</span>
 
-			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> &nbsp;
+			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Conversation", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a>
 		</p>
 
-		<?php do_action( 'bp_before_message_thread_list' ); ?>
+		<?php
+
+		/**
+		 * Fires before the display of the message thread list.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_before_message_thread_list' ); ?>
 
 		<?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?>
 
@@ -32,7 +50,10 @@
 
 				<div class="message-metadata">
 
-					<?php do_action( 'bp_before_message_meta' ); ?>
+					<?php
+
+					/** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
+					do_action( 'bp_before_message_meta' ); ?>
 
 					<?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ); ?>
 
@@ -48,11 +69,23 @@
 
 					<span class="activity"><?php bp_the_thread_message_time_since(); ?></span>
 
-					<?php do_action( 'bp_after_message_meta' ); ?>
+					<?php if ( bp_is_active( 'messages', 'star' ) ) : ?>
+						<div class="message-star-actions">
+							<?php bp_the_message_star_action_link(); ?>
+						</div>
+					<?php endif; ?>
+
+					<?php
+
+					/** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
+					do_action( 'bp_after_message_meta' ); ?>
 
 				</div><!-- .message-metadata -->
 
-				<?php do_action( 'bp_before_message_content' ); ?>
+				<?php
+
+				/** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
+				do_action( 'bp_before_message_content' ); ?>
 
 				<div class="message-content">
 
@@ -60,7 +93,10 @@
 
 				</div><!-- .message-content -->
 
-				<?php do_action( 'bp_after_message_content' ); ?>
+				<?php
+
+				/** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
+				do_action( 'bp_after_message_content' ); ?>
 
 				<div class="clear"></div>
 
@@ -68,9 +104,23 @@
 
 		<?php endwhile; ?>
 
-		<?php do_action( 'bp_after_message_thread_list' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of the message thread list.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_after_message_thread_list' ); ?>
+
+		<?php
 
-		<?php do_action( 'bp_before_message_thread_reply' ); ?>
+		/**
+		 * Fires before the display of the message thread reply form.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_before_message_thread_reply' ); ?>
 
 		<form id="send-reply" action="<?php bp_messages_form_action(); ?>" method="post" class="standard-form">
 
@@ -78,7 +128,10 @@
 
 				<div class="message-metadata">
 
-					<?php do_action( 'bp_before_message_meta' ); ?>
+					<?php
+
+					/** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
+					do_action( 'bp_before_message_meta' ); ?>
 
 					<div class="avatar-box">
 						<?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
@@ -86,17 +139,34 @@
 						<strong><?php _e( 'Send a Reply', 'buddypress' ); ?></strong>
 					</div>
 
-					<?php do_action( 'bp_after_message_meta' ); ?>
+					<?php
+
+					/** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */
+					do_action( 'bp_after_message_meta' ); ?>
 
 				</div><!-- .message-metadata -->
 
 				<div class="message-content">
 
-					<?php do_action( 'bp_before_message_reply_box' ); ?>
+					<?php
+
+					/**
+					 * Fires before the display of the message reply box.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_before_message_reply_box' ); ?>
 
 					<textarea name="content" id="message_content" rows="15" cols="40"></textarea>
 
-					<?php do_action( 'bp_after_message_reply_box' ); ?>
+					<?php
+
+					/**
+					 * Fires after the display of the message reply box.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_after_message_reply_box' ); ?>
 
 					<div class="submit">
 						<input type="submit" name="send" value="<?php esc_attr_e( 'Send Reply', 'buddypress' ); ?>" id="send_reply_button"/>
@@ -112,10 +182,24 @@
 
 		</form><!-- #send-reply -->
 
-		<?php do_action( 'bp_after_message_thread_reply' ); ?>
+		<?php
+
+		/**
+		 * Fires after the display of the message thread reply form.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 */
+		do_action( 'bp_after_message_thread_reply' ); ?>
 
 	<?php endif; ?>
 
-	<?php do_action( 'bp_after_message_thread_content' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of a single member message thread content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_after_message_thread_content' ); ?>
 
-</div>
\ No newline at end of file
+</div>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php
index 61e0aea3d18faa723a807f05bfbf2ea57c96aeba..ccf11d1f4ae5c52c847207c8a84394db51857248 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php
@@ -1,25 +1,35 @@
-<table class="notifications">
-	<thead>
-		<tr>
-			<th class="icon"></th>
-			<th class="title"><?php _e( 'Notification', 'buddypress' ); ?></th>
-			<th class="date"><?php _e( 'Date Received', 'buddypress' ); ?></th>
-			<th class="actions"><?php _e( 'Actions',    'buddypress' ); ?></th>
-		</tr>
-	</thead>
+<form action="" method="post" id="notifications-bulk-management">
+	<table class="notifications">
+		<thead>
+			<tr>
+				<th class="icon"></th>
+				<th class="bulk-select-all"><label class="bp-screen-reader-text" for="select-all-notifications"><?php _e( 'Select all', 'buddypress' ); ?></label><input id="select-all-notifications" type="checkbox"></th>
+				<th class="title"><?php _e( 'Notification', 'buddypress' ); ?></th>
+				<th class="date"><?php _e( 'Date Received', 'buddypress' ); ?></th>
+				<th class="actions"><?php _e( 'Actions',    'buddypress' ); ?></th>
+			</tr>
+		</thead>
 
-	<tbody>
+		<tbody>
 
-		<?php while ( bp_the_notifications() ) : bp_the_notification(); ?>
+			<?php while ( bp_the_notifications() ) : bp_the_notification(); ?>
 
-			<tr>
-				<td></td>
-				<td><?php bp_the_notification_description();  ?></td>
-				<td><?php bp_the_notification_time_since();   ?></td>
-				<td><?php bp_the_notification_action_links(); ?></td>
-			</tr>
+				<tr>
+					<td></td>
+					<td class="bulk-select-check"><input id="<?php bp_the_notification_id(); ?>" type="checkbox" name="notifications[]" value="<?php bp_the_notification_id(); ?>" class="notification-check"></td>
+					<td class="notification-description"><?php bp_the_notification_description();  ?></td>
+					<td class="notification-since"><?php bp_the_notification_time_since();   ?></td>
+					<td class="notification-actions"><?php bp_the_notification_action_links(); ?></td>
+				</tr>
+
+			<?php endwhile; ?>
+
+		</tbody>
+	</table>
 
-		<?php endwhile; ?>
+	<div class="notifications-options-nav">
+		<?php bp_notifications_bulk_management_dropdown(); ?>
+	</div><!-- .notifications-options-nav -->
 
-	</tbody>
-</table>
\ No newline at end of file
+	<?php wp_nonce_field( 'notifications_bulk_nonce', 'notifications_bulk_nonce' ); ?>
+</form>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php
index 4c956fb57977f59ff827bccc78a0976d0f78f501..c3c5afc7fa13f3da35f43b479a23d0d1ff2bf18c 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php
@@ -10,7 +10,14 @@
  */
 ?>
 
-		<?php do_action( 'bp_before_member_plugin_template' ); ?>
+		<?php
+
+		/**
+		 * Fires at the start of the member plugin template.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_before_member_plugin_template' ); ?>
 
 		<?php if ( ! bp_is_current_component_core() ) : ?>
 
@@ -18,14 +25,42 @@
 			<ul>
 				<?php bp_get_options_nav(); ?>
 
-				<?php do_action( 'bp_member_plugin_options_nav' ); ?>
+				<?php
+
+				/**
+				 * Fires inside the member plugin template nav <ul> tag.
+				 *
+				 * @since BuddyPress (1.2.2)
+				 */
+				do_action( 'bp_member_plugin_options_nav' ); ?>
 			</ul>
 		</div><!-- .item-list-tabs -->
 
 		<?php endif; ?>
 
-		<h3><?php do_action( 'bp_template_title' ); ?></h3>
+		<h3><?php
+
+			/**
+			 * Fires inside the member plugin template <h3> tag.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 */
+			do_action( 'bp_template_title' ); ?></h3>
+
+		<?php
+
+		/**
+		 * Fires and displays the member plugin template content.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 */
+		do_action( 'bp_template_content' ); ?>
 
-		<?php do_action( 'bp_template_content' ); ?>
+		<?php
 
-		<?php do_action( 'bp_after_member_plugin_template' ); ?>
+		/**
+		 * Fires at the end of the member plugin template.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 */
+		do_action( 'bp_after_member_plugin_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php
index 7f8927ec34b5aea320c87986200e5bb97bca69da..165cd178e63a18fc817788717c395a275c313c46 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php
@@ -15,9 +15,16 @@
 	</ul>
 </div><!-- .item-list-tabs -->
 
-<?php do_action( 'bp_before_profile_content' ); ?>
+<?php
+
+/**
+ * Fires before the display of member profile content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_profile_content' ); ?>
 
-<div class="profile" role="main">
+<div class="profile">
 
 <?php switch ( bp_current_action() ) :
 
@@ -51,4 +58,11 @@
 endswitch; ?>
 </div><!-- .profile -->
 
-<?php do_action( 'bp_after_profile_content' ); ?>
\ No newline at end of file
+<?php
+
+/**
+ * Fires after the display of member profile content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_profile_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php
index f2a30603c7f259077369365f02925a18c5958a86..bbdf4b7ba7dbdacb3e46dc2ca626782157810e45 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php
@@ -1,6 +1,13 @@
 <h4><?php _e( 'Change Profile Photo', 'buddypress' ); ?></h4>
 
-<?php do_action( 'bp_before_profile_avatar_upload_content' ); ?>
+<?php
+
+/**
+ * Fires before the display of profile avatar upload content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_profile_avatar_upload_content' ); ?>
 
 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
 
@@ -50,10 +57,25 @@
 
 	</form>
 
+	<?php
+	/**
+	 * Load the Avatar UI templates
+	 *
+	 * @since  BuddyPress (2.3.0)
+	 */
+	bp_avatar_get_templates(); ?>
+
 <?php else : ?>
 
 	<p><?php _e( 'Your profile photo will be used on your profile and throughout the site. To change your profile photo, please create an account with <a href="http://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ); ?></p>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_profile_avatar_upload_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of profile avatar upload content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_profile_avatar_upload_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
index 7fe800f4a9b6fec44d6a279fe5dad1909386c96a..cd50612f48bc049c41e98c00db0679eb111967f3 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
@@ -1,11 +1,21 @@
-<?php do_action( 'bp_before_profile_edit_content' );
+<?php
+
+/**
+ * Fires after the display of member profile edit content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_before_profile_edit_content' );
 
 if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
 	while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
 
 <form action="<?php bp_the_profile_group_edit_form_action(); ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug(); ?>">
 
-	<?php do_action( 'bp_before_profile_field_content' ); ?>
+	<?php
+
+		/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+		do_action( 'bp_before_profile_field_content' ); ?>
 
 		<h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4>
 
@@ -27,6 +37,11 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 				$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
 				$field_type->edit_field_html();
 
+				/**
+				 * Fires before the display of visibility options for the field.
+				 *
+				 * @since BuddyPress (1.7.0)
+				 */
 				do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
 				?>
 
@@ -50,14 +65,24 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 					</div>
 				<?php endif ?>
 
-				<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
+				<?php
+
+				/**
+				 * Fires after the visibility options for a field.
+				 *
+				 * @since BuddyPress (1.1.0)
+				 */
+				do_action( 'bp_custom_profile_edit_fields' ); ?>
 
 				<p class="description"><?php bp_the_profile_field_description(); ?></p>
 			</div>
 
 		<?php endwhile; ?>
 
-	<?php do_action( 'bp_after_profile_field_content' ); ?>
+	<?php
+
+	/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+	do_action( 'bp_after_profile_field_content' ); ?>
 
 	<div class="submit">
 		<input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?> " />
@@ -71,4 +96,11 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) )
 
 <?php endwhile; endif; ?>
 
-<?php do_action( 'bp_after_profile_edit_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of member profile edit content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_profile_edit_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
index b90d0a882d526c6dada04065e196d808d09c5b76..687340ce4c6889731c82f6ea14557ca8e70f0e96 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
@@ -1,4 +1,7 @@
-<?php do_action( 'bp_before_profile_loop_content' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+do_action( 'bp_before_profile_loop_content' ); ?>
 
 <?php if ( bp_has_profile() ) : ?>
 
@@ -6,7 +9,10 @@
 
 		<?php if ( bp_profile_group_has_fields() ) : ?>
 
-			<?php do_action( 'bp_before_profile_field_content' ); ?>
+			<?php
+
+			/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+			do_action( 'bp_before_profile_field_content' ); ?>
 
 			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
 
@@ -28,21 +34,37 @@
 
 						<?php endif; ?>
 
-						<?php do_action( 'bp_profile_field_item' ); ?>
+						<?php
+
+						/**
+						 * Fires after the display of a field table row for profile data.
+						 *
+						 * @since BuddyPress (1.1.0)
+						 */
+						do_action( 'bp_profile_field_item' ); ?>
 
 					<?php endwhile; ?>
 
 				</table>
 			</div>
 
-			<?php do_action( 'bp_after_profile_field_content' ); ?>
+			<?php
+
+			/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+			do_action( 'bp_after_profile_field_content' ); ?>
 
 		<?php endif; ?>
 
 	<?php endwhile; ?>
 
-	<?php do_action( 'bp_profile_field_buttons' ); ?>
+	<?php
+
+	/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+	do_action( 'bp_profile_field_buttons' ); ?>
 
 <?php endif; ?>
 
-<?php do_action( 'bp_after_profile_loop_content' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */
+do_action( 'bp_after_profile_loop_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php
index cc00f7d0a33d37965c15423a071fac27e7507a25..981e65b2387213a78c9de662dad68fd295a27518 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php
@@ -1,8 +1,22 @@
-<?php do_action( 'bp_before_profile_loop_content' ); ?>
+<?php
+
+/**
+ * Fires before the display of member profile loop content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_before_profile_loop_content' ); ?>
 
 <?php $ud = get_userdata( bp_displayed_user_id() ); ?>
 
-<?php do_action( 'bp_before_profile_field_content' ); ?>
+<?php
+
+	/**
+	 * Fires before the display of member profile field content.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
+	do_action( 'bp_before_profile_field_content' ); ?>
 
 	<div class="bp-widget wp-profile">
 		<h4><?php bp_is_my_profile() ? _e( 'My Profile', 'buddypress' ) : printf( __( "%s's Profile", 'buddypress' ), bp_get_displayed_user_fullname() ); ?></h4>
@@ -66,8 +80,29 @@
 		</table>
 	</div>
 
-<?php do_action( 'bp_after_profile_field_content' ); ?>
+<?php
+
+/**
+ * Fires after the display of member profile field content.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_after_profile_field_content' ); ?>
+
+<?php
+
+/**
+ * Fires and displays the profile field buttons.
+ *
+ * @since BuddyPress (1.1.0)
+ */
+do_action( 'bp_profile_field_buttons' ); ?>
 
-<?php do_action( 'bp_profile_field_buttons' ); ?>
+<?php
 
-<?php do_action( 'bp_after_profile_loop_content' ); ?>
+/**
+ * Fires after the display of member profile loop content.
+ *
+ * @since BuddyPress (1.2.0)
+ */
+do_action( 'bp_after_profile_loop_content' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php
index c472db1e3e2e6de118ba4d403226363f56afcd16..01260c8ba890333027e67b4d15dc82e9b3f00310 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php
@@ -1,8 +1,18 @@
-<?php do_action( 'bp_before_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_before_member_settings_template' ); ?>
 
 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/'; ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post">
 
-	<?php do_action( 'bp_members_capabilities_account_before_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the submit button for user capabilities saving.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_members_capabilities_account_before_submit' ); ?>
 
 	<label>
 		<input type="checkbox" name="user-spammer" id="user-spammer" value="1" <?php checked( bp_is_user_spammer( bp_displayed_user_id() ) ); ?> />
@@ -13,10 +23,20 @@
 		<input type="submit" value="<?php esc_attr_e( 'Save', 'buddypress' ); ?>" id="capabilities-submit" name="capabilities-submit" />
 	</div>
 
-	<?php do_action( 'bp_members_capabilities_account_after_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the submit button for user capabilities saving.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 */
+	do_action( 'bp_members_capabilities_account_after_submit' ); ?>
 
 	<?php wp_nonce_field( 'capabilities' ); ?>
 
 </form>
 
-<?php do_action( 'bp_after_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_after_member_settings_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php
index d347e95bc6d26433189837a72cb892c16f353ea3..5355d35404a7db744c3a1777d33e41a4d7200d1e 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php
@@ -1,4 +1,7 @@
-<?php do_action( 'bp_before_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_before_member_settings_template' ); ?>
 
 <div id="message" class="info">
 
@@ -16,7 +19,14 @@
 
 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
 
-	<?php do_action( 'bp_members_delete_account_before_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the submit button for user delete account submitting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_members_delete_account_before_submit' ); ?>
 
 	<label>
 		<input type="checkbox" name="delete-account-understand" id="delete-account-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-account-button').disabled = ''; } else { document.getElementById('delete-account-button').disabled = 'disabled'; }" />
@@ -27,10 +37,20 @@
 		<input type="submit" disabled="disabled" value="<?php esc_attr_e( 'Delete Account', 'buddypress' ); ?>" id="delete-account-button" name="delete-account-button" />
 	</div>
 
-	<?php do_action( 'bp_members_delete_account_after_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the submit button for user delete account submitting.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_members_delete_account_after_submit' ); ?>
 
 	<?php wp_nonce_field( 'delete-account' ); ?>
 
 </form>
 
-<?php do_action( 'bp_after_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_after_member_settings_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php
index 8d27837f87f4ba01ac5f6a0a78f3e74e21393f91..a2824083fdb5f4f7f8cc8c64adb11783c003091b 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php
@@ -1,32 +1,52 @@
-<?php do_action( 'bp_before_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_before_member_settings_template' ); ?>
 
 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/general'; ?>" method="post" class="standard-form" id="settings-form">
 
 	<?php if ( !is_super_admin() ) : ?>
 
 		<label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>
-		<input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> &nbsp;<a href="<?php echo wp_lostpassword_url(); ?>" title="<?php esc_attr_e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a>
+		<input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" <?php bp_form_field_attributes( 'password' ); ?>/> &nbsp;<a href="<?php echo wp_lostpassword_url(); ?>" title="<?php esc_attr_e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a>
 
 	<?php endif; ?>
 
 	<label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label>
-	<input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" />
+	<input type="email" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" <?php bp_form_field_attributes( 'email' ); ?>/>
 
 	<label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></label>
-	<input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" /> &nbsp;<?php _e( 'New Password', 'buddypress' ); ?><br />
+	<input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" <?php bp_form_field_attributes( 'password' ); ?>/> &nbsp;<?php _e( 'New Password', 'buddypress' ); ?><br />
 	<div id="pass-strength-result"></div>
-	<input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ); ?>
+	<input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ); ?>
+
+	<?php
 
-	<?php do_action( 'bp_core_general_settings_before_submit' ); ?>
+	/**
+	 * Fires before the display of the submit button for user general settings saving.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_core_general_settings_before_submit' ); ?>
 
 	<div class="submit">
 		<input type="submit" name="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
 	</div>
 
-	<?php do_action( 'bp_core_general_settings_after_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the submit button for user general settings saving.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_core_general_settings_after_submit' ); ?>
 
 	<?php wp_nonce_field( 'bp_settings_general' ); ?>
 
 </form>
 
-<?php do_action( 'bp_after_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_after_member_settings_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php
index 3af9f5635861d4e30fe83d86417801d8db1d4e0d..ff729659c54b713dfa158e4308ccd531502d929f 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php
@@ -1,20 +1,47 @@
-<?php do_action( 'bp_before_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_before_member_settings_template' ); ?>
 
 <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications'; ?>" method="post" class="standard-form" id="settings-form">
 	<p><?php _e( 'Send an email notice when:', 'buddypress' ); ?></p>
 
-	<?php do_action( 'bp_notification_settings' ); ?>
+	<?php
+
+	/**
+	 * Fires at the top of the member template notification settings form.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
+	do_action( 'bp_notification_settings' ); ?>
+
+	<?php
 
-	<?php do_action( 'bp_members_notification_settings_before_submit' ); ?>
+	/**
+	 * Fires before the display of the submit button for user notification saving.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_members_notification_settings_before_submit' ); ?>
 
 	<div class="submit">
 		<input type="submit" name="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
 	</div>
 
-	<?php do_action( 'bp_members_notification_settings_after_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the submit button for user notification saving.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 */
+	do_action( 'bp_members_notification_settings_after_submit' ); ?>
 
 	<?php wp_nonce_field('bp_settings_notifications' ); ?>
 
 </form>
 
-<?php do_action( 'bp_after_member_settings_template' ); ?>
+<?php
+
+/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */
+do_action( 'bp_after_member_settings_template' ); ?>
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/profile.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/profile.php
index 0fdae6f0ff0f396000a05969bccba927ae5df41c..c5156c229413bd6a9a6b17fec70bb062c81157fa 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/profile.php
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/profile.php
@@ -1,4 +1,11 @@
-<?php do_action( 'bp_before_member_settings_template' ); ?>
+<?php
+
+/**
+ * Fires before the display of member settings template.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_before_member_settings_template' ); ?>
 
 <form action="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/profile' ); ?>" method="post" class="standard-form" id="settings-form">
 
@@ -36,13 +43,27 @@
 
 	<?php endif; ?>
 
-	<?php do_action( 'bp_core_xprofile_settings_before_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires before the display of the submit button for user profile saving.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	do_action( 'bp_core_xprofile_settings_before_submit' ); ?>
 
 	<div class="submit">
 		<input id="submit" type="submit" name="xprofile-settings-submit" value="<?php esc_attr_e( 'Save Settings', 'buddypress' ); ?>" class="auto" />
 	</div>
 
-	<?php do_action( 'bp_core_xprofile_settings_after_submit' ); ?>
+	<?php
+
+	/**
+	 * Fires after the display of the submit button for user profile saving.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	do_action( 'bp_core_xprofile_settings_after_submit' ); ?>
 
 	<?php wp_nonce_field( 'bp_xprofile_settings' ); ?>
 
@@ -50,4 +71,11 @@
 
 </form>
 
-<?php do_action( 'bp_after_member_settings_template' );
+<?php
+
+/**
+ * Fires after the display of member settings template.
+ *
+ * @since BuddyPress (1.5.0)
+ */
+do_action( 'bp_after_member_settings_template' );
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css
index b2f0b7d7bd74557569731d5e6900836714102ebd..814d602445fd065875087a18c652dfdb4ede69ec 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css
@@ -38,7 +38,7 @@ Hello, this is the BuddyPress Legacy stylesheet.
 	background: transparent;
 	border: none;
 	color: #888;
-	font-size: 90%;
+	font-size: small;
 	margin: 0;
 	position: relative;
 	display: block;
@@ -126,7 +126,7 @@ Hello, this is the BuddyPress Legacy stylesheet.
 	background: #fff;
 	color: #555;
 	font-family: inherit;
-	font-size: 90%;
+	font-size: medium;
 	height: 20px;
 	padding: 6px;
 	width: 98%;
@@ -250,7 +250,7 @@ body.activity-permalink #buddypress .activity-list li .activity-header > p {
 }
 #buddypress .activity-list .activity-content .activity-header img.avatar {
 	float: none !important;
-	margin: 0 5px -8px 0 !important;
+	margin: 0 0 -8px 5px !important;
 }
 #buddypress a.bp-secondary-action,
 #buddypress span.highlight {
@@ -496,7 +496,9 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 	font-size: 90%;
 	padding: 1px 3px;
 }
-
+#buddypress .current-member-type {
+	font-style: italic;
+}
 #buddypress .dir-form {
 	clear: both;
 }
@@ -512,6 +514,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 }
 #buddypress div#message.updated {
 	clear: both;
+	display: block;
 }
 #buddypress div#message p,
 #sitewide-notice p {
@@ -525,6 +528,12 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 	clear: right;
 	color: #800;
 }
+#buddypress div#message.warning p {
+	background-color: #ffe0af;
+	border: 1px solid #ffd087;
+	clear: right;
+	color: #800;
+}
 #buddypress div#message.updated p {
 	background-color: #efc;
 	border: 1px solid #591;
@@ -728,9 +737,18 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 #buddypress .standard-form #profile-details-section {
 	float: left;
 }
-#buddypress .standard-form #blog-details-section {
+#buddypress .standard-form #blog-details-section,
+#buddypress #notifications-bulk-management {
 	clear: right;
 }
+body.no-js #buddypress #notifications-bulk-management #select-all-notifications,
+body.no-js #buddypress label[for="message-type-select"],
+body.no-js #buddypress #message-type-select,
+body.no-js #buddypress #delete_inbox_messages,
+body.no-js #buddypress #delete_sentbox_messages,
+body.no-js #buddypress #messages-bulk-management #select-all-messages {
+	display: none;
+}
 #buddypress .standard-form input:focus,
 #buddypress .standard-form textarea:focus,
 #buddypress .standard-form select:focus {
@@ -760,7 +778,7 @@ a.bp-title-button {
 	background: #fff; /* Old browsers */
 	border: 1px solid #ccc;
 	color: #777;
-	font-size: .8rem;
+	font-size: small;
 	cursor: pointer;
 	outline: none;
 	padding: 4px 10px;
@@ -818,6 +836,17 @@ a.bp-title-button {
 #buddypress .wp-editor-wrap input[type=reset] {
 	padding: 0 10px 1px;
 }
+
+/* Form classes & generic attr styling */
+#buddypress form *[disabled="disabled"]{
+	cursor: default;
+	opacity: .4;
+ }
+.bp-screen-reader-text {
+	clip: rect(1px, 1px, 1px, 1px);
+	position: absolute;
+}
+
 /*--------------------------------------------------------------
 3.6 - Ajax Loading
 --------------------------------------------------------------*/
@@ -862,6 +891,7 @@ a.bp-title-button {
 #buddypress input[type="submit"].disabled,
 #buddypress input[type="button"].disabled,
 #buddypress input[type="reset"].disabled,
+#buddypress input[type="submit"][disabled=disabled],
 #buddypress button.pending,
 #buddypress button.disabled,
 #buddypress div.pending a,
@@ -952,8 +982,6 @@ a.bp-title-button {
 }
 #buddypress table#message-threads {
 	clear: both;
-	margin: 0;
-	width: auto;
 }
 #buddypress table.profile-fields {
 	margin-bottom: 20px;
@@ -993,6 +1021,9 @@ a.bp-title-button {
 	font-weight: bold;
 	width: 25%;
 }
+#buddypress #message-threads .thread-info {
+	min-width: 40%;
+}
 #buddypress table tr td.thread-info p {
 	margin: 0;
 }
@@ -1109,7 +1140,7 @@ a.bp-title-button {
 }
 #buddypress span.activity {
 	display: inline-block;
-	font-size: 80%;
+	font-size: small;
 	opacity: 0.8;
 	padding: 0;
 }
@@ -1256,6 +1287,9 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	margin: 10px 60px 0 0;
 	width: 50%;
 }
+#buddypress ul.item-list li.group-no-avatar div.item-desc {
+	margin-right: 0;
+}
 #buddypress ul.item-list li div.action {
 	position: absolute;
 	top: 15px;
@@ -1298,7 +1332,7 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	margin-top: 4px;
 }
 #buddypress div.item-list-tabs ul li.last select {
-	max-width: 175px;
+	max-width: 185px;
 }
 #buddypress div.item-list-tabs ul li a,
 #buddypress div.item-list-tabs ul li span {
@@ -1362,6 +1396,11 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	border-bottom: 1px solid #ffe8c4;
 	font-weight: bold;
 }
+#buddypress table#message-threads tr.unread td .thread-excerpt,
+#buddypress table#message-threads tr.unread td .activity,
+#buddypress table#message-threads tr.unread td.thread-options {
+	font-weight: normal;
+}
 #buddypress li span.unread-count,
 #buddypress tr.unread span.unread-count {
 	background: #dd0000;
@@ -1373,13 +1412,6 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	padding: 1px 6px;
 	color: #fff;
 }
-#buddypress div.messages-options-nav {
-	background: #eee;
-	font-size: 80%;
-	margin: 0;
-	padding: 5px 15px;
-	text-align: left;
-}
 #buddypress div#message-thread div.message-box {
 	margin: 0;
 	padding: 15px;
@@ -1422,6 +1454,40 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	margin: 0 20px;
 }
 
+.message-metadata {
+	position: relative;
+}
+.message-star-actions {
+	position: absolute;
+	left: 0;
+	top: 0;
+}
+#buddypress a.message-action-star,
+#buddypress a.message-action-unstar {
+	border-bottom: 0;
+	text-decoration: none;
+	outline: none;
+}
+a.message-action-star {
+	opacity: .7;
+}
+a.message-action-star:hover {
+	opacity: 1;
+}
+.message-action-star span.icon:before,
+.message-action-unstar span.icon:before {
+	font-family: dashicons;
+	font-size: 18px;
+}
+.message-action-star span.icon:before {
+	color: #aaa;
+	content: "\f154";
+}
+.message-action-unstar span.icon:before {
+	color: #FCDD77;
+	content: "\f155";
+}
+
 /*--------------------------------------------------------------
 3.10 - Extended Profiles
 --------------------------------------------------------------*/
@@ -1487,7 +1553,7 @@ body.register #buddypress div.page ul {
 
 .widget.buddypress span.activity {
 	display: inline-block;
-	font-size: 80%;
+	font-size: small;
 	opacity: 0.8;
 	padding: 0;
 }
@@ -1505,13 +1571,13 @@ body.register #buddypress div.page ul {
 .widget.buddypress div.item-meta,
 .widget.buddypress div.item-content {
 	font-size: 11px;
-	margin-right: 38px;
+	margin-right: 50px;
 }
 
 .widget.buddypress ul.item-list img.avatar {
-	height: 20px;
+	height: 40px;
 	margin-left: 10px;
-	width: 20px;
+	width: 40px;
 }
 .widget.buddypress div.item-avatar img {
 	height: 40px;
@@ -1534,7 +1600,11 @@ body.register #buddypress div.page ul {
 
 .widget.buddypress .bp-login-widget-user-avatar {
 	float: right;
-	width: 60px;
+}
+
+.bp-login-widget-user-avatar img.avatar {
+	height: 40px;
+	width: 40px;
 }
 
 .widget.buddypress .bp-login-widget-user-links > div {
@@ -1549,6 +1619,20 @@ body.register #buddypress div.page ul {
 	font-weight: bold;
 }
 
+.widget.buddypress #groups-list,
+.widget.buddypress #members-list,
+.widget.buddypress #friends-list {
+	margin-right: 0;
+	padding-right: 0;
+}
+
+.widget.buddypress #groups-list li,
+.widget.buddypress #members-list li,
+.widget.buddypress #friends-list li {
+	clear: both;
+	list-style-type: none;
+}
+
 /*--------------------------------------------------------------
 4.0 - Media Queries
 --------------------------------------------------------------*/
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.min.css
index 7ff9b54f91cec38a2f62fc4aeb5c6d95fbc747dc..ba432c08b31d9c14d7875e6e7b2f02e527fc9ac6 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-#buddypress div.pagination{background:0 0;border:none;color:#888;font-size:90%;margin:0;position:relative;display:block;float:right;width:100%;padding:10px 0}#buddypress div.pagination .pag-count{float:right;margin-right:10px}#buddypress div.pagination .pagination-links{float:left;margin-left:10px}#buddypress div.pagination .pagination-links a,#buddypress div.pagination .pagination-links span{font-size:90%;padding:0 5px}#buddypress div.pagination .pagination-links a:hover{font-weight:700}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:right}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:right}#buddypress form#whats-new-form #whats-new-content{margin-right:55px;padding:0 20px 20px 0}#buddypress form#whats-new-form p.activity-greeting{line-height:.5em;margin-bottom:15px;margin-right:75px}#buddypress form#whats-new-form textarea{background:#fff;color:#555;font-family:inherit;font-size:90%;height:20px;padding:6px;width:98%}body.no-js #buddypress form#whats-new-form textarea{height:50px}#buddypress form#whats-new-form #whats-new-options select{max-width:200px;margin-top:12px}#buddypress form#whats-new-form #whats-new-submit{float:left;margin-top:12px}#buddypress #whats-new-options{overflow:auto;height:0}body.no-js #buddypress #whats-new-options{height:auto}#buddypress #whats-new:focus{border-color:rgba(31,179,221,.9)!important;outline-color:rgba(31,179,221,.9)}#buddypress ul.activity-list li{overflow:hidden;padding:15px 0 0;list-style:none}#buddypress .activity-list .activity-avatar{float:right}#buddypress ul.item-list.activity-list li.has-comments{padding-bottom:15px}body.activity-permalink #buddypress ul.activity-list li.has-comments{padding-bottom:0}#buddypress .activity-list li.mini{font-size:80%;position:relative}#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-list li.mini .activity-avatar img.avatar{height:20px;margin-right:30px;width:20px}#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar{height:auto;margin-right:0;width:auto}body.activity-permalink #buddypress .activity-list>li:first-child{padding-top:0}#buddypress .activity-list li .activity-content{position:relative}#buddypress .activity-list li.mini .activity-content p{margin:0}#buddypress .activity-list li.mini .activity-comments{clear:both;font-size:120%}body.activity-permalink #buddypress li.mini .activity-meta{margin-top:4px}#buddypress .activity-list li .activity-inreplyto{color:#888;font-size:80%}#buddypress .activity-list li .activity-inreplyto>p{margin:0;display:inline}#buddypress .activity-list li .activity-inreplyto blockquote,#buddypress .activity-list li .activity-inreplyto div.activity-inner{background:0 0;border:none;display:inline;margin:0;overflow:hidden;padding:0}#buddypress .activity-list .activity-content{margin:0 70px 0 0}body.activity-permalink #buddypress .activity-list li .activity-content{border:none;font-size:100%;line-height:150%;margin-right:170px;margin-left:0;padding:0}body.activity-permalink #buddypress .activity-list li .activity-header>p{margin:0;padding:5px 0 0}#buddypress .activity-list .activity-content .activity-header,#buddypress .activity-list .activity-content .comment-header{color:#888;line-height:220%}#buddypress .activity-header{margin-left:20px}#buddypress .acomment-meta a,#buddypress .activity-header a,#buddypress .comment-meta a{text-decoration:none}#buddypress .activity-list .activity-content .activity-header img.avatar{float:none!important;margin:0 5px -8px 0!important}#buddypress a.bp-secondary-action,#buddypress span.highlight{font-size:80%;padding:0;margin-left:5px;text-decoration:none}#buddypress .activity-list .activity-content .activity-inner,#buddypress .activity-list .activity-content blockquote{margin:10px 0 5px 10px;overflow:hidden}#buddypress .activity-list li.new_forum_post .activity-content .activity-inner,#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner{border-right:2px solid #EAEAEA;margin-right:5px;padding-right:10px}body.activity-permalink #buddypress .activity-content .activity-inner,body.activity-permalink #buddypress .activity-content blockquote{margin-right:0;margin-top:5px}#buddypress .activity-inner>p{word-wrap:break-word}#buddypress .activity-inner>.activity-inner,#buddypress .activity-inner>blockquote{margin:0}#buddypress .activity-list .activity-content img.thumbnail{border:2px solid #eee;float:right;margin:0 0 5px 10px}#buddypress .activity-read-more{margin-right:1em;white-space:nowrap}#buddypress .activity-list li.load-more,#buddypress .activity-list li.load-newest{background:#f0f0f0;font-size:110%;margin:15px 0;padding:10px 15px;text-align:center}#buddypress .activity-list li.load-more a,#buddypress .activity-list li.load-newest a{color:#4D4D4D}#buddypress div.activity-meta{margin:18px 0 0}body.activity-permalink #buddypress div.activity-meta{margin-bottom:6px}#buddypress div.activity-meta a{padding:4px 8px}#buddypress a.activity-time-since{color:#aaa;text-decoration:none}#buddypress a.activity-time-since:hover{color:#888;text-decoration:underline}#buddypress #reply-title small a,#buddypress a.bp-primary-action{font-size:80%;margin-left:5px;text-decoration:none}#buddypress #reply-title small a span,#buddypress a.bp-primary-action span{background:#999;color:#fff;font-size:90%;margin-right:2px;padding:0 5px}#buddypress #reply-title small a:hover span,#buddypress a.bp-primary-action:hover span{background:#555;color:#fff}#buddypress div.activity-comments{margin:0 70px 0 0;overflow:hidden;position:relative;width:auto;clear:both}body.activity-permalink #buddypress div.activity-comments{background:0 0;margin-right:170px;width:auto}#buddypress div.activity-comments>ul{padding:0 10px 0 0}#buddypress div.activity-comments ul,#buddypress div.activity-comments ul li{border:none;list-style:none}#buddypress div.activity-comments ul{clear:both;margin:0}#buddypress div.activity-comments ul li{border-top:1px solid #eee;padding:10px 0 0}body.activity-permalink #buddypress .activity-list li.mini .activity-comments{clear:none;margin-top:0}body.activity-permalink #buddypress div.activity-comments ul li{border-width:1px;padding:10px 0 0}#buddypress div.activity-comments>ul>li:first-child{border-top:none}#buddypress div.activity-comments ul li:last-child{margin-bottom:0}#buddypress div.activity-comments ul li>ul{margin-right:30px;margin-top:0;padding-right:10px}body.activity-permalink #buddypress div.activity-comments ul li>ul{margin-top:10px}body.activity-permalink #buddypress div.activity-comments>ul{padding:0 15px 0 10px}#buddypress div.activity-comments div.acomment-avatar img{border-width:1px;float:right;height:25px;margin-left:10px;width:25px}#buddypress div.activity-comments div.acomment-content{font-size:80%;margin:5px 40px 0 0}#buddypress div.acomment-content .activity-delete-link,#buddypress div.acomment-content .comment-header,#buddypress div.acomment-content .time-since{display:none}body.activity-permalink #buddypress div.activity-comments div.acomment-content{font-size:90%}#buddypress div.activity-comments div.acomment-meta{color:#888;font-size:80%}#buddypress div.activity-comments form.ac-form{display:none;padding:10px}#buddypress div.activity-comments li form.ac-form{margin-left:15px;clear:both}#buddypress div.activity-comments form.root{margin-right:0}#buddypress div.activity-comments div#message{margin-top:15px;margin-bottom:0}#buddypress div.activity-comments form .ac-textarea{background:#fff;border:1px inset #ccc;margin-bottom:10px;padding:8px}#buddypress div.activity-comments form textarea{border:none;background:0 0;box-shadow:none;outline:0;color:#555;font-family:inherit;font-size:100%;height:60px;padding:0;margin:0;width:100%}#buddypress div.activity-comments form input{margin-top:5px}#buddypress div.activity-comments form div.ac-reply-avatar{float:right}#buddypress div.ac-reply-avatar img{border:1px solid #eee}#buddypress div.activity-comments form div.ac-reply-content{color:#888;margin-right:50px;padding-right:15px}#buddypress div.activity-comments form div.ac-reply-content a{text-decoration:none}#buddypress .acomment-options{float:right;margin:5px 40px 5px 0}#buddypress .acomment-options a{color:#999}#buddypress .acomment-options a:hover{color:inherit}#buddypress div.dir-search{float:left;margin:-39px 0 0}#buddypress div.dir-search input[type=text],#buddypress li.groups-members-search input[type=text]{font-size:90%;padding:1px 3px}#buddypress .dir-form{clear:both}#buddypress div#message{margin:0 0 15px}#buddypress #message.info{margin-bottom:0}#buddypress div#message.updated{clear:both}#buddypress div#message p,#sitewide-notice p{font-size:90%;display:block;padding:10px 15px}#buddypress div#message.error p{background-color:#fdc;border:1px solid #a00;clear:right;color:#800}#buddypress div#message.updated p{background-color:#efc;border:1px solid #591;color:#250}#buddypress #pass-strength-result{background-color:#eee;border-color:#ddd;border-style:solid;border-width:1px;display:none;margin:5px 0 5px 5px;padding:5px;text-align:center;width:150px}#buddypress .standard-form #basic-details-section #pass-strength-result{width:35%}#buddypress #pass-strength-result.bad,#buddypress #pass-strength-result.error{background-color:#ffb78c;border-color:#ff853c!important;display:block}#buddypress #pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;display:block}#buddypress #pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;display:block}#buddypress #pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;display:block}#buddypress .standard-form#signup_form div div.error{background:#faa;color:#a00;margin:0 0 10px;padding:6px;width:90%}#buddypress div.accept,#buddypress div.reject{float:right;margin-right:10px}#buddypress ul.button-nav li{float:right;margin:0 0 10px 10px;list-style:none}#buddypress ul.button-nav li.current a{font-weight:700}#sitewide-notice #message{right:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}#buddypress .dir-search input[type=search],#buddypress .dir-search input[type=text],#buddypress .groups-members-search input[type=search],#buddypress .groups-members-search input[type=text],#buddypress .standard-form input[type=color],#buddypress .standard-form input[type=date],#buddypress .standard-form input[type=datetime-local],#buddypress .standard-form input[type=datetime],#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=month],#buddypress .standard-form input[type=number],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=range],#buddypress .standard-form input[type=search],#buddypress .standard-form input[type=tel],#buddypress .standard-form input[type=text],#buddypress .standard-form input[type=time],#buddypress .standard-form input[type=url],#buddypress .standard-form input[type=week],#buddypress .standard-form select,#buddypress .standard-form textarea{border:1px solid #ccc;background:#fafafa;border-radius:0;color:#888;font:inherit;font-size:100%;padding:6px}#buddypress .standard-form select{padding:3px}#buddypress .standard-form input[type=password]{margin-bottom:5px}#buddypress .standard-form label,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress .standard-form div.checkbox label:nth-child(n+2),#buddypress .standard-form div.radio div label{color:#888;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form#sidebar-login-form label{margin-top:5px}#buddypress .standard-form input[type=text]{width:75%}#buddypress .standard-form#sidebar-login-form input[type=password],#buddypress .standard-form#sidebar-login-form input[type=text]{padding:4px;width:95%}#buddypress .standard-form #basic-details-section input[type=password],#buddypress .standard-form #blog-details-section input#signup_blog_url{width:35%}#buddypress #commentform input[type=text],#buddypress #commentform textarea,#buddypress .form-allowed-tags,#buddypress .standard-form#signup_form input[type=text],#buddypress .standard-form#signup_form textarea{width:90%}#buddypress .standard-form#signup_form div.submit{float:left}#buddypress div#signup-avatar img{margin:0 0 10px 15px}#buddypress .standard-form textarea{width:75%;height:120px}#buddypress .standard-form textarea#message_content{height:200px}#buddypress .standard-form#send-reply textarea{width:97.5%}#buddypress .standard-form p.description{color:#888;font-size:80%;margin:5px 0}#buddypress .standard-form div.submit{clear:both;padding:15px 0 0}#buddypress .standard-form p.submit{margin-bottom:0;padding:15px 0 0}#buddypress .standard-form div.submit input{margin-left:15px}#buddypress .standard-form div.radio ul{margin:10px 38px 15px 0;list-style:disc}#buddypress .standard-form div.radio ul li{margin-bottom:5px}#buddypress .standard-form a.clear-value{display:block;margin-top:5px;outline:0}#buddypress .standard-form #basic-details-section,#buddypress .standard-form #blog-details-section,#buddypress .standard-form #profile-details-section{float:right;width:48%}#buddypress .standard-form #profile-details-section{float:left}#buddypress .standard-form #blog-details-section{clear:right}#buddypress .standard-form input:focus,#buddypress .standard-form select:focus,#buddypress .standard-form textarea:focus{background:#fafafa;color:#555}#buddypress form#send-invite-form{margin-top:20px}#buddypress div#invite-list{background:#f5f5f5;height:400px;margin:0 0 10px;overflow:auto;padding:5px;width:160px}#buddypress .comment-reply-link,#buddypress a.button,#buddypress button,#buddypress div.generic-button a,#buddypress input[type=button],#buddypress input[type=reset],#buddypress input[type=submit],#buddypress ul.button-nav li a,a.bp-title-button{background:#fff;border:1px solid #ccc;color:#777;font-size:.8rem;cursor:pointer;outline:0;padding:4px 10px;text-align:center;text-decoration:none}#buddypress .comment-reply-link:hover,#buddypress a.button:focus,#buddypress a.button:hover,#buddypress button:hover,#buddypress div.generic-button a:hover,#buddypress input[type=button]:hover,#buddypress input[type=reset]:hover,#buddypress input[type=submit]:hover,#buddypress ul.button-nav li a:hover,#buddypress ul.button-nav li.current a{background:#ededed;border:1px solid #bbb;color:#555;outline:0;text-decoration:none}#buddypress form.standard-form .left-menu{float:right}#buddypress form.standard-form .left-menu #invite-list ul{margin:1%;list-style:none}#buddypress form.standard-form .left-menu #invite-list ul li{margin:0 1% 0 0}#buddypress form.standard-form .main-column{margin-right:190px}#buddypress form.standard-form .main-column ul#friend-list{clear:none;float:right}#buddypress form.standard-form .main-column ul#friend-list h4{clear:none}#buddypress .wp-editor-wrap a.button,#buddypress .wp-editor-wrap button,#buddypress .wp-editor-wrap input[type=button],#buddypress .wp-editor-wrap input[type=reset],#buddypress .wp-editor-wrap input[type=submit]{padding:0 10px 1px}#buddypress a.loading,#buddypress input.loading{-webkit-animation:loader-pulsate .5s infinite ease-in-out alternate;-moz-animation:loader-pulsate .5s infinite ease-in-out alternate;border-color:#aaa}@-webkit-keyframes loader-pulsate{from{border-color:#aaa;-webkit-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-webkit-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}@-moz-keyframes loader-pulsate{from{border-color:#aaa;-moz-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-moz-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}#buddypress a.loading:hover,#buddypress input.loading:hover{color:#777}#buddypress a.disabled,#buddypress button.disabled,#buddypress button.pending,#buddypress div.pending a,#buddypress input[type=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#888;margin-bottom:10px}#buddypress ul#topic-post-list li div.post-content{margin-right:54px}#buddypress div.topic-tags{font-size:80%}#buddypress div.admin-links{color:#888;font-size:80%;position:absolute;top:15px;left:25px}#buddypress div#topic-meta{margin:0;padding:5px 19px 30px;position:relative}#buddypress div#topic-meta div.admin-links{left:19px;top:-36px}#buddypress div#topic-meta h3{margin:5px 0}#buddypress div#new-topic-post{display:none;margin:20px 0 0;padding:1px 0 0}#buddypress table.forum,#buddypress table.messages-notices,#buddypress table.notifications,#buddypress table.notifications-settings,#buddypress table.profile-fields,#buddypress table.profile-settings,#buddypress table.wp-profile-fields{width:100%}#buddypress table.forum thead tr,#buddypress table.messages-notices thead tr,#buddypress table.notifications thead tr,#buddypress table.notifications-settings thead tr,#buddypress table.profile-fields thead tr,#buddypress table.profile-settings thead tr,#buddypress table.wp-profile-fields thead tr{background:#eaeaea}#buddypress table#message-threads{clear:both;margin:0;width:auto}#buddypress table.profile-fields{margin-bottom:20px}#buddypress table.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-left:1px solid #eaeaea;font-weight:700;width:25%}#buddypress table tr td.thread-info p{margin:0}#buddypress table tr td.thread-info p.thread-excerpt{color:#888;font-size:80%;margin-top:3px}#buddypress table.forum td{text-align:center}#buddypress table.forum tr.alt td,#buddypress table.messages-notices tr.alt td,#buddypress table.notifications tr.alt td,#buddypress table.notifications-settings tr.alt td,#buddypress table.profile-fields tr.alt td,#buddypress table.profile-settings tr.alt td,#buddypress table.wp-profile-fields tr.alt td{background:#f5f5f5}#buddypress table.notification-settings{margin-bottom:20px;text-align:right}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon{display:none}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-right:35px}#buddypress table.forum td p.topic-text{color:#888;font-size:100%}#buddypress table.forum tr>td:first-child,#buddypress table.forum tr>th:first-child{padding-right:15px}#buddypress table.forum tr>td:last-child,#buddypress table.forum tr>th:last-child{padding-left:15px}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster,#buddypress table.forum td.td-title,#buddypress table.forum tr th#th-group,#buddypress table.forum tr th#th-poster,#buddypress table.forum tr th#th-title{text-align:right}#buddypress table.forum tr td.td-title a.topic-title{font-size:110%}#buddypress table.forum td.td-freshness{white-space:nowrap}#buddypress table.forum td.td-freshness span.time-since{font-size:80%;color:#888}#buddypress table.forum td img.avatar{float:none;margin:0 0 -8px 5px}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster{min-width:140px}#buddypress table.forum th#th-title{width:80%}#buddypress table.forum th#th-freshness{width:25%}#buddypress table.forum th#th-postcount{width:15%}#buddypress table.forum p.topic-meta{font-size:80%;margin:5px 0 0}#buddypress .item-body{margin:20px 0}#buddypress span.activity{display:inline-block;font-size:80%;opacity:.8;padding:0}#buddypress span.user-nicename{color:#777;display:inline-block;font-size:120%;font-weight:700}#buddypress div#message p,#sitewide-notice p{font-weight:400;margin-top:3px;text-decoration:none;background-color:#ffd;border:1px solid #cb2;color:#440}#buddypress div#item-header{overflow:hidden}#buddypress div#item-header div#item-header-content{float:right;margin-right:0}#buddypress div#item-header h2{line-height:120%;margin:0 0 15px}#buddypress div#item-header h2 a{color:#777;text-decoration:none}#buddypress div#item-header img.avatar{float:right;margin:0 0 19px 15px}#buddypress div#item-header h2{margin-bottom:5px}#buddypress div#item-header h2 span.highlight{font-size:60%;font-weight:400;line-height:170%;vertical-align:middle;display:inline-block}#buddypress div#item-header h2 span.highlight span{background:#a1dcfa;color:#fff;cursor:pointer;font-weight:700;font-size:80%;margin-bottom:2px;padding:1px 4px;position:relative;left:-2px;top:-2px;vertical-align:middle}#buddypress div#item-header div#item-meta{font-size:80%;color:#aaa;overflow:hidden;margin:15px 0 5px;padding-bottom:10px}#buddypress div#item-header div#item-actions{float:left;margin:0 15px 15px 0;text-align:left;width:20%}#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header ul{margin-bottom:15px;overflow:hidden}#buddypress div#item-header ul h5,#buddypress div#item-header ul hr,#buddypress div#item-header ul span{display:none}#buddypress div#item-header ul li{float:left;list-style:none}#buddypress div#item-header ul img.avatar,#buddypress div#item-header ul.avatars img.avatar{height:30px;margin:2px;width:30px}#buddypress div#item-header a.button,#buddypress div#item-header div.generic-button{float:right;margin:10px 0 0 10px}#buddypress div#item-header div#message.info{line-height:80%}#buddypress ul.item-list{border-top:1px solid #eaeaea;width:100%;list-style:none;clear:both;margin:0;padding:0}body.activity-permalink #buddypress ul.item-list,body.activity-permalink #buddypress ul.item-list li.activity-item{border:none}#buddypress ul.item-list li{border-bottom:1px solid #eaeaea;padding:15px 0;margin:0;position:relative;list-style:none}#buddypress ul.single-line li{border:none}#buddypress ul.item-list li img.avatar{float:right;margin:0 0 0 10px}#buddypress ul.item-list li div.item-title,#buddypress ul.item-list li h4{font-weight:400;font-size:90%;margin:0;width:75%}#buddypress ul.item-list li div.item-title span{color:#999;font-size:80%}#buddypress ul.item-list li div.item-desc{color:#888;font-size:80%;margin:10px 60px 0 0;width:50%}#buddypress ul.item-list li div.action{position:absolute;top:15px;left:0;text-align:left}#buddypress ul.item-list li div.meta{color:#888;font-size:80%;margin-top:10px}#buddypress ul.item-list li h5 span.small{float:left;font-size:80%;font-weight:400}#buddypress div.item-list-tabs{background:0 0;clear:right;overflow:hidden}#buddypress div.item-list-tabs ul{margin:0;padding:0}#buddypress div.item-list-tabs ul li{float:right;margin:0;list-style:none}#buddypress div.item-list-tabs#subnav ul li{margin-top:0}#buddypress div.item-list-tabs ul li.last{float:left;margin:7px 0 0}#buddypress div.item-list-tabs#subnav ul li.last{margin-top:4px}#buddypress div.item-list-tabs ul li.last select{max-width:175px}#buddypress div.item-list-tabs ul li a,#buddypress div.item-list-tabs ul li span{display:block;padding:5px 10px;text-decoration:none}#buddypress div.item-list-tabs ul li a span{background:#eee;border-radius:50%;border:1px solid #ccc;color:#999;display:inline;font-size:70%;margin-right:2px;padding:3px 6px;text-align:center;vertical-align:middle}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background-color:#eee;color:#555;opacity:.8;font-weight:700}#buddypress div.item-list-tabs ul li a:hover span,#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#eee}#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#fff}#buddypress div#item-nav ul li.loading a{background-position:12% 50%}#buddypress div.item-list-tabs#object-nav{margin-top:0}#buddypress div.item-list-tabs#subnav{background:0 0;margin:10px 0;overflow:hidden}#buddypress #admins-list li,#buddypress #members-list li,#buddypress #mods-list li{overflow:auto;list-style:none}#buddypress table#message-threads tr.unread td{background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4;font-weight:700}#buddypress li span.unread-count,#buddypress tr.unread span.unread-count{background:#d00;color:#fff;font-weight:700;padding:2px 8px}#buddypress div.item-list-tabs ul li a span.unread-count{padding:1px 6px;color:#fff}#buddypress div.messages-options-nav{background:#eee;font-size:80%;margin:0;padding:5px 15px;text-align:left}#buddypress div#message-thread div.message-box{margin:0;padding:15px}#buddypress div#message-thread div.alt{background:#f4f4f4}#buddypress div#message-thread p#message-recipients{margin:10px 0 20px}#buddypress div#message-thread img.avatar{float:right;margin:0 0 0 10px;vertical-align:middle}#buddypress div#message-thread strong{font-size:100%;margin:0}#buddypress div#message-thread strong a{text-decoration:none}#buddypress div#message-thread strong span.activity{margin-top:4px}#buddypress div#message-thread div.message-metadata{overflow:hidden}#buddypress div#message-thread div.message-content{margin-right:45px}#buddypress div#message-thread div.message-options{text-align:left}#buddypress #message-threads img.avatar{max-width:none}#buddypress div.message-search{float:left;margin:0 20px}#buddypress div.profile h4{margin-bottom:auto;margin-top:15px}#buddypress #profile-edit-form ul.button-nav{margin-top:15px}body.no-js #buddypress .field-visibility-settings-close,body.no-js #buddypress .field-visibility-settings-toggle{display:none}#buddypress .field-visibility-settings{display:none;margin-top:10px}body.no-js #buddypress .field-visibility-settings{display:block}#buddypress .current-visibility-level{font-weight:700;font-style:normal}#buddypress .field-visibility-settings,#buddypress .field-visibility-settings-notoggle,#buddypress .field-visibility-settings-toggle{color:#888}#buddypress .field-visibility-settings a,#buddypress .field-visibility-settings-toggle a{font-size:80%}body.register #buddypress div.page ul{list-style:none}#buddypress .standard-form .field-visibility-settings label{margin:0;font-weight:400}#buddypress .field-visibility-settings legend,#buddypress .field-visibility-settings-toggle{font-style:italic}#buddypress .field-visibility-settings .radio{list-style:none;margin-bottom:0}#buddypress .field-visibility select{margin:0}.widget.buddypress div.item-avatar img.avatar{float:right;margin:0 0 15px 10px}.widget.buddypress span.activity{display:inline-block;font-size:80%;opacity:.8;padding:0}.widget.buddypress div.item-options{font-size:90%;margin:0 0 1em;padding:1em 0}.widget.buddypress div.item{margin:0 0 1em}.widget.buddypress div.item-content,.widget.buddypress div.item-meta{font-size:11px;margin-right:38px}.widget.buddypress ul.item-list img.avatar{height:20px;margin-left:10px;width:20px}.widget.buddypress div.item-avatar img{height:40px;margin:1px;width:40px}.widget.buddypress div.avatar-block{overflow:hidden}.widget.buddypress #bp-login-widget-form label{display:block;margin:1rem 0 .5rem}.widget.buddypress #bp-login-widget-form #bp-login-widget-submit{margin-left:10px}.widget.buddypress .bp-login-widget-user-avatar{float:right;width:60px}.widget.buddypress .bp-login-widget-user-links>div{padding-right:60px;margin-bottom:.5rem}.widget.buddypress .bp-login-widget-user-links>div.bp-login-widget-user-link a{font-weight:700}@media only screen and (max-width:480px){#buddypress div.dir-search{float:left;margin-top:-50px;text-align:left}#buddypress div.dir-search input[type=text]{margin-bottom:1em;width:50%}a.bp-title-button{margin-right:10px}#buddypress form.standard-form .main-column div.action{position:relative;margin-bottom:1em}#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search{clear:right;float:right;margin-top:0;text-align:right}#buddypress li#groups-order-select{clear:right;float:right}#buddypress ul.item-list li div.action{clear:right;float:right;margin-top:0;margin-right:70px;position:relative;top:0;left:0;text-align:right}#buddypress ul.item-list li div.item-desc{clear:right;float:right;margin:10px 0 0;width:auto}#buddypress li div.item{margin-right:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-right:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:right;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:right}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-right:45px}h1 a.bp-title-button{clear:right;float:right;margin:10px 0 20px}}
\ No newline at end of file
+#buddypress div.pagination .pagination-links a:hover,#buddypress ul.button-nav li.current a{font-weight:700}#buddypress div.pagination{background:0 0;border:none;color:#888;font-size:small;margin:0;position:relative;display:block;float:right;width:100%;padding:10px 0}#buddypress div.pagination .pag-count{float:right;margin-right:10px}#buddypress div.pagination .pagination-links{float:left;margin-left:10px}#buddypress div.pagination .pagination-links a,#buddypress div.pagination .pagination-links span{font-size:90%;padding:0 5px}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:right}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:right}#buddypress form#whats-new-form #whats-new-content{margin-right:55px;padding:0 20px 20px 0}#buddypress form#whats-new-form p.activity-greeting{line-height:.5em;margin-bottom:15px;margin-right:75px}#buddypress form#whats-new-form textarea{background:#fff;color:#555;font-family:inherit;font-size:medium;height:20px;padding:6px;width:98%}body.no-js #buddypress form#whats-new-form textarea{height:50px}#buddypress form#whats-new-form #whats-new-options select{max-width:200px;margin-top:12px}#buddypress form#whats-new-form #whats-new-submit{float:left;margin-top:12px}#buddypress #whats-new-options{overflow:auto;height:0}body.no-js #buddypress #whats-new-options{height:auto}#buddypress #whats-new:focus{border-color:rgba(31,179,221,.9)!important;outline-color:rgba(31,179,221,.9)}#buddypress ul.activity-list li{overflow:hidden;padding:15px 0 0;list-style:none}#buddypress .activity-list .activity-avatar{float:right}#buddypress ul.item-list.activity-list li.has-comments{padding-bottom:15px}body.activity-permalink #buddypress ul.activity-list li.has-comments{padding-bottom:0}#buddypress .activity-list li.mini{font-size:80%;position:relative}#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-list li.mini .activity-avatar img.avatar{height:20px;margin-right:30px;width:20px}#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar{height:auto;margin-right:0;width:auto}body.activity-permalink #buddypress .activity-list>li:first-child{padding-top:0}#buddypress .activity-list li .activity-content{position:relative}#buddypress .activity-list li.mini .activity-content p{margin:0}#buddypress .activity-list li.mini .activity-comments{clear:both;font-size:120%}body.activity-permalink #buddypress li.mini .activity-meta{margin-top:4px}#buddypress .activity-list li .activity-inreplyto{color:#888;font-size:80%}#buddypress .activity-list li .activity-inreplyto>p{margin:0;display:inline}#buddypress .activity-list li .activity-inreplyto blockquote,#buddypress .activity-list li .activity-inreplyto div.activity-inner{background:0 0;border:none;display:inline;margin:0;overflow:hidden;padding:0}#buddypress .activity-list .activity-content{margin:0 70px 0 0}body.activity-permalink #buddypress .activity-list li .activity-content{border:none;font-size:100%;line-height:150%;margin-right:170px;margin-left:0;padding:0}body.activity-permalink #buddypress .activity-list li .activity-header>p{margin:0;padding:5px 0 0}#buddypress .activity-list .activity-content .activity-header,#buddypress .activity-list .activity-content .comment-header{color:#888;line-height:220%}#buddypress .activity-header{margin-left:20px}#buddypress .acomment-meta a,#buddypress .activity-header a,#buddypress .comment-meta a{text-decoration:none}#buddypress .activity-list .activity-content .activity-header img.avatar{float:none!important;margin:0 0 -8px 5px!important}#buddypress a.bp-secondary-action,#buddypress span.highlight{font-size:80%;padding:0;margin-left:5px;text-decoration:none}#buddypress .activity-list .activity-content .activity-inner,#buddypress .activity-list .activity-content blockquote{margin:10px 0 5px 10px;overflow:hidden}#buddypress .activity-list li.new_forum_post .activity-content .activity-inner,#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner{border-right:2px solid #EAEAEA;margin-right:5px;padding-right:10px}body.activity-permalink #buddypress .activity-content .activity-inner,body.activity-permalink #buddypress .activity-content blockquote{margin-right:0;margin-top:5px}#buddypress .activity-inner>p{word-wrap:break-word}#buddypress .activity-inner>.activity-inner,#buddypress .activity-inner>blockquote{margin:0}#buddypress .activity-list .activity-content img.thumbnail{border:2px solid #eee;float:right;margin:0 0 5px 10px}#buddypress .activity-read-more{margin-right:1em;white-space:nowrap}#buddypress .activity-list li.load-more,#buddypress .activity-list li.load-newest{background:#f0f0f0;font-size:110%;margin:15px 0;padding:10px 15px;text-align:center}#buddypress .activity-list li.load-more a,#buddypress .activity-list li.load-newest a{color:#4D4D4D}#buddypress div.activity-meta{margin:18px 0 0}body.activity-permalink #buddypress div.activity-meta{margin-bottom:6px}#buddypress div.activity-meta a{padding:4px 8px}#buddypress a.activity-time-since{color:#aaa;text-decoration:none}#buddypress a.activity-time-since:hover{color:#888;text-decoration:underline}#buddypress #reply-title small a,#buddypress a.bp-primary-action{font-size:80%;margin-left:5px;text-decoration:none}#buddypress #reply-title small a span,#buddypress a.bp-primary-action span{background:#999;color:#fff;font-size:90%;margin-right:2px;padding:0 5px}#buddypress #reply-title small a:hover span,#buddypress a.bp-primary-action:hover span{background:#555;color:#fff}#buddypress div.activity-comments{margin:0 70px 0 0;overflow:hidden;position:relative;width:auto;clear:both}body.activity-permalink #buddypress div.activity-comments{background:0 0;margin-right:170px;width:auto}#buddypress div.activity-comments>ul{padding:0 10px 0 0}#buddypress div.activity-comments ul,#buddypress div.activity-comments ul li{border:none;list-style:none}#buddypress div.activity-comments ul{clear:both;margin:0}#buddypress div.activity-comments ul li{border-top:1px solid #eee;padding:10px 0 0}body.activity-permalink #buddypress .activity-list li.mini .activity-comments{clear:none;margin-top:0}body.activity-permalink #buddypress div.activity-comments ul li{border-width:1px;padding:10px 0 0}#buddypress div.activity-comments>ul>li:first-child{border-top:none}#buddypress div.activity-comments ul li:last-child{margin-bottom:0}#buddypress div.activity-comments ul li>ul{margin-right:30px;margin-top:0;padding-right:10px}body.activity-permalink #buddypress div.activity-comments ul li>ul{margin-top:10px}body.activity-permalink #buddypress div.activity-comments>ul{padding:0 15px 0 10px}#buddypress div.activity-comments div.acomment-avatar img{border-width:1px;float:right;height:25px;margin-left:10px;width:25px}#buddypress div.activity-comments div.acomment-content{font-size:80%;margin:5px 40px 0 0}#buddypress div.acomment-content .activity-delete-link,#buddypress div.acomment-content .comment-header,#buddypress div.acomment-content .time-since{display:none}body.activity-permalink #buddypress div.activity-comments div.acomment-content{font-size:90%}#buddypress div.activity-comments div.acomment-meta{color:#888;font-size:80%}#buddypress div.activity-comments form.ac-form{display:none;padding:10px}#buddypress div.activity-comments li form.ac-form{margin-left:15px;clear:both}#buddypress div.activity-comments form.root{margin-right:0}#buddypress div.activity-comments div#message{margin-top:15px;margin-bottom:0}#buddypress div.activity-comments form .ac-textarea{background:#fff;border:1px inset #ccc;margin-bottom:10px;padding:8px}#buddypress div.activity-comments form textarea{border:none;background:0 0;box-shadow:none;outline:0;color:#555;font-family:inherit;font-size:100%;height:60px;padding:0;margin:0;width:100%}#buddypress div.activity-comments form input{margin-top:5px}#buddypress div.activity-comments form div.ac-reply-avatar{float:right}#buddypress div.ac-reply-avatar img{border:1px solid #eee}#buddypress div.activity-comments form div.ac-reply-content{color:#888;margin-right:50px;padding-right:15px}#buddypress div.activity-comments form div.ac-reply-content a{text-decoration:none}#buddypress .acomment-options{float:right;margin:5px 40px 5px 0}#buddypress .acomment-options a{color:#999}#buddypress .acomment-options a:hover{color:inherit}#buddypress div.dir-search{float:left;margin:-39px 0 0}#buddypress div.dir-search input[type=text],#buddypress li.groups-members-search input[type=text]{font-size:90%;padding:1px 3px}#buddypress .current-member-type{font-style:italic}#buddypress .dir-form{clear:both}#buddypress div#message{margin:0 0 15px}#buddypress #message.info{margin-bottom:0}#buddypress div#message.updated{clear:both;display:block}#buddypress div#message p,#sitewide-notice p{font-size:90%;display:block;padding:10px 15px}#buddypress div#message.error p{background-color:#fdc;border:1px solid #a00;clear:right;color:#800}#buddypress div#message.warning p{background-color:#ffe0af;border:1px solid #ffd087;clear:right;color:#800}#buddypress div#message.updated p{background-color:#efc;border:1px solid #591;color:#250}#buddypress #pass-strength-result{background-color:#eee;border-color:#ddd;border-style:solid;border-width:1px;display:none;margin:5px 0 5px 5px;padding:5px;text-align:center;width:150px}#buddypress .standard-form #basic-details-section #pass-strength-result{width:35%}#buddypress #pass-strength-result.bad,#buddypress #pass-strength-result.error{background-color:#ffb78c;border-color:#ff853c!important;display:block}#buddypress #pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;display:block}#buddypress #pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;display:block}#buddypress #pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;display:block}#buddypress .standard-form#signup_form div div.error{background:#faa;color:#a00;margin:0 0 10px;padding:6px;width:90%}#buddypress div.accept,#buddypress div.reject{float:right;margin-right:10px}#buddypress ul.button-nav li{float:right;margin:0 0 10px 10px;list-style:none}#sitewide-notice #message{right:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}#buddypress .dir-search input[type=search],#buddypress .dir-search input[type=text],#buddypress .groups-members-search input[type=search],#buddypress .groups-members-search input[type=text],#buddypress .standard-form input[type=color],#buddypress .standard-form input[type=date],#buddypress .standard-form input[type=datetime-local],#buddypress .standard-form input[type=datetime],#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=month],#buddypress .standard-form input[type=number],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=range],#buddypress .standard-form input[type=search],#buddypress .standard-form input[type=tel],#buddypress .standard-form input[type=text],#buddypress .standard-form input[type=time],#buddypress .standard-form input[type=url],#buddypress .standard-form input[type=week],#buddypress .standard-form select,#buddypress .standard-form textarea{border:1px solid #ccc;background:#fafafa;border-radius:0;color:#888;font:inherit;font-size:100%;padding:6px}#buddypress .standard-form select{padding:3px}#buddypress .standard-form input[type=password]{margin-bottom:5px}#buddypress .standard-form label,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress .standard-form div.checkbox label:nth-child(n+2),#buddypress .standard-form div.radio div label{color:#888;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form#sidebar-login-form label{margin-top:5px}#buddypress .standard-form input[type=text]{width:75%}#buddypress .standard-form#sidebar-login-form input[type=password],#buddypress .standard-form#sidebar-login-form input[type=text]{padding:4px;width:95%}#buddypress .standard-form #basic-details-section input[type=password],#buddypress .standard-form #blog-details-section input#signup_blog_url{width:35%}#buddypress #commentform input[type=text],#buddypress #commentform textarea,#buddypress .form-allowed-tags,#buddypress .standard-form#signup_form input[type=text],#buddypress .standard-form#signup_form textarea{width:90%}#buddypress .standard-form#signup_form div.submit{float:left}#buddypress div#signup-avatar img{margin:0 0 10px 15px}#buddypress .standard-form textarea{width:75%;height:120px}#buddypress .standard-form textarea#message_content{height:200px}#buddypress .standard-form#send-reply textarea{width:97.5%}#buddypress .standard-form p.description{color:#888;font-size:80%;margin:5px 0}#buddypress .standard-form div.submit{clear:both;padding:15px 0 0}#buddypress .standard-form p.submit{margin-bottom:0;padding:15px 0 0}#buddypress .standard-form div.submit input{margin-left:15px}#buddypress .standard-form div.radio ul{margin:10px 38px 15px 0;list-style:disc}#buddypress .standard-form div.radio ul li{margin-bottom:5px}#buddypress .standard-form a.clear-value{display:block;margin-top:5px;outline:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon,body.no-js #buddypress #delete_inbox_messages,body.no-js #buddypress #delete_sentbox_messages,body.no-js #buddypress #message-type-select,body.no-js #buddypress #messages-bulk-management #select-all-messages,body.no-js #buddypress #notifications-bulk-management #select-all-notifications,body.no-js #buddypress label[for=message-type-select]{display:none}#buddypress .standard-form #basic-details-section,#buddypress .standard-form #blog-details-section,#buddypress .standard-form #profile-details-section{float:right;width:48%}#buddypress .standard-form #profile-details-section{float:left}#buddypress #notifications-bulk-management,#buddypress .standard-form #blog-details-section{clear:right}#buddypress .standard-form input:focus,#buddypress .standard-form select:focus,#buddypress .standard-form textarea:focus{background:#fafafa;color:#555}#buddypress form#send-invite-form{margin-top:20px}#buddypress div#invite-list{background:#f5f5f5;height:400px;margin:0 0 10px;overflow:auto;padding:5px;width:160px}#buddypress .comment-reply-link,#buddypress a.button,#buddypress button,#buddypress div.generic-button a,#buddypress input[type=button],#buddypress input[type=reset],#buddypress input[type=submit],#buddypress ul.button-nav li a,a.bp-title-button{background:#fff;border:1px solid #ccc;color:#777;font-size:small;cursor:pointer;outline:0;padding:4px 10px;text-align:center;text-decoration:none}#buddypress .comment-reply-link:hover,#buddypress a.button:focus,#buddypress a.button:hover,#buddypress button:hover,#buddypress div.generic-button a:hover,#buddypress input[type=button]:hover,#buddypress input[type=reset]:hover,#buddypress input[type=submit]:hover,#buddypress ul.button-nav li a:hover,#buddypress ul.button-nav li.current a{background:#ededed;border:1px solid #bbb;color:#555;outline:0;text-decoration:none}#buddypress form.standard-form .left-menu{float:right}#buddypress form.standard-form .left-menu #invite-list ul{margin:1%;list-style:none}#buddypress form.standard-form .left-menu #invite-list ul li{margin:0 1% 0 0}#buddypress form.standard-form .main-column{margin-right:190px}#buddypress form.standard-form .main-column ul#friend-list{clear:none;float:right}#buddypress form.standard-form .main-column ul#friend-list h4{clear:none}#buddypress .wp-editor-wrap a.button,#buddypress .wp-editor-wrap button,#buddypress .wp-editor-wrap input[type=button],#buddypress .wp-editor-wrap input[type=reset],#buddypress .wp-editor-wrap input[type=submit]{padding:0 10px 1px}#buddypress form [disabled=disabled]{cursor:default;opacity:.4}.bp-screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute}#buddypress a.loading,#buddypress input.loading{-webkit-animation:loader-pulsate .5s infinite ease-in-out alternate;-moz-animation:loader-pulsate .5s infinite ease-in-out alternate;border-color:#aaa}@-webkit-keyframes loader-pulsate{from{border-color:#aaa;-webkit-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-webkit-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}@-moz-keyframes loader-pulsate{from{border-color:#aaa;-moz-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-moz-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}#buddypress a.loading:hover,#buddypress input.loading:hover{color:#777}#buddypress a.disabled,#buddypress button.disabled,#buddypress button.pending,#buddypress div.pending a,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending,#buddypress input[type=submit][disabled=disabled],#buddypress input[type=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#888;margin-bottom:10px}#buddypress ul#topic-post-list li div.post-content{margin-right:54px}#buddypress div.topic-tags{font-size:80%}#buddypress div.admin-links{color:#888;font-size:80%;position:absolute;top:15px;left:25px}#buddypress div#topic-meta{margin:0;padding:5px 19px 30px;position:relative}#buddypress div#topic-meta div.admin-links{left:19px;top:-36px}#buddypress div#topic-meta h3{margin:5px 0}#buddypress div#new-topic-post{display:none;margin:20px 0 0;padding:1px 0 0}#buddypress table.forum,#buddypress table.messages-notices,#buddypress table.notifications,#buddypress table.notifications-settings,#buddypress table.profile-fields,#buddypress table.profile-settings,#buddypress table.wp-profile-fields{width:100%}#buddypress table.forum thead tr,#buddypress table.messages-notices thead tr,#buddypress table.notifications thead tr,#buddypress table.notifications-settings thead tr,#buddypress table.profile-fields thead tr,#buddypress table.profile-settings thead tr,#buddypress table.wp-profile-fields thead tr{background:#eaeaea}#buddypress table#message-threads{clear:both}#buddypress table.profile-fields{margin-bottom:20px}#buddypress table tr td.thread-info p,#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-left:1px solid #eaeaea;font-weight:700;width:25%}#buddypress #message-threads .thread-info{min-width:40%}#buddypress table tr td.thread-info p.thread-excerpt{color:#888;font-size:80%;margin-top:3px}#buddypress table.forum td{text-align:center}#buddypress table.forum tr.alt td,#buddypress table.messages-notices tr.alt td,#buddypress table.notifications tr.alt td,#buddypress table.notifications-settings tr.alt td,#buddypress table.profile-fields tr.alt td,#buddypress table.profile-settings tr.alt td,#buddypress table.wp-profile-fields tr.alt td{background:#f5f5f5}#buddypress table.notification-settings{margin-bottom:20px;text-align:right}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-right:35px}#buddypress table.forum td p.topic-text{color:#888;font-size:100%}#buddypress table.forum tr>td:first-child,#buddypress table.forum tr>th:first-child{padding-right:15px}#buddypress table.forum tr>td:last-child,#buddypress table.forum tr>th:last-child{padding-left:15px}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster,#buddypress table.forum td.td-title,#buddypress table.forum tr th#th-group,#buddypress table.forum tr th#th-poster,#buddypress table.forum tr th#th-title{text-align:right}#buddypress table.forum tr td.td-title a.topic-title{font-size:110%}#buddypress table.forum td.td-freshness{white-space:nowrap}#buddypress table.forum td.td-freshness span.time-since{font-size:80%;color:#888}#buddypress table.forum td img.avatar{float:none;margin:0 0 -8px 5px}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster{min-width:140px}#buddypress table.forum th#th-title{width:80%}#buddypress table.forum th#th-freshness{width:25%}#buddypress table.forum th#th-postcount{width:15%}#buddypress table.forum p.topic-meta{font-size:80%;margin:5px 0 0}#buddypress .item-body{margin:20px 0}#buddypress span.activity{display:inline-block;font-size:small;opacity:.8;padding:0}#buddypress span.user-nicename{color:#777;display:inline-block;font-size:120%;font-weight:700}#buddypress div#message p,#sitewide-notice p{font-weight:400;margin-top:3px;text-decoration:none;background-color:#ffd;border:1px solid #cb2;color:#440}#buddypress div#item-header{overflow:hidden}#buddypress div#item-header div#item-header-content{float:right;margin-right:0}#buddypress div#item-header h2{line-height:120%;margin:0 0 15px}#buddypress div#item-header h2 a{color:#777;text-decoration:none}#buddypress div#item-header img.avatar{float:right;margin:0 0 19px 15px}#buddypress div#item-header h2{margin-bottom:5px}#buddypress div#item-header h2 span.highlight{font-size:60%;font-weight:400;line-height:170%;vertical-align:middle;display:inline-block}#buddypress div#item-header h2 span.highlight span{background:#a1dcfa;color:#fff;cursor:pointer;font-weight:700;font-size:80%;margin-bottom:2px;padding:1px 4px;position:relative;left:-2px;top:-2px;vertical-align:middle}#buddypress div#item-header div#item-meta{font-size:80%;color:#aaa;overflow:hidden;margin:15px 0 5px;padding-bottom:10px}#buddypress div#item-header div#item-actions{float:left;margin:0 15px 15px 0;text-align:left;width:20%}#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header ul{margin-bottom:15px;overflow:hidden}#buddypress div#item-header ul h5,#buddypress div#item-header ul hr,#buddypress div#item-header ul span{display:none}#buddypress div#item-header ul li{float:left;list-style:none}#buddypress div#item-header ul img.avatar,#buddypress div#item-header ul.avatars img.avatar{height:30px;margin:2px;width:30px}#buddypress div#item-header a.button,#buddypress div#item-header div.generic-button{float:right;margin:10px 0 0 10px}#buddypress div#item-header div#message.info{line-height:80%}#buddypress ul.item-list{border-top:1px solid #eaeaea;width:100%;list-style:none;clear:both;margin:0;padding:0}body.activity-permalink #buddypress ul.item-list,body.activity-permalink #buddypress ul.item-list li.activity-item{border:none}#buddypress ul.item-list li{border-bottom:1px solid #eaeaea;padding:15px 0;margin:0;position:relative;list-style:none}#buddypress ul.single-line li{border:none}#buddypress ul.item-list li img.avatar{float:right;margin:0 0 0 10px}#buddypress ul.item-list li div.item-title,#buddypress ul.item-list li h4{font-weight:400;font-size:90%;margin:0;width:75%}#buddypress ul.item-list li div.item-title span{color:#999;font-size:80%}#buddypress ul.item-list li div.item-desc{color:#888;font-size:80%;margin:10px 60px 0 0;width:50%}#buddypress ul.item-list li.group-no-avatar div.item-desc{margin-right:0}#buddypress ul.item-list li div.action{position:absolute;top:15px;left:0;text-align:left}#buddypress ul.item-list li div.meta{color:#888;font-size:80%;margin-top:10px}#buddypress ul.item-list li h5 span.small{float:left;font-size:80%;font-weight:400}#buddypress div.item-list-tabs{background:0 0;clear:right;overflow:hidden}#buddypress div.item-list-tabs ul{margin:0;padding:0}#buddypress div.item-list-tabs ul li{float:right;margin:0;list-style:none}#buddypress div.item-list-tabs#subnav ul li{margin-top:0}#buddypress div.item-list-tabs ul li.last{float:left;margin:7px 0 0}#buddypress div.item-list-tabs#subnav ul li.last{margin-top:4px}#buddypress div.item-list-tabs ul li.last select{max-width:185px}#buddypress div.item-list-tabs ul li a,#buddypress div.item-list-tabs ul li span{display:block;padding:5px 10px;text-decoration:none}#buddypress div.item-list-tabs ul li a span{background:#eee;border-radius:50%;border:1px solid #ccc;color:#999;display:inline;font-size:70%;margin-right:2px;padding:3px 6px;text-align:center;vertical-align:middle}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background-color:#eee;color:#555;opacity:.8;font-weight:700}#buddypress div.item-list-tabs ul li a:hover span,#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#eee}#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#fff}#buddypress div#item-nav ul li.loading a{background-position:12% 50%}#buddypress div.item-list-tabs#object-nav{margin-top:0}#buddypress div.item-list-tabs#subnav{background:0 0;margin:10px 0;overflow:hidden}#buddypress #admins-list li,#buddypress #members-list li,#buddypress #mods-list li{overflow:auto;list-style:none}#buddypress div#message-thread div.message-metadata,.widget.buddypress div.avatar-block{overflow:hidden}#buddypress table#message-threads tr.unread td{background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4;font-weight:700}#buddypress table#message-threads tr.unread td .activity,#buddypress table#message-threads tr.unread td .thread-excerpt,#buddypress table#message-threads tr.unread td.thread-options{font-weight:400}#buddypress li span.unread-count,#buddypress tr.unread span.unread-count{background:#d00;color:#fff;font-weight:700;padding:2px 8px}#buddypress div.item-list-tabs ul li a span.unread-count{padding:1px 6px;color:#fff}#buddypress div#message-thread div.message-box{margin:0;padding:15px}#buddypress div#message-thread div.alt{background:#f4f4f4}#buddypress div#message-thread p#message-recipients{margin:10px 0 20px}#buddypress div#message-thread img.avatar{float:right;margin:0 0 0 10px;vertical-align:middle}#buddypress div#message-thread strong{font-size:100%;margin:0}#buddypress div#message-thread strong a{text-decoration:none}#buddypress div#message-thread strong span.activity{margin-top:4px}#buddypress div#message-thread div.message-content{margin-right:45px}#buddypress div#message-thread div.message-options{text-align:left}#buddypress #message-threads img.avatar{max-width:none}#buddypress div.message-search{float:left;margin:0 20px}.message-metadata{position:relative}.message-star-actions{position:absolute;left:0;top:0}#buddypress a.message-action-star,#buddypress a.message-action-unstar{border-bottom:0;text-decoration:none;outline:0}a.message-action-star{opacity:.7}a.message-action-star:hover{opacity:1}.message-action-star span.icon:before,.message-action-unstar span.icon:before{font-family:dashicons;font-size:18px}.message-action-star span.icon:before{color:#aaa;content:"\f154"}.message-action-unstar span.icon:before{color:#FCDD77;content:"\f155"}#buddypress div.profile h4{margin-bottom:auto;margin-top:15px}#buddypress #profile-edit-form ul.button-nav{margin-top:15px}body.no-js #buddypress .field-visibility-settings-close,body.no-js #buddypress .field-visibility-settings-toggle{display:none}#buddypress .field-visibility-settings{display:none;margin-top:10px}body.no-js #buddypress .field-visibility-settings{display:block}#buddypress .current-visibility-level{font-weight:700;font-style:normal}#buddypress .field-visibility-settings,#buddypress .field-visibility-settings-notoggle,#buddypress .field-visibility-settings-toggle{color:#888}#buddypress .field-visibility-settings a,#buddypress .field-visibility-settings-toggle a{font-size:80%}body.register #buddypress div.page ul{list-style:none}#buddypress .standard-form .field-visibility-settings label{margin:0;font-weight:400}#buddypress .field-visibility-settings legend,#buddypress .field-visibility-settings-toggle{font-style:italic}#buddypress .field-visibility-settings .radio{list-style:none;margin-bottom:0}#buddypress .field-visibility select{margin:0}.widget.buddypress div.item-avatar img.avatar{float:right;margin:0 0 15px 10px}.widget.buddypress span.activity{display:inline-block;font-size:small;opacity:.8;padding:0}.widget.buddypress div.item-options{font-size:90%;margin:0 0 1em;padding:1em 0}.widget.buddypress div.item{margin:0 0 1em}.widget.buddypress div.item-content,.widget.buddypress div.item-meta{font-size:11px;margin-right:50px}.widget.buddypress ul.item-list img.avatar{height:40px;margin-left:10px;width:40px}.widget.buddypress div.item-avatar img{height:40px;margin:1px;width:40px}.widget.buddypress #bp-login-widget-form label{display:block;margin:1rem 0 .5rem}.widget.buddypress #bp-login-widget-form #bp-login-widget-submit{margin-left:10px}.widget.buddypress .bp-login-widget-user-avatar{float:right}.bp-login-widget-user-avatar img.avatar{height:40px;width:40px}.widget.buddypress .bp-login-widget-user-links>div{padding-right:60px;margin-bottom:.5rem}.widget.buddypress .bp-login-widget-user-links>div.bp-login-widget-user-link a{font-weight:700}.widget.buddypress #friends-list,.widget.buddypress #groups-list,.widget.buddypress #members-list{margin-right:0;padding-right:0}.widget.buddypress #friends-list li,.widget.buddypress #groups-list li,.widget.buddypress #members-list li{clear:both;list-style-type:none}@media only screen and (max-width:480px){#buddypress div.dir-search{float:left;margin-top:-50px;text-align:left}#buddypress div.dir-search input[type=text]{margin-bottom:1em;width:50%}a.bp-title-button{margin-right:10px}#buddypress form.standard-form .main-column div.action{position:relative;margin-bottom:1em}#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search,#buddypress ul.item-list li div.action{clear:right;float:right;margin-top:0;text-align:right}#buddypress li#groups-order-select{clear:right;float:right}#buddypress ul.item-list li div.action{margin-right:70px;position:relative;top:0;left:0}#buddypress ul.item-list li div.item-desc{clear:right;float:right;margin:10px 0 0;width:auto}#buddypress li div.item{margin-right:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-right:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:right;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:right}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-right:45px}h1 a.bp-title-button{clear:right;float:right;margin:10px 0 20px}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css
index 35ebe0bc4c89114275ff34e938a9f7878954629e..1957cef87bdf7a57effead7caa5de39b8adff444 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css
@@ -38,7 +38,7 @@ Hello, this is the BuddyPress Legacy stylesheet.
 	background: transparent;
 	border: none;
 	color: #888;
-	font-size: 90%;
+	font-size: small;
 	margin: 0;
 	position: relative;
 	display: block;
@@ -126,7 +126,7 @@ Hello, this is the BuddyPress Legacy stylesheet.
 	background: #fff;
 	color: #555;
 	font-family: inherit;
-	font-size: 90%;
+	font-size: medium;
 	height: 20px;
 	padding: 6px;
 	width: 98%;
@@ -496,7 +496,9 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 	font-size: 90%;
 	padding: 1px 3px;
 }
-
+#buddypress .current-member-type {
+	font-style: italic;
+}
 #buddypress .dir-form {
 	clear: both;
 }
@@ -512,6 +514,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 }
 #buddypress div#message.updated {
 	clear: both;
+	display: block;
 }
 #buddypress div#message p,
 #sitewide-notice p {
@@ -525,6 +528,12 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 	clear: left;
 	color: #800;
 }
+#buddypress div#message.warning p {
+	background-color: #ffe0af;
+	border: 1px solid #ffd087;
+	clear: left;
+	color: #800;
+}
 #buddypress div#message.updated p {
 	background-color: #efc;
 	border: 1px solid #591;
@@ -728,9 +737,18 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
 #buddypress .standard-form #profile-details-section {
 	float: right;
 }
-#buddypress .standard-form #blog-details-section {
+#buddypress .standard-form #blog-details-section,
+#buddypress #notifications-bulk-management {
 	clear: left;
 }
+body.no-js #buddypress #notifications-bulk-management #select-all-notifications,
+body.no-js #buddypress label[for="message-type-select"],
+body.no-js #buddypress #message-type-select,
+body.no-js #buddypress #delete_inbox_messages,
+body.no-js #buddypress #delete_sentbox_messages,
+body.no-js #buddypress #messages-bulk-management #select-all-messages {
+	display: none;
+}
 #buddypress .standard-form input:focus,
 #buddypress .standard-form textarea:focus,
 #buddypress .standard-form select:focus {
@@ -760,7 +778,7 @@ a.bp-title-button {
 	background: #fff; /* Old browsers */
 	border: 1px solid #ccc;
 	color: #777;
-	font-size: .8rem;
+	font-size: small;
 	cursor: pointer;
 	outline: none;
 	padding: 4px 10px;
@@ -818,6 +836,17 @@ a.bp-title-button {
 #buddypress .wp-editor-wrap input[type=reset] {
 	padding: 0 10px 1px;
 }
+
+/* Form classes & generic attr styling */
+#buddypress form *[disabled="disabled"]{
+	cursor: default;
+	opacity: .4;
+ }
+.bp-screen-reader-text {
+	clip: rect(1px, 1px, 1px, 1px);
+	position: absolute;
+}
+
 /*--------------------------------------------------------------
 3.6 - Ajax Loading
 --------------------------------------------------------------*/
@@ -862,6 +891,7 @@ a.bp-title-button {
 #buddypress input[type="submit"].disabled,
 #buddypress input[type="button"].disabled,
 #buddypress input[type="reset"].disabled,
+#buddypress input[type="submit"][disabled=disabled],
 #buddypress button.pending,
 #buddypress button.disabled,
 #buddypress div.pending a,
@@ -952,8 +982,6 @@ a.bp-title-button {
 }
 #buddypress table#message-threads {
 	clear: both;
-	margin: 0;
-	width: auto;
 }
 #buddypress table.profile-fields {
 	margin-bottom: 20px;
@@ -993,6 +1021,9 @@ a.bp-title-button {
 	font-weight: bold;
 	width: 25%;
 }
+#buddypress #message-threads .thread-info {
+	min-width: 40%;
+}
 #buddypress table tr td.thread-info p {
 	margin: 0;
 }
@@ -1109,7 +1140,7 @@ a.bp-title-button {
 }
 #buddypress span.activity {
 	display: inline-block;
-	font-size: 80%;
+	font-size: small;
 	opacity: 0.8;
 	padding: 0;
 }
@@ -1256,6 +1287,9 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	margin: 10px 0 0 60px;
 	width: 50%;
 }
+#buddypress ul.item-list li.group-no-avatar div.item-desc {
+	margin-left: 0;
+}
 #buddypress ul.item-list li div.action {
 	position: absolute;
 	top: 15px;
@@ -1298,7 +1332,7 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	margin-top: 4px;
 }
 #buddypress div.item-list-tabs ul li.last select {
-	max-width: 175px;
+	max-width: 185px;
 }
 #buddypress div.item-list-tabs ul li a,
 #buddypress div.item-list-tabs ul li span {
@@ -1362,6 +1396,11 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	border-bottom: 1px solid #ffe8c4;
 	font-weight: bold;
 }
+#buddypress table#message-threads tr.unread td .thread-excerpt,
+#buddypress table#message-threads tr.unread td .activity,
+#buddypress table#message-threads tr.unread td.thread-options {
+	font-weight: normal;
+}
 #buddypress li span.unread-count,
 #buddypress tr.unread span.unread-count {
 	background: #dd0000;
@@ -1373,13 +1412,6 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	padding: 1px 6px;
 	color: #fff;
 }
-#buddypress div.messages-options-nav {
-	background: #eee;
-	font-size: 80%;
-	margin: 0;
-	padding: 5px 15px;
-	text-align: right;
-}
 #buddypress div#message-thread div.message-box {
 	margin: 0;
 	padding: 15px;
@@ -1422,6 +1454,40 @@ body.activity-permalink #buddypress ul.item-list li.activity-item {
 	margin: 0 20px;
 }
 
+.message-metadata {
+	position: relative;
+}
+.message-star-actions {
+	position: absolute;
+	right: 0;
+	top: 0;
+}
+#buddypress a.message-action-star,
+#buddypress a.message-action-unstar {
+	border-bottom: 0;
+	text-decoration: none;
+	outline: none;
+}
+a.message-action-star {
+	opacity: .7;
+}
+a.message-action-star:hover {
+	opacity: 1;
+}
+.message-action-star span.icon:before,
+.message-action-unstar span.icon:before {
+	font-family: dashicons;
+	font-size: 18px;
+}
+.message-action-star span.icon:before {
+	color: #aaa;
+	content: "\f154";
+}
+.message-action-unstar span.icon:before {
+	color: #FCDD77;
+	content: "\f155";
+}
+
 /*--------------------------------------------------------------
 3.10 - Extended Profiles
 --------------------------------------------------------------*/
@@ -1487,7 +1553,7 @@ body.register #buddypress div.page ul {
 
 .widget.buddypress span.activity {
 	display: inline-block;
-	font-size: 80%;
+	font-size: small;
 	opacity: 0.8;
 	padding: 0;
 }
@@ -1505,13 +1571,13 @@ body.register #buddypress div.page ul {
 .widget.buddypress div.item-meta,
 .widget.buddypress div.item-content {
 	font-size: 11px;
-	margin-left: 38px;
+	margin-left: 50px;
 }
 
 .widget.buddypress ul.item-list img.avatar {
-	height: 20px;
+	height: 40px;
 	margin-right: 10px;
-	width: 20px;
+	width: 40px;
 }
 .widget.buddypress div.item-avatar img {
 	height: 40px;
@@ -1534,7 +1600,11 @@ body.register #buddypress div.page ul {
 
 .widget.buddypress .bp-login-widget-user-avatar {
 	float: left;
-	width: 60px;
+}
+
+.bp-login-widget-user-avatar img.avatar {
+	height: 40px;
+	width: 40px;
 }
 
 .widget.buddypress .bp-login-widget-user-links > div {
@@ -1549,6 +1619,20 @@ body.register #buddypress div.page ul {
 	font-weight: bold;
 }
 
+.widget.buddypress #groups-list,
+.widget.buddypress #members-list,
+.widget.buddypress #friends-list {
+	margin-left: 0;
+	padding-left: 0;
+}
+
+.widget.buddypress #groups-list li,
+.widget.buddypress #members-list li,
+.widget.buddypress #friends-list li {
+	clear: both;
+	list-style-type: none;
+}
+
 /*--------------------------------------------------------------
 4.0 - Media Queries
 --------------------------------------------------------------*/
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.min.css
index 5a953e9f56b9d9046594ab06f2af9022719dca2f..9f9b8680c92ccd76943c309b9d0e1d475da23fbb 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.min.css
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-#buddypress div.pagination{background:0 0;border:none;color:#888;font-size:90%;margin:0;position:relative;display:block;float:left;width:100%;padding:10px 0}#buddypress div.pagination .pag-count{float:left;margin-left:10px}#buddypress div.pagination .pagination-links{float:right;margin-right:10px}#buddypress div.pagination .pagination-links a,#buddypress div.pagination .pagination-links span{font-size:90%;padding:0 5px}#buddypress div.pagination .pagination-links a:hover{font-weight:700}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:left}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:left}#buddypress form#whats-new-form #whats-new-content{margin-left:55px;padding:0 0 20px 20px}#buddypress form#whats-new-form p.activity-greeting{line-height:.5em;margin-bottom:15px;margin-left:75px}#buddypress form#whats-new-form textarea{background:#fff;color:#555;font-family:inherit;font-size:90%;height:20px;padding:6px;width:98%}body.no-js #buddypress form#whats-new-form textarea{height:50px}#buddypress form#whats-new-form #whats-new-options select{max-width:200px;margin-top:12px}#buddypress form#whats-new-form #whats-new-submit{float:right;margin-top:12px}#buddypress #whats-new-options{overflow:auto;height:0}body.no-js #buddypress #whats-new-options{height:auto}#buddypress #whats-new:focus{border-color:rgba(31,179,221,.9)!important;outline-color:rgba(31,179,221,.9)}#buddypress ul.activity-list li{overflow:hidden;padding:15px 0 0;list-style:none}#buddypress .activity-list .activity-avatar{float:left}#buddypress ul.item-list.activity-list li.has-comments{padding-bottom:15px}body.activity-permalink #buddypress ul.activity-list li.has-comments{padding-bottom:0}#buddypress .activity-list li.mini{font-size:80%;position:relative}#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-list li.mini .activity-avatar img.avatar{height:20px;margin-left:30px;width:20px}#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar{height:auto;margin-left:0;width:auto}body.activity-permalink #buddypress .activity-list>li:first-child{padding-top:0}#buddypress .activity-list li .activity-content{position:relative}#buddypress .activity-list li.mini .activity-content p{margin:0}#buddypress .activity-list li.mini .activity-comments{clear:both;font-size:120%}body.activity-permalink #buddypress li.mini .activity-meta{margin-top:4px}#buddypress .activity-list li .activity-inreplyto{color:#888;font-size:80%}#buddypress .activity-list li .activity-inreplyto>p{margin:0;display:inline}#buddypress .activity-list li .activity-inreplyto blockquote,#buddypress .activity-list li .activity-inreplyto div.activity-inner{background:0 0;border:none;display:inline;margin:0;overflow:hidden;padding:0}#buddypress .activity-list .activity-content{margin:0 0 0 70px}body.activity-permalink #buddypress .activity-list li .activity-content{border:none;font-size:100%;line-height:150%;margin-left:170px;margin-right:0;padding:0}body.activity-permalink #buddypress .activity-list li .activity-header>p{margin:0;padding:5px 0 0}#buddypress .activity-list .activity-content .activity-header,#buddypress .activity-list .activity-content .comment-header{color:#888;line-height:220%}#buddypress .activity-header{margin-right:20px}#buddypress .acomment-meta a,#buddypress .activity-header a,#buddypress .comment-meta a{text-decoration:none}#buddypress .activity-list .activity-content .activity-header img.avatar{float:none!important;margin:0 5px -8px 0!important}#buddypress a.bp-secondary-action,#buddypress span.highlight{font-size:80%;padding:0;margin-right:5px;text-decoration:none}#buddypress .activity-list .activity-content .activity-inner,#buddypress .activity-list .activity-content blockquote{margin:10px 10px 5px 0;overflow:hidden}#buddypress .activity-list li.new_forum_post .activity-content .activity-inner,#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner{border-left:2px solid #EAEAEA;margin-left:5px;padding-left:10px}body.activity-permalink #buddypress .activity-content .activity-inner,body.activity-permalink #buddypress .activity-content blockquote{margin-left:0;margin-top:5px}#buddypress .activity-inner>p{word-wrap:break-word}#buddypress .activity-inner>.activity-inner,#buddypress .activity-inner>blockquote{margin:0}#buddypress .activity-list .activity-content img.thumbnail{border:2px solid #eee;float:left;margin:0 10px 5px 0}#buddypress .activity-read-more{margin-left:1em;white-space:nowrap}#buddypress .activity-list li.load-more,#buddypress .activity-list li.load-newest{background:#f0f0f0;font-size:110%;margin:15px 0;padding:10px 15px;text-align:center}#buddypress .activity-list li.load-more a,#buddypress .activity-list li.load-newest a{color:#4D4D4D}#buddypress div.activity-meta{margin:18px 0 0}body.activity-permalink #buddypress div.activity-meta{margin-bottom:6px}#buddypress div.activity-meta a{padding:4px 8px}#buddypress a.activity-time-since{color:#aaa;text-decoration:none}#buddypress a.activity-time-since:hover{color:#888;text-decoration:underline}#buddypress #reply-title small a,#buddypress a.bp-primary-action{font-size:80%;margin-right:5px;text-decoration:none}#buddypress #reply-title small a span,#buddypress a.bp-primary-action span{background:#999;color:#fff;font-size:90%;margin-left:2px;padding:0 5px}#buddypress #reply-title small a:hover span,#buddypress a.bp-primary-action:hover span{background:#555;color:#fff}#buddypress div.activity-comments{margin:0 0 0 70px;overflow:hidden;position:relative;width:auto;clear:both}body.activity-permalink #buddypress div.activity-comments{background:0 0;margin-left:170px;width:auto}#buddypress div.activity-comments>ul{padding:0 0 0 10px}#buddypress div.activity-comments ul,#buddypress div.activity-comments ul li{border:none;list-style:none}#buddypress div.activity-comments ul{clear:both;margin:0}#buddypress div.activity-comments ul li{border-top:1px solid #eee;padding:10px 0 0}body.activity-permalink #buddypress .activity-list li.mini .activity-comments{clear:none;margin-top:0}body.activity-permalink #buddypress div.activity-comments ul li{border-width:1px;padding:10px 0 0}#buddypress div.activity-comments>ul>li:first-child{border-top:none}#buddypress div.activity-comments ul li:last-child{margin-bottom:0}#buddypress div.activity-comments ul li>ul{margin-left:30px;margin-top:0;padding-left:10px}body.activity-permalink #buddypress div.activity-comments ul li>ul{margin-top:10px}body.activity-permalink #buddypress div.activity-comments>ul{padding:0 10px 0 15px}#buddypress div.activity-comments div.acomment-avatar img{border-width:1px;float:left;height:25px;margin-right:10px;width:25px}#buddypress div.activity-comments div.acomment-content{font-size:80%;margin:5px 0 0 40px}#buddypress div.acomment-content .activity-delete-link,#buddypress div.acomment-content .comment-header,#buddypress div.acomment-content .time-since{display:none}body.activity-permalink #buddypress div.activity-comments div.acomment-content{font-size:90%}#buddypress div.activity-comments div.acomment-meta{color:#888;font-size:80%}#buddypress div.activity-comments form.ac-form{display:none;padding:10px}#buddypress div.activity-comments li form.ac-form{margin-right:15px;clear:both}#buddypress div.activity-comments form.root{margin-left:0}#buddypress div.activity-comments div#message{margin-top:15px;margin-bottom:0}#buddypress div.activity-comments form .ac-textarea{background:#fff;border:1px inset #ccc;margin-bottom:10px;padding:8px}#buddypress div.activity-comments form textarea{border:none;background:0 0;box-shadow:none;outline:0;color:#555;font-family:inherit;font-size:100%;height:60px;padding:0;margin:0;width:100%}#buddypress div.activity-comments form input{margin-top:5px}#buddypress div.activity-comments form div.ac-reply-avatar{float:left}#buddypress div.ac-reply-avatar img{border:1px solid #eee}#buddypress div.activity-comments form div.ac-reply-content{color:#888;margin-left:50px;padding-left:15px}#buddypress div.activity-comments form div.ac-reply-content a{text-decoration:none}#buddypress .acomment-options{float:left;margin:5px 0 5px 40px}#buddypress .acomment-options a{color:#999}#buddypress .acomment-options a:hover{color:inherit}#buddypress div.dir-search{float:right;margin:-39px 0 0}#buddypress div.dir-search input[type=text],#buddypress li.groups-members-search input[type=text]{font-size:90%;padding:1px 3px}#buddypress .dir-form{clear:both}#buddypress div#message{margin:0 0 15px}#buddypress #message.info{margin-bottom:0}#buddypress div#message.updated{clear:both}#buddypress div#message p,#sitewide-notice p{font-size:90%;display:block;padding:10px 15px}#buddypress div#message.error p{background-color:#fdc;border:1px solid #a00;clear:left;color:#800}#buddypress div#message.updated p{background-color:#efc;border:1px solid #591;color:#250}#buddypress #pass-strength-result{background-color:#eee;border-color:#ddd;border-style:solid;border-width:1px;display:none;margin:5px 5px 5px 0;padding:5px;text-align:center;width:150px}#buddypress .standard-form #basic-details-section #pass-strength-result{width:35%}#buddypress #pass-strength-result.bad,#buddypress #pass-strength-result.error{background-color:#ffb78c;border-color:#ff853c!important;display:block}#buddypress #pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;display:block}#buddypress #pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;display:block}#buddypress #pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;display:block}#buddypress .standard-form#signup_form div div.error{background:#faa;color:#a00;margin:0 0 10px;padding:6px;width:90%}#buddypress div.accept,#buddypress div.reject{float:left;margin-left:10px}#buddypress ul.button-nav li{float:left;margin:0 10px 10px 0;list-style:none}#buddypress ul.button-nav li.current a{font-weight:700}#sitewide-notice #message{left:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}#buddypress .dir-search input[type=search],#buddypress .dir-search input[type=text],#buddypress .groups-members-search input[type=search],#buddypress .groups-members-search input[type=text],#buddypress .standard-form input[type=color],#buddypress .standard-form input[type=date],#buddypress .standard-form input[type=datetime-local],#buddypress .standard-form input[type=datetime],#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=month],#buddypress .standard-form input[type=number],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=range],#buddypress .standard-form input[type=search],#buddypress .standard-form input[type=tel],#buddypress .standard-form input[type=text],#buddypress .standard-form input[type=time],#buddypress .standard-form input[type=url],#buddypress .standard-form input[type=week],#buddypress .standard-form select,#buddypress .standard-form textarea{border:1px solid #ccc;background:#fafafa;border-radius:0;color:#888;font:inherit;font-size:100%;padding:6px}#buddypress .standard-form select{padding:3px}#buddypress .standard-form input[type=password]{margin-bottom:5px}#buddypress .standard-form label,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress .standard-form div.checkbox label:nth-child(n+2),#buddypress .standard-form div.radio div label{color:#888;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form#sidebar-login-form label{margin-top:5px}#buddypress .standard-form input[type=text]{width:75%}#buddypress .standard-form#sidebar-login-form input[type=password],#buddypress .standard-form#sidebar-login-form input[type=text]{padding:4px;width:95%}#buddypress .standard-form #basic-details-section input[type=password],#buddypress .standard-form #blog-details-section input#signup_blog_url{width:35%}#buddypress #commentform input[type=text],#buddypress #commentform textarea,#buddypress .form-allowed-tags,#buddypress .standard-form#signup_form input[type=text],#buddypress .standard-form#signup_form textarea{width:90%}#buddypress .standard-form#signup_form div.submit{float:right}#buddypress div#signup-avatar img{margin:0 15px 10px 0}#buddypress .standard-form textarea{width:75%;height:120px}#buddypress .standard-form textarea#message_content{height:200px}#buddypress .standard-form#send-reply textarea{width:97.5%}#buddypress .standard-form p.description{color:#888;font-size:80%;margin:5px 0}#buddypress .standard-form div.submit{clear:both;padding:15px 0 0}#buddypress .standard-form p.submit{margin-bottom:0;padding:15px 0 0}#buddypress .standard-form div.submit input{margin-right:15px}#buddypress .standard-form div.radio ul{margin:10px 0 15px 38px;list-style:disc}#buddypress .standard-form div.radio ul li{margin-bottom:5px}#buddypress .standard-form a.clear-value{display:block;margin-top:5px;outline:0}#buddypress .standard-form #basic-details-section,#buddypress .standard-form #blog-details-section,#buddypress .standard-form #profile-details-section{float:left;width:48%}#buddypress .standard-form #profile-details-section{float:right}#buddypress .standard-form #blog-details-section{clear:left}#buddypress .standard-form input:focus,#buddypress .standard-form select:focus,#buddypress .standard-form textarea:focus{background:#fafafa;color:#555}#buddypress form#send-invite-form{margin-top:20px}#buddypress div#invite-list{background:#f5f5f5;height:400px;margin:0 0 10px;overflow:auto;padding:5px;width:160px}#buddypress .comment-reply-link,#buddypress a.button,#buddypress button,#buddypress div.generic-button a,#buddypress input[type=button],#buddypress input[type=reset],#buddypress input[type=submit],#buddypress ul.button-nav li a,a.bp-title-button{background:#fff;border:1px solid #ccc;color:#777;font-size:.8rem;cursor:pointer;outline:0;padding:4px 10px;text-align:center;text-decoration:none}#buddypress .comment-reply-link:hover,#buddypress a.button:focus,#buddypress a.button:hover,#buddypress button:hover,#buddypress div.generic-button a:hover,#buddypress input[type=button]:hover,#buddypress input[type=reset]:hover,#buddypress input[type=submit]:hover,#buddypress ul.button-nav li a:hover,#buddypress ul.button-nav li.current a{background:#ededed;border:1px solid #bbb;color:#555;outline:0;text-decoration:none}#buddypress form.standard-form .left-menu{float:left}#buddypress form.standard-form .left-menu #invite-list ul{margin:1%;list-style:none}#buddypress form.standard-form .left-menu #invite-list ul li{margin:0 0 0 1%}#buddypress form.standard-form .main-column{margin-left:190px}#buddypress form.standard-form .main-column ul#friend-list{clear:none;float:left}#buddypress form.standard-form .main-column ul#friend-list h4{clear:none}#buddypress .wp-editor-wrap a.button,#buddypress .wp-editor-wrap button,#buddypress .wp-editor-wrap input[type=button],#buddypress .wp-editor-wrap input[type=reset],#buddypress .wp-editor-wrap input[type=submit]{padding:0 10px 1px}#buddypress a.loading,#buddypress input.loading{-webkit-animation:loader-pulsate .5s infinite ease-in-out alternate;-moz-animation:loader-pulsate .5s infinite ease-in-out alternate;border-color:#aaa}@-webkit-keyframes loader-pulsate{from{border-color:#aaa;-webkit-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-webkit-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}@-moz-keyframes loader-pulsate{from{border-color:#aaa;-moz-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-moz-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}#buddypress a.loading:hover,#buddypress input.loading:hover{color:#777}#buddypress a.disabled,#buddypress button.disabled,#buddypress button.pending,#buddypress div.pending a,#buddypress input[type=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#888;margin-bottom:10px}#buddypress ul#topic-post-list li div.post-content{margin-left:54px}#buddypress div.topic-tags{font-size:80%}#buddypress div.admin-links{color:#888;font-size:80%;position:absolute;top:15px;right:25px}#buddypress div#topic-meta{margin:0;padding:5px 19px 30px;position:relative}#buddypress div#topic-meta div.admin-links{right:19px;top:-36px}#buddypress div#topic-meta h3{margin:5px 0}#buddypress div#new-topic-post{display:none;margin:20px 0 0;padding:1px 0 0}#buddypress table.forum,#buddypress table.messages-notices,#buddypress table.notifications,#buddypress table.notifications-settings,#buddypress table.profile-fields,#buddypress table.profile-settings,#buddypress table.wp-profile-fields{width:100%}#buddypress table.forum thead tr,#buddypress table.messages-notices thead tr,#buddypress table.notifications thead tr,#buddypress table.notifications-settings thead tr,#buddypress table.profile-fields thead tr,#buddypress table.profile-settings thead tr,#buddypress table.wp-profile-fields thead tr{background:#eaeaea}#buddypress table#message-threads{clear:both;margin:0;width:auto}#buddypress table.profile-fields{margin-bottom:20px}#buddypress table.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-right:1px solid #eaeaea;font-weight:700;width:25%}#buddypress table tr td.thread-info p{margin:0}#buddypress table tr td.thread-info p.thread-excerpt{color:#888;font-size:80%;margin-top:3px}#buddypress table.forum td{text-align:center}#buddypress table.forum tr.alt td,#buddypress table.messages-notices tr.alt td,#buddypress table.notifications tr.alt td,#buddypress table.notifications-settings tr.alt td,#buddypress table.profile-fields tr.alt td,#buddypress table.profile-settings tr.alt td,#buddypress table.wp-profile-fields tr.alt td{background:#f5f5f5}#buddypress table.notification-settings{margin-bottom:20px;text-align:left}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon{display:none}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-left:35px}#buddypress table.forum td p.topic-text{color:#888;font-size:100%}#buddypress table.forum tr>td:first-child,#buddypress table.forum tr>th:first-child{padding-left:15px}#buddypress table.forum tr>td:last-child,#buddypress table.forum tr>th:last-child{padding-right:15px}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster,#buddypress table.forum td.td-title,#buddypress table.forum tr th#th-group,#buddypress table.forum tr th#th-poster,#buddypress table.forum tr th#th-title{text-align:left}#buddypress table.forum tr td.td-title a.topic-title{font-size:110%}#buddypress table.forum td.td-freshness{white-space:nowrap}#buddypress table.forum td.td-freshness span.time-since{font-size:80%;color:#888}#buddypress table.forum td img.avatar{float:none;margin:0 5px -8px 0}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster{min-width:140px}#buddypress table.forum th#th-title{width:80%}#buddypress table.forum th#th-freshness{width:25%}#buddypress table.forum th#th-postcount{width:15%}#buddypress table.forum p.topic-meta{font-size:80%;margin:5px 0 0}#buddypress .item-body{margin:20px 0}#buddypress span.activity{display:inline-block;font-size:80%;opacity:.8;padding:0}#buddypress span.user-nicename{color:#777;display:inline-block;font-size:120%;font-weight:700}#buddypress div#message p,#sitewide-notice p{font-weight:400;margin-top:3px;text-decoration:none;background-color:#ffd;border:1px solid #cb2;color:#440}#buddypress div#item-header{overflow:hidden}#buddypress div#item-header div#item-header-content{float:left;margin-left:0}#buddypress div#item-header h2{line-height:120%;margin:0 0 15px}#buddypress div#item-header h2 a{color:#777;text-decoration:none}#buddypress div#item-header img.avatar{float:left;margin:0 15px 19px 0}#buddypress div#item-header h2{margin-bottom:5px}#buddypress div#item-header h2 span.highlight{font-size:60%;font-weight:400;line-height:170%;vertical-align:middle;display:inline-block}#buddypress div#item-header h2 span.highlight span{background:#a1dcfa;color:#fff;cursor:pointer;font-weight:700;font-size:80%;margin-bottom:2px;padding:1px 4px;position:relative;right:-2px;top:-2px;vertical-align:middle}#buddypress div#item-header div#item-meta{font-size:80%;color:#aaa;overflow:hidden;margin:15px 0 5px;padding-bottom:10px}#buddypress div#item-header div#item-actions{float:right;margin:0 0 15px 15px;text-align:right;width:20%}#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header ul{margin-bottom:15px;overflow:hidden}#buddypress div#item-header ul h5,#buddypress div#item-header ul hr,#buddypress div#item-header ul span{display:none}#buddypress div#item-header ul li{float:right;list-style:none}#buddypress div#item-header ul img.avatar,#buddypress div#item-header ul.avatars img.avatar{height:30px;margin:2px;width:30px}#buddypress div#item-header a.button,#buddypress div#item-header div.generic-button{float:left;margin:10px 10px 0 0}#buddypress div#item-header div#message.info{line-height:80%}#buddypress ul.item-list{border-top:1px solid #eaeaea;width:100%;list-style:none;clear:both;margin:0;padding:0}body.activity-permalink #buddypress ul.item-list,body.activity-permalink #buddypress ul.item-list li.activity-item{border:none}#buddypress ul.item-list li{border-bottom:1px solid #eaeaea;padding:15px 0;margin:0;position:relative;list-style:none}#buddypress ul.single-line li{border:none}#buddypress ul.item-list li img.avatar{float:left;margin:0 10px 0 0}#buddypress ul.item-list li div.item-title,#buddypress ul.item-list li h4{font-weight:400;font-size:90%;margin:0;width:75%}#buddypress ul.item-list li div.item-title span{color:#999;font-size:80%}#buddypress ul.item-list li div.item-desc{color:#888;font-size:80%;margin:10px 0 0 60px;width:50%}#buddypress ul.item-list li div.action{position:absolute;top:15px;right:0;text-align:right}#buddypress ul.item-list li div.meta{color:#888;font-size:80%;margin-top:10px}#buddypress ul.item-list li h5 span.small{float:right;font-size:80%;font-weight:400}#buddypress div.item-list-tabs{background:0 0;clear:left;overflow:hidden}#buddypress div.item-list-tabs ul{margin:0;padding:0}#buddypress div.item-list-tabs ul li{float:left;margin:0;list-style:none}#buddypress div.item-list-tabs#subnav ul li{margin-top:0}#buddypress div.item-list-tabs ul li.last{float:right;margin:7px 0 0}#buddypress div.item-list-tabs#subnav ul li.last{margin-top:4px}#buddypress div.item-list-tabs ul li.last select{max-width:175px}#buddypress div.item-list-tabs ul li a,#buddypress div.item-list-tabs ul li span{display:block;padding:5px 10px;text-decoration:none}#buddypress div.item-list-tabs ul li a span{background:#eee;border-radius:50%;border:1px solid #ccc;color:#999;display:inline;font-size:70%;margin-left:2px;padding:3px 6px;text-align:center;vertical-align:middle}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background-color:#eee;color:#555;opacity:.8;font-weight:700}#buddypress div.item-list-tabs ul li a:hover span,#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#eee}#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#fff}#buddypress div#item-nav ul li.loading a{background-position:88% 50%}#buddypress div.item-list-tabs#object-nav{margin-top:0}#buddypress div.item-list-tabs#subnav{background:0 0;margin:10px 0;overflow:hidden}#buddypress #admins-list li,#buddypress #members-list li,#buddypress #mods-list li{overflow:auto;list-style:none}#buddypress table#message-threads tr.unread td{background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4;font-weight:700}#buddypress li span.unread-count,#buddypress tr.unread span.unread-count{background:#d00;color:#fff;font-weight:700;padding:2px 8px}#buddypress div.item-list-tabs ul li a span.unread-count{padding:1px 6px;color:#fff}#buddypress div.messages-options-nav{background:#eee;font-size:80%;margin:0;padding:5px 15px;text-align:right}#buddypress div#message-thread div.message-box{margin:0;padding:15px}#buddypress div#message-thread div.alt{background:#f4f4f4}#buddypress div#message-thread p#message-recipients{margin:10px 0 20px}#buddypress div#message-thread img.avatar{float:left;margin:0 10px 0 0;vertical-align:middle}#buddypress div#message-thread strong{font-size:100%;margin:0}#buddypress div#message-thread strong a{text-decoration:none}#buddypress div#message-thread strong span.activity{margin-top:4px}#buddypress div#message-thread div.message-metadata{overflow:hidden}#buddypress div#message-thread div.message-content{margin-left:45px}#buddypress div#message-thread div.message-options{text-align:right}#buddypress #message-threads img.avatar{max-width:none}#buddypress div.message-search{float:right;margin:0 20px}#buddypress div.profile h4{margin-bottom:auto;margin-top:15px}#buddypress #profile-edit-form ul.button-nav{margin-top:15px}body.no-js #buddypress .field-visibility-settings-close,body.no-js #buddypress .field-visibility-settings-toggle{display:none}#buddypress .field-visibility-settings{display:none;margin-top:10px}body.no-js #buddypress .field-visibility-settings{display:block}#buddypress .current-visibility-level{font-weight:700;font-style:normal}#buddypress .field-visibility-settings,#buddypress .field-visibility-settings-notoggle,#buddypress .field-visibility-settings-toggle{color:#888}#buddypress .field-visibility-settings a,#buddypress .field-visibility-settings-toggle a{font-size:80%}body.register #buddypress div.page ul{list-style:none}#buddypress .standard-form .field-visibility-settings label{margin:0;font-weight:400}#buddypress .field-visibility-settings legend,#buddypress .field-visibility-settings-toggle{font-style:italic}#buddypress .field-visibility-settings .radio{list-style:none;margin-bottom:0}#buddypress .field-visibility select{margin:0}.widget.buddypress div.item-avatar img.avatar{float:left;margin:0 10px 15px 0}.widget.buddypress span.activity{display:inline-block;font-size:80%;opacity:.8;padding:0}.widget.buddypress div.item-options{font-size:90%;margin:0 0 1em;padding:1em 0}.widget.buddypress div.item{margin:0 0 1em}.widget.buddypress div.item-content,.widget.buddypress div.item-meta{font-size:11px;margin-left:38px}.widget.buddypress ul.item-list img.avatar{height:20px;margin-right:10px;width:20px}.widget.buddypress div.item-avatar img{height:40px;margin:1px;width:40px}.widget.buddypress div.avatar-block{overflow:hidden}.widget.buddypress #bp-login-widget-form label{display:block;margin:1rem 0 .5rem}.widget.buddypress #bp-login-widget-form #bp-login-widget-submit{margin-right:10px}.widget.buddypress .bp-login-widget-user-avatar{float:left;width:60px}.widget.buddypress .bp-login-widget-user-links>div{padding-left:60px;margin-bottom:.5rem}.widget.buddypress .bp-login-widget-user-links>div.bp-login-widget-user-link a{font-weight:700}@media only screen and (max-width:480px){#buddypress div.dir-search{float:right;margin-top:-50px;text-align:right}#buddypress div.dir-search input[type=text]{margin-bottom:1em;width:50%}a.bp-title-button{margin-left:10px}#buddypress form.standard-form .main-column div.action{position:relative;margin-bottom:1em}#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search{clear:left;float:left;margin-top:0;text-align:left}#buddypress li#groups-order-select{clear:left;float:left}#buddypress ul.item-list li div.action{clear:left;float:left;margin-top:0;margin-left:70px;position:relative;top:0;right:0;text-align:left}#buddypress ul.item-list li div.item-desc{clear:left;float:left;margin:10px 0 0;width:auto}#buddypress li div.item{margin-left:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-left:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:left;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:left}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-left:45px}h1 a.bp-title-button{clear:left;float:left;margin:10px 0 20px}}
\ No newline at end of file
+#buddypress div.pagination .pagination-links a:hover,#buddypress ul.button-nav li.current a{font-weight:700}#buddypress div.pagination{background:0 0;border:none;color:#888;font-size:small;margin:0;position:relative;display:block;float:left;width:100%;padding:10px 0}#buddypress div.pagination .pag-count{float:left;margin-left:10px}#buddypress div.pagination .pagination-links{float:right;margin-right:10px}#buddypress div.pagination .pagination-links a,#buddypress div.pagination .pagination-links span{font-size:90%;padding:0 5px}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:left}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:left}#buddypress form#whats-new-form #whats-new-content{margin-left:55px;padding:0 0 20px 20px}#buddypress form#whats-new-form p.activity-greeting{line-height:.5em;margin-bottom:15px;margin-left:75px}#buddypress form#whats-new-form textarea{background:#fff;color:#555;font-family:inherit;font-size:medium;height:20px;padding:6px;width:98%}body.no-js #buddypress form#whats-new-form textarea{height:50px}#buddypress form#whats-new-form #whats-new-options select{max-width:200px;margin-top:12px}#buddypress form#whats-new-form #whats-new-submit{float:right;margin-top:12px}#buddypress #whats-new-options{overflow:auto;height:0}body.no-js #buddypress #whats-new-options{height:auto}#buddypress #whats-new:focus{border-color:rgba(31,179,221,.9)!important;outline-color:rgba(31,179,221,.9)}#buddypress ul.activity-list li{overflow:hidden;padding:15px 0 0;list-style:none}#buddypress .activity-list .activity-avatar{float:left}#buddypress ul.item-list.activity-list li.has-comments{padding-bottom:15px}body.activity-permalink #buddypress ul.activity-list li.has-comments{padding-bottom:0}#buddypress .activity-list li.mini{font-size:80%;position:relative}#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-list li.mini .activity-avatar img.avatar{height:20px;margin-left:30px;width:20px}#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic,#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar{height:auto;margin-left:0;width:auto}body.activity-permalink #buddypress .activity-list>li:first-child{padding-top:0}#buddypress .activity-list li .activity-content{position:relative}#buddypress .activity-list li.mini .activity-content p{margin:0}#buddypress .activity-list li.mini .activity-comments{clear:both;font-size:120%}body.activity-permalink #buddypress li.mini .activity-meta{margin-top:4px}#buddypress .activity-list li .activity-inreplyto{color:#888;font-size:80%}#buddypress .activity-list li .activity-inreplyto>p{margin:0;display:inline}#buddypress .activity-list li .activity-inreplyto blockquote,#buddypress .activity-list li .activity-inreplyto div.activity-inner{background:0 0;border:none;display:inline;margin:0;overflow:hidden;padding:0}#buddypress .activity-list .activity-content{margin:0 0 0 70px}body.activity-permalink #buddypress .activity-list li .activity-content{border:none;font-size:100%;line-height:150%;margin-left:170px;margin-right:0;padding:0}body.activity-permalink #buddypress .activity-list li .activity-header>p{margin:0;padding:5px 0 0}#buddypress .activity-list .activity-content .activity-header,#buddypress .activity-list .activity-content .comment-header{color:#888;line-height:220%}#buddypress .activity-header{margin-right:20px}#buddypress .acomment-meta a,#buddypress .activity-header a,#buddypress .comment-meta a{text-decoration:none}#buddypress .activity-list .activity-content .activity-header img.avatar{float:none!important;margin:0 5px -8px 0!important}#buddypress a.bp-secondary-action,#buddypress span.highlight{font-size:80%;padding:0;margin-right:5px;text-decoration:none}#buddypress .activity-list .activity-content .activity-inner,#buddypress .activity-list .activity-content blockquote{margin:10px 10px 5px 0;overflow:hidden}#buddypress .activity-list li.new_forum_post .activity-content .activity-inner,#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner{border-left:2px solid #EAEAEA;margin-left:5px;padding-left:10px}body.activity-permalink #buddypress .activity-content .activity-inner,body.activity-permalink #buddypress .activity-content blockquote{margin-left:0;margin-top:5px}#buddypress .activity-inner>p{word-wrap:break-word}#buddypress .activity-inner>.activity-inner,#buddypress .activity-inner>blockquote{margin:0}#buddypress .activity-list .activity-content img.thumbnail{border:2px solid #eee;float:left;margin:0 10px 5px 0}#buddypress .activity-read-more{margin-left:1em;white-space:nowrap}#buddypress .activity-list li.load-more,#buddypress .activity-list li.load-newest{background:#f0f0f0;font-size:110%;margin:15px 0;padding:10px 15px;text-align:center}#buddypress .activity-list li.load-more a,#buddypress .activity-list li.load-newest a{color:#4D4D4D}#buddypress div.activity-meta{margin:18px 0 0}body.activity-permalink #buddypress div.activity-meta{margin-bottom:6px}#buddypress div.activity-meta a{padding:4px 8px}#buddypress a.activity-time-since{color:#aaa;text-decoration:none}#buddypress a.activity-time-since:hover{color:#888;text-decoration:underline}#buddypress #reply-title small a,#buddypress a.bp-primary-action{font-size:80%;margin-right:5px;text-decoration:none}#buddypress #reply-title small a span,#buddypress a.bp-primary-action span{background:#999;color:#fff;font-size:90%;margin-left:2px;padding:0 5px}#buddypress #reply-title small a:hover span,#buddypress a.bp-primary-action:hover span{background:#555;color:#fff}#buddypress div.activity-comments{margin:0 0 0 70px;overflow:hidden;position:relative;width:auto;clear:both}body.activity-permalink #buddypress div.activity-comments{background:0 0;margin-left:170px;width:auto}#buddypress div.activity-comments>ul{padding:0 0 0 10px}#buddypress div.activity-comments ul,#buddypress div.activity-comments ul li{border:none;list-style:none}#buddypress div.activity-comments ul{clear:both;margin:0}#buddypress div.activity-comments ul li{border-top:1px solid #eee;padding:10px 0 0}body.activity-permalink #buddypress .activity-list li.mini .activity-comments{clear:none;margin-top:0}body.activity-permalink #buddypress div.activity-comments ul li{border-width:1px;padding:10px 0 0}#buddypress div.activity-comments>ul>li:first-child{border-top:none}#buddypress div.activity-comments ul li:last-child{margin-bottom:0}#buddypress div.activity-comments ul li>ul{margin-left:30px;margin-top:0;padding-left:10px}body.activity-permalink #buddypress div.activity-comments ul li>ul{margin-top:10px}body.activity-permalink #buddypress div.activity-comments>ul{padding:0 10px 0 15px}#buddypress div.activity-comments div.acomment-avatar img{border-width:1px;float:left;height:25px;margin-right:10px;width:25px}#buddypress div.activity-comments div.acomment-content{font-size:80%;margin:5px 0 0 40px}#buddypress div.acomment-content .activity-delete-link,#buddypress div.acomment-content .comment-header,#buddypress div.acomment-content .time-since{display:none}body.activity-permalink #buddypress div.activity-comments div.acomment-content{font-size:90%}#buddypress div.activity-comments div.acomment-meta{color:#888;font-size:80%}#buddypress div.activity-comments form.ac-form{display:none;padding:10px}#buddypress div.activity-comments li form.ac-form{margin-right:15px;clear:both}#buddypress div.activity-comments form.root{margin-left:0}#buddypress div.activity-comments div#message{margin-top:15px;margin-bottom:0}#buddypress div.activity-comments form .ac-textarea{background:#fff;border:1px inset #ccc;margin-bottom:10px;padding:8px}#buddypress div.activity-comments form textarea{border:none;background:0 0;box-shadow:none;outline:0;color:#555;font-family:inherit;font-size:100%;height:60px;padding:0;margin:0;width:100%}#buddypress div.activity-comments form input{margin-top:5px}#buddypress div.activity-comments form div.ac-reply-avatar{float:left}#buddypress div.ac-reply-avatar img{border:1px solid #eee}#buddypress div.activity-comments form div.ac-reply-content{color:#888;margin-left:50px;padding-left:15px}#buddypress div.activity-comments form div.ac-reply-content a{text-decoration:none}#buddypress .acomment-options{float:left;margin:5px 0 5px 40px}#buddypress .acomment-options a{color:#999}#buddypress .acomment-options a:hover{color:inherit}#buddypress div.dir-search{float:right;margin:-39px 0 0}#buddypress div.dir-search input[type=text],#buddypress li.groups-members-search input[type=text]{font-size:90%;padding:1px 3px}#buddypress .current-member-type{font-style:italic}#buddypress .dir-form{clear:both}#buddypress div#message{margin:0 0 15px}#buddypress #message.info{margin-bottom:0}#buddypress div#message.updated{clear:both;display:block}#buddypress div#message p,#sitewide-notice p{font-size:90%;display:block;padding:10px 15px}#buddypress div#message.error p{background-color:#fdc;border:1px solid #a00;clear:left;color:#800}#buddypress div#message.warning p{background-color:#ffe0af;border:1px solid #ffd087;clear:left;color:#800}#buddypress div#message.updated p{background-color:#efc;border:1px solid #591;color:#250}#buddypress #pass-strength-result{background-color:#eee;border-color:#ddd;border-style:solid;border-width:1px;display:none;margin:5px 5px 5px 0;padding:5px;text-align:center;width:150px}#buddypress .standard-form #basic-details-section #pass-strength-result{width:35%}#buddypress #pass-strength-result.bad,#buddypress #pass-strength-result.error{background-color:#ffb78c;border-color:#ff853c!important;display:block}#buddypress #pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;display:block}#buddypress #pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;display:block}#buddypress #pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;display:block}#buddypress .standard-form#signup_form div div.error{background:#faa;color:#a00;margin:0 0 10px;padding:6px;width:90%}#buddypress div.accept,#buddypress div.reject{float:left;margin-left:10px}#buddypress ul.button-nav li{float:left;margin:0 10px 10px 0;list-style:none}#sitewide-notice #message{left:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}#buddypress .dir-search input[type=search],#buddypress .dir-search input[type=text],#buddypress .groups-members-search input[type=search],#buddypress .groups-members-search input[type=text],#buddypress .standard-form input[type=color],#buddypress .standard-form input[type=date],#buddypress .standard-form input[type=datetime-local],#buddypress .standard-form input[type=datetime],#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=month],#buddypress .standard-form input[type=number],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=range],#buddypress .standard-form input[type=search],#buddypress .standard-form input[type=tel],#buddypress .standard-form input[type=text],#buddypress .standard-form input[type=time],#buddypress .standard-form input[type=url],#buddypress .standard-form input[type=week],#buddypress .standard-form select,#buddypress .standard-form textarea{border:1px solid #ccc;background:#fafafa;border-radius:0;color:#888;font:inherit;font-size:100%;padding:6px}#buddypress .standard-form select{padding:3px}#buddypress .standard-form input[type=password]{margin-bottom:5px}#buddypress .standard-form label,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress .standard-form div.checkbox label:nth-child(n+2),#buddypress .standard-form div.radio div label{color:#888;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form#sidebar-login-form label{margin-top:5px}#buddypress .standard-form input[type=text]{width:75%}#buddypress .standard-form#sidebar-login-form input[type=password],#buddypress .standard-form#sidebar-login-form input[type=text]{padding:4px;width:95%}#buddypress .standard-form #basic-details-section input[type=password],#buddypress .standard-form #blog-details-section input#signup_blog_url{width:35%}#buddypress #commentform input[type=text],#buddypress #commentform textarea,#buddypress .form-allowed-tags,#buddypress .standard-form#signup_form input[type=text],#buddypress .standard-form#signup_form textarea{width:90%}#buddypress .standard-form#signup_form div.submit{float:right}#buddypress div#signup-avatar img{margin:0 15px 10px 0}#buddypress .standard-form textarea{width:75%;height:120px}#buddypress .standard-form textarea#message_content{height:200px}#buddypress .standard-form#send-reply textarea{width:97.5%}#buddypress .standard-form p.description{color:#888;font-size:80%;margin:5px 0}#buddypress .standard-form div.submit{clear:both;padding:15px 0 0}#buddypress .standard-form p.submit{margin-bottom:0;padding:15px 0 0}#buddypress .standard-form div.submit input{margin-right:15px}#buddypress .standard-form div.radio ul{margin:10px 0 15px 38px;list-style:disc}#buddypress .standard-form div.radio ul li{margin-bottom:5px}#buddypress .standard-form a.clear-value{display:block;margin-top:5px;outline:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon,body.no-js #buddypress #delete_inbox_messages,body.no-js #buddypress #delete_sentbox_messages,body.no-js #buddypress #message-type-select,body.no-js #buddypress #messages-bulk-management #select-all-messages,body.no-js #buddypress #notifications-bulk-management #select-all-notifications,body.no-js #buddypress label[for=message-type-select]{display:none}#buddypress .standard-form #basic-details-section,#buddypress .standard-form #blog-details-section,#buddypress .standard-form #profile-details-section{float:left;width:48%}#buddypress .standard-form #profile-details-section{float:right}#buddypress #notifications-bulk-management,#buddypress .standard-form #blog-details-section{clear:left}#buddypress .standard-form input:focus,#buddypress .standard-form select:focus,#buddypress .standard-form textarea:focus{background:#fafafa;color:#555}#buddypress form#send-invite-form{margin-top:20px}#buddypress div#invite-list{background:#f5f5f5;height:400px;margin:0 0 10px;overflow:auto;padding:5px;width:160px}#buddypress .comment-reply-link,#buddypress a.button,#buddypress button,#buddypress div.generic-button a,#buddypress input[type=button],#buddypress input[type=reset],#buddypress input[type=submit],#buddypress ul.button-nav li a,a.bp-title-button{background:#fff;border:1px solid #ccc;color:#777;font-size:small;cursor:pointer;outline:0;padding:4px 10px;text-align:center;text-decoration:none}#buddypress .comment-reply-link:hover,#buddypress a.button:focus,#buddypress a.button:hover,#buddypress button:hover,#buddypress div.generic-button a:hover,#buddypress input[type=button]:hover,#buddypress input[type=reset]:hover,#buddypress input[type=submit]:hover,#buddypress ul.button-nav li a:hover,#buddypress ul.button-nav li.current a{background:#ededed;border:1px solid #bbb;color:#555;outline:0;text-decoration:none}#buddypress form.standard-form .left-menu{float:left}#buddypress form.standard-form .left-menu #invite-list ul{margin:1%;list-style:none}#buddypress form.standard-form .left-menu #invite-list ul li{margin:0 0 0 1%}#buddypress form.standard-form .main-column{margin-left:190px}#buddypress form.standard-form .main-column ul#friend-list{clear:none;float:left}#buddypress form.standard-form .main-column ul#friend-list h4{clear:none}#buddypress .wp-editor-wrap a.button,#buddypress .wp-editor-wrap button,#buddypress .wp-editor-wrap input[type=button],#buddypress .wp-editor-wrap input[type=reset],#buddypress .wp-editor-wrap input[type=submit]{padding:0 10px 1px}#buddypress form [disabled=disabled]{cursor:default;opacity:.4}.bp-screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute}#buddypress a.loading,#buddypress input.loading{-webkit-animation:loader-pulsate .5s infinite ease-in-out alternate;-moz-animation:loader-pulsate .5s infinite ease-in-out alternate;border-color:#aaa}@-webkit-keyframes loader-pulsate{from{border-color:#aaa;-webkit-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-webkit-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}@-moz-keyframes loader-pulsate{from{border-color:#aaa;-moz-box-shadow:0 0 6px #ccc;box-shadow:0 0 6px #ccc}to{border-color:#ccc;-moz-box-shadow:0 0 6px #f8f8f8;box-shadow:0 0 6px #f8f8f8}}#buddypress a.loading:hover,#buddypress input.loading:hover{color:#777}#buddypress a.disabled,#buddypress button.disabled,#buddypress button.pending,#buddypress div.pending a,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending,#buddypress input[type=submit][disabled=disabled],#buddypress input[type=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#888;margin-bottom:10px}#buddypress ul#topic-post-list li div.post-content{margin-left:54px}#buddypress div.topic-tags{font-size:80%}#buddypress div.admin-links{color:#888;font-size:80%;position:absolute;top:15px;right:25px}#buddypress div#topic-meta{margin:0;padding:5px 19px 30px;position:relative}#buddypress div#topic-meta div.admin-links{right:19px;top:-36px}#buddypress div#topic-meta h3{margin:5px 0}#buddypress div#new-topic-post{display:none;margin:20px 0 0;padding:1px 0 0}#buddypress table.forum,#buddypress table.messages-notices,#buddypress table.notifications,#buddypress table.notifications-settings,#buddypress table.profile-fields,#buddypress table.profile-settings,#buddypress table.wp-profile-fields{width:100%}#buddypress table.forum thead tr,#buddypress table.messages-notices thead tr,#buddypress table.notifications thead tr,#buddypress table.notifications-settings thead tr,#buddypress table.profile-fields thead tr,#buddypress table.profile-settings thead tr,#buddypress table.wp-profile-fields thead tr{background:#eaeaea}#buddypress table#message-threads{clear:both}#buddypress table.profile-fields{margin-bottom:20px}#buddypress table tr td.thread-info p,#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-right:1px solid #eaeaea;font-weight:700;width:25%}#buddypress #message-threads .thread-info{min-width:40%}#buddypress table tr td.thread-info p.thread-excerpt{color:#888;font-size:80%;margin-top:3px}#buddypress table.forum td{text-align:center}#buddypress table.forum tr.alt td,#buddypress table.messages-notices tr.alt td,#buddypress table.notifications tr.alt td,#buddypress table.notifications-settings tr.alt td,#buddypress table.profile-fields tr.alt td,#buddypress table.profile-settings tr.alt td,#buddypress table.wp-profile-fields tr.alt td{background:#f5f5f5}#buddypress table.notification-settings{margin-bottom:20px;text-align:left}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-left:35px}#buddypress table.forum td p.topic-text{color:#888;font-size:100%}#buddypress table.forum tr>td:first-child,#buddypress table.forum tr>th:first-child{padding-left:15px}#buddypress table.forum tr>td:last-child,#buddypress table.forum tr>th:last-child{padding-right:15px}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster,#buddypress table.forum td.td-title,#buddypress table.forum tr th#th-group,#buddypress table.forum tr th#th-poster,#buddypress table.forum tr th#th-title{text-align:left}#buddypress table.forum tr td.td-title a.topic-title{font-size:110%}#buddypress table.forum td.td-freshness{white-space:nowrap}#buddypress table.forum td.td-freshness span.time-since{font-size:80%;color:#888}#buddypress table.forum td img.avatar{float:none;margin:0 5px -8px 0}#buddypress table.forum td.td-group,#buddypress table.forum td.td-poster{min-width:140px}#buddypress table.forum th#th-title{width:80%}#buddypress table.forum th#th-freshness{width:25%}#buddypress table.forum th#th-postcount{width:15%}#buddypress table.forum p.topic-meta{font-size:80%;margin:5px 0 0}#buddypress .item-body{margin:20px 0}#buddypress span.activity{display:inline-block;font-size:small;opacity:.8;padding:0}#buddypress span.user-nicename{color:#777;display:inline-block;font-size:120%;font-weight:700}#buddypress div#message p,#sitewide-notice p{font-weight:400;margin-top:3px;text-decoration:none;background-color:#ffd;border:1px solid #cb2;color:#440}#buddypress div#item-header{overflow:hidden}#buddypress div#item-header div#item-header-content{float:left;margin-left:0}#buddypress div#item-header h2{line-height:120%;margin:0 0 15px}#buddypress div#item-header h2 a{color:#777;text-decoration:none}#buddypress div#item-header img.avatar{float:left;margin:0 15px 19px 0}#buddypress div#item-header h2{margin-bottom:5px}#buddypress div#item-header h2 span.highlight{font-size:60%;font-weight:400;line-height:170%;vertical-align:middle;display:inline-block}#buddypress div#item-header h2 span.highlight span{background:#a1dcfa;color:#fff;cursor:pointer;font-weight:700;font-size:80%;margin-bottom:2px;padding:1px 4px;position:relative;right:-2px;top:-2px;vertical-align:middle}#buddypress div#item-header div#item-meta{font-size:80%;color:#aaa;overflow:hidden;margin:15px 0 5px;padding-bottom:10px}#buddypress div#item-header div#item-actions{float:right;margin:0 0 15px 15px;text-align:right;width:20%}#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header ul{margin-bottom:15px;overflow:hidden}#buddypress div#item-header ul h5,#buddypress div#item-header ul hr,#buddypress div#item-header ul span{display:none}#buddypress div#item-header ul li{float:right;list-style:none}#buddypress div#item-header ul img.avatar,#buddypress div#item-header ul.avatars img.avatar{height:30px;margin:2px;width:30px}#buddypress div#item-header a.button,#buddypress div#item-header div.generic-button{float:left;margin:10px 10px 0 0}#buddypress div#item-header div#message.info{line-height:80%}#buddypress ul.item-list{border-top:1px solid #eaeaea;width:100%;list-style:none;clear:both;margin:0;padding:0}body.activity-permalink #buddypress ul.item-list,body.activity-permalink #buddypress ul.item-list li.activity-item{border:none}#buddypress ul.item-list li{border-bottom:1px solid #eaeaea;padding:15px 0;margin:0;position:relative;list-style:none}#buddypress ul.single-line li{border:none}#buddypress ul.item-list li img.avatar{float:left;margin:0 10px 0 0}#buddypress ul.item-list li div.item-title,#buddypress ul.item-list li h4{font-weight:400;font-size:90%;margin:0;width:75%}#buddypress ul.item-list li div.item-title span{color:#999;font-size:80%}#buddypress ul.item-list li div.item-desc{color:#888;font-size:80%;margin:10px 0 0 60px;width:50%}#buddypress ul.item-list li.group-no-avatar div.item-desc{margin-left:0}#buddypress ul.item-list li div.action{position:absolute;top:15px;right:0;text-align:right}#buddypress ul.item-list li div.meta{color:#888;font-size:80%;margin-top:10px}#buddypress ul.item-list li h5 span.small{float:right;font-size:80%;font-weight:400}#buddypress div.item-list-tabs{background:0 0;clear:left;overflow:hidden}#buddypress div.item-list-tabs ul{margin:0;padding:0}#buddypress div.item-list-tabs ul li{float:left;margin:0;list-style:none}#buddypress div.item-list-tabs#subnav ul li{margin-top:0}#buddypress div.item-list-tabs ul li.last{float:right;margin:7px 0 0}#buddypress div.item-list-tabs#subnav ul li.last{margin-top:4px}#buddypress div.item-list-tabs ul li.last select{max-width:185px}#buddypress div.item-list-tabs ul li a,#buddypress div.item-list-tabs ul li span{display:block;padding:5px 10px;text-decoration:none}#buddypress div.item-list-tabs ul li a span{background:#eee;border-radius:50%;border:1px solid #ccc;color:#999;display:inline;font-size:70%;margin-left:2px;padding:3px 6px;text-align:center;vertical-align:middle}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background-color:#eee;color:#555;opacity:.8;font-weight:700}#buddypress div.item-list-tabs ul li a:hover span,#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#eee}#buddypress div.item-list-tabs ul li.current a span,#buddypress div.item-list-tabs ul li.selected a span{background-color:#fff}#buddypress div#item-nav ul li.loading a{background-position:88% 50%}#buddypress div.item-list-tabs#object-nav{margin-top:0}#buddypress div.item-list-tabs#subnav{background:0 0;margin:10px 0;overflow:hidden}#buddypress #admins-list li,#buddypress #members-list li,#buddypress #mods-list li{overflow:auto;list-style:none}#buddypress div#message-thread div.message-metadata,.widget.buddypress div.avatar-block{overflow:hidden}#buddypress table#message-threads tr.unread td{background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4;font-weight:700}#buddypress table#message-threads tr.unread td .activity,#buddypress table#message-threads tr.unread td .thread-excerpt,#buddypress table#message-threads tr.unread td.thread-options{font-weight:400}#buddypress li span.unread-count,#buddypress tr.unread span.unread-count{background:#d00;color:#fff;font-weight:700;padding:2px 8px}#buddypress div.item-list-tabs ul li a span.unread-count{padding:1px 6px;color:#fff}#buddypress div#message-thread div.message-box{margin:0;padding:15px}#buddypress div#message-thread div.alt{background:#f4f4f4}#buddypress div#message-thread p#message-recipients{margin:10px 0 20px}#buddypress div#message-thread img.avatar{float:left;margin:0 10px 0 0;vertical-align:middle}#buddypress div#message-thread strong{font-size:100%;margin:0}#buddypress div#message-thread strong a{text-decoration:none}#buddypress div#message-thread strong span.activity{margin-top:4px}#buddypress div#message-thread div.message-content{margin-left:45px}#buddypress div#message-thread div.message-options{text-align:right}#buddypress #message-threads img.avatar{max-width:none}#buddypress div.message-search{float:right;margin:0 20px}.message-metadata{position:relative}.message-star-actions{position:absolute;right:0;top:0}#buddypress a.message-action-star,#buddypress a.message-action-unstar{border-bottom:0;text-decoration:none;outline:0}a.message-action-star{opacity:.7}a.message-action-star:hover{opacity:1}.message-action-star span.icon:before,.message-action-unstar span.icon:before{font-family:dashicons;font-size:18px}.message-action-star span.icon:before{color:#aaa;content:"\f154"}.message-action-unstar span.icon:before{color:#FCDD77;content:"\f155"}#buddypress div.profile h4{margin-bottom:auto;margin-top:15px}#buddypress #profile-edit-form ul.button-nav{margin-top:15px}body.no-js #buddypress .field-visibility-settings-close,body.no-js #buddypress .field-visibility-settings-toggle{display:none}#buddypress .field-visibility-settings{display:none;margin-top:10px}body.no-js #buddypress .field-visibility-settings{display:block}#buddypress .current-visibility-level{font-weight:700;font-style:normal}#buddypress .field-visibility-settings,#buddypress .field-visibility-settings-notoggle,#buddypress .field-visibility-settings-toggle{color:#888}#buddypress .field-visibility-settings a,#buddypress .field-visibility-settings-toggle a{font-size:80%}body.register #buddypress div.page ul{list-style:none}#buddypress .standard-form .field-visibility-settings label{margin:0;font-weight:400}#buddypress .field-visibility-settings legend,#buddypress .field-visibility-settings-toggle{font-style:italic}#buddypress .field-visibility-settings .radio{list-style:none;margin-bottom:0}#buddypress .field-visibility select{margin:0}.widget.buddypress div.item-avatar img.avatar{float:left;margin:0 10px 15px 0}.widget.buddypress span.activity{display:inline-block;font-size:small;opacity:.8;padding:0}.widget.buddypress div.item-options{font-size:90%;margin:0 0 1em;padding:1em 0}.widget.buddypress div.item{margin:0 0 1em}.widget.buddypress div.item-content,.widget.buddypress div.item-meta{font-size:11px;margin-left:50px}.widget.buddypress ul.item-list img.avatar{height:40px;margin-right:10px;width:40px}.widget.buddypress div.item-avatar img{height:40px;margin:1px;width:40px}.widget.buddypress #bp-login-widget-form label{display:block;margin:1rem 0 .5rem}.widget.buddypress #bp-login-widget-form #bp-login-widget-submit{margin-right:10px}.widget.buddypress .bp-login-widget-user-avatar{float:left}.bp-login-widget-user-avatar img.avatar{height:40px;width:40px}.widget.buddypress .bp-login-widget-user-links>div{padding-left:60px;margin-bottom:.5rem}.widget.buddypress .bp-login-widget-user-links>div.bp-login-widget-user-link a{font-weight:700}.widget.buddypress #friends-list,.widget.buddypress #groups-list,.widget.buddypress #members-list{margin-left:0;padding-left:0}.widget.buddypress #friends-list li,.widget.buddypress #groups-list li,.widget.buddypress #members-list li{clear:both;list-style-type:none}@media only screen and (max-width:480px){#buddypress div.dir-search{float:right;margin-top:-50px;text-align:right}#buddypress div.dir-search input[type=text]{margin-bottom:1em;width:50%}a.bp-title-button{margin-left:10px}#buddypress form.standard-form .main-column div.action{position:relative;margin-bottom:1em}#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search,#buddypress ul.item-list li div.action{clear:left;float:left;margin-top:0;text-align:left}#buddypress li#groups-order-select{clear:left;float:left}#buddypress ul.item-list li div.action{margin-left:70px;position:relative;top:0;right:0}#buddypress ul.item-list li div.item-desc{clear:left;float:left;margin:10px 0 0;width:auto}#buddypress li div.item{margin-left:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-left:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:left;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:left}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-left:45px}h1 a.bp-title-button{clear:left;float:left;margin:10px 0 20px}}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..422898c59d1269c2de30018c3985873e9b500f18
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen-rtl.css
@@ -0,0 +1,1946 @@
+@charset "UTF-8";
+/*------------------------------------------------------------------------------
+
+This is the BuddyPress companion stylesheet for
+the WordPress Twentyfifteen theme.
+
+This sheet supports the primary BuddyPress styles in buddypress.css
+
+If you are running as a child theme of twentyfifteen this stylesheet will be
+loaded by default. If you want to modify the styles the normal BP Theme Compat
+hierarchy works and you can copy the file to buddypress/css/ or community/css/
+in your child themes root & either start over or modify the rulesets.
+
+If you do not require the styles you can dequeue them from the themes functions file.
+
+Please see this codex article for more information:
+http://codex.buddypress.org/themes/buddypress-companion-stylesheets/
+
+--------------------------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+--------------------------------------------------------------------------------
+1.0 Theme Structural Elements & overrides
+2.0 - Navigation - General
+	2.1 - Navs - Object Nav / Sub Nav (item-list-tabs)
+	2.2 - Pagination
+3.0 - Images
+4.0 - BP Lists / Loops Generic
+	4.1 - Activity Loop
+		4.1.1 Whats New Activity
+		4.1.2 - Activity Listing
+		4.1.3 - Activity Comments
+	4.2 - Members Loop
+	4.3 - Groups Loop
+	4.4 - Blogs Loop
+5.0 - Directories - Members, Groups, Blogs, Forums
+6.0 - Single Item screens: User Account & Single Group Screens
+	6.1 - Item Headers: Global
+		6.1.1 - item-header: Groups
+		6.1.2 - item-header: User Accounts
+	6.2 - Item Body: Global
+		6.2.1 - item-body: Groups
+			6.2.1.1 - Management settings screens
+			6.2.1.2 - Group members list
+			6.2.1.3 - Group Send Invites
+		6.2.2 - item-body: User Accounts
+			6.2.2.1 - classes, pag, filters
+			6.2.2.2 - Extended Profiles
+			6.2.2.3 - Groups
+			6.2.2.4 - friends
+			6.2.2.5 - Private Messaging Threads
+			6.2.2.6 - Settings
+7.0 - Forms  -  General
+8.0 - Tables -  General
+9.0 - Error / Success Messages
+10.0 - Ajax Loading, Widgets, General classes
+------------------------------------------------------------------------------*/
+/**
+*-------------------------------------------------------------------------------
+* @section 1.0 - Theme - Structural Elements & overrides
+*-------------------------------------------------------------------------------
+*/
+#buddypress h1,
+#buddypress h2,
+#buddypress h3,
+#buddypress h4,
+#buddypress h5,
+#buddypress h6 {
+	clear: none;
+}
+
+.buddypress div.clear {
+	display: none;
+}
+
+.buddypress main {
+	padding-top: 4%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress main {
+		padding-top: 0;
+	}
+}
+
+.buddypress main article {
+	margin: 0 4%;
+	padding-top: 8.3333%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress main article {
+		margin: 0 1px 0 0;
+	}
+}
+
+@media screen and (min-width: 87.6875em) {
+	.buddypress main article {
+		margin: 0 8.3333% 0 4.3333%;
+	}
+}
+
+.buddypress main article .entry-header,
+.buddypress main article .entry-content {
+	padding: 0 3rem 3rem 3rem;
+}
+
+.buddypress main article #buddypress {
+	margin-bottom: 40px;
+}
+
+.buddypress .site-footer {
+	margin: 0 4%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress .site-footer {
+		margin: 0 35.2941% 0 0;
+		width: 61.8235%;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 2.0 - Navigation - General
+*-------------------------------------------------------------------------------
+*/
+.buddypress #buddypress .item-list-tabs a,
+.buddypress #buddypress .activity-header a,
+.buddypress #buddypress .activity-inner a,
+.buddypress #buddypress .activity-comments a,
+.buddypress #buddypress .item-title a,
+.buddypress #buddypress .load-more a,
+.buddypress #buddypress .field-visibility-settings-toggle a,
+.buddypress #buddypress #latest-update a,
+.buddypress #buddypress table a,
+.buddypress #buddypress .avatar-nav-items a {
+	border-bottom: 0;
+}
+
+.buddypress #buddypress .pagination-links a,
+.buddypress #buddypress .pagination-links span {
+	border-bottom: 0;
+}
+
+/**
+*----------------------------------------------------------
+* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs)
+*
+* The main navigational elements for all BP screens
+*----------------------------------------------------------
+*/
+#buddypress {
+	/*__ Horizontal menus __*/
+}
+
+#buddypress div.item-list-tabs ul li.selected a {
+	background: #555;
+	color: #fff;
+	opacity: 1;
+}
+
+#buddypress div.item-list-tabs ul {
+	background-color: #f7f7f7;
+	border-bottom: 1px solid rgba(234, 234, 234, 0.9);
+	border-top: 1px solid rgba(234, 234, 234, 0.9);
+	overflow: hidden;
+	padding: 5px 0;
+}
+
+#buddypress div.item-list-tabs ul li a span {
+	border-radius: 25%;
+}
+
+#buddypress #object-nav ul {
+	overflow: hidden;
+}
+
+#buddypress #object-nav ul li {
+	float: none;
+}
+
+#buddypress #object-nav ul li:not(.selected) a {
+	opacity: 0.7;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #object-nav ul li {
+		float: right;
+	}
+}
+
+#buddypress div#subnav.item-list-tabs {
+	margin-top: 0;
+}
+
+#buddypress div#subnav.item-list-tabs ul {
+	background-color: #f7f7f7;
+	border-bottom: 0;
+	padding: 0;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last {
+	background: #fff;
+	margin-top: 0;
+	padding: 5px 0 5px 5px;
+	width: 100%;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last select,
+#buddypress div#subnav.item-list-tabs ul li.last select:focus {
+	background: transparent;
+	border: 0;
+	outline: 0;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last select,
+#buddypress div#subnav.item-list-tabs ul li.last label,
+#buddypress div#subnav.item-list-tabs ul li.last option {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last select {
+	font-style: italic;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress div#subnav.item-list-tabs ul li.last {
+		text-align: left;
+	}
+}
+
+#buddypress div.item-list-tabs ul li.selected a,
+#buddypress div.item-list-tabs ul li.current a {
+	background: #555;
+	color: #fff;
+	opacity: 1;
+}
+
+/*__ Vertical menu User Account / Group single screens __*/
+@media screen and (min-width: 55em) {
+	.bp-user #buddypress,
+	.single-item.groups #buddypress {
+		background: #f7f7f7;
+	}
+	#buddypress #item-header,
+	#buddypress #item-body {
+		background: #fff;
+	}
+	#buddypress #object-nav {
+		border-left: 1px solid #ddd;
+		float: right;
+		margin-left: -1px;
+		width: 200px;
+	}
+	#buddypress #object-nav ul {
+		border-bottom: 0;
+		padding: 0;
+	}
+	#buddypress #object-nav ul li {
+		float: none;
+		overflow: hidden;
+	}
+	#buddypress #object-nav ul li span {
+		background: #fff;
+		border-radius: 10%;
+		float: left;
+		margin-left: 2px;
+	}
+	#buddypress #item-body {
+		border-right: 1px solid #ddd;
+		overflow: hidden;
+		padding: 0 20px 0 0;
+		width: auto;
+	}
+	#buddypress #item-body #subnav {
+		margin: 0 -20px 0 0;
+	}
+}
+
+/**
+*----------------------------------------------------------
+* @section 2.2 - Pagination
+*----------------------------------------------------------
+*/
+#buddypress div.pagination {
+	box-shadow: none;
+}
+
+#buddypress div.pagination .pag-count {
+	margin-right: 0;
+}
+
+#buddypress div.pagination .pagination-links {
+	margin-left: 0;
+}
+
+#buddypress div.pagination .pagination-links span,
+#buddypress div.pagination .pagination-links a {
+	height: auto;
+	line-height: 1;
+	padding: 5px;
+}
+
+#buddypress div.pagination .pagination-links .prev,
+#buddypress div.pagination .pagination-links .next {
+	background-color: transparent;
+	color: inherit;
+	overflow: visible;
+	width: auto;
+}
+
+#buddypress div.pagination .pagination-links .prev:before,
+#buddypress div.pagination .pagination-links .next:before {
+	display: none;
+}
+
+#buddypress div.pagination .pagination-links .prev {
+	right: auto;
+	position: static;
+}
+
+#buddypress div.pagination .pagination-links .next {
+	position: static;
+	left: auto;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 4.0 - BP Lists / Loops Generic
+*-------------------------------------------------------------------------------
+*/
+#buddypress .item-list .activity-header,
+#buddypress .item-list .activity-meta {
+	font-family: "Noto Sans", sans-serif;
+}
+
+#buddypress ul.item-list li {
+	overflow: hidden !important;
+}
+
+#buddypress ul.item-list li .item-avatar {
+	margin-bottom: 10px;
+	text-align: center;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress ul.item-list li .item-avatar {
+		margin-bottom: 0;
+	}
+}
+
+#buddypress ul.item-list li .item-avatar a {
+	border-bottom: 0;
+}
+
+#buddypress ul.item-list li .item-avatar img.avatar {
+	display: inline-block;
+	float: none;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress ul.item-list li .item-avatar img.avatar {
+		display: block;
+		float: right;
+	}
+}
+
+#buddypress ul.item-list li .item {
+	margin-right: 25%;
+}
+
+#buddypress ul.item-list li .item span.activity {
+	font-style: italic;
+}
+
+#buddypress ul.item-list li .item .item-desc {
+	margin-right: 0;
+	width: 70%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	#buddypress ul.item-list li .item-avatar,
+	#buddypress ul.item-list li .item,
+	#buddypress ul.item-list li .action {
+		float: right;
+	}
+	#buddypress ul.item-list li .item {
+		right: 10%;
+		margin-right: 0;
+		position: relative;
+		width: 55%;
+	}
+}
+
+#buddypress ul.item-list li div.action {
+	clear: right;
+	float: none;
+	margin-bottom: -20px;
+	margin-right: 0;
+	padding: 20px 0 5px;
+	position: relative;
+	text-align: right;
+	top: 0;
+}
+
+@media screen and (min-width: 59.6875em) {
+	#buddypress ul.item-list li div.action {
+		clear: none;
+		float: left;
+		margin-bottom: 0;
+		padding: 0;
+	}
+}
+
+#buddypress ul.item-list li div.action div {
+	display: inline-block;
+	margin: 10px 0;
+	width: 100%;
+}
+
+#buddypress ul.item-list li div.action div a {
+	display: block;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress ul.item-list li div.action div {
+		margin: 0 0 10px 10px;
+		width: auto;
+	}
+}
+
+@media screen and (min-width: 59.6875em) {
+	#buddypress ul.item-list li div.action div {
+		clear: left;
+		float: left;
+		margin: 0 0 10px 0;
+	}
+}
+
+#buddypress ul.item-list li div.action .meta {
+	font-style: italic;
+}
+
+/**
+*----------------------------------------------------------
+* @section 4.1 - Activity
+*----------------------------------------------------------
+*/
+/**
+*-----------------------------------------------------
+* @section 4.1.1 - Activity Whats New
+*-----------------------------------------------------
+*/
+#buddypress form#whats-new-form p.activity-greeting {
+	line-height: 1.4;
+}
+
+#buddypress form#whats-new-form textarea {
+	width: 100%;
+}
+
+@media screen and (max-width: 30em) {
+	#buddypress form#whats-new-form #whats-new-post-in-box select {
+		font-size: 14px;
+		font-size: 1.4rem;
+		max-width: 120px;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	#buddypress form#whats-new-form #whats-new-content {
+		clear: right;
+		margin: 10px 0 40px;
+		padding: 10px 0 0;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-submit {
+		float: none;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-submit input {
+		width: 100%;
+	}
+	#buddypress form#whats-new-form #whats-new-options {
+		display: flex;
+		flex-direction: column;
+	}
+	#buddypress form#whats-new-form #whats-new-options #whats-new-submit {
+		order: 2;
+	}
+	#buddypress form#whats-new-form #whats-new-options #whats-new-post-in-box {
+		order: 1;
+	}
+}
+
+#buddypress form#whats-new-form #whats-new-options[style] {
+	min-height: 6rem;
+	overflow: visible;
+}
+
+#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box {
+	border: 1px solid rgba(153, 153, 153, 0.5);
+	float: right;
+	line-height: 1.5em;
+	margin-top: 12px;
+	padding-right: 0.2em;
+	width: 100%;
+}
+
+#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box select {
+	background: none;
+	border: 0;
+	float: left;
+	margin: 0;
+	min-height: 1.5em;
+	outline: 0;
+	padding-right: 0.4em;
+}
+
+@media screen and (min-width: 30em) {
+	#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box {
+		width: auto;
+	}
+	#buddypress form#whats-new-form #whats-new-options[style] #whats-new-submit {
+		float: left;
+	}
+}
+
+#buddypress #item-body form#whats-new-form {
+	margin: 40px 0;
+}
+
+/**
+*-----------------------------------------------------
+* @section 4.1.2 - Activity Listing
+*-----------------------------------------------------
+*/
+#buddypress #activity-stream li {
+	padding: 25px 0 15px;
+}
+
+#buddypress #activity-stream li .activity-avatar {
+	float: none;
+	text-align: center;
+}
+
+#buddypress #activity-stream li .activity-avatar a {
+	display: inline-block;
+}
+
+#buddypress #activity-stream li .activity-avatar a img.avatar {
+	display: inline;
+	float: none;
+	height: 60px;
+	margin-bottom: 20px;
+	margin-right: 0;
+	width: 60px;
+}
+
+#buddypress #activity-stream li .activity-content {
+	margin-right: 0;
+}
+
+#buddypress #activity-stream li .activity-content .activity-header {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+@media screen and (min-width: 46.25em) {
+	#buddypress #activity-stream li .activity-avatar {
+		float: right;
+		margin-left: 10px;
+		text-align: right;
+	}
+	#buddypress #activity-stream li .activity-avatar a {
+		border-bottom: 0;
+	}
+	#buddypress #activity-stream li .activity-content {
+		margin: 0;
+		overflow: hidden;
+	}
+	#buddypress #activity-stream li .activity-content .activity-header {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+#buddypress #activity-stream li.mini .activity-avatar a img.avatar {
+	height: 30px;
+	margin-right: 15px;
+	width: 30px;
+}
+
+#buddypress #activity-stream li.mini .activity-content .activity-header {
+	font-size: 13px;
+	font-size: 1.3rem;
+}
+
+#buddypress #activity-stream .activity-content {
+	margin-top: -12px;
+}
+
+#buddypress #activity-stream .activity-content .activity-header {
+	line-height: inherit;
+	margin-left: 0;
+}
+
+#buddypress #activity-stream .activity-content .activity-header p {
+	background-color: #f7f7f7;
+	border: 1px solid rgba(234, 234, 234, 0.6);
+	padding: 0 0.2em;
+}
+
+#buddypress #activity-stream .activity-content .activity-header img.avatar {
+	display: inline-block;
+	margin-bottom: 0 !important;
+}
+
+#buddypress #activity-stream .activity-content .activity-meta a {
+	display: block;
+	margin: 0 0 5px;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #activity-stream .activity-content .activity-meta a {
+		display: inline-block;
+		margin: 0;
+	}
+}
+
+#buddypress #activity-stream .load-more {
+	background: #f7f7f7;
+	border: 1px solid transparent;
+	padding: 10px;
+}
+
+#buddypress #activity-stream .load-more:focus,
+#buddypress #activity-stream .load-more:hover {
+	background: #f4f4f4;
+	border: 1px solid rgba(159, 209, 226, 0.3);
+}
+
+#buddypress #activity-stream .load-more:focus a,
+#buddypress #activity-stream .load-more:hover a {
+	font-style: italic;
+}
+
+#buddypress #activity-stream .load-more a {
+	display: block;
+}
+
+/* Single activity view  - activity permalink */
+.activity-permalink #buddypress {
+	background: none;
+}
+
+.activity-permalink #buddypress #activity-stream li.activity-item {
+	padding: 20px 0;
+}
+
+.activity-permalink #buddypress #activity-stream li.mini .activity-header {
+	font-size: 16px;
+	font-size: 1.6rem;
+	margin-bottom: 40px;
+}
+
+@media screen and (min-width: 46.25em) {
+	.activity-permalink #buddypress #activity-stream li.mini .activity-header {
+		font-size: 20px;
+		font-size: 2rem;
+	}
+}
+
+.activity-permalink #buddypress #activity-stream li.mini .activity-header p {
+	padding: 20px;
+}
+
+/**
+*-----------------------------------------------------
+* @section 4.1.3 - Activity Comments
+*-----------------------------------------------------
+*/
+#buddypress #activity-stream .activity-comments {
+	margin: 10px 0 0;
+}
+
+#buddypress #activity-stream .activity-comments.has-comments {
+	border-right: 1px solid #eaeaea;
+}
+
+#buddypress #activity-stream .activity-comments .ac-form {
+	padding: 20px 0 0;
+}
+
+#buddypress #activity-stream .activity-comments > ul {
+	background: rgba(247, 247, 247, 0.6);
+	margin: 15px 2px 0 0;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #activity-stream .activity-comments > ul {
+		margin-right: 70px;
+	}
+}
+
+#buddypress #activity-stream .activity-comments > ul ul {
+	margin-right: 1%;
+	padding-right: 0;
+}
+
+@media screen and (min-width: 30em) {
+	#buddypress #activity-stream .activity-comments > ul ul {
+		margin-right: 1%;
+		padding-right: 1em;
+	}
+}
+
+#buddypress #activity-stream .activity-comments > ul ul li {
+	border-right: 1px solid #eaeaea;
+	border-top: 0;
+	padding-right: 0.2em;
+}
+
+#buddypress #activity-stream .activity-comments > ul .acomment-meta {
+	border-bottom: 1px solid #eaeaea;
+	font-style: italic;
+}
+
+@media screen and (max-width: 38.75em) {
+	#buddypress #activity-stream .activity-comments > ul .acomment-avatar {
+		display: block;
+		text-align: center;
+	}
+	#buddypress #activity-stream .activity-comments > ul .acomment-avatar a,
+	#buddypress #activity-stream .activity-comments > ul .acomment-avatar img.avatar {
+		display: inline;
+		float: none;
+	}
+	#buddypress #activity-stream .activity-comments > ul .acomment-content,
+	#buddypress #activity-stream .activity-comments > ul .acomment-meta,
+	#buddypress #activity-stream .activity-comments > ul .acomment-options {
+		margin: 5px;
+	}
+	#buddypress #activity-stream .activity-comments > ul .acomment-content {
+		padding: 0 10px;
+	}
+}
+
+#buddypress #activity-stream .activity-comments .ac-reply-avatar {
+	display: none;
+}
+
+#buddypress #activity-stream .activity-comments .ac-reply-content {
+	margin-right: 0;
+	padding-right: 0;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #activity-stream .activity-comments .ac-reply-avatar {
+		display: block;
+	}
+	#buddypress #activity-stream .activity-comments .ac-reply-content {
+		overflow: hidden;
+	}
+}
+
+#buddypress #activity-stream .activity-comments .ac-form input[type="submit"],
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel {
+	color: rgba(51, 51, 51, 0.8);
+	display: inline-block;
+	font-family: inherit;
+	font-size: 12px;
+	font-size: 1.2rem;
+	font-weight: normal;
+	line-height: 1.2;
+	padding: 4px 10px;
+	text-transform: lowercase;
+	width: 100px;
+}
+
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel {
+	border: 1px solid rgba(153, 153, 153, 0.7);
+	text-align: center;
+}
+
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:focus,
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:hover {
+	background: #ededed;
+}
+
+/**
+*----------------------------------------------------------
+* @section 4.2 - Members Loop
+*----------------------------------------------------------
+*/
+@media screen and (min-width: 59.6875em) {
+	#buddypress #members-list li .item-avatar,
+	#buddypress #members-list li .item {
+		float: right;
+	}
+	#buddypress #members-list li .action {
+		float: left;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 6.0 - Single Item screens: User Account & Single Group Screens
+*-------------------------------------------------------------------------------
+*/
+/**
+*-----------------------------------------------------------
+* @subsection 6.1 - Item Header Global
+*-----------------------------------------------------------
+*/
+@media screen and (max-width: 46.25em) {
+	.bp-user main header.entry-header,
+	.single-item.groups main header.entry-header {
+		padding-bottom: 1rem;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user h1,
+	.bp-user #item-header-content,
+	.single-item.groups h1,
+	.single-item.groups #item-header-content {
+		text-align: center;
+	}
+}
+
+@media screen and (max-width: 46.25em) {
+	.bp-user #buddypress #item-header .generic-button,
+	.single-item.groups #buddypress #item-header .generic-button {
+		float: none;
+		margin: 1.5em 0 0 0;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user #buddypress h1,
+	.single-item.groups #buddypress h1 {
+		margin-bottom: 0;
+	}
+	.bp-user #buddypress #item-header-avatar img.avatar,
+	.single-item.groups #buddypress #item-header-avatar img.avatar {
+		margin-left: 0;
+	}
+	.bp-user #buddypress #item-header-content,
+	.single-item.groups #buddypress #item-header-content {
+		width: 100%;
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.1.1 - item-header Groups
+*
+* Group Specific Item Header
+*-----------------------------------------------------
+*/
+@media screen and (max-width: 46.25em) {
+	.single-item.groups #buddypress #item-header #item-meta {
+		margin-bottom: 20px;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	.single-item.groups #buddypress div#item-header {
+		display: flex;
+		flex-direction: column;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar {
+		order: 1;
+		text-align: center;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a {
+		border-bottom: 0;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a img {
+		display: inline-block;
+		float: none;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		order: 2;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions {
+		order: 3;
+	}
+}
+
+.single-item.groups #buddypress div#item-header {
+	padding-bottom: 40px;
+}
+
+.single-item.groups #buddypress div#item-header div#item-actions {
+	margin: 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.single-item.groups #buddypress div#item-header div#item-actions {
+		clear: none;
+		float: left;
+		width: 50%;
+	}
+}
+
+.single-item.groups #buddypress div#item-header div#item-actions h3 {
+	background: #555;
+	color: #fff;
+	font-size: 14px;
+	font-size: 1.4rem;
+	padding: 0.2em;
+}
+
+@media screen and (min-width: 46.25em) {
+	.single-item.groups #buddypress div#item-header div#item-actions h3 {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+@media screen and (min-width: 46.25em) {
+	.single-item.groups #buddypress div#item-header #item-header-avatar,
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		float: right;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar {
+		width: 21%;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		margin-right: 4%;
+		width: 40%;
+	}
+	.single-item.groups #buddypress div#item-header div#item-actions {
+		float: left;
+		width: 28%;
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.1.2 - Item Header User Accounts
+*
+* User Accounts Specific Item Header
+*-----------------------------------------------------
+*/
+.bp-user #buddypress #item-header {
+	padding: 20px 0;
+}
+
+.bp-user #buddypress #item-header #item-header-avatar {
+	text-align: center;
+	width: 100%;
+}
+
+.bp-user #buddypress #item-header #item-header-avatar img.avatar,
+.bp-user #buddypress #item-header #item-header-avatar a {
+	border-bottom: 0;
+	display: inline-block;
+	float: none;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress #item-header #item-header-avatar {
+		float: right;
+		width: 20%;
+	}
+	.bp-user #buddypress #item-header #item-header-avatar img.avatar,
+	.bp-user #buddypress #item-header #item-header-avatar a {
+		float: right;
+		width: 100%;
+	}
+	.bp-user #buddypress #item-header #item-header-content {
+		float: left;
+		margin-left: 5%;
+		width: 69%;
+	}
+}
+
+/**
+*-----------------------------------------------------------
+* @subsection 6.2 - Item Body: Global
+*-----------------------------------------------------------
+*/
+#item-body h1,
+#item-body h2,
+#item-body h3,
+#item-body h4,
+#item-body h5,
+#item-body h6 {
+	margin: 1em 0;
+}
+
+#item-body h1 a,
+#item-body h2 a,
+#item-body h3 a,
+#item-body h4 a,
+#item-body h5 a,
+#item-body h6 a {
+	border-bottom: 0;
+}
+
+/**
+*----------------------------------------------------
+* @subsection 6.2.1 - Item Body Groups
+*
+* Groups specific item body rules -  screens
+*----------------------------------------------------
+*/
+/**
+*-----------------------------------------
+* @subsection 6.2.1.1 - Group Management
+*-----------------------------------------
+*/
+.groups #group-settings-form h4 {
+	background: #555;
+	color: #fff;
+	padding: 0.2em;
+}
+
+.groups #group-settings-form #request-list h4 {
+	background: none;
+	color: inherit;
+}
+
+.groups.edit-details #group-settings-form label {
+	background: #555;
+	-webkit-border-top-left-radius: 4px;
+	border-top-left-radius: 4px;
+	-webkit-border-top-right-radius: 4px;
+	border-top-right-radius: 4px;
+	background-clip: padding-box;
+	color: #fff;
+	display: inline-block;
+	margin-bottom: 0;
+	padding: 0.2em;
+	width: 80%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.groups.edit-details #group-settings-form label {
+		width: 60%;
+	}
+}
+
+.groups.edit-details #group-settings-form textarea + p label {
+	background: none;
+	color: inherit;
+	font-size: 14px;
+	font-size: 1.4rem;
+	width: auto;
+}
+
+.groups.group-settings #group-settings-form div.radio label,
+.groups.group-settings #create-group-form div.radio label {
+	border: 1px solid #eaeaea;
+	padding: 0.2em;
+}
+
+.groups.group-settings #group-settings-form div.radio ul,
+.groups.group-settings #create-group-form div.radio ul {
+	color: rgba(51, 51, 51, 0.6);
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+.groups.group-avatar form > p {
+	margin-top: 20px;
+}
+
+.groups.manage-members #group-settings-form .item-list li {
+	border-bottom: 1px solid #eaeaea;
+}
+
+.groups.manage-members #group-settings-form .item-list li img,
+.groups.manage-members #group-settings-form .item-list li h5 {
+	float: right;
+}
+
+.groups.manage-members #group-settings-form .item-list li img > a,
+.groups.manage-members #group-settings-form .item-list li h5 > a {
+	border-bottom: 0;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small {
+	clear: right;
+	display: block;
+	float: none;
+	margin-top: 10px;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small a {
+	display: inline-block;
+	margin: 5px 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.groups.manage-members #group-settings-form .item-list li span.small a {
+		width: auto;
+	}
+}
+
+.groups.manage-members #group-settings-form .item-list li h5 {
+	margin: 0;
+}
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.2 - Group members
+*-----------------------------------------
+*/
+/* Members loop */
+@media screen and (max-width: 30em) {
+	.groups.group-members #buddypress #members-group-list li > a {
+		border-bottom: 0;
+		display: block;
+		margin-bottom: 10px;
+		text-align: center;
+	}
+	.groups.group-members #buddypress #members-group-list li > a img.avatar {
+		display: inline;
+		float: none;
+	}
+}
+
+.groups.group-members #buddypress #members-group-list li h5 {
+	display: inline-block;
+	font-size: 14px;
+	font-size: 1.4rem;
+	margin: 0;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.groups.group-members #buddypress #members-group-list li h5 {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+.groups.group-members #buddypress #members-group-list li h5 a {
+	border-bottom: 0;
+}
+
+.groups.group-members #buddypress #members-group-list li span.activity {
+	font-size: 12px;
+	font-size: 1.2rem;
+}
+
+.groups.group-members #buddypress #members-group-list li .action {
+	top: 0;
+}
+
+.groups.group-members #subnav li {
+	width: 100%;
+}
+
+@media screen and (max-width: 38.75em) {
+	.groups.group-members #subnav li {
+		background: #fff;
+		padding: 20px 0;
+	}
+}
+
+.groups.group-members #subnav li #search-members-form {
+	float: left;
+	margin: 5px 0 0 5px;
+}
+
+@media screen and (max-width: 38.75em) {
+	.groups.group-members #subnav li #search-members-form {
+		margin: 0;
+		width: 100%;
+	}
+	.groups.group-members #subnav li #search-members-form label input[type="text"] {
+		width: 100%;
+	}
+}
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.3 - Group Send Invites
+*-----------------------------------------
+*/
+.groups.group-invites #item-body .item-list .action {
+	margin-bottom: 0;
+}
+
+@media screen and (min-width: 46.25em) {
+	.groups.group-invites #buddypress #item-body #message {
+		margin-top: 0;
+	}
+}
+
+@media screen and (min-width: 55em) {
+	.groups.group-invites #buddypress #send-invite-form {
+		margin-top: 0;
+	}
+}
+
+@media screen and (max-width: 46.25em) {
+	.groups.group-invites #item-body .left-menu {
+		float: none;
+		margin: 10px 0;
+	}
+	.groups.group-invites #item-body .left-menu #invite-list {
+		height: auto;
+		width: auto;
+	}
+	.groups.group-invites #item-body .main-column {
+		margin-right: 0;
+	}
+	.groups.group-invites #item-body .submit input {
+		display: inline-block;
+		width: 100%;
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.2.2 - Item Body User Accounts
+*
+* User Account specific item body rules
+*-----------------------------------------------------
+*/
+.bp-user .entry-title {
+	margin-bottom: 0.5em;
+}
+
+/**
+*--------------------------------------------
+* @subsection 6.2.2.1 - classes, pag, filters
+*--------------------------------------------
+*/
+.bp-user #buddypress table th {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+.bp-user #buddypress table td {
+	font-size: 12px;
+	font-size: 1.2rem;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress table th {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+	.bp-user #buddypress table td {
+		font-size: 14px;
+		font-size: 1.4rem;
+	}
+}
+
+@media screen and (min-width: 77.5em) {
+	.bp-user #buddypress table th {
+		font-size: 18px;
+		font-size: 1.8rem;
+	}
+	.bp-user #buddypress table td {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+.bp-user #buddypress .pag-count {
+	font-style: italic;
+}
+
+.bp-user #buddypress .notifications-options-nav,
+.bp-user #buddypress .messages-options-nav {
+	float: right;
+	width: 100%;
+}
+
+@media screen and (min-width: 30em) {
+	.bp-user #buddypress .notifications-options-nav,
+	.bp-user #buddypress .messages-options-nav {
+		width: 50%;
+	}
+}
+
+.bp-user #buddypress .notifications-options-nav select,
+.bp-user #buddypress .notifications-options-nav input,
+.bp-user #buddypress .messages-options-nav select,
+.bp-user #buddypress .messages-options-nav input {
+	font-size: 14px;
+	font-size: 1.4rem;
+	outline: 0;
+	padding: 0;
+}
+
+.bp-user #buddypress .notifications-options-nav select,
+.bp-user #buddypress .messages-options-nav select {
+	float: right;
+	margin-left: 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 30em) {
+	.bp-user #buddypress .notifications-options-nav select,
+	.bp-user #buddypress .messages-options-nav select {
+		width: 60%;
+	}
+}
+
+.bp-user #buddypress .notifications-options-nav input,
+.bp-user #buddypress .messages-options-nav input {
+	float: left;
+	font-family: "Noto Serif", serif;
+	line-height: 1.5;
+	margin-top: 10px;
+	width: 100%;
+}
+
+.bp-user #buddypress .notifications-options-nav input[disabled]:hover,
+.bp-user #buddypress .messages-options-nav input[disabled]:hover {
+	background: none;
+}
+
+@media screen and (min-width: 30em) {
+	.bp-user #buddypress .notifications-options-nav input,
+	.bp-user #buddypress .messages-options-nav input {
+		margin-top: 0;
+		width: 38%;
+	}
+}
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.2 - Extended Profiles
+	*-------------------------------------------
+	*/
+.bp-user #buddypress .profile .bp-widget h4 {
+	background: #6e6e6e;
+	color: #fff;
+	margin-bottom: 0;
+	padding: 0.4em;
+}
+
+.bp-user #buddypress .profile .bp-widget table {
+	margin-top: 0;
+}
+
+/* Edit Profile */
+.bp-user #buddypress .profile #profile-edit-form .button-nav:before,
+.bp-user #buddypress .profile #profile-edit-form .button-nav:after {
+	content: " ";
+	display: table;
+}
+
+.bp-user #buddypress .profile #profile-edit-form .button-nav:after {
+	clear: both;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav {
+	border-bottom: 1px solid #eaeaea;
+	margin-right: 0;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav li {
+	float: right;
+	margin-bottom: 0;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav li.current {
+	border: 1px solid #eaeaea;
+	border-bottom-color: #fff;
+	margin-bottom: -1px;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav a {
+	background: none;
+	border: 0;
+	font-size: 18px;
+	font-size: 1.8rem;
+}
+
+.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle,
+.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close,
+.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link {
+	background: #555;
+	color: #fff;
+	padding: 0.2em 0.5em;
+}
+
+.bp-user #buddypress .profile .bp-avatar #bp-delete-avatar a {
+	font-size: inherit;
+}
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.3 - Groups
+	*-------------------------------------------
+	*/
+@media screen and (min-width: 77.5em) {
+	.bp-user #buddypress #groups-list li .item {
+		right: 5%;
+		width: 50%;
+	}
+}
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.5 - Private Messaging
+	*-------------------------------------------
+	*/
+.bp-user #buddypress {
+	/* Auto Complete background */
+	/* Sitewide Notices loop */
+}
+
+.bp-user #buddypress #message-thread a {
+	border-bottom: 0;
+}
+
+.bp-user #buddypress #message-thread #message-subject {
+	background: #6e6e6e;
+	color: #fff;
+	padding: 0.3em 0.2em 0.3em 0;
+}
+
+.bp-user #buddypress #message-thread #message-recipients {
+	font-style: italic;
+}
+
+.bp-user #buddypress #message-thread #message-recipients a.confirm {
+	border: 1px solid #eaeaea;
+	font-style: normal;
+}
+
+.bp-user #buddypress #message-thread .message-metadata {
+	overflow: hidden;
+}
+
+.bp-user #buddypress #message-thread .message-metadata img.avatar {
+	float: none;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress #message-thread .message-metadata img.avatar {
+		float: right;
+	}
+}
+
+.bp-user #buddypress #message-thread .message-metadata .message-star-actions {
+	float: left;
+	margin-left: 5px;
+	position: static;
+}
+
+.bp-user #buddypress #message-thread .message-content {
+	background: #f7f7f7;
+	border: 1px solid #eaeaea;
+	margin: 10px 0 0 0;
+	padding: 0.3em;
+}
+
+.bp-user #buddypress #message-thread #send-reply .message-content {
+	background: #fff;
+	border: 0;
+}
+
+.bp-user #buddypress #message-thread .alt {
+	background: #fff;
+}
+
+.bp-user #buddypress #message-threads thead tr {
+	background: #6e6e6e;
+}
+
+.bp-user #buddypress #message-threads tr td {
+	background: #fff;
+	display: inline-block;
+	float: right;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-star,
+.bp-user #buddypress #message-threads tr td.thread-options {
+	border-bottom-color: #b7b7b7;
+	border-bottom-width: 2px;
+	height: 2.4em;
+	padding-bottom: 0.2em;
+	padding-top: 0.2em;
+}
+
+@media screen and (max-width: 46.25em) {
+	.bp-user #buddypress #message-threads tr td.thread-star,
+	.bp-user #buddypress #message-threads tr td.thread-options {
+		padding-top: 0;
+	}
+}
+
+.bp-user #buddypress #message-threads tr td.bulk-select-check,
+.bp-user #buddypress #message-threads tr td.thread-from {
+	height: 2.6em;
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user #buddypress #message-threads tr td.bulk-select-check,
+	.bp-user #buddypress #message-threads tr td.thread-from {
+		height: 5.2em;
+	}
+}
+
+.bp-user #buddypress #message-threads tr td.thread-from,
+.bp-user #buddypress #message-threads tr td.thread-options {
+	border-right: 0 !important;
+	width: -webkit-calc(100% - 30px);
+	width: -moz-calc(100% - 30px);
+	width: calc(100% - 30px);
+	margin-right: 0;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-info {
+	padding-right: 41px;
+	width: 100%;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-info a::after {
+	content: " –  " attr(title);
+	font-size: 12px;
+	font-size: 1.2rem;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-options {
+	text-align: left;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-options a {
+	font-size: 12px;
+	font-size: 1.2rem;
+	line-height: 2.2;
+}
+
+.bp-user #buddypress #message-threads tr span.from {
+	display: none;
+}
+
+.bp-user #buddypress #message-threads tr span.activity {
+	display: block;
+	float: left;
+	line-height: 2;
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user #buddypress #message-threads tr span.activity {
+		clear: both;
+		font-size: 11px;
+		font-size: 1.1rem;
+		width: 100%;
+	}
+}
+
+.bp-user #buddypress #message-threads tr.unread td {
+	background: #dce5ff;
+	border-bottom-color: #b7b7b7;
+	border-color: #d1d1d1;
+}
+
+.bp-user #buddypress #message-threads th {
+	display: none;
+}
+
+.bp-user #buddypress #message-threads th.bulk-select-all {
+	border-bottom: 0;
+	display: inline-block;
+	text-align: right;
+}
+
+.bp-user #buddypress #message-threads th.bulk-select-all,
+.bp-user #buddypress #message-threads td.bulk-select-check,
+.bp-user #buddypress #message-threads td.thread-star {
+	border-left: 0;
+	width: 30px;
+}
+
+.bp-user #buddypress .acfb-holder li.friend-tab {
+	margin-left: 0;
+}
+
+.bp-user #buddypress .acfb-holder li.friend-tab a {
+	border-bottom: 0;
+}
+
+.bp-user #buddypress .acfb-holder li.friend-tab a img {
+	display: inline;
+	height: 20px;
+	margin-left: 0.5em;
+	width: 20px !important;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td {
+	width: 100%;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td strong {
+	background: #6e6e6e;
+	color: #fff;
+	display: block;
+	margin-bottom: 0.4em;
+	padding-right: 0.2em;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td a {
+	display: inline-block;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:first-child {
+	display: none;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:first-child + td + td {
+	border-bottom: 0;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:first-child + td + td span {
+	line-height: 1;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:last-child {
+	border-bottom-color: #b7b7b7;
+	line-height: 1;
+	text-align: left;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child {
+	line-height: 0;
+	margin-right: 0.7em;
+	text-indent: -999em;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child::after {
+	content: attr(title);
+	display: block;
+	line-height: initial;
+	text-indent: 0;
+}
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.6 - Settings
+	*------------------------------
+	*/
+.bp-user #buddypress #settings-form > p {
+	font-size: 20px;
+	font-size: 2rem;
+	margin: 20px 0 10px;
+}
+
+.bp-user #buddypress table.notification-settings th.title {
+	width: 75%;
+}
+
+.bp-user #buddypress table.notification-settings td.yes,
+.bp-user #buddypress table.notification-settings td.no {
+	vertical-align: middle;
+}
+
+.bp-user #buddypress table.profile-settings {
+	width: 100%;
+}
+
+.bp-user #buddypress table.profile-settings th.field-group-name,
+.bp-user #buddypress table.profile-settings td.field-name {
+	width: 50%;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress table.profile-settings th.field-group-name,
+	.bp-user #buddypress table.profile-settings td.field-name {
+		width: 70%;
+	}
+}
+
+.bp-user #buddypress table.profile-settings th.title,
+.bp-user #buddypress table.profile-settings td.field-visibility {
+	width: 30%;
+}
+
+.bp-user #buddypress table.profile-settings td.field-visibility select {
+	width: 100%;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 7.0 - Forms  - General
+*-------------------------------------------------------------------------------
+*/
+#buddypress div.activity-comments form .ac-textarea {
+	background: #f7f7f7;
+	border: 1px solid rgba(153, 153, 153, 0.3);
+}
+
+#buddypress div.activity-comments form .ac-textarea textarea {
+	background: none;
+	border: 0;
+}
+
+#buddypress select {
+	border: 1px solid rgba(153, 153, 153, 0.5);
+}
+
+#buddypress .standard-form li,
+#buddypress .group-create-form li {
+	float: none;
+}
+
+#buddypress .standard-form input[type='text'],
+#buddypress .standard-form textarea,
+#buddypress .group-create-form input[type='text'],
+#buddypress .group-create-form textarea {
+	width: 100%;
+}
+
+#buddypress div.dir-search,
+#buddypress div.message-search,
+#buddypress
+li.groups-members-search {
+	float: none;
+	margin: 10px 0;
+}
+
+#buddypress div.dir-search form,
+#buddypress div.message-search form,
+#buddypress
+li.groups-members-search form {
+	border: 1px solid rgba(153, 153, 153, 0.4);
+	overflow: hidden;
+}
+
+#buddypress div.dir-search form label,
+#buddypress div.message-search form label,
+#buddypress
+li.groups-members-search form label {
+	float: right;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress
+li.groups-members-search form input[type='text'] {
+	float: right;
+	margin: 0;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='text'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress
+li.groups-members-search form input[type='text'],
+#buddypress
+li.groups-members-search form input[type='submit'] {
+	font-size: 14px;
+	font-size: 1.4rem;
+	border: 0;
+	line-height: inherit;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress
+li.groups-members-search form input[type='text'] {
+	border-left: 1px solid rgba(153, 153, 153, 0.4);
+	padding: 0.2em 0.2em 0.2em 0;
+}
+
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress
+li.groups-members-search form input[type='submit'] {
+	float: left;
+	font-weight: normal;
+	padding: 0.2em 1em;
+	text-align: center;
+	text-transform: none;
+	width: 20%;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress div.dir-search,
+	#buddypress div.message-search,
+	#buddypress li.groups-members-search {
+		float: left;
+		margin-bottom: 5px !important;
+	}
+	#buddypress div.dir-search form label,
+	#buddypress div.dir-search form input[type='text'],
+	#buddypress div.dir-search form input[type='submit'],
+	#buddypress div.message-search form label,
+	#buddypress div.message-search form input[type='text'],
+	#buddypress div.message-search form input[type='submit'],
+	#buddypress li.groups-members-search form label,
+	#buddypress li.groups-members-search form input[type='text'],
+	#buddypress li.groups-members-search form input[type='submit'] {
+		width: auto;
+	}
+}
+
+@media screen and (min-width: 77.5em) {
+	#buddypress .dir-search form input[type='text'],
+	#buddypress .message-search form input[type='text'] {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+	#buddypress .dir-search form input[type='submit'],
+	#buddypress .message-search form input[type='submit'] {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 8.0 - Tables - General
+*-------------------------------------------------------------------------------
+*/
+#buddypress table {
+	font-size: 14px;
+	font-size: 1.4rem;
+	margin: 20px 0;
+}
+
+#buddypress table tr th {
+	background: #6e6e6e;
+	border-color: #b7b7b7;
+	color: #fff;
+}
+
+#buddypress table p {
+	margin-bottom: 0.5em;
+}
+
+@media screen and (min-width: 55em) {
+	#buddypress table {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+/*__ User Account tables __*/
+#buddypress .notifications th,
+#buddypress .messages-notices th {
+	width: 30%;
+}
+
+#buddypress .notifications th.bulk-select-all,
+#buddypress .messages-notices th.bulk-select-all {
+	text-align: center;
+	width: 10%;
+}
+
+#buddypress .notifications .bulk-select-check,
+#buddypress .notifications .thread-star,
+#buddypress .messages-notices .bulk-select-check,
+#buddypress .messages-notices .thread-star {
+	text-align: center;
+}
+
+#buddypress .notifications .notification-actions,
+#buddypress .notifications td.thread-options,
+#buddypress .messages-notices .notification-actions,
+#buddypress .messages-notices td.thread-options {
+	text-align: center;
+}
+
+#buddypress .notifications .notification-actions a,
+#buddypress .notifications td.thread-options a,
+#buddypress .messages-notices .notification-actions a,
+#buddypress .messages-notices td.thread-options a {
+	display: inline-block;
+	margin: 0;
+	padding: 0;
+}
+
+#buddypress .notifications td .button,
+#buddypress .messages-notices td .button {
+	border: 0;
+	display: block;
+	padding: 0;
+	text-align: center;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 9.0 - Error / Success messages
+*-------------------------------------------------------------------------------
+*/
+#buddypress #item-body div#message {
+	margin-top: 20px;
+}
+
+@media screen and (min-width: 55em) {
+	#buddypress #item-body div#message {
+		margin-left: 20px;
+	}
+}
+
+#buddypress div#message p {
+	font-size: 18px;
+	font-size: 1.8rem;
+	font-weight: bold;
+}
+
+#buddypress div#message.info p {
+	background: #c6e4ee;
+	border: 1px solid #78bed6;
+	color: #1e5264;
+}
+
+#buddypress div#message.updated p {
+	background: #dee6b2;
+	border: 1px solid #becc66;
+	color: #454d19;
+}
+
+.delete-group #buddypress div#message.info p {
+	background: #db7e7e;
+	border: 1px solid #be3535;
+	color: #1f0808;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 10.0 - Ajax Loading, Widgets, General classes
+*-------------------------------------------------------------------------------
+*/
+#buddypress {
+	/* Auto Complete background */
+}
+
+#buddypress .acfb-holder li.friend-tab {
+	background: #9fd1e2;
+	border: inherit;
+}
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css
new file mode 100644
index 0000000000000000000000000000000000000000..ae0954f17696a297ea8fa57979740b448bbe5fe3
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen-rtl.min.css
@@ -0,0 +1 @@
+@charset "UTF-8";#buddypress div.pagination .pagination-links .next:before,#buddypress div.pagination .pagination-links .prev:before,.buddypress div.clear{display:none}#buddypress #activity-stream .load-more:focus a,#buddypress #activity-stream .load-more:hover a,#buddypress div#subnav.item-list-tabs ul li.last select,#buddypress ul.item-list li .item span.activity,#buddypress ul.item-list li div.action .meta,.bp-user #buddypress #message-thread #message-recipients,.bp-user #buddypress .pag-count{font-style:italic}#buddypress h1,#buddypress h2,#buddypress h3,#buddypress h4,#buddypress h5,#buddypress h6{clear:none}.buddypress main{padding-top:4%}@media screen and (min-width:59.6875em){.buddypress main{padding-top:0}}.buddypress main article{margin:0 4%;padding-top:8.3333%}@media screen and (min-width:59.6875em){.buddypress main article{margin:0 1px 0 0}}@media screen and (min-width:87.6875em){.buddypress main article{margin:0 8.3333% 0 4.3333%}}.buddypress main article .entry-content,.buddypress main article .entry-header{padding:0 3rem 3rem}.buddypress main article #buddypress{margin-bottom:40px}.buddypress .site-footer{margin:0 4%}@media screen and (min-width:59.6875em){.buddypress .site-footer{margin:0 35.2941% 0 0;width:61.8235%}}.buddypress #buddypress #latest-update a,.buddypress #buddypress .activity-comments a,.buddypress #buddypress .activity-header a,.buddypress #buddypress .activity-inner a,.buddypress #buddypress .avatar-nav-items a,.buddypress #buddypress .field-visibility-settings-toggle a,.buddypress #buddypress .item-list-tabs a,.buddypress #buddypress .item-title a,.buddypress #buddypress .load-more a,.buddypress #buddypress .pagination-links a,.buddypress #buddypress .pagination-links span,.buddypress #buddypress table a{border-bottom:0}#buddypress div.item-list-tabs ul{background-color:#f7f7f7;border-bottom:1px solid rgba(234,234,234,.9);border-top:1px solid rgba(234,234,234,.9);overflow:hidden;padding:5px 0}#buddypress div.item-list-tabs ul li a span{border-radius:25%}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}#buddypress #object-nav ul li:not(.selected) a{opacity:.7}#buddypress div#subnav.item-list-tabs{margin-top:0}#buddypress div#subnav.item-list-tabs ul{background-color:#f7f7f7;border-bottom:0;padding:0}#buddypress div#subnav.item-list-tabs ul li.last{background:#fff;margin-top:0;padding:5px 0 5px 5px;width:100%}#buddypress div#subnav.item-list-tabs ul li.last select,#buddypress div#subnav.item-list-tabs ul li.last select:focus{background:0 0;border:0;outline:0}#buddypress div#subnav.item-list-tabs ul li.last label,#buddypress div#subnav.item-list-tabs ul li.last option,#buddypress div#subnav.item-list-tabs ul li.last select{font-size:14px;font-size:1.4rem}@media screen and (min-width:38.75em){#buddypress #object-nav ul li{float:right}#buddypress div#subnav.item-list-tabs ul li.last{text-align:left}}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background:#555;color:#fff;opacity:1}@media screen and (min-width:55em){.bp-user #buddypress,.single-item.groups #buddypress{background:#f7f7f7}#buddypress #item-body,#buddypress #item-header{background:#fff}#buddypress #object-nav{border-left:1px solid #ddd;float:right;margin-left:-1px;width:200px}#buddypress #object-nav ul{border-bottom:0;padding:0}#buddypress #object-nav ul li{float:none;overflow:hidden}#buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:left;margin-left:2px}#buddypress #item-body{border-right:1px solid #ddd;overflow:hidden;padding:0 20px 0 0;width:auto}#buddypress #item-body #subnav{margin:0 -20px 0 0}}#buddypress div.pagination{box-shadow:none}#buddypress div.pagination .pag-count{margin-right:0}#buddypress div.pagination .pagination-links{margin-left:0}#buddypress div.pagination .pagination-links a,#buddypress div.pagination .pagination-links span{height:auto;line-height:1;padding:5px}#buddypress div.pagination .pagination-links .next,#buddypress div.pagination .pagination-links .prev{background-color:transparent;color:inherit;overflow:visible;width:auto}#buddypress div.pagination .pagination-links .prev{right:auto;position:static}#buddypress div.pagination .pagination-links .next{position:static;left:auto}#buddypress .item-list .activity-header,#buddypress .item-list .activity-meta{font-family:"Noto Sans",sans-serif}#buddypress ul.item-list li{overflow:hidden!important}#buddypress ul.item-list li .item-avatar{margin-bottom:10px;text-align:center}#buddypress ul.item-list li .item-avatar a{border-bottom:0}#buddypress ul.item-list li .item-avatar img.avatar{display:inline-block;float:none}@media screen and (min-width:38.75em){#buddypress ul.item-list li .item-avatar{margin-bottom:0}#buddypress ul.item-list li .item-avatar img.avatar{display:block;float:right}}#buddypress ul.item-list li .item{margin-right:25%}#buddypress ul.item-list li .item .item-desc{margin-right:0;width:70%}@media screen and (min-width:59.6875em){#buddypress ul.item-list li .action,#buddypress ul.item-list li .item,#buddypress ul.item-list li .item-avatar{float:right}#buddypress ul.item-list li .item{right:10%;margin-right:0;position:relative;width:55%}}#buddypress ul.item-list li div.action{clear:right;float:none;margin-bottom:-20px;margin-right:0;padding:20px 0 5px;position:relative;text-align:right;top:0}@media screen and (min-width:59.6875em){#buddypress ul.item-list li div.action{clear:none;float:left;margin-bottom:0;padding:0}}#buddypress ul.item-list li div.action div{display:inline-block;margin:10px 0;width:100%}#buddypress ul.item-list li div.action div a{display:block;width:100%}@media screen and (min-width:38.75em){#buddypress ul.item-list li div.action div{margin:0 0 10px 10px;width:auto}}@media screen and (min-width:59.6875em){#buddypress ul.item-list li div.action div{clear:left;float:left;margin:0 0 10px}}#buddypress form#whats-new-form p.activity-greeting{line-height:1.4}#buddypress form#whats-new-form textarea{width:100%}@media screen and (max-width:30em){#buddypress form#whats-new-form #whats-new-post-in-box select{font-size:14px;font-size:1.4rem;max-width:120px}}@media screen and (max-width:38.75em){#buddypress form#whats-new-form #whats-new-content{clear:right;margin:10px 0 40px;padding:10px 0 0}#buddypress form#whats-new-form #whats-new-content #whats-new-submit{float:none}#buddypress form#whats-new-form #whats-new-content #whats-new-submit input{width:100%}#buddypress form#whats-new-form #whats-new-options{display:flex;flex-direction:column}#buddypress form#whats-new-form #whats-new-options #whats-new-submit{order:2}#buddypress form#whats-new-form #whats-new-options #whats-new-post-in-box{order:1}}#buddypress form#whats-new-form #whats-new-options[style]{min-height:6rem;overflow:visible}#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(153,153,153,.5);float:right;line-height:1.5em;margin-top:12px;padding-right:.2em;width:100%}#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:left;margin:0;min-height:1.5em;outline:0;padding-right:.4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-options[style] #whats-new-submit{float:left}}#buddypress #item-body form#whats-new-form{margin:40px 0}#buddypress #activity-stream li{padding:25px 0 15px}#buddypress #activity-stream li .activity-avatar{float:none;text-align:center}#buddypress #activity-stream li .activity-avatar a{display:inline-block}#buddypress #activity-stream li .activity-avatar a img.avatar{display:inline;float:none;height:60px;margin-bottom:20px;margin-right:0;width:60px}#buddypress #activity-stream li .activity-content{margin-right:0}#buddypress #activity-stream li .activity-content .activity-header{font-size:14px;font-size:1.4rem}@media screen and (min-width:46.25em){#buddypress #activity-stream li .activity-avatar{float:right;margin-left:10px;text-align:right}#buddypress #activity-stream li .activity-avatar a{border-bottom:0}#buddypress #activity-stream li .activity-content{margin:0;overflow:hidden}#buddypress #activity-stream li .activity-content .activity-header{font-size:16px;font-size:1.6rem}}#buddypress #activity-stream li.mini .activity-avatar a img.avatar{height:30px;margin-right:15px;width:30px}#buddypress #activity-stream li.mini .activity-content .activity-header{font-size:13px;font-size:1.3rem}#buddypress #activity-stream .activity-content{margin-top:-12px}#buddypress #activity-stream .activity-content .activity-header{line-height:inherit;margin-left:0}#buddypress #activity-stream .activity-content .activity-header p{background-color:#f7f7f7;border:1px solid rgba(234,234,234,.6);padding:0 .2em}#buddypress #activity-stream .activity-content .activity-header img.avatar{display:inline-block;margin-bottom:0!important}#buddypress #activity-stream .activity-content .activity-meta a{display:block;margin:0 0 5px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-content .activity-meta a{display:inline-block;margin:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}#buddypress #activity-stream .load-more:focus,#buddypress #activity-stream .load-more:hover{background:#f4f4f4;border:1px solid rgba(159,209,226,.3)}#buddypress #activity-stream .load-more a{display:block}.activity-permalink #buddypress{background:0 0}.activity-permalink #buddypress #activity-stream li.activity-item{padding:20px 0}.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:16px;font-size:1.6rem;margin-bottom:40px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:2rem}}.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:20px}#buddypress #activity-stream .activity-comments{margin:10px 0 0}#buddypress #activity-stream .activity-comments.has-comments{border-right:1px solid #eaeaea}#buddypress #activity-stream .activity-comments .ac-form{padding:20px 0 0}#buddypress #activity-stream .activity-comments>ul{background:rgba(247,247,247,.6);margin:15px 2px 0 0}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-comments>ul{margin-right:70px}}#buddypress #activity-stream .activity-comments>ul ul{margin-right:1%;padding-right:0}@media screen and (min-width:30em){#buddypress #activity-stream .activity-comments>ul ul{margin-right:1%;padding-right:1em}}#buddypress #activity-stream .activity-comments>ul ul li{border-right:1px solid #eaeaea;border-top:0;padding-right:.2em}#buddypress #activity-stream .activity-comments>ul .acomment-meta{border-bottom:1px solid #eaeaea;font-style:italic}@media screen and (max-width:38.75em){#buddypress #activity-stream .activity-comments>ul .acomment-avatar{display:block;text-align:center}#buddypress #activity-stream .activity-comments>ul .acomment-avatar a,#buddypress #activity-stream .activity-comments>ul .acomment-avatar img.avatar{display:inline;float:none}#buddypress #activity-stream .activity-comments>ul .acomment-content,#buddypress #activity-stream .activity-comments>ul .acomment-meta,#buddypress #activity-stream .activity-comments>ul .acomment-options{margin:5px}#buddypress #activity-stream .activity-comments>ul .acomment-content{padding:0 10px}}#buddypress #activity-stream .activity-comments .ac-reply-avatar{display:none}#buddypress #activity-stream .activity-comments .ac-reply-content{margin-right:0;padding-right:0}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-comments .ac-reply-avatar{display:block}#buddypress #activity-stream .activity-comments .ac-reply-content{overflow:hidden}}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(51,51,51,.8);display:inline-block;font-family:inherit;font-size:12px;font-size:1.2rem;font-weight:400;line-height:1.2;padding:4px 10px;text-transform:lowercase;width:100px}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(153,153,153,.7);text-align:center}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:focus,#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:hover{background:#ededed}@media screen and (min-width:59.6875em){#buddypress #members-list li .item,#buddypress #members-list li .item-avatar{float:right}#buddypress #members-list li .action{float:left}}@media screen and (max-width:46.25em){.bp-user main header.entry-header,.single-item.groups main header.entry-header{padding-bottom:1rem}.bp-user #buddypress #item-header .generic-button,.single-item.groups #buddypress #item-header .generic-button{float:none;margin:1.5em 0 0}}@media screen and (max-width:38.75em){.bp-user #item-header-content,.bp-user h1,.single-item.groups #item-header-content,.single-item.groups h1{text-align:center}.bp-user #buddypress h1,.single-item.groups #buddypress h1{margin-bottom:0}.bp-user #buddypress #item-header-avatar img.avatar,.single-item.groups #buddypress #item-header-avatar img.avatar{margin-left:0}.bp-user #buddypress #item-header-content,.single-item.groups #buddypress #item-header-content{width:100%}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}@media screen and (max-width:38.75em){.single-item.groups #buddypress div#item-header{display:flex;flex-direction:column}.single-item.groups #buddypress div#item-header #item-header-avatar{order:1;text-align:center}.single-item.groups #buddypress div#item-header #item-header-avatar a{border-bottom:0}.single-item.groups #buddypress div#item-header #item-header-avatar a img{display:inline-block;float:none}.single-item.groups #buddypress div#item-header #item-header-content{order:2}.single-item.groups #buddypress div#item-header #item-actions{order:3}}.single-item.groups #buddypress div#item-header{padding-bottom:40px}.single-item.groups #buddypress div#item-header div#item-actions{margin:0;width:100%}@media screen and (min-width:38.75em){.single-item.groups #buddypress div#item-header div#item-actions{clear:none;float:left;width:50%}}.single-item.groups #buddypress div#item-header div#item-actions h3{background:#555;color:#fff;font-size:14px;font-size:1.4rem;padding:.2em}@media screen and (min-width:46.25em){.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:16px;font-size:1.6rem}.single-item.groups #buddypress div#item-header #item-header-avatar,.single-item.groups #buddypress div#item-header #item-header-content{float:right}.single-item.groups #buddypress div#item-header #item-header-avatar{width:21%}.single-item.groups #buddypress div#item-header #item-header-content{margin-right:4%;width:40%}.single-item.groups #buddypress div#item-header div#item-actions{float:left;width:28%}}.bp-user #buddypress #item-header{padding:20px 0}.bp-user #buddypress #item-header #item-header-avatar{text-align:center;width:100%}.bp-user #buddypress #item-header #item-header-avatar a,.bp-user #buddypress #item-header #item-header-avatar img.avatar{border-bottom:0;display:inline-block;float:none}@media screen and (min-width:46.25em){.bp-user #buddypress #item-header #item-header-avatar{float:right;width:20%}.bp-user #buddypress #item-header #item-header-avatar a,.bp-user #buddypress #item-header #item-header-avatar img.avatar{float:right;width:100%}.bp-user #buddypress #item-header #item-header-content{float:left;margin-left:5%;width:69%}}#item-body h1,#item-body h2,#item-body h3,#item-body h4,#item-body h5,#item-body h6{margin:1em 0}#item-body h1 a,#item-body h2 a,#item-body h3 a,#item-body h4 a,#item-body h5 a,#item-body h6 a{border-bottom:0}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups #group-settings-form #request-list h4{background:0 0;color:inherit}.groups.edit-details #group-settings-form label{background:#555;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;background-clip:padding-box;color:#fff;display:inline-block;margin-bottom:0;padding:.2em;width:80%}@media screen and (min-width:38.75em){.groups.edit-details #group-settings-form label{width:60%}}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:1.4rem;width:auto}.groups.group-settings #create-group-form div.radio label,.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #create-group-form div.radio ul,.groups.group-settings #group-settings-form div.radio ul{color:rgba(51,51,51,.6);font-size:14px;font-size:1.4rem}.groups.group-avatar form>p{margin-top:20px}.groups.manage-members #group-settings-form .item-list li{border-bottom:1px solid #eaeaea}.groups.group-members #buddypress #members-group-list li h5 a,.groups.manage-members #group-settings-form .item-list li h5>a,.groups.manage-members #group-settings-form .item-list li img>a{border-bottom:0}.groups.manage-members #group-settings-form .item-list li h5,.groups.manage-members #group-settings-form .item-list li img{float:right}.groups.manage-members #group-settings-form .item-list li span.small{clear:right;display:block;float:none;margin-top:10px}.groups.manage-members #group-settings-form .item-list li span.small a{display:inline-block;margin:5px 0;width:100%}@media screen and (min-width:38.75em){.groups.manage-members #group-settings-form .item-list li span.small a{width:auto}}.groups.manage-members #group-settings-form .item-list li h5{margin:0}@media screen and (max-width:30em){.groups.group-members #buddypress #members-group-list li>a{border-bottom:0;display:block;margin-bottom:10px;text-align:center}.groups.group-members #buddypress #members-group-list li>a img.avatar{display:inline;float:none}}.groups.group-members #buddypress #members-group-list li h5{display:inline-block;font-size:14px;font-size:1.4rem;margin:0}@media screen and (min-width:59.6875em){.groups.group-members #buddypress #members-group-list li h5{font-size:16px;font-size:1.6rem}}.groups.group-members #buddypress #members-group-list li span.activity{font-size:12px;font-size:1.2rem}.groups.group-members #buddypress #members-group-list li .action{top:0}.groups.group-members #subnav li{width:100%}.groups.group-members #subnav li #search-members-form{float:left;margin:5px 0 0 5px}@media screen and (max-width:38.75em){.groups.group-members #subnav li{background:#fff;padding:20px 0}.groups.group-members #subnav li #search-members-form{margin:0;width:100%}.groups.group-members #subnav li #search-members-form label input[type=text]{width:100%}}.groups.group-invites #item-body .item-list .action{margin-bottom:0}@media screen and (min-width:46.25em){.groups.group-invites #buddypress #item-body #message{margin-top:0}}@media screen and (min-width:55em){.groups.group-invites #buddypress #send-invite-form{margin-top:0}}@media screen and (max-width:46.25em){.groups.group-invites #item-body .left-menu{float:none;margin:10px 0}.groups.group-invites #item-body .left-menu #invite-list{height:auto;width:auto}.groups.group-invites #item-body .main-column{margin-right:0}.groups.group-invites #item-body .submit input{display:inline-block;width:100%}}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:14px;font-size:1.4rem}.bp-user #buddypress table td{font-size:12px;font-size:1.2rem}@media screen and (min-width:46.25em){.bp-user #buddypress table th{font-size:16px;font-size:1.6rem}.bp-user #buddypress table td{font-size:14px;font-size:1.4rem}}@media screen and (min-width:77.5em){.bp-user #buddypress table th{font-size:18px;font-size:1.8rem}.bp-user #buddypress table td{font-size:16px;font-size:1.6rem}}.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{float:right;width:100%}@media screen and (min-width:30em){.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{width:50%}}.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav input,.bp-user #buddypress .notifications-options-nav select{font-size:14px;font-size:1.4rem;outline:0;padding:0}.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{float:right;margin-left:0;width:100%}@media screen and (min-width:30em){.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{width:60%}}.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{float:left;font-family:"Noto Serif",serif;line-height:1.5;margin-top:10px;width:100%}.bp-user #buddypress .messages-options-nav input[disabled]:hover,.bp-user #buddypress .notifications-options-nav input[disabled]:hover{background:0 0}@media screen and (min-width:30em){.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{margin-top:0;width:38%}}.bp-user #buddypress .profile .bp-widget h4{background:#6e6e6e;color:#fff;margin-bottom:0;padding:.4em}.bp-user #buddypress .profile .bp-widget table{margin-top:0}.bp-user #buddypress .profile #profile-edit-form .button-nav:after,.bp-user #buddypress .profile #profile-edit-form .button-nav:before{content:" ";display:table}.bp-user #buddypress .profile #profile-edit-form .button-nav:after{clear:both}.bp-user #buddypress .profile #profile-edit-form ul.button-nav{border-bottom:1px solid #eaeaea;margin-right:0}.bp-user #buddypress .profile #profile-edit-form ul.button-nav li{float:right;margin-bottom:0}.bp-user #buddypress .profile #profile-edit-form ul.button-nav li.current{border:1px solid #eaeaea;border-bottom-color:#fff;margin-bottom:-1px}.bp-user #buddypress .profile #profile-edit-form ul.button-nav a{background:0 0;border:0;font-size:18px;font-size:1.8rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings,.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle{font-size:14px;font-size:1.4rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link{background:#555;color:#fff;padding:.2em .5em}.bp-user #buddypress .profile .bp-avatar #bp-delete-avatar a{font-size:inherit}@media screen and (min-width:77.5em){.bp-user #buddypress #groups-list li .item{right:5%;width:50%}}.bp-user #buddypress #message-thread a{border-bottom:0}.bp-user #buddypress #message-thread #message-subject{background:#6e6e6e;color:#fff;padding:.3em .2em .3em 0}.bp-user #buddypress #message-thread #message-recipients a.confirm{border:1px solid #eaeaea;font-style:normal}.bp-user #buddypress #message-thread .message-metadata{overflow:hidden}.bp-user #buddypress #message-thread .message-metadata img.avatar{float:none}@media screen and (min-width:46.25em){.bp-user #buddypress #message-thread .message-metadata img.avatar{float:right}}.bp-user #buddypress #message-thread .message-metadata .message-star-actions{float:left;margin-left:5px;position:static}.bp-user #buddypress #message-thread .message-content{background:#f7f7f7;border:1px solid #eaeaea;margin:10px 0 0;padding:.3em}.bp-user #buddypress #message-thread #send-reply .message-content{background:#fff;border:0}.bp-user #buddypress #message-thread .alt{background:#fff}.bp-user #buddypress #message-threads thead tr{background:#6e6e6e}.bp-user #buddypress #message-threads tr td{background:#fff;display:inline-block;float:right}.bp-user #buddypress #message-threads tr td.thread-options,.bp-user #buddypress #message-threads tr td.thread-star{border-bottom-color:#b7b7b7;border-bottom-width:2px;height:2.4em;padding-bottom:.2em;padding-top:.2em}.bp-user #buddypress #message-threads.sitewide-notices td:first-child+td+td,.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0}@media screen and (max-width:46.25em){.bp-user #buddypress #message-threads tr td.thread-options,.bp-user #buddypress #message-threads tr td.thread-star{padding-top:0}}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:2.6em}.bp-user #buddypress #message-threads tr td.thread-from,.bp-user #buddypress #message-threads tr td.thread-options{border-right:0!important;width:-webkit-calc(100% - 30px);width:-moz-calc(100% - 30px);width:calc(100% - 30px);margin-right:0}.bp-user #buddypress #message-threads tr td.thread-info{padding-right:41px;width:100%}.bp-user #buddypress #message-threads tr td.thread-info a::after{content:" –  " attr(title);font-size:12px;font-size:1.2rem}.bp-user #buddypress #message-threads tr td.thread-options{text-align:left}.bp-user #buddypress #message-threads tr td.thread-options a{font-size:12px;font-size:1.2rem;line-height:2.2}.bp-user #buddypress #message-threads tr span.from{display:none}.bp-user #buddypress #message-threads tr span.activity{display:block;float:left;line-height:2}@media screen and (max-width:38.75em){.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:5.2em}.bp-user #buddypress #message-threads tr span.activity{clear:both;font-size:11px;font-size:1.1rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{background:#dce5ff;border-color:#d1d1d1}.bp-user #buddypress #message-threads th{display:none}.bp-user #buddypress #message-threads th.bulk-select-all{border-bottom:0;display:inline-block;text-align:right}.bp-user #buddypress #message-threads td.bulk-select-check,.bp-user #buddypress #message-threads td.thread-star,.bp-user #buddypress #message-threads th.bulk-select-all{border-left:0;width:30px}.bp-user #buddypress .acfb-holder li.friend-tab{margin-left:0}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;margin-left:.5em;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td{width:100%}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6e6e6e;color:#fff;display:block;margin-bottom:.4em;padding-right:.2em}.bp-user #buddypress #message-threads.sitewide-notices td a{display:inline-block}.bp-user #buddypress #message-threads.sitewide-notices td:first-child{display:none}.bp-user #buddypress #message-threads.sitewide-notices td:first-child+td+td span{line-height:1}.bp-user #buddypress #message-threads.sitewide-notices td:last-child{border-bottom-color:#b7b7b7;line-height:1;text-align:left}.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child{line-height:0;margin-right:.7em;text-indent:-999em}.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child::after{content:attr(title);display:block;line-height:initial;text-indent:0}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:2rem;margin:20px 0 10px}.bp-user #buddypress table.notification-settings th.title{width:75%}.bp-user #buddypress table.notification-settings td.no,.bp-user #buddypress table.notification-settings td.yes{vertical-align:middle}.bp-user #buddypress table.profile-settings{width:100%}.bp-user #buddypress table.profile-settings td.field-name,.bp-user #buddypress table.profile-settings th.field-group-name{width:50%}@media screen and (min-width:46.25em){.bp-user #buddypress table.profile-settings td.field-name,.bp-user #buddypress table.profile-settings th.field-group-name{width:70%}}.bp-user #buddypress table.profile-settings td.field-visibility,.bp-user #buddypress table.profile-settings th.title{width:30%}#buddypress .group-create-form input[type=text],#buddypress .group-create-form textarea,#buddypress .standard-form input[type=text],#buddypress .standard-form textarea,.bp-user #buddypress table.profile-settings td.field-visibility select{width:100%}#buddypress div.activity-comments form .ac-textarea{background:#f7f7f7;border:1px solid rgba(153,153,153,.3)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress select{border:1px solid rgba(153,153,153,.5)}#buddypress .group-create-form li,#buddypress .standard-form li{float:none}#buddypress div.dir-search,#buddypress div.message-search,#buddypress li.groups-members-search{float:none;margin:10px 0}#buddypress div.dir-search form,#buddypress div.message-search form,#buddypress li.groups-members-search form{border:1px solid rgba(153,153,153,.4);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:right;width:80%}#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit]{font-size:14px;font-size:1.4rem;border:0;line-height:inherit}#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=text]{float:right;margin:0;width:80%;border-left:1px solid rgba(153,153,153,.4);padding:.2em .2em .2em 0}#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=submit]{float:left;font-weight:400;padding:.2em 1em;text-align:center;text-transform:none;width:20%}@media screen and (min-width:38.75em){#buddypress div.dir-search,#buddypress div.message-search,#buddypress li.groups-members-search{float:left;margin-bottom:5px!important}#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:77.5em){#buddypress .dir-search form input[type=text],#buddypress .dir-search form input[type=submit],#buddypress .message-search form input[type=text],#buddypress .message-search form input[type=submit]{font-size:16px;font-size:1.6rem}}#buddypress table{font-size:14px;font-size:1.4rem;margin:20px 0}#buddypress table tr th{background:#6e6e6e;border-color:#b7b7b7;color:#fff}#buddypress table p{margin-bottom:.5em}#buddypress .messages-notices th,#buddypress .notifications th{width:30%}#buddypress .messages-notices th.bulk-select-all,#buddypress .notifications th.bulk-select-all{text-align:center;width:10%}#buddypress .messages-notices .bulk-select-check,#buddypress .messages-notices .notification-actions,#buddypress .messages-notices .thread-star,#buddypress .messages-notices td.thread-options,#buddypress .notifications .bulk-select-check,#buddypress .notifications .notification-actions,#buddypress .notifications .thread-star,#buddypress .notifications td.thread-options{text-align:center}#buddypress .messages-notices .notification-actions a,#buddypress .messages-notices td.thread-options a,#buddypress .notifications .notification-actions a,#buddypress .notifications td.thread-options a{display:inline-block;margin:0;padding:0}#buddypress .messages-notices td .button,#buddypress .notifications td .button{border:0;display:block;padding:0;text-align:center}#buddypress #item-body div#message{margin-top:20px}@media screen and (min-width:55em){#buddypress table{font-size:16px;font-size:1.6rem}#buddypress #item-body div#message{margin-left:20px}}#buddypress div#message p{font-size:18px;font-size:1.8rem;font-weight:700}#buddypress div#message.info p{background:#c6e4ee;border:1px solid #78bed6;color:#1e5264}#buddypress div#message.updated p{background:#dee6b2;border:1px solid #becc66;color:#454d19}.delete-group #buddypress div#message.info p{background:#db7e7e;border:1px solid #be3535;color:#1f0808}#buddypress .acfb-holder li.friend-tab{background:#9fd1e2;border:inherit inherit inherit}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.css
new file mode 100644
index 0000000000000000000000000000000000000000..7c9eabfbe1e9e4ba454aa8a0349cc2bbf2953afe
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.css
@@ -0,0 +1,1946 @@
+@charset "UTF-8";
+/*------------------------------------------------------------------------------
+
+This is the BuddyPress companion stylesheet for
+the WordPress Twentyfifteen theme.
+
+This sheet supports the primary BuddyPress styles in buddypress.css
+
+If you are running as a child theme of twentyfifteen this stylesheet will be
+loaded by default. If you want to modify the styles the normal BP Theme Compat
+hierarchy works and you can copy the file to buddypress/css/ or community/css/
+in your child themes root & either start over or modify the rulesets.
+
+If you do not require the styles you can dequeue them from the themes functions file.
+
+Please see this codex article for more information:
+http://codex.buddypress.org/themes/buddypress-companion-stylesheets/
+
+--------------------------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+--------------------------------------------------------------------------------
+1.0 Theme Structural Elements & overrides
+2.0 - Navigation - General
+	2.1 - Navs - Object Nav / Sub Nav (item-list-tabs)
+	2.2 - Pagination
+3.0 - Images
+4.0 - BP Lists / Loops Generic
+	4.1 - Activity Loop
+		4.1.1 Whats New Activity
+		4.1.2 - Activity Listing
+		4.1.3 - Activity Comments
+	4.2 - Members Loop
+	4.3 - Groups Loop
+	4.4 - Blogs Loop
+5.0 - Directories - Members, Groups, Blogs, Forums
+6.0 - Single Item screens: User Account & Single Group Screens
+	6.1 - Item Headers: Global
+		6.1.1 - item-header: Groups
+		6.1.2 - item-header: User Accounts
+	6.2 - Item Body: Global
+		6.2.1 - item-body: Groups
+			6.2.1.1 - Management settings screens
+			6.2.1.2 - Group members list
+			6.2.1.3 - Group Send Invites
+		6.2.2 - item-body: User Accounts
+			6.2.2.1 - classes, pag, filters
+			6.2.2.2 - Extended Profiles
+			6.2.2.3 - Groups
+			6.2.2.4 - friends
+			6.2.2.5 - Private Messaging Threads
+			6.2.2.6 - Settings
+7.0 - Forms  -  General
+8.0 - Tables -  General
+9.0 - Error / Success Messages
+10.0 - Ajax Loading, Widgets, General classes
+------------------------------------------------------------------------------*/
+/**
+*-------------------------------------------------------------------------------
+* @section 1.0 - Theme - Structural Elements & overrides
+*-------------------------------------------------------------------------------
+*/
+#buddypress h1,
+#buddypress h2,
+#buddypress h3,
+#buddypress h4,
+#buddypress h5,
+#buddypress h6 {
+	clear: none;
+}
+
+.buddypress div.clear {
+	display: none;
+}
+
+.buddypress main {
+	padding-top: 4%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress main {
+		padding-top: 0;
+	}
+}
+
+.buddypress main article {
+	margin: 0 4%;
+	padding-top: 8.3333%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress main article {
+		margin: 0 0 0 1px;
+	}
+}
+
+@media screen and (min-width: 87.6875em) {
+	.buddypress main article {
+		margin: 0 4.3333% 0 8.3333%;
+	}
+}
+
+.buddypress main article .entry-header,
+.buddypress main article .entry-content {
+	padding: 0 3rem 3rem 3rem;
+}
+
+.buddypress main article #buddypress {
+	margin-bottom: 40px;
+}
+
+.buddypress .site-footer {
+	margin: 0 4%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress .site-footer {
+		margin: 0 0 0 35.2941%;
+		width: 61.8235%;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 2.0 - Navigation - General
+*-------------------------------------------------------------------------------
+*/
+.buddypress #buddypress .item-list-tabs a,
+.buddypress #buddypress .activity-header a,
+.buddypress #buddypress .activity-inner a,
+.buddypress #buddypress .activity-comments a,
+.buddypress #buddypress .item-title a,
+.buddypress #buddypress .load-more a,
+.buddypress #buddypress .field-visibility-settings-toggle a,
+.buddypress #buddypress #latest-update a,
+.buddypress #buddypress table a,
+.buddypress #buddypress .avatar-nav-items a {
+	border-bottom: 0;
+}
+
+.buddypress #buddypress .pagination-links a,
+.buddypress #buddypress .pagination-links span {
+	border-bottom: 0;
+}
+
+/**
+*----------------------------------------------------------
+* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs)
+*
+* The main navigational elements for all BP screens
+*----------------------------------------------------------
+*/
+#buddypress {
+	/*__ Horizontal menus __*/
+}
+
+#buddypress div.item-list-tabs ul li.selected a {
+	background: #555;
+	color: #fff;
+	opacity: 1;
+}
+
+#buddypress div.item-list-tabs ul {
+	background-color: #f7f7f7;
+	border-bottom: 1px solid rgba(234, 234, 234, 0.9);
+	border-top: 1px solid rgba(234, 234, 234, 0.9);
+	overflow: hidden;
+	padding: 5px 0;
+}
+
+#buddypress div.item-list-tabs ul li a span {
+	border-radius: 25%;
+}
+
+#buddypress #object-nav ul {
+	overflow: hidden;
+}
+
+#buddypress #object-nav ul li {
+	float: none;
+}
+
+#buddypress #object-nav ul li:not(.selected) a {
+	opacity: 0.7;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #object-nav ul li {
+		float: left;
+	}
+}
+
+#buddypress div#subnav.item-list-tabs {
+	margin-top: 0;
+}
+
+#buddypress div#subnav.item-list-tabs ul {
+	background-color: #f7f7f7;
+	border-bottom: 0;
+	padding: 0;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last {
+	background: #fff;
+	margin-top: 0;
+	padding: 5px 5px 5px 0;
+	width: 100%;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last select,
+#buddypress div#subnav.item-list-tabs ul li.last select:focus {
+	background: transparent;
+	border: 0;
+	outline: 0;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last select,
+#buddypress div#subnav.item-list-tabs ul li.last label,
+#buddypress div#subnav.item-list-tabs ul li.last option {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+#buddypress div#subnav.item-list-tabs ul li.last select {
+	font-style: italic;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress div#subnav.item-list-tabs ul li.last {
+		text-align: right;
+	}
+}
+
+#buddypress div.item-list-tabs ul li.selected a,
+#buddypress div.item-list-tabs ul li.current a {
+	background: #555;
+	color: #fff;
+	opacity: 1;
+}
+
+/*__ Vertical menu User Account / Group single screens __*/
+@media screen and (min-width: 55em) {
+	.bp-user #buddypress,
+	.single-item.groups #buddypress {
+		background: #f7f7f7;
+	}
+	#buddypress #item-header,
+	#buddypress #item-body {
+		background: #fff;
+	}
+	#buddypress #object-nav {
+		border-right: 1px solid #ddd;
+		float: left;
+		margin-right: -1px;
+		width: 200px;
+	}
+	#buddypress #object-nav ul {
+		border-bottom: 0;
+		padding: 0;
+	}
+	#buddypress #object-nav ul li {
+		float: none;
+		overflow: hidden;
+	}
+	#buddypress #object-nav ul li span {
+		background: #fff;
+		border-radius: 10%;
+		float: right;
+		margin-right: 2px;
+	}
+	#buddypress #item-body {
+		border-left: 1px solid #ddd;
+		overflow: hidden;
+		padding: 0 0 0 20px;
+		width: auto;
+	}
+	#buddypress #item-body #subnav {
+		margin: 0 0 0 -20px;
+	}
+}
+
+/**
+*----------------------------------------------------------
+* @section 2.2 - Pagination
+*----------------------------------------------------------
+*/
+#buddypress div.pagination {
+	box-shadow: none;
+}
+
+#buddypress div.pagination .pag-count {
+	margin-left: 0;
+}
+
+#buddypress div.pagination .pagination-links {
+	margin-right: 0;
+}
+
+#buddypress div.pagination .pagination-links span,
+#buddypress div.pagination .pagination-links a {
+	height: auto;
+	line-height: 1;
+	padding: 5px;
+}
+
+#buddypress div.pagination .pagination-links .prev,
+#buddypress div.pagination .pagination-links .next {
+	background-color: transparent;
+	color: inherit;
+	overflow: visible;
+	width: auto;
+}
+
+#buddypress div.pagination .pagination-links .prev:before,
+#buddypress div.pagination .pagination-links .next:before {
+	display: none;
+}
+
+#buddypress div.pagination .pagination-links .prev {
+	left: auto;
+	position: static;
+}
+
+#buddypress div.pagination .pagination-links .next {
+	position: static;
+	right: auto;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 4.0 - BP Lists / Loops Generic
+*-------------------------------------------------------------------------------
+*/
+#buddypress .item-list .activity-header,
+#buddypress .item-list .activity-meta {
+	font-family: "Noto Sans", sans-serif;
+}
+
+#buddypress ul.item-list li {
+	overflow: hidden !important;
+}
+
+#buddypress ul.item-list li .item-avatar {
+	margin-bottom: 10px;
+	text-align: center;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress ul.item-list li .item-avatar {
+		margin-bottom: 0;
+	}
+}
+
+#buddypress ul.item-list li .item-avatar a {
+	border-bottom: 0;
+}
+
+#buddypress ul.item-list li .item-avatar img.avatar {
+	display: inline-block;
+	float: none;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress ul.item-list li .item-avatar img.avatar {
+		display: block;
+		float: left;
+	}
+}
+
+#buddypress ul.item-list li .item {
+	margin-left: 25%;
+}
+
+#buddypress ul.item-list li .item span.activity {
+	font-style: italic;
+}
+
+#buddypress ul.item-list li .item .item-desc {
+	margin-left: 0;
+	width: 70%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	#buddypress ul.item-list li .item-avatar,
+	#buddypress ul.item-list li .item,
+	#buddypress ul.item-list li .action {
+		float: left;
+	}
+	#buddypress ul.item-list li .item {
+		left: 10%;
+		margin-left: 0;
+		position: relative;
+		width: 55%;
+	}
+}
+
+#buddypress ul.item-list li div.action {
+	clear: left;
+	float: none;
+	margin-bottom: -20px;
+	margin-left: 0;
+	padding: 20px 0 5px;
+	position: relative;
+	text-align: left;
+	top: 0;
+}
+
+@media screen and (min-width: 59.6875em) {
+	#buddypress ul.item-list li div.action {
+		clear: none;
+		float: right;
+		margin-bottom: 0;
+		padding: 0;
+	}
+}
+
+#buddypress ul.item-list li div.action div {
+	display: inline-block;
+	margin: 10px 0;
+	width: 100%;
+}
+
+#buddypress ul.item-list li div.action div a {
+	display: block;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress ul.item-list li div.action div {
+		margin: 0 10px 10px 0;
+		width: auto;
+	}
+}
+
+@media screen and (min-width: 59.6875em) {
+	#buddypress ul.item-list li div.action div {
+		clear: right;
+		float: right;
+		margin: 0 0 10px 0;
+	}
+}
+
+#buddypress ul.item-list li div.action .meta {
+	font-style: italic;
+}
+
+/**
+*----------------------------------------------------------
+* @section 4.1 - Activity
+*----------------------------------------------------------
+*/
+/**
+*-----------------------------------------------------
+* @section 4.1.1 - Activity Whats New
+*-----------------------------------------------------
+*/
+#buddypress form#whats-new-form p.activity-greeting {
+	line-height: 1.4;
+}
+
+#buddypress form#whats-new-form textarea {
+	width: 100%;
+}
+
+@media screen and (max-width: 30em) {
+	#buddypress form#whats-new-form #whats-new-post-in-box select {
+		font-size: 14px;
+		font-size: 1.4rem;
+		max-width: 120px;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	#buddypress form#whats-new-form #whats-new-content {
+		clear: left;
+		margin: 10px 0 40px;
+		padding: 10px 0 0;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-submit {
+		float: none;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-submit input {
+		width: 100%;
+	}
+	#buddypress form#whats-new-form #whats-new-options {
+		display: flex;
+		flex-direction: column;
+	}
+	#buddypress form#whats-new-form #whats-new-options #whats-new-submit {
+		order: 2;
+	}
+	#buddypress form#whats-new-form #whats-new-options #whats-new-post-in-box {
+		order: 1;
+	}
+}
+
+#buddypress form#whats-new-form #whats-new-options[style] {
+	min-height: 6rem;
+	overflow: visible;
+}
+
+#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box {
+	border: 1px solid rgba(153, 153, 153, 0.5);
+	float: left;
+	line-height: 1.5em;
+	margin-top: 12px;
+	padding-left: 0.2em;
+	width: 100%;
+}
+
+#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box select {
+	background: none;
+	border: 0;
+	float: right;
+	margin: 0;
+	min-height: 1.5em;
+	outline: 0;
+	padding-left: 0.4em;
+}
+
+@media screen and (min-width: 30em) {
+	#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box {
+		width: auto;
+	}
+	#buddypress form#whats-new-form #whats-new-options[style] #whats-new-submit {
+		float: right;
+	}
+}
+
+#buddypress #item-body form#whats-new-form {
+	margin: 40px 0;
+}
+
+/**
+*-----------------------------------------------------
+* @section 4.1.2 - Activity Listing
+*-----------------------------------------------------
+*/
+#buddypress #activity-stream li {
+	padding: 25px 0 15px;
+}
+
+#buddypress #activity-stream li .activity-avatar {
+	float: none;
+	text-align: center;
+}
+
+#buddypress #activity-stream li .activity-avatar a {
+	display: inline-block;
+}
+
+#buddypress #activity-stream li .activity-avatar a img.avatar {
+	display: inline;
+	float: none;
+	height: 60px;
+	margin-bottom: 20px;
+	margin-left: 0;
+	width: 60px;
+}
+
+#buddypress #activity-stream li .activity-content {
+	margin-left: 0;
+}
+
+#buddypress #activity-stream li .activity-content .activity-header {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+@media screen and (min-width: 46.25em) {
+	#buddypress #activity-stream li .activity-avatar {
+		float: left;
+		margin-right: 10px;
+		text-align: left;
+	}
+	#buddypress #activity-stream li .activity-avatar a {
+		border-bottom: 0;
+	}
+	#buddypress #activity-stream li .activity-content {
+		margin: 0;
+		overflow: hidden;
+	}
+	#buddypress #activity-stream li .activity-content .activity-header {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+#buddypress #activity-stream li.mini .activity-avatar a img.avatar {
+	height: 30px;
+	margin-left: 15px;
+	width: 30px;
+}
+
+#buddypress #activity-stream li.mini .activity-content .activity-header {
+	font-size: 13px;
+	font-size: 1.3rem;
+}
+
+#buddypress #activity-stream .activity-content {
+	margin-top: -12px;
+}
+
+#buddypress #activity-stream .activity-content .activity-header {
+	line-height: inherit;
+	margin-right: 0;
+}
+
+#buddypress #activity-stream .activity-content .activity-header p {
+	background-color: #f7f7f7;
+	border: 1px solid rgba(234, 234, 234, 0.6);
+	padding: 0 0.2em;
+}
+
+#buddypress #activity-stream .activity-content .activity-header img.avatar {
+	display: inline-block;
+	margin-bottom: 0 !important;
+}
+
+#buddypress #activity-stream .activity-content .activity-meta a {
+	display: block;
+	margin: 0 0 5px;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #activity-stream .activity-content .activity-meta a {
+		display: inline-block;
+		margin: 0;
+	}
+}
+
+#buddypress #activity-stream .load-more {
+	background: #f7f7f7;
+	border: 1px solid transparent;
+	padding: 10px;
+}
+
+#buddypress #activity-stream .load-more:focus,
+#buddypress #activity-stream .load-more:hover {
+	background: #f4f4f4;
+	border: 1px solid rgba(159, 209, 226, 0.3);
+}
+
+#buddypress #activity-stream .load-more:focus a,
+#buddypress #activity-stream .load-more:hover a {
+	font-style: italic;
+}
+
+#buddypress #activity-stream .load-more a {
+	display: block;
+}
+
+/* Single activity view  - activity permalink */
+.activity-permalink #buddypress {
+	background: none;
+}
+
+.activity-permalink #buddypress #activity-stream li.activity-item {
+	padding: 20px 0;
+}
+
+.activity-permalink #buddypress #activity-stream li.mini .activity-header {
+	font-size: 16px;
+	font-size: 1.6rem;
+	margin-bottom: 40px;
+}
+
+@media screen and (min-width: 46.25em) {
+	.activity-permalink #buddypress #activity-stream li.mini .activity-header {
+		font-size: 20px;
+		font-size: 2rem;
+	}
+}
+
+.activity-permalink #buddypress #activity-stream li.mini .activity-header p {
+	padding: 20px;
+}
+
+/**
+*-----------------------------------------------------
+* @section 4.1.3 - Activity Comments
+*-----------------------------------------------------
+*/
+#buddypress #activity-stream .activity-comments {
+	margin: 10px 0 0;
+}
+
+#buddypress #activity-stream .activity-comments.has-comments {
+	border-left: 1px solid #eaeaea;
+}
+
+#buddypress #activity-stream .activity-comments .ac-form {
+	padding: 20px 0 0;
+}
+
+#buddypress #activity-stream .activity-comments > ul {
+	background: rgba(247, 247, 247, 0.6);
+	margin: 15px 0 0 2px;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #activity-stream .activity-comments > ul {
+		margin-left: 70px;
+	}
+}
+
+#buddypress #activity-stream .activity-comments > ul ul {
+	margin-left: 1%;
+	padding-left: 0;
+}
+
+@media screen and (min-width: 30em) {
+	#buddypress #activity-stream .activity-comments > ul ul {
+		margin-left: 1%;
+		padding-left: 1em;
+	}
+}
+
+#buddypress #activity-stream .activity-comments > ul ul li {
+	border-left: 1px solid #eaeaea;
+	border-top: 0;
+	padding-left: 0.2em;
+}
+
+#buddypress #activity-stream .activity-comments > ul .acomment-meta {
+	border-bottom: 1px solid #eaeaea;
+	font-style: italic;
+}
+
+@media screen and (max-width: 38.75em) {
+	#buddypress #activity-stream .activity-comments > ul .acomment-avatar {
+		display: block;
+		text-align: center;
+	}
+	#buddypress #activity-stream .activity-comments > ul .acomment-avatar a,
+	#buddypress #activity-stream .activity-comments > ul .acomment-avatar img.avatar {
+		display: inline;
+		float: none;
+	}
+	#buddypress #activity-stream .activity-comments > ul .acomment-content,
+	#buddypress #activity-stream .activity-comments > ul .acomment-meta,
+	#buddypress #activity-stream .activity-comments > ul .acomment-options {
+		margin: 5px;
+	}
+	#buddypress #activity-stream .activity-comments > ul .acomment-content {
+		padding: 0 10px;
+	}
+}
+
+#buddypress #activity-stream .activity-comments .ac-reply-avatar {
+	display: none;
+}
+
+#buddypress #activity-stream .activity-comments .ac-reply-content {
+	margin-left: 0;
+	padding-left: 0;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress #activity-stream .activity-comments .ac-reply-avatar {
+		display: block;
+	}
+	#buddypress #activity-stream .activity-comments .ac-reply-content {
+		overflow: hidden;
+	}
+}
+
+#buddypress #activity-stream .activity-comments .ac-form input[type="submit"],
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel {
+	color: rgba(51, 51, 51, 0.8);
+	display: inline-block;
+	font-family: inherit;
+	font-size: 12px;
+	font-size: 1.2rem;
+	font-weight: normal;
+	line-height: 1.2;
+	padding: 4px 10px;
+	text-transform: lowercase;
+	width: 100px;
+}
+
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel {
+	border: 1px solid rgba(153, 153, 153, 0.7);
+	text-align: center;
+}
+
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:focus,
+#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:hover {
+	background: #ededed;
+}
+
+/**
+*----------------------------------------------------------
+* @section 4.2 - Members Loop
+*----------------------------------------------------------
+*/
+@media screen and (min-width: 59.6875em) {
+	#buddypress #members-list li .item-avatar,
+	#buddypress #members-list li .item {
+		float: left;
+	}
+	#buddypress #members-list li .action {
+		float: right;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 6.0 - Single Item screens: User Account & Single Group Screens
+*-------------------------------------------------------------------------------
+*/
+/**
+*-----------------------------------------------------------
+* @subsection 6.1 - Item Header Global
+*-----------------------------------------------------------
+*/
+@media screen and (max-width: 46.25em) {
+	.bp-user main header.entry-header,
+	.single-item.groups main header.entry-header {
+		padding-bottom: 1rem;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user h1,
+	.bp-user #item-header-content,
+	.single-item.groups h1,
+	.single-item.groups #item-header-content {
+		text-align: center;
+	}
+}
+
+@media screen and (max-width: 46.25em) {
+	.bp-user #buddypress #item-header .generic-button,
+	.single-item.groups #buddypress #item-header .generic-button {
+		float: none;
+		margin: 1.5em 0 0 0;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user #buddypress h1,
+	.single-item.groups #buddypress h1 {
+		margin-bottom: 0;
+	}
+	.bp-user #buddypress #item-header-avatar img.avatar,
+	.single-item.groups #buddypress #item-header-avatar img.avatar {
+		margin-right: 0;
+	}
+	.bp-user #buddypress #item-header-content,
+	.single-item.groups #buddypress #item-header-content {
+		width: 100%;
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.1.1 - item-header Groups
+*
+* Group Specific Item Header
+*-----------------------------------------------------
+*/
+@media screen and (max-width: 46.25em) {
+	.single-item.groups #buddypress #item-header #item-meta {
+		margin-bottom: 20px;
+	}
+}
+
+@media screen and (max-width: 38.75em) {
+	.single-item.groups #buddypress div#item-header {
+		display: flex;
+		flex-direction: column;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar {
+		order: 1;
+		text-align: center;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a {
+		border-bottom: 0;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a img {
+		display: inline-block;
+		float: none;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		order: 2;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions {
+		order: 3;
+	}
+}
+
+.single-item.groups #buddypress div#item-header {
+	padding-bottom: 40px;
+}
+
+.single-item.groups #buddypress div#item-header div#item-actions {
+	margin: 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.single-item.groups #buddypress div#item-header div#item-actions {
+		clear: none;
+		float: right;
+		width: 50%;
+	}
+}
+
+.single-item.groups #buddypress div#item-header div#item-actions h3 {
+	background: #555;
+	color: #fff;
+	font-size: 14px;
+	font-size: 1.4rem;
+	padding: 0.2em;
+}
+
+@media screen and (min-width: 46.25em) {
+	.single-item.groups #buddypress div#item-header div#item-actions h3 {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+@media screen and (min-width: 46.25em) {
+	.single-item.groups #buddypress div#item-header #item-header-avatar,
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		float: left;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar {
+		width: 21%;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		margin-left: 4%;
+		width: 40%;
+	}
+	.single-item.groups #buddypress div#item-header div#item-actions {
+		float: right;
+		width: 28%;
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.1.2 - Item Header User Accounts
+*
+* User Accounts Specific Item Header
+*-----------------------------------------------------
+*/
+.bp-user #buddypress #item-header {
+	padding: 20px 0;
+}
+
+.bp-user #buddypress #item-header #item-header-avatar {
+	text-align: center;
+	width: 100%;
+}
+
+.bp-user #buddypress #item-header #item-header-avatar img.avatar,
+.bp-user #buddypress #item-header #item-header-avatar a {
+	border-bottom: 0;
+	display: inline-block;
+	float: none;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress #item-header #item-header-avatar {
+		float: left;
+		width: 20%;
+	}
+	.bp-user #buddypress #item-header #item-header-avatar img.avatar,
+	.bp-user #buddypress #item-header #item-header-avatar a {
+		float: left;
+		width: 100%;
+	}
+	.bp-user #buddypress #item-header #item-header-content {
+		float: right;
+		margin-right: 5%;
+		width: 69%;
+	}
+}
+
+/**
+*-----------------------------------------------------------
+* @subsection 6.2 - Item Body: Global
+*-----------------------------------------------------------
+*/
+#item-body h1,
+#item-body h2,
+#item-body h3,
+#item-body h4,
+#item-body h5,
+#item-body h6 {
+	margin: 1em 0;
+}
+
+#item-body h1 a,
+#item-body h2 a,
+#item-body h3 a,
+#item-body h4 a,
+#item-body h5 a,
+#item-body h6 a {
+	border-bottom: 0;
+}
+
+/**
+*----------------------------------------------------
+* @subsection 6.2.1 - Item Body Groups
+*
+* Groups specific item body rules -  screens
+*----------------------------------------------------
+*/
+/**
+*-----------------------------------------
+* @subsection 6.2.1.1 - Group Management
+*-----------------------------------------
+*/
+.groups #group-settings-form h4 {
+	background: #555;
+	color: #fff;
+	padding: 0.2em;
+}
+
+.groups #group-settings-form #request-list h4 {
+	background: none;
+	color: inherit;
+}
+
+.groups.edit-details #group-settings-form label {
+	background: #555;
+	-webkit-border-top-right-radius: 4px;
+	border-top-right-radius: 4px;
+	-webkit-border-top-left-radius: 4px;
+	border-top-left-radius: 4px;
+	background-clip: padding-box;
+	color: #fff;
+	display: inline-block;
+	margin-bottom: 0;
+	padding: 0.2em;
+	width: 80%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.groups.edit-details #group-settings-form label {
+		width: 60%;
+	}
+}
+
+.groups.edit-details #group-settings-form textarea + p label {
+	background: none;
+	color: inherit;
+	font-size: 14px;
+	font-size: 1.4rem;
+	width: auto;
+}
+
+.groups.group-settings #group-settings-form div.radio label,
+.groups.group-settings #create-group-form div.radio label {
+	border: 1px solid #eaeaea;
+	padding: 0.2em;
+}
+
+.groups.group-settings #group-settings-form div.radio ul,
+.groups.group-settings #create-group-form div.radio ul {
+	color: rgba(51, 51, 51, 0.6);
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+.groups.group-avatar form > p {
+	margin-top: 20px;
+}
+
+.groups.manage-members #group-settings-form .item-list li {
+	border-bottom: 1px solid #eaeaea;
+}
+
+.groups.manage-members #group-settings-form .item-list li img,
+.groups.manage-members #group-settings-form .item-list li h5 {
+	float: left;
+}
+
+.groups.manage-members #group-settings-form .item-list li img > a,
+.groups.manage-members #group-settings-form .item-list li h5 > a {
+	border-bottom: 0;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small {
+	clear: left;
+	display: block;
+	float: none;
+	margin-top: 10px;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small a {
+	display: inline-block;
+	margin: 5px 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.groups.manage-members #group-settings-form .item-list li span.small a {
+		width: auto;
+	}
+}
+
+.groups.manage-members #group-settings-form .item-list li h5 {
+	margin: 0;
+}
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.2 - Group members
+*-----------------------------------------
+*/
+/* Members loop */
+@media screen and (max-width: 30em) {
+	.groups.group-members #buddypress #members-group-list li > a {
+		border-bottom: 0;
+		display: block;
+		margin-bottom: 10px;
+		text-align: center;
+	}
+	.groups.group-members #buddypress #members-group-list li > a img.avatar {
+		display: inline;
+		float: none;
+	}
+}
+
+.groups.group-members #buddypress #members-group-list li h5 {
+	display: inline-block;
+	font-size: 14px;
+	font-size: 1.4rem;
+	margin: 0;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.groups.group-members #buddypress #members-group-list li h5 {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+.groups.group-members #buddypress #members-group-list li h5 a {
+	border-bottom: 0;
+}
+
+.groups.group-members #buddypress #members-group-list li span.activity {
+	font-size: 12px;
+	font-size: 1.2rem;
+}
+
+.groups.group-members #buddypress #members-group-list li .action {
+	top: 0;
+}
+
+.groups.group-members #subnav li {
+	width: 100%;
+}
+
+@media screen and (max-width: 38.75em) {
+	.groups.group-members #subnav li {
+		background: #fff;
+		padding: 20px 0;
+	}
+}
+
+.groups.group-members #subnav li #search-members-form {
+	float: right;
+	margin: 5px 5px 0 0;
+}
+
+@media screen and (max-width: 38.75em) {
+	.groups.group-members #subnav li #search-members-form {
+		margin: 0;
+		width: 100%;
+	}
+	.groups.group-members #subnav li #search-members-form label input[type="text"] {
+		width: 100%;
+	}
+}
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.3 - Group Send Invites
+*-----------------------------------------
+*/
+.groups.group-invites #item-body .item-list .action {
+	margin-bottom: 0;
+}
+
+@media screen and (min-width: 46.25em) {
+	.groups.group-invites #buddypress #item-body #message {
+		margin-top: 0;
+	}
+}
+
+@media screen and (min-width: 55em) {
+	.groups.group-invites #buddypress #send-invite-form {
+		margin-top: 0;
+	}
+}
+
+@media screen and (max-width: 46.25em) {
+	.groups.group-invites #item-body .left-menu {
+		float: none;
+		margin: 10px 0;
+	}
+	.groups.group-invites #item-body .left-menu #invite-list {
+		height: auto;
+		width: auto;
+	}
+	.groups.group-invites #item-body .main-column {
+		margin-left: 0;
+	}
+	.groups.group-invites #item-body .submit input {
+		display: inline-block;
+		width: 100%;
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.2.2 - Item Body User Accounts
+*
+* User Account specific item body rules
+*-----------------------------------------------------
+*/
+.bp-user .entry-title {
+	margin-bottom: 0.5em;
+}
+
+/**
+*--------------------------------------------
+* @subsection 6.2.2.1 - classes, pag, filters
+*--------------------------------------------
+*/
+.bp-user #buddypress table th {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+.bp-user #buddypress table td {
+	font-size: 12px;
+	font-size: 1.2rem;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress table th {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+	.bp-user #buddypress table td {
+		font-size: 14px;
+		font-size: 1.4rem;
+	}
+}
+
+@media screen and (min-width: 77.5em) {
+	.bp-user #buddypress table th {
+		font-size: 18px;
+		font-size: 1.8rem;
+	}
+	.bp-user #buddypress table td {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+.bp-user #buddypress .pag-count {
+	font-style: italic;
+}
+
+.bp-user #buddypress .notifications-options-nav,
+.bp-user #buddypress .messages-options-nav {
+	float: left;
+	width: 100%;
+}
+
+@media screen and (min-width: 30em) {
+	.bp-user #buddypress .notifications-options-nav,
+	.bp-user #buddypress .messages-options-nav {
+		width: 50%;
+	}
+}
+
+.bp-user #buddypress .notifications-options-nav select,
+.bp-user #buddypress .notifications-options-nav input,
+.bp-user #buddypress .messages-options-nav select,
+.bp-user #buddypress .messages-options-nav input {
+	font-size: 14px;
+	font-size: 1.4rem;
+	outline: 0;
+	padding: 0;
+}
+
+.bp-user #buddypress .notifications-options-nav select,
+.bp-user #buddypress .messages-options-nav select {
+	float: left;
+	margin-right: 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 30em) {
+	.bp-user #buddypress .notifications-options-nav select,
+	.bp-user #buddypress .messages-options-nav select {
+		width: 60%;
+	}
+}
+
+.bp-user #buddypress .notifications-options-nav input,
+.bp-user #buddypress .messages-options-nav input {
+	float: right;
+	font-family: "Noto Serif", serif;
+	line-height: 1.5;
+	margin-top: 10px;
+	width: 100%;
+}
+
+.bp-user #buddypress .notifications-options-nav input[disabled]:hover,
+.bp-user #buddypress .messages-options-nav input[disabled]:hover {
+	background: none;
+}
+
+@media screen and (min-width: 30em) {
+	.bp-user #buddypress .notifications-options-nav input,
+	.bp-user #buddypress .messages-options-nav input {
+		margin-top: 0;
+		width: 38%;
+	}
+}
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.2 - Extended Profiles
+	*-------------------------------------------
+	*/
+.bp-user #buddypress .profile .bp-widget h4 {
+	background: #6e6e6e;
+	color: #fff;
+	margin-bottom: 0;
+	padding: 0.4em;
+}
+
+.bp-user #buddypress .profile .bp-widget table {
+	margin-top: 0;
+}
+
+/* Edit Profile */
+.bp-user #buddypress .profile #profile-edit-form .button-nav:before,
+.bp-user #buddypress .profile #profile-edit-form .button-nav:after {
+	content: " ";
+	display: table;
+}
+
+.bp-user #buddypress .profile #profile-edit-form .button-nav:after {
+	clear: both;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav {
+	border-bottom: 1px solid #eaeaea;
+	margin-left: 0;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav li {
+	float: left;
+	margin-bottom: 0;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav li.current {
+	border: 1px solid #eaeaea;
+	border-bottom-color: #fff;
+	margin-bottom: -1px;
+}
+
+.bp-user #buddypress .profile #profile-edit-form ul.button-nav a {
+	background: none;
+	border: 0;
+	font-size: 18px;
+	font-size: 1.8rem;
+}
+
+.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle,
+.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings {
+	font-size: 14px;
+	font-size: 1.4rem;
+}
+
+.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close,
+.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link {
+	background: #555;
+	color: #fff;
+	padding: 0.2em 0.5em;
+}
+
+.bp-user #buddypress .profile .bp-avatar #bp-delete-avatar a {
+	font-size: inherit;
+}
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.3 - Groups
+	*-------------------------------------------
+	*/
+@media screen and (min-width: 77.5em) {
+	.bp-user #buddypress #groups-list li .item {
+		left: 5%;
+		width: 50%;
+	}
+}
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.5 - Private Messaging
+	*-------------------------------------------
+	*/
+.bp-user #buddypress {
+	/* Auto Complete background */
+	/* Sitewide Notices loop */
+}
+
+.bp-user #buddypress #message-thread a {
+	border-bottom: 0;
+}
+
+.bp-user #buddypress #message-thread #message-subject {
+	background: #6e6e6e;
+	color: #fff;
+	padding: 0.3em 0 0.3em 0.2em;
+}
+
+.bp-user #buddypress #message-thread #message-recipients {
+	font-style: italic;
+}
+
+.bp-user #buddypress #message-thread #message-recipients a.confirm {
+	border: 1px solid #eaeaea;
+	font-style: normal;
+}
+
+.bp-user #buddypress #message-thread .message-metadata {
+	overflow: hidden;
+}
+
+.bp-user #buddypress #message-thread .message-metadata img.avatar {
+	float: none;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress #message-thread .message-metadata img.avatar {
+		float: left;
+	}
+}
+
+.bp-user #buddypress #message-thread .message-metadata .message-star-actions {
+	float: right;
+	margin-right: 5px;
+	position: static;
+}
+
+.bp-user #buddypress #message-thread .message-content {
+	background: #f7f7f7;
+	border: 1px solid #eaeaea;
+	margin: 10px 0 0 0;
+	padding: 0.3em;
+}
+
+.bp-user #buddypress #message-thread #send-reply .message-content {
+	background: #fff;
+	border: 0;
+}
+
+.bp-user #buddypress #message-thread .alt {
+	background: #fff;
+}
+
+.bp-user #buddypress #message-threads thead tr {
+	background: #6e6e6e;
+}
+
+.bp-user #buddypress #message-threads tr td {
+	background: #fff;
+	display: inline-block;
+	float: left;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-star,
+.bp-user #buddypress #message-threads tr td.thread-options {
+	border-bottom-color: #b7b7b7;
+	border-bottom-width: 2px;
+	height: 2.4em;
+	padding-bottom: 0.2em;
+	padding-top: 0.2em;
+}
+
+@media screen and (max-width: 46.25em) {
+	.bp-user #buddypress #message-threads tr td.thread-star,
+	.bp-user #buddypress #message-threads tr td.thread-options {
+		padding-top: 0;
+	}
+}
+
+.bp-user #buddypress #message-threads tr td.bulk-select-check,
+.bp-user #buddypress #message-threads tr td.thread-from {
+	height: 2.6em;
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user #buddypress #message-threads tr td.bulk-select-check,
+	.bp-user #buddypress #message-threads tr td.thread-from {
+		height: 5.2em;
+	}
+}
+
+.bp-user #buddypress #message-threads tr td.thread-from,
+.bp-user #buddypress #message-threads tr td.thread-options {
+	border-left: 0 !important;
+	width: -webkit-calc(100% - 30px);
+	width: -moz-calc(100% - 30px);
+	width: calc(100% - 30px);
+	margin-left: 0;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-info {
+	padding-left: 41px;
+	width: 100%;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-info a::after {
+	content: " –  " attr(title);
+	font-size: 12px;
+	font-size: 1.2rem;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-options {
+	text-align: right;
+}
+
+.bp-user #buddypress #message-threads tr td.thread-options a {
+	font-size: 12px;
+	font-size: 1.2rem;
+	line-height: 2.2;
+}
+
+.bp-user #buddypress #message-threads tr span.from {
+	display: none;
+}
+
+.bp-user #buddypress #message-threads tr span.activity {
+	display: block;
+	float: right;
+	line-height: 2;
+}
+
+@media screen and (max-width: 38.75em) {
+	.bp-user #buddypress #message-threads tr span.activity {
+		clear: both;
+		font-size: 11px;
+		font-size: 1.1rem;
+		width: 100%;
+	}
+}
+
+.bp-user #buddypress #message-threads tr.unread td {
+	background: #dce5ff;
+	border-bottom-color: #b7b7b7;
+	border-color: #d1d1d1;
+}
+
+.bp-user #buddypress #message-threads th {
+	display: none;
+}
+
+.bp-user #buddypress #message-threads th.bulk-select-all {
+	border-bottom: 0;
+	display: inline-block;
+	text-align: left;
+}
+
+.bp-user #buddypress #message-threads th.bulk-select-all,
+.bp-user #buddypress #message-threads td.bulk-select-check,
+.bp-user #buddypress #message-threads td.thread-star {
+	border-right: 0;
+	width: 30px;
+}
+
+.bp-user #buddypress .acfb-holder li.friend-tab {
+	margin-right: 0;
+}
+
+.bp-user #buddypress .acfb-holder li.friend-tab a {
+	border-bottom: 0;
+}
+
+.bp-user #buddypress .acfb-holder li.friend-tab a img {
+	display: inline;
+	height: 20px;
+	margin-right: 0.5em;
+	width: 20px !important;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td {
+	width: 100%;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td strong {
+	background: #6e6e6e;
+	color: #fff;
+	display: block;
+	margin-bottom: 0.4em;
+	padding-left: 0.2em;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td a {
+	display: inline-block;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:first-child {
+	display: none;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:first-child + td + td {
+	border-bottom: 0;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:first-child + td + td span {
+	line-height: 1;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:last-child {
+	border-bottom-color: #b7b7b7;
+	line-height: 1;
+	text-align: right;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child {
+	line-height: 0;
+	margin-left: 0.7em;
+	text-indent: -999em;
+}
+
+.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child::after {
+	content: attr(title);
+	display: block;
+	line-height: initial;
+	text-indent: 0;
+}
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.6 - Settings
+	*------------------------------
+	*/
+.bp-user #buddypress #settings-form > p {
+	font-size: 20px;
+	font-size: 2rem;
+	margin: 20px 0 10px;
+}
+
+.bp-user #buddypress table.notification-settings th.title {
+	width: 75%;
+}
+
+.bp-user #buddypress table.notification-settings td.yes,
+.bp-user #buddypress table.notification-settings td.no {
+	vertical-align: middle;
+}
+
+.bp-user #buddypress table.profile-settings {
+	width: 100%;
+}
+
+.bp-user #buddypress table.profile-settings th.field-group-name,
+.bp-user #buddypress table.profile-settings td.field-name {
+	width: 50%;
+}
+
+@media screen and (min-width: 46.25em) {
+	.bp-user #buddypress table.profile-settings th.field-group-name,
+	.bp-user #buddypress table.profile-settings td.field-name {
+		width: 70%;
+	}
+}
+
+.bp-user #buddypress table.profile-settings th.title,
+.bp-user #buddypress table.profile-settings td.field-visibility {
+	width: 30%;
+}
+
+.bp-user #buddypress table.profile-settings td.field-visibility select {
+	width: 100%;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 7.0 - Forms  - General
+*-------------------------------------------------------------------------------
+*/
+#buddypress div.activity-comments form .ac-textarea {
+	background: #f7f7f7;
+	border: 1px solid rgba(153, 153, 153, 0.3);
+}
+
+#buddypress div.activity-comments form .ac-textarea textarea {
+	background: none;
+	border: 0;
+}
+
+#buddypress select {
+	border: 1px solid rgba(153, 153, 153, 0.5);
+}
+
+#buddypress .standard-form li,
+#buddypress .group-create-form li {
+	float: none;
+}
+
+#buddypress .standard-form input[type='text'],
+#buddypress .standard-form textarea,
+#buddypress .group-create-form input[type='text'],
+#buddypress .group-create-form textarea {
+	width: 100%;
+}
+
+#buddypress div.dir-search,
+#buddypress div.message-search,
+#buddypress
+li.groups-members-search {
+	float: none;
+	margin: 10px 0;
+}
+
+#buddypress div.dir-search form,
+#buddypress div.message-search form,
+#buddypress
+li.groups-members-search form {
+	border: 1px solid rgba(153, 153, 153, 0.4);
+	overflow: hidden;
+}
+
+#buddypress div.dir-search form label,
+#buddypress div.message-search form label,
+#buddypress
+li.groups-members-search form label {
+	float: left;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress
+li.groups-members-search form input[type='text'] {
+	float: left;
+	margin: 0;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='text'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress
+li.groups-members-search form input[type='text'],
+#buddypress
+li.groups-members-search form input[type='submit'] {
+	font-size: 14px;
+	font-size: 1.4rem;
+	border: 0;
+	line-height: inherit;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress
+li.groups-members-search form input[type='text'] {
+	border-right: 1px solid rgba(153, 153, 153, 0.4);
+	padding: 0.2em 0 0.2em 0.2em;
+}
+
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress
+li.groups-members-search form input[type='submit'] {
+	float: right;
+	font-weight: normal;
+	padding: 0.2em 1em;
+	text-align: center;
+	text-transform: none;
+	width: 20%;
+}
+
+@media screen and (min-width: 38.75em) {
+	#buddypress div.dir-search,
+	#buddypress div.message-search,
+	#buddypress li.groups-members-search {
+		float: right;
+		margin-bottom: 5px !important;
+	}
+	#buddypress div.dir-search form label,
+	#buddypress div.dir-search form input[type='text'],
+	#buddypress div.dir-search form input[type='submit'],
+	#buddypress div.message-search form label,
+	#buddypress div.message-search form input[type='text'],
+	#buddypress div.message-search form input[type='submit'],
+	#buddypress li.groups-members-search form label,
+	#buddypress li.groups-members-search form input[type='text'],
+	#buddypress li.groups-members-search form input[type='submit'] {
+		width: auto;
+	}
+}
+
+@media screen and (min-width: 77.5em) {
+	#buddypress .dir-search form input[type='text'],
+	#buddypress .message-search form input[type='text'] {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+	#buddypress .dir-search form input[type='submit'],
+	#buddypress .message-search form input[type='submit'] {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 8.0 - Tables - General
+*-------------------------------------------------------------------------------
+*/
+#buddypress table {
+	font-size: 14px;
+	font-size: 1.4rem;
+	margin: 20px 0;
+}
+
+#buddypress table tr th {
+	background: #6e6e6e;
+	border-color: #b7b7b7;
+	color: #fff;
+}
+
+#buddypress table p {
+	margin-bottom: 0.5em;
+}
+
+@media screen and (min-width: 55em) {
+	#buddypress table {
+		font-size: 16px;
+		font-size: 1.6rem;
+	}
+}
+
+/*__ User Account tables __*/
+#buddypress .notifications th,
+#buddypress .messages-notices th {
+	width: 30%;
+}
+
+#buddypress .notifications th.bulk-select-all,
+#buddypress .messages-notices th.bulk-select-all {
+	text-align: center;
+	width: 10%;
+}
+
+#buddypress .notifications .bulk-select-check,
+#buddypress .notifications .thread-star,
+#buddypress .messages-notices .bulk-select-check,
+#buddypress .messages-notices .thread-star {
+	text-align: center;
+}
+
+#buddypress .notifications .notification-actions,
+#buddypress .notifications td.thread-options,
+#buddypress .messages-notices .notification-actions,
+#buddypress .messages-notices td.thread-options {
+	text-align: center;
+}
+
+#buddypress .notifications .notification-actions a,
+#buddypress .notifications td.thread-options a,
+#buddypress .messages-notices .notification-actions a,
+#buddypress .messages-notices td.thread-options a {
+	display: inline-block;
+	margin: 0;
+	padding: 0;
+}
+
+#buddypress .notifications td .button,
+#buddypress .messages-notices td .button {
+	border: 0;
+	display: block;
+	padding: 0;
+	text-align: center;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 9.0 - Error / Success messages
+*-------------------------------------------------------------------------------
+*/
+#buddypress #item-body div#message {
+	margin-top: 20px;
+}
+
+@media screen and (min-width: 55em) {
+	#buddypress #item-body div#message {
+		margin-right: 20px;
+	}
+}
+
+#buddypress div#message p {
+	font-size: 18px;
+	font-size: 1.8rem;
+	font-weight: bold;
+}
+
+#buddypress div#message.info p {
+	background: #c6e4ee;
+	border: 1px solid #78bed6;
+	color: #1e5264;
+}
+
+#buddypress div#message.updated p {
+	background: #dee6b2;
+	border: 1px solid #becc66;
+	color: #454d19;
+}
+
+.delete-group #buddypress div#message.info p {
+	background: #db7e7e;
+	border: 1px solid #be3535;
+	color: #1f0808;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 10.0 - Ajax Loading, Widgets, General classes
+*-------------------------------------------------------------------------------
+*/
+#buddypress {
+	/* Auto Complete background */
+}
+
+#buddypress .acfb-holder li.friend-tab {
+	background: #9fd1e2;
+	border: inherit;
+}
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.min.css
new file mode 100644
index 0000000000000000000000000000000000000000..436772df6e8b92ae25b2cef829bd5e5d565c432e
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.min.css
@@ -0,0 +1 @@
+@charset "UTF-8";#buddypress div.pagination .pagination-links .next:before,#buddypress div.pagination .pagination-links .prev:before,.buddypress div.clear{display:none}#buddypress #activity-stream .load-more:focus a,#buddypress #activity-stream .load-more:hover a,#buddypress div#subnav.item-list-tabs ul li.last select,#buddypress ul.item-list li .item span.activity,#buddypress ul.item-list li div.action .meta,.bp-user #buddypress #message-thread #message-recipients,.bp-user #buddypress .pag-count{font-style:italic}#buddypress h1,#buddypress h2,#buddypress h3,#buddypress h4,#buddypress h5,#buddypress h6{clear:none}.buddypress main{padding-top:4%}@media screen and (min-width:59.6875em){.buddypress main{padding-top:0}}.buddypress main article{margin:0 4%;padding-top:8.3333%}@media screen and (min-width:59.6875em){.buddypress main article{margin:0 0 0 1px}}@media screen and (min-width:87.6875em){.buddypress main article{margin:0 4.3333% 0 8.3333%}}.buddypress main article .entry-content,.buddypress main article .entry-header{padding:0 3rem 3rem}.buddypress main article #buddypress{margin-bottom:40px}.buddypress .site-footer{margin:0 4%}@media screen and (min-width:59.6875em){.buddypress .site-footer{margin:0 0 0 35.2941%;width:61.8235%}}.buddypress #buddypress #latest-update a,.buddypress #buddypress .activity-comments a,.buddypress #buddypress .activity-header a,.buddypress #buddypress .activity-inner a,.buddypress #buddypress .avatar-nav-items a,.buddypress #buddypress .field-visibility-settings-toggle a,.buddypress #buddypress .item-list-tabs a,.buddypress #buddypress .item-title a,.buddypress #buddypress .load-more a,.buddypress #buddypress .pagination-links a,.buddypress #buddypress .pagination-links span,.buddypress #buddypress table a{border-bottom:0}#buddypress div.item-list-tabs ul{background-color:#f7f7f7;border-bottom:1px solid rgba(234,234,234,.9);border-top:1px solid rgba(234,234,234,.9);overflow:hidden;padding:5px 0}#buddypress div.item-list-tabs ul li a span{border-radius:25%}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}#buddypress #object-nav ul li:not(.selected) a{opacity:.7}#buddypress div#subnav.item-list-tabs{margin-top:0}#buddypress div#subnav.item-list-tabs ul{background-color:#f7f7f7;border-bottom:0;padding:0}#buddypress div#subnav.item-list-tabs ul li.last{background:#fff;margin-top:0;padding:5px 5px 5px 0;width:100%}#buddypress div#subnav.item-list-tabs ul li.last select,#buddypress div#subnav.item-list-tabs ul li.last select:focus{background:0 0;border:0;outline:0}#buddypress div#subnav.item-list-tabs ul li.last label,#buddypress div#subnav.item-list-tabs ul li.last option,#buddypress div#subnav.item-list-tabs ul li.last select{font-size:14px;font-size:1.4rem}@media screen and (min-width:38.75em){#buddypress #object-nav ul li{float:left}#buddypress div#subnav.item-list-tabs ul li.last{text-align:right}}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background:#555;color:#fff;opacity:1}@media screen and (min-width:55em){.bp-user #buddypress,.single-item.groups #buddypress{background:#f7f7f7}#buddypress #item-body,#buddypress #item-header{background:#fff}#buddypress #object-nav{border-right:1px solid #ddd;float:left;margin-right:-1px;width:200px}#buddypress #object-nav ul{border-bottom:0;padding:0}#buddypress #object-nav ul li{float:none;overflow:hidden}#buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:right;margin-right:2px}#buddypress #item-body{border-left:1px solid #ddd;overflow:hidden;padding:0 0 0 20px;width:auto}#buddypress #item-body #subnav{margin:0 0 0 -20px}}#buddypress div.pagination{box-shadow:none}#buddypress div.pagination .pag-count{margin-left:0}#buddypress div.pagination .pagination-links{margin-right:0}#buddypress div.pagination .pagination-links a,#buddypress div.pagination .pagination-links span{height:auto;line-height:1;padding:5px}#buddypress div.pagination .pagination-links .next,#buddypress div.pagination .pagination-links .prev{background-color:transparent;color:inherit;overflow:visible;width:auto}#buddypress div.pagination .pagination-links .prev{left:auto;position:static}#buddypress div.pagination .pagination-links .next{position:static;right:auto}#buddypress .item-list .activity-header,#buddypress .item-list .activity-meta{font-family:"Noto Sans",sans-serif}#buddypress ul.item-list li{overflow:hidden!important}#buddypress ul.item-list li .item-avatar{margin-bottom:10px;text-align:center}#buddypress ul.item-list li .item-avatar a{border-bottom:0}#buddypress ul.item-list li .item-avatar img.avatar{display:inline-block;float:none}@media screen and (min-width:38.75em){#buddypress ul.item-list li .item-avatar{margin-bottom:0}#buddypress ul.item-list li .item-avatar img.avatar{display:block;float:left}}#buddypress ul.item-list li .item{margin-left:25%}#buddypress ul.item-list li .item .item-desc{margin-left:0;width:70%}@media screen and (min-width:59.6875em){#buddypress ul.item-list li .action,#buddypress ul.item-list li .item,#buddypress ul.item-list li .item-avatar{float:left}#buddypress ul.item-list li .item{left:10%;margin-left:0;position:relative;width:55%}}#buddypress ul.item-list li div.action{clear:left;float:none;margin-bottom:-20px;margin-left:0;padding:20px 0 5px;position:relative;text-align:left;top:0}@media screen and (min-width:59.6875em){#buddypress ul.item-list li div.action{clear:none;float:right;margin-bottom:0;padding:0}}#buddypress ul.item-list li div.action div{display:inline-block;margin:10px 0;width:100%}#buddypress ul.item-list li div.action div a{display:block;width:100%}@media screen and (min-width:38.75em){#buddypress ul.item-list li div.action div{margin:0 10px 10px 0;width:auto}}@media screen and (min-width:59.6875em){#buddypress ul.item-list li div.action div{clear:right;float:right;margin:0 0 10px}}#buddypress form#whats-new-form p.activity-greeting{line-height:1.4}#buddypress form#whats-new-form textarea{width:100%}@media screen and (max-width:30em){#buddypress form#whats-new-form #whats-new-post-in-box select{font-size:14px;font-size:1.4rem;max-width:120px}}@media screen and (max-width:38.75em){#buddypress form#whats-new-form #whats-new-content{clear:left;margin:10px 0 40px;padding:10px 0 0}#buddypress form#whats-new-form #whats-new-content #whats-new-submit{float:none}#buddypress form#whats-new-form #whats-new-content #whats-new-submit input{width:100%}#buddypress form#whats-new-form #whats-new-options{display:flex;flex-direction:column}#buddypress form#whats-new-form #whats-new-options #whats-new-submit{order:2}#buddypress form#whats-new-form #whats-new-options #whats-new-post-in-box{order:1}}#buddypress form#whats-new-form #whats-new-options[style]{min-height:6rem;overflow:visible}#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(153,153,153,.5);float:left;line-height:1.5em;margin-top:12px;padding-left:.2em;width:100%}#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:right;margin:0;min-height:1.5em;outline:0;padding-left:.4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-options[style] #whats-new-submit{float:right}}#buddypress #item-body form#whats-new-form{margin:40px 0}#buddypress #activity-stream li{padding:25px 0 15px}#buddypress #activity-stream li .activity-avatar{float:none;text-align:center}#buddypress #activity-stream li .activity-avatar a{display:inline-block}#buddypress #activity-stream li .activity-avatar a img.avatar{display:inline;float:none;height:60px;margin-bottom:20px;margin-left:0;width:60px}#buddypress #activity-stream li .activity-content{margin-left:0}#buddypress #activity-stream li .activity-content .activity-header{font-size:14px;font-size:1.4rem}@media screen and (min-width:46.25em){#buddypress #activity-stream li .activity-avatar{float:left;margin-right:10px;text-align:left}#buddypress #activity-stream li .activity-avatar a{border-bottom:0}#buddypress #activity-stream li .activity-content{margin:0;overflow:hidden}#buddypress #activity-stream li .activity-content .activity-header{font-size:16px;font-size:1.6rem}}#buddypress #activity-stream li.mini .activity-avatar a img.avatar{height:30px;margin-left:15px;width:30px}#buddypress #activity-stream li.mini .activity-content .activity-header{font-size:13px;font-size:1.3rem}#buddypress #activity-stream .activity-content{margin-top:-12px}#buddypress #activity-stream .activity-content .activity-header{line-height:inherit;margin-right:0}#buddypress #activity-stream .activity-content .activity-header p{background-color:#f7f7f7;border:1px solid rgba(234,234,234,.6);padding:0 .2em}#buddypress #activity-stream .activity-content .activity-header img.avatar{display:inline-block;margin-bottom:0!important}#buddypress #activity-stream .activity-content .activity-meta a{display:block;margin:0 0 5px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-content .activity-meta a{display:inline-block;margin:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}#buddypress #activity-stream .load-more:focus,#buddypress #activity-stream .load-more:hover{background:#f4f4f4;border:1px solid rgba(159,209,226,.3)}#buddypress #activity-stream .load-more a{display:block}.activity-permalink #buddypress{background:0 0}.activity-permalink #buddypress #activity-stream li.activity-item{padding:20px 0}.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:16px;font-size:1.6rem;margin-bottom:40px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:2rem}}.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:20px}#buddypress #activity-stream .activity-comments{margin:10px 0 0}#buddypress #activity-stream .activity-comments.has-comments{border-left:1px solid #eaeaea}#buddypress #activity-stream .activity-comments .ac-form{padding:20px 0 0}#buddypress #activity-stream .activity-comments>ul{background:rgba(247,247,247,.6);margin:15px 0 0 2px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-comments>ul{margin-left:70px}}#buddypress #activity-stream .activity-comments>ul ul{margin-left:1%;padding-left:0}@media screen and (min-width:30em){#buddypress #activity-stream .activity-comments>ul ul{margin-left:1%;padding-left:1em}}#buddypress #activity-stream .activity-comments>ul ul li{border-left:1px solid #eaeaea;border-top:0;padding-left:.2em}#buddypress #activity-stream .activity-comments>ul .acomment-meta{border-bottom:1px solid #eaeaea;font-style:italic}@media screen and (max-width:38.75em){#buddypress #activity-stream .activity-comments>ul .acomment-avatar{display:block;text-align:center}#buddypress #activity-stream .activity-comments>ul .acomment-avatar a,#buddypress #activity-stream .activity-comments>ul .acomment-avatar img.avatar{display:inline;float:none}#buddypress #activity-stream .activity-comments>ul .acomment-content,#buddypress #activity-stream .activity-comments>ul .acomment-meta,#buddypress #activity-stream .activity-comments>ul .acomment-options{margin:5px}#buddypress #activity-stream .activity-comments>ul .acomment-content{padding:0 10px}}#buddypress #activity-stream .activity-comments .ac-reply-avatar{display:none}#buddypress #activity-stream .activity-comments .ac-reply-content{margin-left:0;padding-left:0}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-comments .ac-reply-avatar{display:block}#buddypress #activity-stream .activity-comments .ac-reply-content{overflow:hidden}}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(51,51,51,.8);display:inline-block;font-family:inherit;font-size:12px;font-size:1.2rem;font-weight:400;line-height:1.2;padding:4px 10px;text-transform:lowercase;width:100px}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(153,153,153,.7);text-align:center}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:focus,#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel:hover{background:#ededed}@media screen and (min-width:59.6875em){#buddypress #members-list li .item,#buddypress #members-list li .item-avatar{float:left}#buddypress #members-list li .action{float:right}}@media screen and (max-width:46.25em){.bp-user main header.entry-header,.single-item.groups main header.entry-header{padding-bottom:1rem}.bp-user #buddypress #item-header .generic-button,.single-item.groups #buddypress #item-header .generic-button{float:none;margin:1.5em 0 0}}@media screen and (max-width:38.75em){.bp-user #item-header-content,.bp-user h1,.single-item.groups #item-header-content,.single-item.groups h1{text-align:center}.bp-user #buddypress h1,.single-item.groups #buddypress h1{margin-bottom:0}.bp-user #buddypress #item-header-avatar img.avatar,.single-item.groups #buddypress #item-header-avatar img.avatar{margin-right:0}.bp-user #buddypress #item-header-content,.single-item.groups #buddypress #item-header-content{width:100%}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}@media screen and (max-width:38.75em){.single-item.groups #buddypress div#item-header{display:flex;flex-direction:column}.single-item.groups #buddypress div#item-header #item-header-avatar{order:1;text-align:center}.single-item.groups #buddypress div#item-header #item-header-avatar a{border-bottom:0}.single-item.groups #buddypress div#item-header #item-header-avatar a img{display:inline-block;float:none}.single-item.groups #buddypress div#item-header #item-header-content{order:2}.single-item.groups #buddypress div#item-header #item-actions{order:3}}.single-item.groups #buddypress div#item-header{padding-bottom:40px}.single-item.groups #buddypress div#item-header div#item-actions{margin:0;width:100%}@media screen and (min-width:38.75em){.single-item.groups #buddypress div#item-header div#item-actions{clear:none;float:right;width:50%}}.single-item.groups #buddypress div#item-header div#item-actions h3{background:#555;color:#fff;font-size:14px;font-size:1.4rem;padding:.2em}@media screen and (min-width:46.25em){.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:16px;font-size:1.6rem}.single-item.groups #buddypress div#item-header #item-header-avatar,.single-item.groups #buddypress div#item-header #item-header-content{float:left}.single-item.groups #buddypress div#item-header #item-header-avatar{width:21%}.single-item.groups #buddypress div#item-header #item-header-content{margin-left:4%;width:40%}.single-item.groups #buddypress div#item-header div#item-actions{float:right;width:28%}}.bp-user #buddypress #item-header{padding:20px 0}.bp-user #buddypress #item-header #item-header-avatar{text-align:center;width:100%}.bp-user #buddypress #item-header #item-header-avatar a,.bp-user #buddypress #item-header #item-header-avatar img.avatar{border-bottom:0;display:inline-block;float:none}@media screen and (min-width:46.25em){.bp-user #buddypress #item-header #item-header-avatar{float:left;width:20%}.bp-user #buddypress #item-header #item-header-avatar a,.bp-user #buddypress #item-header #item-header-avatar img.avatar{float:left;width:100%}.bp-user #buddypress #item-header #item-header-content{float:right;margin-right:5%;width:69%}}#item-body h1,#item-body h2,#item-body h3,#item-body h4,#item-body h5,#item-body h6{margin:1em 0}#item-body h1 a,#item-body h2 a,#item-body h3 a,#item-body h4 a,#item-body h5 a,#item-body h6 a{border-bottom:0}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups #group-settings-form #request-list h4{background:0 0;color:inherit}.groups.edit-details #group-settings-form label{background:#555;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;background-clip:padding-box;color:#fff;display:inline-block;margin-bottom:0;padding:.2em;width:80%}@media screen and (min-width:38.75em){.groups.edit-details #group-settings-form label{width:60%}}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:1.4rem;width:auto}.groups.group-settings #create-group-form div.radio label,.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #create-group-form div.radio ul,.groups.group-settings #group-settings-form div.radio ul{color:rgba(51,51,51,.6);font-size:14px;font-size:1.4rem}.groups.group-avatar form>p{margin-top:20px}.groups.manage-members #group-settings-form .item-list li{border-bottom:1px solid #eaeaea}.groups.group-members #buddypress #members-group-list li h5 a,.groups.manage-members #group-settings-form .item-list li h5>a,.groups.manage-members #group-settings-form .item-list li img>a{border-bottom:0}.groups.manage-members #group-settings-form .item-list li h5,.groups.manage-members #group-settings-form .item-list li img{float:left}.groups.manage-members #group-settings-form .item-list li span.small{clear:left;display:block;float:none;margin-top:10px}.groups.manage-members #group-settings-form .item-list li span.small a{display:inline-block;margin:5px 0;width:100%}@media screen and (min-width:38.75em){.groups.manage-members #group-settings-form .item-list li span.small a{width:auto}}.groups.manage-members #group-settings-form .item-list li h5{margin:0}@media screen and (max-width:30em){.groups.group-members #buddypress #members-group-list li>a{border-bottom:0;display:block;margin-bottom:10px;text-align:center}.groups.group-members #buddypress #members-group-list li>a img.avatar{display:inline;float:none}}.groups.group-members #buddypress #members-group-list li h5{display:inline-block;font-size:14px;font-size:1.4rem;margin:0}@media screen and (min-width:59.6875em){.groups.group-members #buddypress #members-group-list li h5{font-size:16px;font-size:1.6rem}}.groups.group-members #buddypress #members-group-list li span.activity{font-size:12px;font-size:1.2rem}.groups.group-members #buddypress #members-group-list li .action{top:0}.groups.group-members #subnav li{width:100%}.groups.group-members #subnav li #search-members-form{float:right;margin:5px 5px 0 0}@media screen and (max-width:38.75em){.groups.group-members #subnav li{background:#fff;padding:20px 0}.groups.group-members #subnav li #search-members-form{margin:0;width:100%}.groups.group-members #subnav li #search-members-form label input[type=text]{width:100%}}.groups.group-invites #item-body .item-list .action{margin-bottom:0}@media screen and (min-width:46.25em){.groups.group-invites #buddypress #item-body #message{margin-top:0}}@media screen and (min-width:55em){.groups.group-invites #buddypress #send-invite-form{margin-top:0}}@media screen and (max-width:46.25em){.groups.group-invites #item-body .left-menu{float:none;margin:10px 0}.groups.group-invites #item-body .left-menu #invite-list{height:auto;width:auto}.groups.group-invites #item-body .main-column{margin-left:0}.groups.group-invites #item-body .submit input{display:inline-block;width:100%}}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:14px;font-size:1.4rem}.bp-user #buddypress table td{font-size:12px;font-size:1.2rem}@media screen and (min-width:46.25em){.bp-user #buddypress table th{font-size:16px;font-size:1.6rem}.bp-user #buddypress table td{font-size:14px;font-size:1.4rem}}@media screen and (min-width:77.5em){.bp-user #buddypress table th{font-size:18px;font-size:1.8rem}.bp-user #buddypress table td{font-size:16px;font-size:1.6rem}}.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{float:left;width:100%}@media screen and (min-width:30em){.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{width:50%}}.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav input,.bp-user #buddypress .notifications-options-nav select{font-size:14px;font-size:1.4rem;outline:0;padding:0}.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{float:left;margin-right:0;width:100%}@media screen and (min-width:30em){.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{width:60%}}.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{float:right;font-family:"Noto Serif",serif;line-height:1.5;margin-top:10px;width:100%}.bp-user #buddypress .messages-options-nav input[disabled]:hover,.bp-user #buddypress .notifications-options-nav input[disabled]:hover{background:0 0}@media screen and (min-width:30em){.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{margin-top:0;width:38%}}.bp-user #buddypress .profile .bp-widget h4{background:#6e6e6e;color:#fff;margin-bottom:0;padding:.4em}.bp-user #buddypress .profile .bp-widget table{margin-top:0}.bp-user #buddypress .profile #profile-edit-form .button-nav:after,.bp-user #buddypress .profile #profile-edit-form .button-nav:before{content:" ";display:table}.bp-user #buddypress .profile #profile-edit-form .button-nav:after{clear:both}.bp-user #buddypress .profile #profile-edit-form ul.button-nav{border-bottom:1px solid #eaeaea;margin-left:0}.bp-user #buddypress .profile #profile-edit-form ul.button-nav li{float:left;margin-bottom:0}.bp-user #buddypress .profile #profile-edit-form ul.button-nav li.current{border:1px solid #eaeaea;border-bottom-color:#fff;margin-bottom:-1px}.bp-user #buddypress .profile #profile-edit-form ul.button-nav a{background:0 0;border:0;font-size:18px;font-size:1.8rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings,.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle{font-size:14px;font-size:1.4rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link{background:#555;color:#fff;padding:.2em .5em}.bp-user #buddypress .profile .bp-avatar #bp-delete-avatar a{font-size:inherit}@media screen and (min-width:77.5em){.bp-user #buddypress #groups-list li .item{left:5%;width:50%}}.bp-user #buddypress #message-thread a{border-bottom:0}.bp-user #buddypress #message-thread #message-subject{background:#6e6e6e;color:#fff;padding:.3em 0 .3em .2em}.bp-user #buddypress #message-thread #message-recipients a.confirm{border:1px solid #eaeaea;font-style:normal}.bp-user #buddypress #message-thread .message-metadata{overflow:hidden}.bp-user #buddypress #message-thread .message-metadata img.avatar{float:none}@media screen and (min-width:46.25em){.bp-user #buddypress #message-thread .message-metadata img.avatar{float:left}}.bp-user #buddypress #message-thread .message-metadata .message-star-actions{float:right;margin-right:5px;position:static}.bp-user #buddypress #message-thread .message-content{background:#f7f7f7;border:1px solid #eaeaea;margin:10px 0 0;padding:.3em}.bp-user #buddypress #message-thread #send-reply .message-content{background:#fff;border:0}.bp-user #buddypress #message-thread .alt{background:#fff}.bp-user #buddypress #message-threads thead tr{background:#6e6e6e}.bp-user #buddypress #message-threads tr td{background:#fff;display:inline-block;float:left}.bp-user #buddypress #message-threads tr td.thread-options,.bp-user #buddypress #message-threads tr td.thread-star{border-bottom-color:#b7b7b7;border-bottom-width:2px;height:2.4em;padding-bottom:.2em;padding-top:.2em}.bp-user #buddypress #message-threads.sitewide-notices td:first-child+td+td,.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0}@media screen and (max-width:46.25em){.bp-user #buddypress #message-threads tr td.thread-options,.bp-user #buddypress #message-threads tr td.thread-star{padding-top:0}}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:2.6em}.bp-user #buddypress #message-threads tr td.thread-from,.bp-user #buddypress #message-threads tr td.thread-options{border-left:0!important;width:-webkit-calc(100% - 30px);width:-moz-calc(100% - 30px);width:calc(100% - 30px);margin-left:0}.bp-user #buddypress #message-threads tr td.thread-info{padding-left:41px;width:100%}.bp-user #buddypress #message-threads tr td.thread-info a::after{content:" –  " attr(title);font-size:12px;font-size:1.2rem}.bp-user #buddypress #message-threads tr td.thread-options{text-align:right}.bp-user #buddypress #message-threads tr td.thread-options a{font-size:12px;font-size:1.2rem;line-height:2.2}.bp-user #buddypress #message-threads tr span.from{display:none}.bp-user #buddypress #message-threads tr span.activity{display:block;float:right;line-height:2}@media screen and (max-width:38.75em){.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:5.2em}.bp-user #buddypress #message-threads tr span.activity{clear:both;font-size:11px;font-size:1.1rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{background:#dce5ff;border-color:#d1d1d1}.bp-user #buddypress #message-threads th{display:none}.bp-user #buddypress #message-threads th.bulk-select-all{border-bottom:0;display:inline-block;text-align:left}.bp-user #buddypress #message-threads td.bulk-select-check,.bp-user #buddypress #message-threads td.thread-star,.bp-user #buddypress #message-threads th.bulk-select-all{border-right:0;width:30px}.bp-user #buddypress .acfb-holder li.friend-tab{margin-right:0}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;margin-right:.5em;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td{width:100%}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6e6e6e;color:#fff;display:block;margin-bottom:.4em;padding-left:.2em}.bp-user #buddypress #message-threads.sitewide-notices td a{display:inline-block}.bp-user #buddypress #message-threads.sitewide-notices td:first-child{display:none}.bp-user #buddypress #message-threads.sitewide-notices td:first-child+td+td span{line-height:1}.bp-user #buddypress #message-threads.sitewide-notices td:last-child{border-bottom-color:#b7b7b7;line-height:1;text-align:right}.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child{line-height:0;margin-left:.7em;text-indent:-999em}.bp-user #buddypress #message-threads.sitewide-notices td:last-child a:last-child::after{content:attr(title);display:block;line-height:initial;text-indent:0}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:2rem;margin:20px 0 10px}.bp-user #buddypress table.notification-settings th.title{width:75%}.bp-user #buddypress table.notification-settings td.no,.bp-user #buddypress table.notification-settings td.yes{vertical-align:middle}.bp-user #buddypress table.profile-settings{width:100%}.bp-user #buddypress table.profile-settings td.field-name,.bp-user #buddypress table.profile-settings th.field-group-name{width:50%}@media screen and (min-width:46.25em){.bp-user #buddypress table.profile-settings td.field-name,.bp-user #buddypress table.profile-settings th.field-group-name{width:70%}}.bp-user #buddypress table.profile-settings td.field-visibility,.bp-user #buddypress table.profile-settings th.title{width:30%}#buddypress .group-create-form input[type=text],#buddypress .group-create-form textarea,#buddypress .standard-form input[type=text],#buddypress .standard-form textarea,.bp-user #buddypress table.profile-settings td.field-visibility select{width:100%}#buddypress div.activity-comments form .ac-textarea{background:#f7f7f7;border:1px solid rgba(153,153,153,.3)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress select{border:1px solid rgba(153,153,153,.5)}#buddypress .group-create-form li,#buddypress .standard-form li{float:none}#buddypress div.dir-search,#buddypress div.message-search,#buddypress li.groups-members-search{float:none;margin:10px 0}#buddypress div.dir-search form,#buddypress div.message-search form,#buddypress li.groups-members-search form{border:1px solid rgba(153,153,153,.4);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:left;width:80%}#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit]{font-size:14px;font-size:1.4rem;border:0;line-height:inherit}#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=text]{float:left;margin:0;width:80%;border-right:1px solid rgba(153,153,153,.4);padding:.2em 0 .2em .2em}#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=submit]{float:right;font-weight:400;padding:.2em 1em;text-align:center;text-transform:none;width:20%}@media screen and (min-width:38.75em){#buddypress div.dir-search,#buddypress div.message-search,#buddypress li.groups-members-search{float:right;margin-bottom:5px!important}#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:77.5em){#buddypress .dir-search form input[type=text],#buddypress .dir-search form input[type=submit],#buddypress .message-search form input[type=text],#buddypress .message-search form input[type=submit]{font-size:16px;font-size:1.6rem}}#buddypress table{font-size:14px;font-size:1.4rem;margin:20px 0}#buddypress table tr th{background:#6e6e6e;border-color:#b7b7b7;color:#fff}#buddypress table p{margin-bottom:.5em}#buddypress .messages-notices th,#buddypress .notifications th{width:30%}#buddypress .messages-notices th.bulk-select-all,#buddypress .notifications th.bulk-select-all{text-align:center;width:10%}#buddypress .messages-notices .bulk-select-check,#buddypress .messages-notices .notification-actions,#buddypress .messages-notices .thread-star,#buddypress .messages-notices td.thread-options,#buddypress .notifications .bulk-select-check,#buddypress .notifications .notification-actions,#buddypress .notifications .thread-star,#buddypress .notifications td.thread-options{text-align:center}#buddypress .messages-notices .notification-actions a,#buddypress .messages-notices td.thread-options a,#buddypress .notifications .notification-actions a,#buddypress .notifications td.thread-options a{display:inline-block;margin:0;padding:0}#buddypress .messages-notices td .button,#buddypress .notifications td .button{border:0;display:block;padding:0;text-align:center}#buddypress #item-body div#message{margin-top:20px}@media screen and (min-width:55em){#buddypress table{font-size:16px;font-size:1.6rem}#buddypress #item-body div#message{margin-right:20px}}#buddypress div#message p{font-size:18px;font-size:1.8rem;font-weight:700}#buddypress div#message.info p{background:#c6e4ee;border:1px solid #78bed6;color:#1e5264}#buddypress div#message.updated p{background:#dee6b2;border:1px solid #becc66;color:#454d19}.delete-group #buddypress div#message.info p{background:#db7e7e;border:1px solid #be3535;color:#1f0808}#buddypress .acfb-holder li.friend-tab{background:#9fd1e2;border:inherit inherit inherit}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.scss b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.scss
new file mode 100644
index 0000000000000000000000000000000000000000..22c7eba0c68ba256eaad5363a444e589d8d815b9
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.scss
@@ -0,0 +1,2297 @@
+// Stylesheet Guidence Notes
+// Table of content represents a guide to sections of the sheet.
+// Note that not all sections may be described in the body of the
+// rulesets only those that require styles for a given theme.
+// Sub sections might not exist but can be added as required
+// as per BP Lists - 'activity' section.
+
+// We follow the dictats of the parent theme in respect of media queries,
+// font sizing etc. Media queries are used in a modular sense (OOCSS)
+// rather than described as blocks to the end of the sheet, this aids ease
+// of managing media queries, scalability & flexibility .
+
+// Twentyfifteen Media Queries / Breakpoints
+// @media screen and (max-width: 22em) // Additional for xtra small mobile only
+// @media screen and (max-width: 30em) // Additional small only
+// @media screen and (min-width: 38.75em)
+// @media screen and (min-width: 46.25em)
+// @media screen and (min-width: 55em)
+// @media screen and (min-width: 59.6875em)
+// @media screen and (min-width: 77.5em)
+// @media screen and (min-width: 87.6875em)
+
+// Mixins and Variables
+
+// Common margin values
+$spacing-val-lg: 40px;
+$spacing-val-md: 20px;
+$spacing-val-sm: 10px;
+$spacing-val-xs: 5px;
+
+// A simple mixin to handle font-sizing to match 2015 62.5% approach
+@mixin font-size($font-size: 16) {
+	$rem-font-value: ($font-size / 10);
+	font-size: ($font-size * 1px);
+	font-size: $rem-font-value + rem;
+}
+
+// To allow mixins to pass VendorPrefix scss-lint tests we disable lint-test
+// for specific blocks / rulesets
+// until such time as exemption lists can be built for the scss-lint.yml?
+// Any vendor prefix properties / mixins need to be in this block
+// scss-lint:disable VendorPrefix
+
+// Border border-radius mixins
+@mixin border-radius($radius) {
+	-webkit-border-radius: $radius;
+	-moz-border-radius: $radius;
+	-ms-border-radius: $radius;
+	border-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-top-radius($radius) {
+	-webkit-border-top-right-radius: $radius;
+	border-top-right-radius: $radius;
+	-webkit-border-top-left-radius: $radius;
+	border-top-left-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-right-radius($radius) {
+	-webkit-border-bottom-right-radius: $radius;
+	border-bottom-right-radius: $radius;
+	-webkit-border-top-right-radius: $radius;
+	border-top-right-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-bottom-radius($radius) {
+	-webkit-border-bottom-right-radius: $radius;
+	border-bottom-right-radius: $radius;
+	-webkit-border-bottom-left-radius: $radius;
+	border-bottom-left-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-left-radius($radius) {
+	-webkit-border-bottom-left-radius: $radius;
+	border-bottom-left-radius: $radius;
+	-webkit-border-top-left-radius: $radius;
+	border-top-left-radius: $radius;
+	background-clip: padding-box;
+}
+
+// Box sizing
+@mixin box-model($box-model) {
+	-webkit-box-sizing: $box-model;
+	-moz-box-sizing: $box-model;
+	box-sizing: $box-model;
+}
+
+// Calc
+@mixin calc($property, $expression) {
+	#{$property}: -webkit-calc(#{$expression});
+	#{$property}: -moz-calc(#{$expression});
+	#{$property}: calc(#{$expression});
+}
+
+// Re-enable the VendorPrefix lint test
+// scss-lint:enable VendorPrefix
+
+// BP message boxes
+@mixin message-box($background, $text-color: null) {
+
+	@if $text-color {
+		// if a param was passed through
+		$text-color: $text-color;
+	} @else {
+		$text-color: darken($background, 50%);
+	}
+
+	background: lighten($background, 10%);
+	border: 1px solid darken($background, 10%);
+	color: $text-color;
+}
+
+// 2015 font family
+@mixin default-font-sans() {
+	font-family: "Noto Sans", sans-serif;
+}
+
+@mixin default-font-serif() {
+	font-family: "Noto Serif", serif;
+}
+
+// Variables: color definitions
+$content-background: #fff;
+$light-background:   #f7f7f7;
+$medium-background:  #ccc;
+$dark-background:    #555;
+$border-color:       #999;    // border color is varied using rgba
+$border-light:       #eaeaea; // BP dividers
+$border-med:         #ddd;
+$body-text:          #333;    // 2015 body text color
+$bp-button-hover:    #ededed; // this is the default BP button hover background
+$notice-error:       #c85a6e;
+$notice-warning:     #d05656;
+$notice-info:        #9fd1e2;
+$notice-update:      #ced98c;
+$stripe-odd:         #ebf0ff;
+$stripe-even:        #dbe5ff;
+$unread:             #dce5ff;
+
+/*------------------------------------------------------------------------------
+
+This is the BuddyPress companion stylesheet for
+the WordPress Twentyfifteen theme.
+
+This sheet supports the primary BuddyPress styles in buddypress.css
+
+If you are running as a child theme of twentyfifteen this stylesheet will be
+loaded by default. If you want to modify the styles the normal BP Theme Compat
+hierarchy works and you can copy the file to buddypress/css/ or community/css/
+in your child themes root & either start over or modify the rulesets.
+
+If you do not require the styles you can dequeue them from the themes functions file.
+
+Please see this codex article for more information:
+http://codex.buddypress.org/themes/buddypress-companion-stylesheets/
+
+--------------------------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+--------------------------------------------------------------------------------
+1.0 Theme Structural Elements & overrides
+2.0 - Navigation - General
+	2.1 - Navs - Object Nav / Sub Nav (item-list-tabs)
+	2.2 - Pagination
+3.0 - Images
+4.0 - BP Lists / Loops Generic
+	4.1 - Activity Loop
+		4.1.1 Whats New Activity
+		4.1.2 - Activity Listing
+		4.1.3 - Activity Comments
+	4.2 - Members Loop
+	4.3 - Groups Loop
+	4.4 - Blogs Loop
+5.0 - Directories - Members, Groups, Blogs, Forums
+6.0 - Single Item screens: User Account & Single Group Screens
+	6.1 - Item Headers: Global
+		6.1.1 - item-header: Groups
+		6.1.2 - item-header: User Accounts
+	6.2 - Item Body: Global
+		6.2.1 - item-body: Groups
+			6.2.1.1 - Management settings screens
+			6.2.1.2 - Group members list
+			6.2.1.3 - Group Send Invites
+		6.2.2 - item-body: User Accounts
+			6.2.2.1 - classes, pag, filters
+			6.2.2.2 - Extended Profiles
+			6.2.2.3 - Groups
+			6.2.2.4 - friends
+			6.2.2.5 - Private Messaging Threads
+			6.2.2.6 - Settings
+7.0 - Forms  -  General
+8.0 - Tables -  General
+9.0 - Error / Success Messages
+10.0 - Ajax Loading, Widgets, General classes
+------------------------------------------------------------------------------*/
+
+/**
+*-------------------------------------------------------------------------------
+* @section 1.0 - Theme - Structural Elements & overrides
+*-------------------------------------------------------------------------------
+*/
+
+// Twentyfifteen  adds a generic grouped ruleset of clear:both;
+// for all heading h# elements this is problematic where floats are concerned
+// We reset this here under our #buddypress namespace
+#buddypress {
+	h1,
+	h2,
+	h3,
+	h4,
+	h5,
+	h6 {
+		clear: none;
+	}
+}
+
+// As BP screens have specific content lets adjust the themes primary elements
+// to maximise the screen real estate for BP pages.
+
+.buddypress {
+	div.clear {display: none;}
+	.site-content {
+		@media screen and (min-width: 77.5em) {
+		}
+	}
+
+	main {
+		padding-top: 4%;
+		@media screen and (min-width: 59.6875em) {
+			padding-top: 0;
+		}
+
+		article {
+			margin: 0 4%;
+			padding-top: 8.3333%;
+			@media screen and (min-width: 59.6875em) {
+				margin: 0 0 0 1px;
+			}
+			@media screen and (min-width: 87.6875em) {
+				margin: 0 4.3333% 0 8.3333%;
+			}
+
+			.entry-header,
+			.entry-content {
+				padding: 0 3rem 3rem 3rem;
+			}
+
+			#buddypress {
+				margin-bottom: $spacing-val-lg;
+			}
+		} // .article
+	} // .main
+
+	.site-footer {
+		margin: 0 4%;
+		@media screen and (min-width: 59.6875em) {
+			margin: 0 0 0 35.2941%;
+			width: 61.8235%;
+		}
+	}
+} // .buddypress (body class)
+
+/**
+*-------------------------------------------------------------------------------
+* @section 2.0 - Navigation - General
+*-------------------------------------------------------------------------------
+*/
+
+// Remove 2015 border bottom on BP links/spans
+
+.buddypress #buddypress {
+	.item-list-tabs,
+	.activity-header,
+	.activity-inner,
+	.activity-comments,
+	.item-title,
+	.load-more,
+	.field-visibility-settings-toggle,
+	#latest-update,
+	table,
+	.avatar-nav-items {
+		a { border-bottom: 0; }
+	}
+
+	.pagination-links {
+		a,
+		span { border-bottom: 0; }
+	}
+} // close .buddypress #buddypress
+
+/**
+*----------------------------------------------------------
+* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs)
+*
+* The main navigational elements for all BP screens
+*----------------------------------------------------------
+*/
+
+// We have a need to override BP specifity
+// so some rulesets sets are seemingly over weighted in selectors
+
+#buddypress {
+
+	// active/current states all navs
+	div.item-list-tabs {
+		ul {
+			li.selected {
+				a {
+					background: $dark-background;
+					color: #fff;
+					opacity: 1;
+				}
+			}
+		}
+	}
+	// Global Nav Styles
+	div.item-list-tabs {
+		ul {
+			background-color: $light-background;
+			border-bottom: 1px solid rgba($border-light, 0.9);
+			border-top: 1px solid rgba($border-light, 0.9);
+			overflow: hidden;
+			padding: $spacing-val-xs 0;
+
+			li {
+				a {
+					span {border-radius: 25%;}
+				}
+			}
+		}
+	}
+
+	/*__ Horizontal menus __*/
+	#object-nav {
+
+		ul {
+			overflow: hidden;
+			li {float: none;}
+			li:not(.selected) {
+				a {opacity: 0.7;}
+			}
+
+			@media screen and (min-width: 38.75em) {
+				li {
+					float: left;
+				}
+			}
+		}
+	}
+
+	div#subnav.item-list-tabs {
+		margin-top: 0;
+
+		ul {
+			background-color: $light-background;
+			border-bottom: 0;
+			padding: 0;
+
+			li.last {
+				background: $content-background;
+				margin-top: 0;
+				padding: $spacing-val-xs $spacing-val-xs $spacing-val-xs 0;
+				width: 100%;
+
+				select,
+				select:focus {
+					background: transparent;
+					border: 0;
+					outline: 0;
+				}
+
+				select,
+				label,
+				option {
+					@include font-size(14);
+				}
+
+				select {
+					font-style: italic;
+				}
+			}
+
+			@media screen and (min-width: 38.75em) {
+				li.last {
+					text-align: right;
+				}
+			}
+		} // close ul
+	} // close #subnav
+
+	// active/current states all navs
+	div.item-list-tabs {
+		ul {
+			li.selected,
+			li.current {
+				a {
+					background: $dark-background;
+					color: #fff;
+					opacity: 1;
+				}
+			}
+		}
+	}
+
+} // close #buddypress
+
+	/*__ Vertical menu User Account / Group single screens __*/
+
+// This block contains rules to re-factor the item-body structural element
+// to sit alongside the vert menu
+
+@media screen and (min-width: 55em) {
+	.bp-user #buddypress,
+	.single-item.groups #buddypress {
+		background: $light-background;
+	}
+
+	#buddypress {
+		#item-header,
+		#item-body {
+			background: $content-background;
+		}
+
+		#object-nav {
+			border-right: 1px solid $border-med;
+			float: left;
+			margin-right: -1px;
+			width: 200px;
+
+			ul {
+				border-bottom: 0;
+				padding: 0;
+
+				li {
+					float: none;
+					overflow: hidden;
+
+					span {
+						background: $content-background;
+						border-radius: 10%;
+						float: right;
+						margin-right: 2px;
+					}
+				}
+			}
+		}
+
+		#item-body {
+			border-left: 1px solid $border-med;
+			overflow: hidden;
+			padding: 0 0 0 $spacing-val-md;
+			width: auto;
+
+			#subnav {
+				margin: 0 0 0 (-$spacing-val-md);
+			}
+		}
+
+	} // close  #buddypress
+} // close @media
+
+/**
+*----------------------------------------------------------
+* @section 2.2 - Pagination
+*----------------------------------------------------------
+*/
+
+#buddypress {
+	div.pagination {
+		box-shadow: none;
+		.pag-count {margin-left: 0;}
+		.pagination-links {
+			margin-right: 0;
+
+			span,
+			a {
+				height: auto;
+				line-height: 1;
+				padding: 5px;
+			}
+
+			.prev,
+			.next {
+				background-color: transparent;
+				color: inherit;
+				overflow: visible;
+				width: auto;
+				&:before {display: none;}
+			}
+
+			.prev {
+				left: auto;
+				position: static;
+			}
+
+			.next {
+				position: static;
+				right: auto;
+			}
+		} // close .pagination-links
+	} // close .pagination
+} // close #buddypress
+
+/**
+*-------------------------------------------------------------------------------
+* @section 4.0 - BP Lists / Loops Generic
+*-------------------------------------------------------------------------------
+*/
+
+// Adjusts Meta items and various elements to match 2015 font-family
+#buddypress {
+	.item-list {
+		.activity-header,
+		.activity-meta {
+			@include default-font-sans();
+		}
+	}
+}
+
+// Trying to position the action div absolute has bad consequences where
+// aditional items are displayed, floating is an alternative that
+// allows natural flow expansion.
+// This block:
+// * Manages li items, Stacks them small screen, floated left at wider screens.
+// * Adjusts display of action buttons at small screen mobile up.
+// Adjusts Meta items to match 2015 font-family
+
+#buddypress {
+	ul.item-list {
+		li {
+			overflow: hidden !important;
+
+			// Undo BP floats to center avatars initially mobile up
+			.item-avatar {
+				margin-bottom: $spacing-val-sm;
+				@media screen and (min-width: 38.75em) { margin-bottom: 0; }
+				text-align: center;
+				a {border-bottom: 0;}
+				img.avatar {
+					display: inline-block;
+					float: none;
+					// Quite early on we need to move avatars to the left(right)
+					@media screen and (min-width: 38.75em) {
+						display: block;
+						float: left;
+					}
+				}
+			}
+
+			.item {
+				margin-left: 25%;
+
+				span.activity {font-style: italic;}
+
+				.item-desc {
+					margin-left: 0;
+					width: 70%;
+				}
+			}
+
+			@media screen and (min-width: 59.6875em) {
+				.item-avatar,
+				.item,
+				.action {
+					float: left;
+				}
+
+				.item {
+					left: 10%;
+					margin-left: 0;
+					position: relative;
+					width: 55%;
+				}
+			}// close @media
+
+			div.action {
+				clear: left;
+				float: none;
+				margin-bottom: -$spacing-val-md;
+				// remove BP margin left
+				margin-left: 0;
+				padding: $spacing-val-md 0 $spacing-val-xs;
+				// push the actions to the right
+				@media screen and (min-width: 59.6875em) {
+					clear: none;
+					float: right;
+					margin-bottom: 0;
+					padding: 0;
+				}
+				position: relative;
+				text-align: left;
+				top: 0;
+
+				div {
+					display: inline-block;
+					margin: $spacing-val-sm 0;
+					width: 100%;
+
+					a {
+						display: block;
+						width: 100%;
+					}
+					// Provisionally lets keep the 'action' div
+					//position but inline-block the buttons
+
+					@media screen and (min-width: 38.75em) {
+						// keep buttons to a row small tablet up
+						margin: 0 $spacing-val-sm $spacing-val-sm 0;
+						width: auto;
+					} // close @media
+
+					@media screen and (min-width: 59.6875em) {
+						// take buttons to block to stack them when floated right
+						clear: right;
+						float: right;
+						margin: 0 0 $spacing-val-sm 0;
+					} // close @media
+
+				} // close div
+
+				.meta {
+					font-style: italic;
+				}
+
+			} // close .action
+
+		} // close li
+	} // close .item-list
+} // close #buddypress
+
+/**
+*----------------------------------------------------------
+* @section 4.1 - Activity
+*----------------------------------------------------------
+*/
+
+/**
+*-----------------------------------------------------
+* @section 4.1.1 - Activity Whats New
+*-----------------------------------------------------
+*/
+
+#buddypress {
+	form#whats-new-form {
+
+		// Line-height issue inherited from BP rules, override.
+		p.activity-greeting {
+			line-height: 1.4;
+		}
+
+		textarea {width: 100%;}
+		// corrective measure for clipped elements due to JS inline styling
+
+		@media screen and (max-width: 30em) {
+			#whats-new-post-in-box {
+				select {
+					@include font-size(14);
+					max-width: 120px;
+				}
+			}
+		}
+
+		@media screen and (max-width: 38.75em) {
+			#whats-new-content {
+				clear: left;
+				margin: $spacing-val-sm 0 $spacing-val-lg;
+				padding: $spacing-val-sm 0 0;
+
+				#whats-new-submit {
+					float: none;
+
+					input {width: 100%;}
+				}
+			}
+
+			#whats-new-options {
+				display: flex;
+				flex-direction: column;
+
+				#whats-new-submit {order: 2;}
+				#whats-new-post-in-box {order: 1;}
+			}
+		} // close @media
+
+		#whats-new-options[style] {
+			min-height: 6rem;
+			overflow: visible;
+
+			#whats-new-post-in-box {
+				border: 1px solid rgba($border-color, 0.5);
+				float: left;
+				line-height: 1.5em;
+				margin-top: 12px;
+				padding-left: 0.2em;
+				width: 100%;
+
+				select {
+					background: none;
+					border: 0;
+					float: right;
+					margin: 0;
+					min-height: 1.5em;
+					outline: 0;
+					padding-left: 0.4em;
+				}
+			}
+
+			@media screen and (min-width: 30em) {
+				#whats-new-post-in-box {
+					width: auto;
+				}
+
+				#whats-new-submit {
+					float: right;
+				}
+			}
+
+		} // close #whats-new-options
+
+	} // close #whats-new-form
+
+	// User account form requires matching bp default specificity
+	#item-body {
+		form#whats-new-form {
+			margin: $spacing-val-lg 0;
+		}
+	}
+} // close #buddypress
+
+/**
+*-----------------------------------------------------
+* @section 4.1.2 - Activity Listing
+*-----------------------------------------------------
+*/
+
+#buddypress {
+
+	#activity-stream {
+
+		// re-size activity avatars and stack small screen
+		// refactor main elements positioning medium up.
+		li {
+			padding: 25px 0 15px;
+
+			.activity-avatar {
+				float: none;
+				text-align: center;
+
+				a {
+					display: inline-block;
+
+					img.avatar {
+						display: inline;
+						float: none;
+						height: 60px;
+						margin-bottom: $spacing-val-md;
+						margin-left: 0;
+						width: 60px;
+					}
+				}
+			} // close .activity-avatar
+
+			.activity-content {
+				margin-left: 0;
+
+				.activity-header {
+					@include font-size(14);
+				}
+			}
+
+			@media screen and (min-width: 46.25em) {
+
+				.activity-avatar {
+					float: left;
+					margin-right: $spacing-val-sm;
+					text-align: left;
+					a {border-bottom: 0;}
+				}
+
+				.activity-content {
+					margin: 0;
+					overflow: hidden;
+
+					.activity-header {
+						@include font-size(16);
+					}
+				}
+
+			} // close @media
+
+		} // close li
+
+		li.mini {
+			.activity-avatar {
+				a {
+					img.avatar {
+						height: 30px;
+						margin-left: 15px;
+						width: 30px;
+					}
+				}
+			}
+
+			.activity-content {
+				.activity-header {
+					@include font-size(13);
+				}
+			}
+		}
+
+		.activity-content {
+			margin-top: -12px;
+
+			.activity-header {
+				line-height: inherit;
+				margin-right: 0;
+
+				p {
+					background-color: $light-background;
+					border: 1px solid rgba($border-light, 0.6);
+					padding: 0 0.2em;
+				}
+
+				img.avatar {
+					display: inline-block;
+					margin-bottom: 0 !important; // have to match to BP
+				}
+			} // close .activity-header
+
+			.activity-meta {
+				a {
+					display: block;
+					margin: 0 0 $spacing-val-xs;
+					@media screen and (min-width: 38.75em) {
+						display: inline-block;
+						margin: 0;
+					}
+				}
+			}
+
+		} // close .activity-content
+
+		.load-more {
+			background: $light-background;
+			border: 1px solid transparent;
+			padding: $spacing-val-sm;
+
+			&:focus,
+			&:hover {
+				background: darken($light-background, 1%);
+				border: 1px solid rgba(#9fd1e2, 0.3);
+				a { font-style: italic; }
+			}
+
+			a {
+				display: block;
+			}
+		}
+
+	} // close #activity-stream
+} // close #buddypress
+
+/* Single activity view  - activity permalink */
+
+.activity-permalink {
+	#buddypress {
+		background: none; // counter the .bp-user faux column background
+		#activity-stream {
+
+			li.activity-item {
+				padding: $spacing-val-md 0;
+			}
+
+			li.mini {
+				.activity-header {
+					@include font-size(16);
+					@media screen and (min-width: 46.25em) {
+						@include font-size(20);
+					}
+					margin-bottom: $spacing-val-lg;
+					p {padding: $spacing-val-md;}
+				}
+			}
+		}
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @section 4.1.3 - Activity Comments
+*-----------------------------------------------------
+*/
+#buddypress {
+
+	#activity-stream {
+		.activity-comments {
+			margin: $spacing-val-sm 0 0;
+
+			&.has-comments {
+				border-left: 1px solid $border-light;
+			}
+
+			.ac-form {
+				padding: $spacing-val-md 0 0;
+			}
+
+			> ul {
+				background: rgba($light-background, 0.6);
+				margin: 15px 0 0 2px;
+				@media screen and (min-width: 38.75em) {
+					margin-left: 70px;
+				}
+
+				ul {
+					// all nested ul margins & padding flattened initially
+					margin-left: 1%;
+					padding-left: 0;
+
+					@media screen and (min-width: 30em) {
+						margin-left: 1%;
+						padding-left: 1em;
+					}
+				}
+
+				ul li {
+					border-left: 1px solid $border-light;
+					border-top: 0;
+					padding-left: 0.2em;
+				}
+
+				.acomment-meta {border-bottom: 1px solid $border-light; font-style: italic;}
+
+				// Display the user avatar stacked up to 30em
+				// reduce/widen the content margins
+				@media screen and (max-width: 38.75em) {
+					.acomment-avatar {
+						display: block;
+						text-align: center;
+
+						a,
+						img.avatar {display: inline; float: none;}
+					}
+
+					.acomment-content,
+					.acomment-meta,
+					.acomment-options {
+						margin: $spacing-val-xs;
+					}
+
+					.acomment-content {padding: 0 $spacing-val-sm;}
+				} // close @media
+
+			} // close the ul li comments construct
+
+			.ac-reply-avatar {display: none;}
+
+			.ac-reply-content {
+				margin-left: 0;
+				padding-left: 0;
+			}
+
+			@media screen and (min-width: 38.75em) {
+				.ac-reply-avatar {display: block;}
+
+				.ac-reply-content {
+					overflow: hidden;
+				}
+			}
+
+			.ac-form {
+
+				input[type="submit"],
+				.ac-reply-cancel {
+					color: rgba($body-text, 0.8);
+					display: inline-block;
+					font-family: inherit;
+					@include font-size(12);
+					font-weight: normal;
+					line-height: 1.2;
+					padding: 4px 10px;
+					text-transform: lowercase;
+					width: 100px;
+				}
+
+				.ac-reply-cancel {
+					border: 1px solid rgba($border-color, 0.7);
+					text-align: center;
+
+					&:focus,
+					&:hover {
+						background: $bp-button-hover;
+					}
+				}
+
+			} // close .ac-form
+
+		} // close .activity-comments
+	} // close .activity
+
+} // close #buddypress
+
+/**
+*----------------------------------------------------------
+* @section 4.2 - Members Loop
+*----------------------------------------------------------
+*/
+
+#buddypress {
+	#members-list {
+
+		@media screen and (min-width: 59.6875em) {
+			li {
+				.item-avatar,
+				.item {
+					float: left;
+				}
+
+				.action {
+					float: right;
+				}
+			}
+		}
+
+	} // close #members-list
+} //close #BuddyPress
+
+/**
+*-------------------------------------------------------------------------------
+* @section 6.0 - Single Item screens: User Account & Single Group Screens
+*-------------------------------------------------------------------------------
+*/
+
+
+/**
+*-----------------------------------------------------------
+* @subsection 6.1 - Item Header Global
+*-----------------------------------------------------------
+*/
+
+.bp-user,
+.single-item.groups {
+	@media screen and (max-width: 46.25em) {
+		main {
+			header.entry-header {
+				padding-bottom: 1rem;
+			}
+		}
+	}
+
+	@media screen and (max-width: 38.75em) {
+		h1,
+		#item-header-content {
+			text-align: center;
+		}
+	}
+
+	#buddypress {
+		@media screen and (max-width: 46.25em) {
+			#item-header {
+				.generic-button {
+					float: none;
+					margin: 1.5em 0 0 0;
+				}
+			}
+		}
+
+		@media screen and (max-width: 38.75em) {
+			h1 {
+				margin-bottom: 0;
+			}
+
+			#item-header-avatar {
+				img.avatar {
+					margin-right: 0;
+				}
+			}
+
+			#item-header-content {
+				width: 100%;
+			}
+		}
+	}
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.1.1 - item-header Groups
+*
+* Group Specific Item Header
+*-----------------------------------------------------
+*/
+
+.single-item.groups {
+	#buddypress {
+		@media screen and (max-width: 46.25em) {
+			#item-header {
+				#item-meta {
+					margin-bottom: $spacing-val-md;
+				}
+			}
+		}
+
+		// Move visual flow of avatar & item-actions at narrow width,
+		// avatar first after group title
+		@media screen and (max-width: 38.75em) {
+			div#item-header {
+				display: flex;
+				flex-direction: column;
+
+				#item-header-avatar {
+					order: 1;
+					text-align: center;
+
+					a {
+						border-bottom: 0;
+
+						img {
+							display: inline-block;
+							float: none;
+						}
+					}
+				}
+
+				#item-header-content {order: 2;}
+
+				#item-actions {order: 3;}
+			}
+		} // close @media
+
+		div#item-header {
+			padding-bottom: $spacing-val-lg;
+
+			div#item-actions {
+				margin: 0;
+				width: 100%;
+
+				@media screen and (min-width: 38.75em) {
+					clear: none;
+					float: right;
+					width: 50%;
+				}
+
+				h3 {
+					background: $dark-background;
+					color: $content-background;
+					@include font-size(14);
+
+					@media screen and (min-width: 46.25em) {
+						@include font-size(16);
+					}
+					padding: 0.2em;
+				}
+			} // close item-actions
+
+			@media screen and (min-width: 46.25em) {
+
+				#item-header-avatar,
+				#item-header-content {
+					float: left;
+				}
+
+				#item-header-avatar {
+					width: 21%;
+				}
+
+				#item-header-content {
+					margin-left: 4%;
+					width: 40%;
+				}
+
+				div#item-actions {
+					float: right;
+					width: 28%;
+				}
+
+			} // close @media
+
+		} // close #item-header
+	} // close #buddypress
+} // close .groups
+
+/**
+*-----------------------------------------------------
+* @subsection 6.1.2 - Item Header User Accounts
+*
+* User Accounts Specific Item Header
+*-----------------------------------------------------
+*/
+
+.bp-user {
+	#buddypress {
+		#item-header {
+			padding: $spacing-val-md 0;
+
+			#item-header-avatar {
+				text-align: center;
+				width: 100%;
+
+				img.avatar,
+				a {
+					border-bottom: 0;
+					display: inline-block;
+					float: none;
+				}
+			}
+
+			@media screen and (min-width: 46.25em) {
+				#item-header-avatar {
+					float: left;
+					width: 20%;
+
+					img.avatar,
+					a {
+						float: left;
+						width: 100%;
+					}
+				}
+
+				#item-header-content {
+					float: right;
+					margin-right: 5%;
+					width: 69%;
+				}
+
+			} // close @media
+
+		} // close #item-header
+
+	} // close #buddypress
+} // close .bp-user
+
+/**
+*-----------------------------------------------------------
+* @subsection 6.2 - Item Body: Global
+*-----------------------------------------------------------
+*/
+// Manage the margins inherited from 2015 inside the item-body sections
+// generally far too large a top margin for headings in our lists
+#item-body {
+	h1,
+	h2,
+	h3,
+	h4,
+	h5,
+	h6 {
+		margin: 1em 0;
+
+		a {border-bottom: 0;}
+	}
+}
+/**
+*----------------------------------------------------
+* @subsection 6.2.1 - Item Body Groups
+*
+* Groups specific item body rules -  screens
+*----------------------------------------------------
+*/
+
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.1 - Group Management
+*-----------------------------------------
+*/
+
+// headings settings screens & general global settings styles
+.groups {
+	#group-settings-form {
+		h4 {
+			background: $dark-background;
+			color: $content-background;
+			padding: 0.2em;
+		}
+		// remove backgrounds from request list member names.
+		#request-list {
+			h4 {
+				background: none;
+				color: inherit;
+			}
+		}
+	}
+}
+
+.groups.edit-details {
+	#group-settings-form {
+
+		label {
+			background: $dark-background;
+			@include border-top-radius(4px);
+			color: $content-background;
+			display: inline-block;
+			margin-bottom: 0;
+			padding: 0.2em;
+			width: 80%;
+
+			@media screen and (min-width: 38.75em) {
+				width: 60%;
+			}
+
+		}
+
+		textarea + p label {
+			background: none;
+			color: inherit;
+			@include font-size(14);
+			width: auto;
+		}
+
+	}
+} // close .groups.edit-details
+
+.groups.group-settings {
+	#group-settings-form,
+	#create-group-form {
+
+		div.radio {
+			label {
+				border: 1px solid $border-light;
+				padding: 0.2em;
+			}
+
+			ul {
+				color: rgba($body-text, 0.6);
+				@include font-size(14);
+			}
+		}
+
+	}
+} // close .groups.group-settings
+
+.groups.group-avatar {
+
+	form > p {
+		margin-top: $spacing-val-md;
+	}
+
+}
+
+.groups.manage-members {
+	#group-settings-form {
+		.item-list {
+			li {
+				border-bottom: 1px solid $border-light;
+
+				img,
+				h5 {
+					float: left;
+
+					> a {border-bottom: 0;}
+				}
+
+				span.small {
+					clear: left;
+					display: block;
+					float: none;
+					margin-top: $spacing-val-sm;
+
+					a {
+						display: inline-block;
+						margin: $spacing-val-xs 0;
+						width: 100%;
+
+						@media screen and (min-width: 38.75em) {
+							width: auto;
+						}
+					}
+				}
+
+				h5 {
+					margin: 0;
+				}
+
+			}
+		}
+	}
+} // close .groups.manage-members
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.2 - Group members
+*-----------------------------------------
+*/
+
+/* Members loop */
+
+.groups.group-members {
+	#buddypress {
+		#members-group-list {
+			li {
+
+				@media screen and (max-width: 30em) {
+					> a {
+						border-bottom: 0;
+						display: block;
+						margin-bottom: $spacing-val-sm;
+						text-align: center;
+
+						img.avatar {
+							display: inline;
+							float: none;
+						}
+					}
+				}
+
+				h5 {
+					display: inline-block;
+					@include font-size(14);
+
+					@media screen and (min-width: 59.6875em) {
+						@include font-size(16);
+					}
+					margin: 0;
+
+					a {border-bottom: 0;}
+				} //  close h5
+
+				span.activity {
+					@include font-size(12);
+				}
+
+				.action {
+					top: 0;
+				}
+			} // close li
+		}
+	}
+}
+
+// Massage the members search for groups nav specifically.
+.groups.group-members {
+	#subnav {
+		li {
+			@media screen and (max-width: 38.75em) {
+				background: $content-background;
+				padding: $spacing-val-md 0;
+			}
+			width: 100%;
+
+			#search-members-form {
+				float: right;
+
+				@media screen and (max-width: 38.75em) {
+					margin: 0;
+					width: 100%;
+
+					label {
+						input[type="text"] {width: 100%;}
+					}
+				}
+
+				margin: $spacing-val-xs $spacing-val-xs 0 0;
+			}
+		}
+	}
+}
+
+/**
+*-----------------------------------------
+* @subsection 6.2.1.3 - Group Send Invites
+*-----------------------------------------
+*/
+
+.groups.group-invites {
+	#item-body {
+		.item-list {
+			.action {
+				margin-bottom: 0;
+			}
+		}
+	}
+
+	@media screen and (min-width: 46.25em) {
+		#buddypress {
+			#item-body {
+				#message {
+					margin-top: 0;
+				}
+			}
+		}
+	}
+
+	@media screen and (min-width: 55em) {
+		#buddypress {
+			#send-invite-form { margin-top: 0;}
+		}
+	}
+
+	#item-body {
+		@media screen and (max-width: 46.25em) {
+			.left-menu {
+				float: none;
+				margin: $spacing-val-sm 0;
+
+				#invite-list {
+					height: auto;
+					width: auto;
+ 			}
+ 		}
+
+			.main-column {
+				margin-left: 0;
+ 		}
+
+			.submit {
+				input {
+					display: inline-block;
+					width: 100%;
+ 			}
+ 		}
+ 	}
+ }
+
+}
+
+/**
+*-----------------------------------------------------
+* @subsection 6.2.2 - Item Body User Accounts
+*
+* User Account specific item body rules
+*-----------------------------------------------------
+*/
+
+.bp-user {
+	.entry-title {
+		margin-bottom: 0.5em;
+	}
+}
+
+/**
+*--------------------------------------------
+* @subsection 6.2.2.1 - classes, pag, filters
+*--------------------------------------------
+*/
+
+.bp-user {
+
+	#buddypress {
+
+		table {
+			th {@include font-size(14)}
+			td {@include font-size(12)}
+
+			@media screen and (min-width: 46.25em) {
+				th {@include font-size(16)}
+				td {@include font-size(14)}
+			}
+
+			@media screen and (min-width: 77.5em) {
+				th {@include font-size(18)}
+				td {@include font-size(16)}
+			}
+		}
+
+		.pag-count {font-style: italic;}
+
+		.notifications-options-nav,
+		.messages-options-nav {
+			float: left;
+			width: 100%;
+			@media screen and (min-width: 30em) {
+				width: 50%;
+			}
+
+			select,
+			input {
+				@include font-size(14);
+				outline: 0;
+				padding: 0;
+			}
+
+			select {
+				float: left;
+				margin-right: 0;
+				width: 100%;
+
+				@media screen and (min-width: 30em) {
+					width: 60%;
+				}
+			}
+
+			input {
+				float: right;
+				@include default-font-serif();
+				line-height: 1.5;
+				margin-top: $spacing-val-sm;
+				width: 100%;
+
+				&[disabled]:hover {background: none;}
+
+				@media screen and (min-width: 30em) {
+					margin-top: 0;
+					width: 38%;
+				}
+			}
+
+		} // close .notifications-options-nav
+
+	} // close #BuddyPress
+
+} // close .bp-user
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.2 - Extended Profiles
+	*-------------------------------------------
+	*/
+
+.bp-user {
+	#buddypress {
+		.profile {
+			.bp-widget {
+				h4 {
+					background: lighten($dark-background, 10%);
+					color: #fff;
+					margin-bottom: 0;
+					padding: 0.4em;
+				}
+
+				table {margin-top: 0;}
+			}
+		}
+	}
+}
+
+/* Edit Profile */
+.bp-user {
+	#buddypress {
+
+		.profile {
+			#profile-edit-form {
+				.button-nav:before,
+				.button-nav:after {
+					content: " ";
+					display: table;
+				}
+
+				.button-nav:after {
+					clear: both;
+				}
+
+				ul.button-nav {
+					border-bottom: 1px solid $border-light;
+					margin-left: 0;
+
+					li {
+						float: left;
+						margin-bottom: 0;
+
+						&.current {
+							border: 1px solid $border-light;
+							border-bottom-color: #fff;
+							margin-bottom: -1px;
+						}
+					} // li
+
+					a {
+						background: none;
+						border: 0;
+						@include font-size(18)
+					}
+				} //.button-nav
+
+				.field-visibility-settings-toggle,
+				.field-visibility-settings {
+					@include font-size(14);
+				}
+
+				.field-visibility-settings-close,
+				.visibility-toggle-link {
+					background: $dark-background;
+					color: #fff;
+					padding: 0.2em 0.5em;
+				}
+			} // close profile form
+
+			.bp-avatar {
+				#bp-delete-avatar {
+					a {font-size: inherit; }
+				}
+			}
+		} // close .profile
+
+	} // close #BuddyPress
+} // close .bp-user
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.3 - Groups
+	*-------------------------------------------
+	*/
+.bp-user {
+
+	#buddypress {
+
+		#groups-list {
+			li {
+				.item {
+					@media screen and (min-width: 77.5em) {
+						left: 5%;
+						width: 50%;
+					}
+				}
+			}
+		}
+
+	} // close #BuddyPress
+
+} // close .bp-user
+
+/**
+	*-------------------------------------------
+	* @subsection 6.2.2.5 - Private Messaging
+	*-------------------------------------------
+	*/
+
+.bp-user {
+
+	#buddypress {
+
+		#message-thread {
+		//Single message view
+			a {
+				border-bottom: 0;
+			}
+
+			#message-subject {
+				background: lighten($dark-background, 10%);
+				color: $content-background;
+				padding: 0.3em 0 0.3em 0.2em;
+			}
+
+			#message-recipients {
+				font-style: italic;
+
+				a.confirm {
+					border: 1px solid $border-light;
+					font-style: normal;
+				}
+			}
+
+			.message-metadata {
+				overflow: hidden;
+
+				img.avatar {
+					float: none;
+				}
+
+				@media screen and (min-width: 46.25em) {
+					img.avatar {
+						float: left;
+					}
+				}
+
+				.message-star-actions {
+					float: right;
+					margin-right: $spacing-val-xs;
+					position: static;
+				}
+			} // close .message-meta
+
+			.message-content {
+				background: $light-background;
+				border: 1px solid $border-light;
+				margin: $spacing-val-sm 0 0 0;
+				padding: 0.3em;
+			}
+
+			#send-reply {
+				.message-content {
+					background: $content-background;
+					border: 0;
+				}
+			}
+
+			.alt {
+				background: $content-background;
+			}
+
+		} // close message-thread  Singular view!
+
+		#message-threads {
+			thead {
+				tr {
+					background: lighten($dark-background, 10%);
+				}
+			}
+
+			tr {
+				td {
+					background: $content-background;
+					display: inline-block;
+					float: left;
+				}
+
+				td.thread-star,
+				td.thread-options {
+					border-bottom-color: darken($border-light, 20%);
+					border-bottom-width: 2px;
+					height: 2.4em;
+					padding-bottom: 0.2em;
+					padding-top: 0.2em;
+
+					@media screen and (max-width: 46.25em) {
+						padding-top: 0;
+					}
+				}
+
+				td.bulk-select-check,
+				td.thread-from {
+					height: 2.6em;
+					@media screen and (max-width: 38.75em) {
+						height: 5.2em;
+					}
+				}
+
+				td.thread-from,
+				td.thread-options {
+					border-left: 0 !important;
+					@include calc(width, "100% - 30px");
+					margin-left: 0;
+				}
+
+				td.thread-info {
+					padding-left: 41px;
+					width: 100%;
+
+					a::after {
+						content: " \2013 \00a0"attr(title);
+						@include font-size(12);
+					}
+				}
+
+				td.thread-options {
+					text-align: right;
+
+					a {
+						@include font-size(12);
+						line-height: 2.2;
+					}
+				}
+
+				span.from {
+					display: none;
+				}
+
+				span.activity {
+					display: block;
+					float: right;
+					line-height: 2;
+					@media screen and (max-width: 38.75em) {
+						clear: both;
+						@include font-size(11);
+						width: 100%;
+					}
+				}
+			}
+
+			tr.unread {
+				td {
+					background: $unread;
+					border-bottom-color: darken($border-light, 20%);
+					border-color: darken($border-light, 10%);
+				}
+			}
+
+			th {
+				display: none;
+			}
+
+			th.bulk-select-all {
+				border-bottom: 0;
+				display: inline-block;
+				text-align: left;
+			}
+
+			th.bulk-select-all,
+			td.bulk-select-check,
+			td.thread-star {
+				border-right: 0;
+				width: 30px;
+			}
+		}
+
+	/* Auto Complete background */
+		.acfb-holder {
+
+			li.friend-tab {
+				margin-right: 0;
+
+				a {
+					border-bottom: 0;
+
+					img {
+	 				// this is the tiny user avatar
+						display: inline;
+						height: 20px;
+						margin-right: 0.5em;
+						width: 20px !important; // override inline style
+	 			}
+	 		}
+	 	}
+		}
+
+		/* Sitewide Notices loop */
+		#message-threads.sitewide-notices {
+			td {
+				width: 100%;
+
+				strong {
+					background: lighten($dark-background, 10%);
+					color: $content-background;
+					display: block;
+					margin-bottom: 0.4em;
+					padding-left: 0.2em;
+				}
+
+				a {
+					display: inline-block;
+				}
+			}
+
+			td:first-child {
+				display: none;
+			}
+
+			td:first-child + td + td {
+			// notice date
+				border-bottom: 0;
+
+				span {
+					line-height: 1;
+				}
+			}
+
+			td:last-child {
+			// notice actions
+				border-bottom-color: darken($border-light, 20%);
+				line-height: 1;
+				text-align: right;
+
+				a:last-child {
+				// hide the 'x' text
+					line-height: 0;
+					margin-left: 0.7em;
+					text-indent: -999em;
+				}
+
+				a:last-child::after {
+					content: attr(title);
+					display: block;
+					line-height: initial;
+					text-indent: 0;
+				}
+			}
+		}
+
+	} // close #BuddyPress
+
+} // close .bp-user
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.6 - Settings
+	*------------------------------
+	*/
+
+.bp-user {
+	#buddypress {
+
+		#settings-form {
+			// 'p' = email notification screen sub heading
+			> p {
+				@include font-size(20);
+				margin: $spacing-val-md 0 $spacing-val-sm;
+			}
+		}
+
+		table.notification-settings {
+			th.title {width: 75%;}
+			td.yes,
+			td.no {
+				vertical-align: middle;
+			}
+		}
+		// Profile visibility table td widths
+		table.profile-settings {
+			width: 100%;
+
+			th.field-group-name,
+			td.field-name {
+				width: 50%;
+			}
+
+			@media screen and (min-width: 46.25em) {
+				th.field-group-name,
+				td.field-name {
+					width: 70%;
+				}
+			}
+
+			th.title,
+			td.field-visibility {
+				width: 30%;
+			}
+
+			td.field-visibility {
+				select {width: 100%;}
+			}
+		}
+
+	} // close #BuddyPress
+
+} // close .bp-user
+
+/**
+*-------------------------------------------------------------------------------
+* @section 7.0 - Forms  - General
+*-------------------------------------------------------------------------------
+*/
+
+// Match BP form elements to Themes(2015) styling where styles
+// are not inherited or being overriden.
+#buddypress {
+
+	div.activity-comments {
+		form {
+			.ac-textarea {
+				background: $light-background;
+				border: 1px solid rgba($border-color, 0.3);
+
+				textarea {
+					background: none;
+					border: 0;
+				}
+			}
+		}
+	}
+
+	select {border: 1px solid rgba($border-color, 0.5);}
+
+} // close #buddypress
+
+
+#buddypress {
+
+	// Manage form control widths override BP 75% width.
+
+	.standard-form,
+	.group-create-form {
+		li {float: none;}
+		input[type='text'],
+		textarea {
+			width: 100%;
+		}
+	}
+
+	div.dir-search,
+	div.message-search,
+	li.groups-members-search
+	 {
+		float: none;
+		margin: $spacing-val-sm 0;
+
+		// Stylise the seach form elements, in part this deals with padding
+		// issues on the submit & sizing issues between bp styles & twentyfifteen
+
+		form { // *sigh* only to bludgeon over specified rules
+			border: 1px solid rgba($border-color, 0.4);
+			overflow: hidden;
+
+			label {
+				float: left;
+				width: 80%;
+			}
+
+			input[type='text'] {
+				float: left;
+				margin: 0;
+				width: 80%;
+			}
+
+			input[type='text'],
+			input[type='submit'] {
+				@include font-size(14);
+				border: 0;
+				line-height: inherit;
+			}
+
+			input[type='text'] {
+				border-right: 1px solid rgba($border-color, 0.4);
+				padding: 0.2em 0 0.2em 0.2em;
+			}
+
+			input[type='submit'] {
+				float: right;
+				font-weight: normal;
+				padding: 0.2em 1em;
+				text-align: center;
+				text-transform: none;
+				width: 20%;
+		 	}
+		}// close form
+
+	} // close .dir-search, .message-search
+
+	// Shift the search parent to the right and allow to shrinkwrap
+	@media screen and (min-width: 38.75em) {
+		div.dir-search,
+		div.message-search,
+		li.groups-members-search {
+			float: right;
+			margin-bottom: 5px !important;
+
+			form {
+				label,
+				input[type='text'],
+				input[type='submit'] {
+					width: auto;
+				}
+			}
+		}
+	} // close @media
+
+	// Attempt to replicate the 2015 breakpoint font resizing for buttons/submits
+//	@media screen and (min-width: 59.6875em) {
+//		.dir-search,
+//	 .message-search {
+	//		form {
+	//			input[type='text'] { @include font-size(14) ;}
+	//			input[type='submit'] {@include font-size(14);}
+	//		}
+	//	}
+//	}
+
+	@media screen and (min-width: 77.5em) {
+
+		.dir-search,
+		.message-search {
+			form {
+				input[type='text'] { @include font-size(16) ;}
+				input[type='submit'] { @include font-size(16) ;}
+			}
+		}
+	}
+
+} // close #buddypress
+
+/**
+*-------------------------------------------------------------------------------
+* @section 8.0 - Tables - General
+*-------------------------------------------------------------------------------
+*/
+
+// Adjust table font sizes, default too large proportionally
+// This approach will require refinement and perhaps re-location to
+// a more general typography section to manage BP elements grouped under
+// breakpoints. Provide top/bottom margins for tables, lacking in BP styles
+#buddypress {
+	table {
+		@include font-size(14);
+		margin: $spacing-val-md 0;
+
+		tr th {
+			background: lighten($dark-background, 10%);
+			border-color: darken($border-light, 20%);
+			color: $content-background;
+		}
+
+		// Reduce the themes inherited paragraph margins in tables
+		p {margin-bottom: 0.5em;}
+	}
+
+	@media screen and (min-width: 55em) {
+		table {@include font-size(16);}
+	}
+}
+
+/*__ User Account tables __*/
+
+#buddypress {
+
+	// Manage some table cells widths that are disproportionate to their content
+	.notifications,
+	.messages-notices {
+		th {
+			width: 30%;
+
+			&.bulk-select-all {
+				text-align: center;
+				width: 10%;
+			}
+		}
+
+		.bulk-select-check,
+		.thread-star {
+			text-align: center;
+		}
+
+		.notification-actions,
+		td.thread-options {
+			text-align: center;
+
+			a {
+				display: inline-block;
+				margin: 0;
+				padding: 0;
+			}
+		}
+
+		// Notices action buttons, this maybe better moved, temp for now to address
+		// styling issues - this will need styling ideas
+		td {
+			.button {
+				border: 0;
+				display: block;
+				padding: 0;
+				text-align: center;
+			}
+		}
+
+	} // .notifications, .message-notices
+} // #buddypress
+
+/**
+*-------------------------------------------------------------------------------
+* @section 9.0 - Error / Success messages
+*-------------------------------------------------------------------------------
+*/
+
+// message args ($variable-color, text-color)
+// Leave text-color undefined to automagically set text color
+// to background color darker by 50%
+
+#buddypress {
+	#item-body {
+		div#message {
+			margin-top: $spacing-val-md;
+			@media screen and (min-width: 55em) {
+				margin-right: $spacing-val-md;
+			}
+		}
+	}
+
+	div#message {
+		p {
+			@include font-size(18);
+			font-weight: bold;
+		}
+
+		&.info {
+			p {
+				@include message-box($notice-info);
+			}
+		}
+
+		&.updated {
+			p {
+				@include message-box($notice-update);
+			}
+		}
+
+	} // close #message
+
+} // close  #buddypress
+
+// Without direct classes on our mesages ( 'warning' )
+// we need to use the body classes
+.delete-group {
+	#buddypress {
+		div#message.info {
+
+			p {
+				@include message-box($notice-warning);
+			}
+		}
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 10.0 - Ajax Loading, Widgets, General classes
+*-------------------------------------------------------------------------------
+*/
+
+#buddypress {
+	/* Auto Complete background */
+	.acfb-holder {
+
+		li.friend-tab {
+			background: $notice-info;
+			border: inherit;
+	 }
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..8f987c0ec77d730cdd2867d01d41c96f01747e6c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen-rtl.css
@@ -0,0 +1,1469 @@
+@charset "UTF-8";
+/*------------------------------------------------------------------------------
+
+This is the BuddyPress companion stylesheet for
+the WordPress Twentyfourteen theme.
+
+This sheet supports the primary BuddyPress styles in buddypress.css
+
+If you are running as a child theme of twentyfourteen this stylesheet will be
+loaded by default. If you want to modify the styles the normal BP Theme Compat
+hierarchy works and you can copy the file to buddypress/css/ or community/css/
+in your child themes root & either start over or modify the ruelesets.
+
+If you do not require the styles you can dequeue them from the themes functions file.
+
+Please see this codex article for more information:
+http://codex.buddypress.org/themes/buddypress-companion-stylesheets/
+
+--------------------------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+--------------------------------------------------------------------------------
+1.0 Theme Structural Elements
+2.0 - Navigation - General
+	2.1 - Navs - Object Nav / Sub Nav (item-list-tabs)
+	2.2 - Pagination
+3.0 - Images
+4.0 - BP Lists / Loops Generic
+	4.1 - Activity Loop
+		4.1.1 - Activity Whats new
+		4.1.2 - Activity Listing
+		4.1.3 - Activity Comments
+	4.2 - Members Loop
+	4.3 - Groups Loop
+	4.4 - Blogs Loop
+5.0 - Directories - Members, Groups, Blogs, Forums
+6.0 - Single Item screens: User Account & Single Group Screens
+	6.1 - Item Headers: Global
+		6.1.1 - Item-header: Groups;
+		6.1.2 -  item-header: User Accounts
+	6.2 - Item Body: Global
+		6.2.1 - item-body: Groups
+			6.2.1.1- Management settings screens
+			6.2.1.2 - Group members list
+			6.2.1.3 - Group Send Invites
+		6.2.2 - item-body: User Accounts
+			6.2.2.1 - classes, pag, filters
+			6.2.2.2 - Extended Profiles
+			6.2.2.3 - Groups
+			6.2.2.4 - friends
+			6.2.2.5 - Private Messaging Threads
+			6.2.2.6 - Settings
+7.0 - Forms  -  General
+8.0 - Tables -  General
+9.0 - Error / Success Messages
+10.0 - Ajax Loading
+11.0 - Widgets
+------------------------------------------------------------------------------*/
+/**
+*-------------------------------------------------------------------------------
+* @section - 1.0 - Theme - Structural Elements
+*-------------------------------------------------------------------------------
+*/
+#buddypress h1,
+#buddypress h2,
+#buddypress h3,
+#buddypress h4,
+#buddypress h5,
+#buddypress h6 {
+	clear: none;
+}
+
+.buddypress .site-content {
+	padding-bottom: 20px;
+	padding-top: 4%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress .site-content {
+		padding-top: 0;
+	}
+}
+
+.buddypress .site-content article {
+	margin: 0 4%;
+	padding-top: 0;
+}
+
+.buddypress .site-content article .entry-header,
+.buddypress .site-content article .entry-content {
+	max-width: 100%;
+	padding: 0;
+}
+
+.buddypress .site-content article #buddypress {
+	margin-bottom: 40px;
+}
+
+/**
+* ------------------------------------------------------------------------------
+* @section 2.0 - Navigation - General
+*-------------------------------------------------------------------------------
+*/
+/**
+*----------------------------------------------------------
+* @subsection 2.1 - Object Nav / Subnav (item-list-tabs)
+*
+* The main navigational elements for all BP screens
+*----------------------------------------------------------
+*/
+#buddypress .item-list-tabs ul li {
+	width: 100%;
+}
+
+@media screen and (min-width: 400px) {
+	#buddypress .item-list-tabs ul li {
+		width: 50%;
+	}
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress .item-list-tabs ul li {
+		width: auto;
+	}
+}
+
+.directory #buddypress .item-list-tabs ul:before,
+.directory #buddypress .item-list-tabs ul:after {
+	content: " ";
+	display: table;
+}
+
+.directory #buddypress .item-list-tabs ul:after {
+	clear: both;
+}
+
+.directory #buddypress .item-list-tabs ul {
+	border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+	padding-bottom: 10px;
+}
+
+@media screen and (min-width: 783px) {
+	.directory #buddypress .item-list-tabs ul {
+		padding-bottom: 0;
+	}
+	.directory #buddypress .item-list-tabs ul li.selected {
+		border: 1px solid rgba(0, 0, 0, 0.2);
+		border-bottom-color: #fff;
+		-webkit-border-top-left-radius: 4px;
+		border-top-left-radius: 4px;
+		-webkit-border-top-right-radius: 4px;
+		border-top-right-radius: 4px;
+		background-clip: padding-box;
+		margin-bottom: -1px;
+	}
+	.directory #buddypress .item-list-tabs ul li.selected a {
+		background: none;
+		outline: none;
+	}
+}
+
+.directory #buddypress #subnav ul {
+	border-bottom: 0;
+}
+
+/* List last filters global */
+#buddypress #subnav li#activity-filter-select.last {
+	line-height: 2.1;
+	margin-top: 0;
+}
+
+@media screen and (max-width: 783px) {
+	#buddypress #object-nav ul {
+		border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+		overflow: hidden;
+		padding-bottom: 10px;
+	}
+	#buddypress div#subnav.item-list-tabs {
+		margin-bottom: 40px;
+	}
+	#buddypress div#subnav.item-list-tabs ul li {
+		width: auto;
+	}
+}
+
+/*__ Vertical Menu User Account Screens __*/
+@media screen and (min-width: 783px) {
+	.bp-user #buddypress,
+	.single-item.groups #buddypress {
+		background: #d8d8d8;
+	}
+	#buddypress #item-header,
+	#buddypress #item-body {
+		background: #fff;
+	}
+	#buddypress #item-body {
+		border-right: 1px solid #bebebe;
+	}
+	#buddypress #object-nav {
+		background: #d8d8d8;
+		border-left: 1px solid #bebebe;
+		float: right;
+		margin-left: -1px;
+		width: 200px;
+	}
+	#buddypress #object-nav ul {
+		border-bottom: 0;
+		border-top: 1px solid #bebebe;
+		padding: 0;
+	}
+	#buddypress #object-nav ul li {
+		float: none;
+		overflow: hidden;
+	}
+	#buddypress #object-nav ul li:focus,
+	#buddypress #object-nav ul li:hover {
+		background: #bebebe;
+	}
+	#buddypress #object-nav ul li span {
+		border-radius: 10%;
+		float: left;
+		margin-left: 15px;
+	}
+	#buddypress #object-nav ul li.current {
+		background: #f1f1f1;
+	}
+	#buddypress #item-body {
+		overflow: hidden;
+		padding: 0 20px;
+		width: auto;
+	}
+	#buddypress #item-body #subnav {
+		border: 1px solid #bebebe;
+		border-right: 0;
+		border-left: 0;
+		margin: 0 -20px 20px;
+	}
+	#buddypress #item-body #subnav li:focus,
+	#buddypress #item-body #subnav li:hover {
+		background: #bebebe;
+	}
+	#buddypress #item-body #subnav li.current {
+		background: #f1f1f1;
+	}
+	#buddypress #item-body #subnav li#activity-filter-select:focus,
+	#buddypress #item-body #subnav li#activity-filter-select:hover {
+		background: none;
+	}
+	#buddypress #item-body #subnav li#activity-filter-select select {
+		max-width: 130px;
+	}
+}
+
+/**
+*----------------------------------------------------------
+* @subsection 2.2 - Pagination
+*----------------------------------------------------------
+*/
+#buddypress div.pagination .pag-count {
+	margin-right: 0;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 4.0 - BP Lists / Loops Generic
+*-------------------------------------------------------------------------------
+*/
+#buddypress .item-list .item-title a {
+	display: block;
+	font-size: 22px;
+	font-size: 1.375rem;
+	text-decoration: none;
+}
+
+#buddypress .item-list .item-title span.update,
+#buddypress .item-list .item-title span a {
+	font-size: 12px;
+	font-size: 0.75rem;
+}
+
+#buddypress ul.item-list li {
+	overflow: hidden !important;
+}
+
+#buddypress ul.item-list li .item-avatar {
+	float: none;
+	margin-bottom: 20px;
+	text-align: center;
+}
+
+#buddypress ul.item-list li .item-avatar a img.avatar {
+	float: none;
+}
+
+#buddypress ul.item-list li div.item-title {
+	float: none;
+	width: 100%;
+}
+
+#buddypress ul.item-list li div.item-title > a {
+	text-align: center;
+}
+
+#buddypress ul.item-list li .item {
+	margin-right: 0;
+}
+
+#buddypress ul.item-list li div.item-desc {
+	margin-right: 0;
+	width: auto;
+}
+
+#buddypress ul.item-list li div.action {
+	clear: both;
+	float: none;
+	margin: 0;
+	position: relative;
+	text-align: right;
+}
+
+#buddypress ul.item-list li div.action div {
+	margin: 0 0 10px;
+}
+
+#buddypress ul.item-list li .activity-meta,
+#buddypress ul.item-list li .action {
+	float: none;
+}
+
+#buddypress ul.item-list li .activity-meta a,
+#buddypress ul.item-list li .activity-meta div,
+#buddypress ul.item-list li .action a,
+#buddypress ul.item-list li .action div {
+	display: block;
+	margin: 5px 0;
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress ul.item-list li .item-avatar {
+		float: right;
+		margin-bottom: 0;
+	}
+	#buddypress ul.item-list li div.item-title > a {
+		text-align: right;
+	}
+	#buddypress ul.item-list li .item {
+		float: left;
+		margin-right: 5%;
+		width: 80%;
+	}
+	#buddypress ul.item-list li .activity-meta {
+		clear: both;
+	}
+	#buddypress ul.item-list li .activity-meta a,
+	#buddypress ul.item-list li .activity-meta div {
+		display: inline-block;
+		margin: 5px 0 0 5px;
+	}
+}
+
+@media screen and (min-width: 783px) {
+	#buddypress ul.item-list li .item {
+		float: right;
+		width: 55%;
+	}
+	#buddypress ul.item-list li .item div.item-desc {
+		margin: 0;
+		width: auto;
+	}
+	#buddypress ul.item-list li div.action {
+		clear: none;
+		float: left;
+		top: 0;
+		width: 25%;
+	}
+	#buddypress ul.item-list li div.action div {
+		display: block;
+	}
+	#buddypress ul.item-list li div.action div a {
+		-webkit-box-sizing: border-box;
+		-moz-box-sizing: border-box;
+		box-sizing: border-box;
+		display: block;
+		width: 100%;
+	}
+	#buddypress ul.item-list li div.action .meta {
+		text-align: center;
+	}
+}
+
+#buddypress ul.item-list li .meta,
+#buddypress ul.item-list li .item-meta .activity {
+	font-style: italic;
+}
+
+/**
+*------------------------------------------------------------
+* @section 4.1 - Activity
+*------------------------------------------------------------
+*/
+/**
+*-------------------------------------------------
+* @subsection 4.1.1 - Activity What's New
+*-------------------------------------------------
+*/
+#buddypress form#whats-new-form {
+	margin: 40px 0;
+}
+
+#buddypress form#whats-new-form #whats-new-avatar {
+	float: none;
+	margin-bottom: 20px;
+	text-align: center;
+}
+
+#buddypress form#whats-new-form #whats-new-content,
+#buddypress form#whats-new-form p.activity-greeting {
+	margin-right: 0;
+	padding-right: 0;
+}
+
+#buddypress form#whats-new-form p.activity-greeting {
+	clear: right;
+	line-height: inherit;
+	margin-bottom: 5px;
+}
+
+#buddypress form#whats-new-form textarea#whats-new {
+	width: 100%;
+}
+
+#buddypress form#whats-new-form #whats-new-content #whats-new-options[style] {
+	height: auto !important;
+}
+
+@media screen and (max-width: 594px) {
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options {
+		display: flex;
+		flex-direction: column;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit {
+		order: 2;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit input {
+		width: 100%;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box {
+		margin-top: 10px;
+		order: 1;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box select {
+		margin-top: 5px;
+		max-width: 100%;
+		width: 100%;
+	}
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress form#whats-new-form #whats-new-avatar {
+		float: right;
+	}
+	#buddypress form#whats-new-form #whats-new-content,
+	#buddypress form#whats-new-form p.activity-greeting {
+		clear: none;
+		overflow: hidden;
+		padding-right: 20px;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.2 - Activity Listing
+*-------------------------------------------------
+*/
+#buddypress #activity-stream {
+	margin-top: 40px;
+}
+
+#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar {
+	float: none;
+	margin-bottom: 10px;
+	text-align: center;
+}
+
+#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar {
+	display: inline;
+	float: none;
+}
+
+#buddypress .activity-list li.mini .activity-avatar img.avatar {
+	margin-right: 0;
+}
+
+#buddypress .activity-list li.mini .activity-meta a {
+	font-size: 12px;
+	font-size: 0.75rem;
+}
+
+#buddypress .activity-list .activity-content {
+	margin: 0;
+}
+
+#buddypress .activity-list .activity-content .activity-header {
+	margin: -0.5em 0 0;
+}
+
+#buddypress .activity-list .activity-content .activity-header > p {
+	line-height: 1.4;
+	margin-top: -10px;
+}
+
+#buddypress .activity-list .activity-content .activity-header img.avatar {
+	margin-bottom: 0 !important;
+	vertical-align: middle;
+}
+
+#buddypress .activity-list .activity-content .activity-inner {
+	margin: 10px 0;
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar {
+		float: right;
+		margin: 0 0 0 20px;
+	}
+	#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar {
+		display: inline;
+		float: none;
+	}
+	#buddypress .activity-list li.mini .activity-avatar {
+		margin: 0 5% 0 10px;
+	}
+	#buddypress .activity-list .activity-content {
+		margin-right: 0;
+		overflow: hidden;
+	}
+}
+
+body.activity-permalink #buddypress {
+	background: transparent;
+}
+
+@media screen and (max-width: 760px) {
+	body.activity-permalink #buddypress .activity-list li .activity-content,
+	body.activity-permalink #buddypress .activity-list li .activity-comments {
+		margin-right: 0;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.3 - Activity Comments
+*-------------------------------------------------
+*/
+#buddypress .activity .activity-comments {
+	margin-right: 0;
+	margin-top: 5px;
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress .activity .activity-comments {
+		margin-right: 70px;
+	}
+}
+
+#buddypress .activity .activity-comments ul {
+	background: rgba(247, 247, 247, 0.6);
+	margin: 30px 2px 0 0;
+}
+
+#buddypress .activity .activity-comments ul ul {
+	border-right: 1px solid rgba(0, 0, 0, 0.1);
+	padding-right: 2%;
+}
+
+@media screen and (max-width: 400px) {
+	#buddypress .activity .activity-comments .acomment-avatar {
+		display: block;
+		text-align: center;
+	}
+	#buddypress .activity .activity-comments .acomment-avatar a,
+	#buddypress .activity .activity-comments .acomment-avatar img.avatar {
+		display: inline;
+		float: none;
+	}
+	#buddypress .activity .activity-comments .acomment-content,
+	#buddypress .activity .activity-comments .acomment-meta,
+	#buddypress .activity .activity-comments .acomment-options {
+		margin: 5px;
+	}
+	#buddypress .activity .activity-comments .acomment-content {
+		padding: 0 10px;
+	}
+}
+
+#buddypress .activity .activity-comments .ac-form input[type="submit"],
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel {
+	color: rgba(43, 43, 43, 0.8);
+	display: inline-block;
+	font-family: inherit;
+	font-size: 12px;
+	font-size: 0.75rem;
+	font-weight: normal;
+	line-height: 1.2;
+	padding: 4px 10px;
+	text-transform: lowercase;
+	width: 100px;
+}
+
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel {
+	border: 1px solid rgba(0, 0, 0, 0.2);
+	text-align: center;
+}
+
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:focus,
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:hover {
+	background: #ededed;
+}
+
+/**
+*------------------------------------------------------------
+* @section 4.2 - Members Loop
+*------------------------------------------------------------
+*/
+/*
+*-------------------------------------------------------------------------------
+* @section 6.0 - Single Item screens
+*-------------------------------------------------------------------------------
+*/
+/* groups & user account page entry title */
+.single-item.groups .entry-title,
+.bp-user .entry-title {
+	background: #4d4d4d;
+	color: #fff;
+	font-size: 22px;
+	font-size: 1.375rem;
+	margin-bottom: 10px;
+	padding: 0.2em;
+}
+
+@media screen and (min-width: 673px) {
+	.single-item.groups .entry-title,
+	.bp-user .entry-title {
+		font-size: 28px;
+		font-size: 1.75rem;
+	}
+}
+
+/**
+*------------------------------------------------------------
+* @subsection 6.1 - Item Header: Global
+*------------------------------------------------------------
+*/
+#buddypress div#item-header {
+	padding-bottom: 10px;
+}
+
+#buddypress div#item-header img.avatar {
+	margin: 0 0 10px 20px;
+}
+
+#buddypress div#item-header #message {
+	clear: both;
+	margin-bottom: 5px;
+	padding-top: 10px;
+}
+
+#buddypress div#item-header #message p {
+	margin-bottom: 0;
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.1.1 - item-header: Groups
+*-------------------------------------------------
+*/
+@media screen and (max-width: 594px) {
+	.single-item.groups #buddypress div#item-header {
+		display: flex;
+		flex-direction: column;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar {
+		order: 1;
+		text-align: center;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a {
+		border-bottom: 0;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a img {
+		display: inline-block;
+		float: none;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		order: 2;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions {
+		margin-right: 0;
+		order: 3;
+		text-align: right;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions ul {
+		margin-right: 0;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions ul li {
+		float: right;
+	}
+	.single-item.groups #buddypress div#item-header #message {
+		order: 4;
+	}
+}
+
+.single-item.groups #buddypress #item-header #item-actions {
+	float: none;
+	margin: 0 20px 0 0;
+	width: auto;
+}
+
+.single-item.groups #buddypress #item-header #item-actions h3 {
+	font-size: 20px;
+	font-size: 1.25rem;
+}
+
+.single-item.groups #buddypress #item-header #item-header-avatar {
+	text-align: center;
+}
+
+.single-item.groups #buddypress #item-header #item-header-content {
+	float: none;
+	overflow: hidden;
+}
+
+@media screen and (min-width: 594px) {
+	.single-item.groups #buddypress #item-header #item-actions {
+		float: left;
+	}
+	.single-item.groups #buddypress #item-header #item-header-avatar {
+		float: right;
+	}
+	.single-item.groups #buddypress #item-header #item-header-content {
+		float: none;
+		overflow: hidden;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.1.2 - item-header: User Accounts
+*-------------------------------------------------
+*/
+.bp-user #buddypress #item-header #item-header-avatar {
+	text-align: center;
+	width: 100%;
+}
+
+.bp-user #buddypress #item-header #item-header-avatar img {
+	float: none;
+}
+
+.bp-user #buddypress #item-header #latest-update {
+	margin-bottom: 10px;
+}
+
+@media screen and (max-width: 594px) {
+	.bp-user #buddypress #item-header #item-buttons div.generic-button {
+		display: inline-block;
+		float: none;
+		margin: 0 0 5px 0;
+		width: 100%;
+	}
+	.bp-user #buddypress #item-header #item-buttons div.generic-button a {
+		-webkit-box-sizing: border-box;
+		-moz-box-sizing: border-box;
+		box-sizing: border-box;
+		display: block;
+		width: 100%;
+	}
+}
+
+@media screen and (min-width: 673px) {
+	.bp-user #buddypress #item-header #item-header-avatar {
+		float: right;
+		overflow: hidden;
+		text-align: right;
+		width: 20%;
+	}
+	.bp-user #buddypress #item-header #item-header-avatar img {
+		margin: 0;
+	}
+	.bp-user #buddypress #item-header #item-header-content {
+		float: left;
+		width: 78%;
+	}
+	.bp-user #buddypress #item-header #item-header-content #latest-update {
+		margin-bottom: 20px;
+	}
+}
+
+/**
+*------------------------------------------------------------
+* @subsection 6.2 - Item Body: Global
+*------------------------------------------------------------
+*/
+/**
+*-------------------------------------------------
+* @subsection 6.2.1 - item-body: Groups
+*-------------------------------------------------
+*/
+/**
+	*------------------------------
+	* 6.2.1.1 - Groups Management
+	*------------------------------
+	*/
+/* Settings */
+#group-settings-form .radio strong,
+#create-group-form .radio strong {
+	font-size: 18px;
+	font-size: 1.125rem;
+}
+
+#group-settings-form .radio ul,
+#create-group-form .radio ul {
+	color: #777777;
+}
+
+#group-settings-form #group-creation-previous,
+#create-group-form #group-creation-previous {
+	margin: 10px 0;
+}
+
+/* Manage Members */
+.groups.manage-members #group-settings-form h4 {
+	margin-top: 40px;
+}
+
+.groups.manage-members #group-settings-form .item-list {
+	background: #f7f7f7;
+	border-top: 0;
+	padding: 0 0.5em;
+}
+
+.groups.manage-members #group-settings-form .item-list li {
+	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.groups.manage-members #group-settings-form .item-list li:last-child {
+	border-bottom: 0;
+}
+
+.groups.manage-members #group-settings-form .item-list li img,
+.groups.manage-members #group-settings-form .item-list li h5 {
+	clear: none;
+	float: right;
+}
+
+.groups.manage-members #group-settings-form .item-list li img > a,
+.groups.manage-members #group-settings-form .item-list li h5 > a {
+	border-bottom: 0;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small {
+	display: block;
+	float: none;
+	margin-top: 10px;
+	width: 100%;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small a {
+	display: inline-block;
+	margin: 5px 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.groups.manage-members #group-settings-form .item-list li span.small a {
+		width: auto;
+	}
+}
+
+.groups.manage-members #group-settings-form .item-list li h5 {
+	margin: 0;
+}
+
+/**
+	*------------------------------
+	* 6.2.1.2 - Group Members List
+	*------------------------------
+	*/
+#buddypress #members-group-list .item-list h5 {
+	display: inline-block;
+	margin: 0;
+}
+
+#buddypress #members-group-list .item-list span.activity {
+	padding-right: 10px;
+}
+
+#buddypress #item-body #subnav li.groups-members-search:focus,
+#buddypress #item-body #subnav li.groups-members-search:hover,
+#buddypress #item-body #subnav li.last:focus,
+#buddypress #item-body #subnav li.last:hover {
+	background: none;
+}
+
+.groups.group-members #subnav ul:before,
+.groups.group-members #subnav ul:after {
+	content: " ";
+	display: table;
+}
+
+.groups.group-members #subnav ul:after {
+	clear: both;
+}
+
+.groups.group-members #subnav ul {
+	padding: 5px 0;
+}
+
+@media screen and (max-width: 400px) {
+	.groups.group-members #subnav li {
+		background: #fff;
+		padding: 10px 0;
+		width: 100% !important;
+	}
+}
+
+.groups.group-members #subnav li #search-members-form {
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	float: right;
+}
+
+@media screen and (max-width: 400px) {
+	.groups.group-members #subnav li #search-members-form {
+		margin: 0;
+		width: 100%;
+	}
+	.groups.group-members #subnav li #search-members-form label input[type="text"] {
+		width: 100%;
+	}
+}
+
+@media screen and (min-width: 783px) {
+	.groups.group-members #subnav li #search-members-form {
+		margin-right: 3px;
+	}
+}
+
+/**
+	*------------------------------
+	* 6.2.1.3 - Groups Send Invites
+	*------------------------------
+	*/
+@media screen and (min-width: 783px) {
+	.send-invites #buddypress #item-body {
+		border-top: 1px solid #bebebe;
+	}
+}
+
+@media screen and (max-width: 400px) {
+	.send-invites #buddypress #item-body .left-menu {
+		float: none;
+	}
+	.send-invites #buddypress #item-body .left-menu #invite-list {
+		height: auto;
+		width: auto;
+	}
+	.send-invites #buddypress #item-body .main-column {
+		margin-right: 0;
+	}
+}
+
+.send-invites #buddypress #item-body li img.avatar {
+	display: block;
+	float: none;
+	margin: 10px auto;
+}
+
+.send-invites #buddypress #item-body li .action {
+	margin-top: 10px;
+	text-align: right;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.send-invites #buddypress #item-body li .action {
+		text-align: left;
+	}
+}
+
+@media screen and (min-width: 594px) {
+	.send-invites #buddypress #item-body #invite-list {
+		width: 160px;
+	}
+	.send-invites #buddypress #item-body .main-column {
+		margin-right: 190px;
+	}
+	.send-invites #buddypress #item-body li img.avatar {
+		float: right;
+		margin: 0 0 0 10px;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.2.2 - item-body: User Accounts
+*-------------------------------------------------
+*/
+/**
+	*------------------------------
+	* 6.2.2.2 - Extended Profiles
+	*------------------------------
+	*/
+#buddypress .profile .bp-widget h4 {
+	background: #999;
+	color: #fff;
+	padding: 0.4em 0.2em;
+}
+
+#buddypress .profile #profile-edit-form .button-nav:before,
+#buddypress .profile #profile-edit-form .button-nav:after {
+	content: " ";
+	display: table;
+}
+
+#buddypress .profile #profile-edit-form .button-nav:after {
+	clear: both;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav {
+	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+	margin-right: 0;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav li {
+	float: right;
+	margin-bottom: 0;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav li.current {
+	border: 1px solid rgba(0, 0, 0, 0.1);
+	border-bottom-color: #fff;
+	margin-bottom: -1px;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav a {
+	background: none;
+	border: 0;
+	font-size: 18px;
+	font-size: 1.125rem;
+}
+
+#buddypress .profile #profile-edit-form .field-visibility-settings-toggle,
+#buddypress .profile #profile-edit-form .field-visibility-settings {
+	font-size: 14px;
+	font-size: 0.875rem;
+}
+
+#buddypress .profile #profile-edit-form .field-visibility-settings-close,
+#buddypress .profile #profile-edit-form .visibility-toggle-link {
+	background: #000;
+	color: #fff;
+	padding: 0.2em 0.5em;
+}
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.5 - Messaging
+	*------------------------------
+	*/
+#buddypress {
+	/* Read Single thread */
+	/* Sitewide Notices loop */
+}
+
+#buddypress table#message-threads {
+	border-right: 1px solid rgba(0, 0, 0, 0.2);
+	border-left: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress table#message-threads tbody > tr:first-child td.bulk-select-check,
+#buddypress table#message-threads tbody > tr:first-child td.thread-from {
+	border-top: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress table#message-threads tr td {
+	background: #fff;
+	border-left: 0 !important;
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	display: inline-block;
+	float: right;
+}
+
+#buddypress table#message-threads tr td.thread-star,
+#buddypress table#message-threads tr td.thread-options {
+	border-bottom-color: rgba(0, 0, 0, 0.2);
+	border-bottom-width: 2px;
+	border-right: 0;
+	height: 2.4em;
+	padding-bottom: 0.2em;
+	padding-top: 0.2em;
+}
+
+@media screen and (max-width: 549px) {
+	#buddypress table#message-threads tr td.thread-star,
+	#buddypress table#message-threads tr td.thread-options {
+		padding-top: 0;
+	}
+}
+
+#buddypress table#message-threads tr td.bulk-select-check,
+#buddypress table#message-threads tr td.thread-from {
+	border-right: 0;
+	height: 2.6em;
+}
+
+@media screen and (max-width: 320px) {
+	#buddypress table#message-threads tr td.bulk-select-check,
+	#buddypress table#message-threads tr td.thread-from {
+		height: 5.2em;
+	}
+}
+
+#buddypress table#message-threads tr td.thread-from,
+#buddypress table#message-threads tr td.thread-options {
+	border-right: 0;
+	width: -webkit-calc(100% - 30px);
+	width: -moz-calc(100% - 30px);
+	width: calc(100% - 30px);
+	margin-right: 0;
+}
+
+#buddypress table#message-threads tr td.thread-info {
+	border-right: 0;
+	padding-right: 41px;
+	width: 100%;
+}
+
+#buddypress table#message-threads tr td.thread-info a::after {
+	content: " –  " attr(title);
+	font-size: 12px;
+	font-size: 0.75rem;
+}
+
+#buddypress table#message-threads tr td.thread-options {
+	text-align: left;
+}
+
+#buddypress table#message-threads tr td.thread-options a {
+	font-size: 12px;
+	font-size: 0.75rem;
+	line-height: 2.2;
+}
+
+#buddypress table#message-threads tr span.from {
+	display: none;
+}
+
+#buddypress table#message-threads tr span.activity {
+	display: block;
+	float: left;
+	line-height: 2;
+}
+
+@media screen and (max-width: 320px) {
+	#buddypress table#message-threads tr span.activity {
+		clear: both;
+		font-size: 11px;
+		font-size: 0.6875rem;
+		width: 100%;
+	}
+}
+
+#buddypress table#message-threads tr.unread td {
+	background: #f1f4ff;
+	border-color: rgba(0, 0, 0, 0.2);
+	border-top: 0;
+	border-width: 1px;
+}
+
+#buddypress table#message-threads th {
+	display: none;
+}
+
+#buddypress table#message-threads th.bulk-select-all {
+	border-bottom: 0;
+	display: inline-block;
+	text-align: right;
+}
+
+#buddypress table#message-threads th.bulk-select-all,
+#buddypress table#message-threads td.bulk-select-check,
+#buddypress table#message-threads td.thread-star {
+	border-left: 0;
+	width: 30px;
+}
+
+#buddypress #message-thread #message-subject {
+	background: #4d4d4d;
+	color: #fff;
+	padding: 0.5em;
+}
+
+#buddypress #message-thread .message-box .message-metadata {
+	margin-bottom: 10px;
+}
+
+#buddypress #message-thread .message-box .message-content {
+	clear: right;
+	margin-right: 0;
+}
+
+#buddypress #message-threads.sitewide-notices td {
+	width: 100%;
+}
+
+#buddypress #message-threads.sitewide-notices td strong {
+	background: #4d4d4d;
+	color: #fff;
+	font-size: 16px;
+	font-size: 1rem;
+	display: block;
+	margin-bottom: 0.4em;
+	padding: 0.2em;
+}
+
+#buddypress #message-threads.sitewide-notices td a {
+	display: inline-block;
+	line-height: initial;
+}
+
+#buddypress #message-threads.sitewide-notices td:first-child {
+	display: none;
+}
+
+#buddypress #message-threads.sitewide-notices td:first-child + td + td {
+	border-bottom: 0;
+}
+
+#buddypress #message-threads.sitewide-notices td:first-child + td + td span {
+	line-height: 1;
+}
+
+#buddypress #message-threads.sitewide-notices td:last-child {
+	border-bottom-color: rgba(0, 0, 0, 0.2);
+	line-height: 1;
+	text-align: left;
+}
+
+#buddypress #message-threads.sitewide-notices td:last-child a:last-child {
+	line-height: 0;
+	margin-right: 0.7em;
+	text-indent: -999em;
+}
+
+#buddypress #message-threads.sitewide-notices td:last-child a:last-child::after {
+	content: attr(title);
+	display: block;
+	line-height: initial;
+	text-indent: 0;
+}
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.6 - Settings
+	*------------------------------
+	*/
+#buddypress #settings-form > p {
+	font-size: 20px;
+	font-size: 1.25rem;
+}
+
+#buddypress table.notification-settings td.yes,
+#buddypress table.notification-settings td.no {
+	vertical-align: middle;
+}
+
+#buddypress table.profile-settings {
+	width: 100%;
+}
+
+#buddypress table.profile-settings th.field-group-name,
+#buddypress table.profile-settings td.field-name {
+	width: 50%;
+}
+
+@media screen and (min-width: 401px) {
+	#buddypress table.profile-settings th.field-group-name,
+	#buddypress table.profile-settings td.field-name {
+		width: 70%;
+	}
+}
+
+#buddypress table.profile-settings td.field-visibility select {
+	width: 100%;
+}
+
+/*------------------------------------------------------------------------------
+* @section - 7.0 - Forms  - General
+*-------------------------------------------------------------------------------
+*/
+#buddypress input[type="text"],
+#buddypress input[type="email"],
+#buddypress input[type="password"],
+#buddypress input[type="submit"],
+#buddypress select,
+#buddypress textarea {
+	border: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress .standard-form input[type="text"],
+#buddypress .standard-form input[type="email"],
+#buddypress .standard-form input[type="password"],
+#buddypress .standard-form input[type="submit"],
+#buddypress .standard-form textarea {
+	width: 100%;
+}
+
+#buddypress #send-reply.standard-form textarea {
+	width: 100%;
+}
+
+#buddypress div.activity-comments form .ac-textarea {
+	background: #f7f7f7;
+	border: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress div.activity-comments form .ac-textarea textarea {
+	background: none;
+	border: 0;
+}
+
+#buddypress div.dir-search,
+#buddypress div.message-search,
+#buddypress li.groups-members-search {
+	clear: both;
+	float: none;
+	margin: 10px 0;
+}
+
+#buddypress div.dir-search form,
+#buddypress div.message-search form,
+#buddypress li.groups-members-search form {
+	border: 1px solid #ccc;
+	overflow: hidden;
+}
+
+#buddypress div.dir-search form label,
+#buddypress div.message-search form label,
+#buddypress li.groups-members-search form label {
+	float: right;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress li.groups-members-search form input[type='text'] {
+	float: right;
+	margin: 0;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='text'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress li.groups-members-search form input[type='text'],
+#buddypress li.groups-members-search form input[type='submit'] {
+	border: 0;
+	font-size: 14px;
+	font-size: 0.875rem;
+	line-height: inherit;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress li.groups-members-search form input[type='text'] {
+	border-left: 1px solid #ccc;
+	padding: 0.2em 0.2em 0.2em 0;
+}
+
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress li.groups-members-search form input[type='submit'] {
+	float: left;
+	font-weight: normal;
+	padding: 0.2em 1em;
+	text-align: center;
+	text-transform: none;
+	width: 20%;
+}
+
+@media screen and (min-width: 401px) {
+	#buddypress div.dir-search,
+	#buddypress div.message-search {
+		clear: none;
+		float: left;
+	}
+	#buddypress div.dir-search form label,
+	#buddypress div.dir-search form input[type='submit'],
+	#buddypress div.dir-search form input[type='text'],
+	#buddypress div.message-search form label,
+	#buddypress div.message-search form input[type='submit'],
+	#buddypress div.message-search form input[type='text'] {
+		width: auto;
+	}
+	#buddypress div.message-search {
+		margin: 3px 0 0;
+	}
+	#buddypress li.groups-members-search form label,
+	#buddypress li.groups-members-search form input[type='submit'],
+	#buddypress li.groups-members-search form input[type='text'] {
+		width: auto;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 8.0 - Tables General
+*-------------------------------------------------------------------------------
+*/
+#buddypress table {
+	border-color: rgba(0, 0, 0, 0.2);
+}
+
+/*__ User Account tables __*/
+/**
+*-------------------------------------------------------------------------------
+* @section 9.0 - Error / Success messages
+*-------------------------------------------------------------------------------
+*/
+#buddypress div#message p {
+	font-size: 18px;
+	font-size: 1.125rem;
+	font-weight: bold;
+}
+
+#buddypress div#message.info p {
+	background: #c6e4ee;
+	border: 1px solid #78bed6;
+	color: #1e5264;
+}
+
+#buddypress div#message.updated p {
+	background: #dee6b2;
+	border: 1px solid #becc66;
+	color: #454d19;
+}
+
+.delete-group #buddypress div#message.info p {
+	background: #db7e7e;
+	border: 1px solid #be3535;
+	color: #1f0808;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 10.0 - Ajax Loading, Widgets, General classes
+*-------------------------------------------------------------------------------
+*/
+#buddypress {
+	/* Auto Complete background */
+}
+
+#buddypress .acfb-holder li.friend-tab {
+	background: #9fd1e2;
+	border: inherit;
+}
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css
new file mode 100644
index 0000000000000000000000000000000000000000..fa1ad3fc1a5e35cc51154c19005a3857aa1b06ad
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen-rtl.min.css
@@ -0,0 +1 @@
+@charset "UTF-8";#buddypress h1,#buddypress h2,#buddypress h3,#buddypress h4,#buddypress h5,#buddypress h6{clear:none}.buddypress .site-content{padding-bottom:20px;padding-top:4%}@media screen and (min-width:59.6875em){.buddypress .site-content{padding-top:0}}.buddypress .site-content article{margin:0 4%;padding-top:0}.buddypress .site-content article .entry-content,.buddypress .site-content article .entry-header{max-width:100%;padding:0}.buddypress .site-content article #buddypress{margin-bottom:40px}#buddypress .item-list-tabs ul li{width:100%}@media screen and (min-width:400px){#buddypress .item-list-tabs ul li{width:50%}}@media screen and (min-width:594px){#buddypress .item-list-tabs ul li{width:auto}}.directory #buddypress .item-list-tabs ul:after,.directory #buddypress .item-list-tabs ul:before{content:" ";display:table}.directory #buddypress .item-list-tabs ul:after{clear:both}.directory #buddypress .item-list-tabs ul{border-bottom:1px solid rgba(0,0,0,.2);padding-bottom:10px}@media screen and (min-width:783px){.directory #buddypress .item-list-tabs ul{padding-bottom:0}.directory #buddypress .item-list-tabs ul li.selected{border:1px solid rgba(0,0,0,.2);border-bottom-color:#fff;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;background-clip:padding-box;margin-bottom:-1px}.directory #buddypress .item-list-tabs ul li.selected a{background:0 0;outline:0}}.directory #buddypress #subnav ul{border-bottom:0}#buddypress #subnav li#activity-filter-select.last{line-height:2.1;margin-top:0}@media screen and (max-width:783px){#buddypress #object-nav ul{border-bottom:1px solid rgba(0,0,0,.2);overflow:hidden;padding-bottom:10px}#buddypress div#subnav.item-list-tabs{margin-bottom:40px}#buddypress div#subnav.item-list-tabs ul li{width:auto}}@media screen and (min-width:783px){.bp-user #buddypress,.single-item.groups #buddypress{background:#d8d8d8}#buddypress #item-body,#buddypress #item-header{background:#fff}#buddypress #object-nav{background:#d8d8d8;border-left:1px solid #bebebe;float:right;margin-left:-1px;width:200px}#buddypress #object-nav ul{border-bottom:0;border-top:1px solid #bebebe;padding:0}#buddypress #object-nav ul li{float:none;overflow:hidden}#buddypress #object-nav ul li:focus,#buddypress #object-nav ul li:hover{background:#bebebe}#buddypress #object-nav ul li span{border-radius:10%;float:left;margin-left:15px}#buddypress #object-nav ul li.current{background:#f1f1f1}#buddypress #item-body{border-right:1px solid #bebebe;overflow:hidden;padding:0 20px;width:auto}#buddypress #item-body #subnav{border:1px solid #bebebe;border-right:0;border-left:0;margin:0 -20px 20px}#buddypress #item-body #subnav li:focus,#buddypress #item-body #subnav li:hover{background:#bebebe}#buddypress #item-body #subnav li.current{background:#f1f1f1}#buddypress #item-body #subnav li#activity-filter-select:focus,#buddypress #item-body #subnav li#activity-filter-select:hover{background:0 0}#buddypress #item-body #subnav li#activity-filter-select select{max-width:130px}}#buddypress div.pagination .pag-count,#buddypress ul.item-list li .item{margin-right:0}#buddypress .item-list .item-title a{display:block;font-size:22px;font-size:1.375rem;text-decoration:none}#buddypress .item-list .item-title span a,#buddypress .item-list .item-title span.update{font-size:12px;font-size:.75rem}#buddypress ul.item-list li{overflow:hidden!important}#buddypress ul.item-list li .item-avatar{float:none;margin-bottom:20px;text-align:center}#buddypress ul.item-list li .item-avatar a img.avatar{float:none}#buddypress ul.item-list li div.item-title{float:none;width:100%}#buddypress ul.item-list li div.item-title>a{text-align:center}#buddypress ul.item-list li div.item-desc{margin-right:0;width:auto}#buddypress ul.item-list li div.action{clear:both;float:none;margin:0;position:relative;text-align:right}#buddypress ul.item-list li div.action div{margin:0 0 10px}#buddypress ul.item-list li .action,#buddypress ul.item-list li .activity-meta{float:none}#buddypress ul.item-list li .action a,#buddypress ul.item-list li .action div,#buddypress ul.item-list li .activity-meta a,#buddypress ul.item-list li .activity-meta div{display:block;margin:5px 0}@media screen and (min-width:594px){#buddypress ul.item-list li .item-avatar{float:right;margin-bottom:0}#buddypress ul.item-list li div.item-title>a{text-align:right}#buddypress ul.item-list li .item{float:left;margin-right:5%;width:80%}#buddypress ul.item-list li .activity-meta{clear:both}#buddypress ul.item-list li .activity-meta a,#buddypress ul.item-list li .activity-meta div{display:inline-block;margin:5px 0 0 5px}}@media screen and (min-width:783px){#buddypress ul.item-list li .item{float:right;width:55%}#buddypress ul.item-list li .item div.item-desc{margin:0;width:auto}#buddypress ul.item-list li div.action{clear:none;float:left;top:0;width:25%}#buddypress ul.item-list li div.action div{display:block}#buddypress ul.item-list li div.action div a{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:100%}#buddypress ul.item-list li div.action .meta{text-align:center}}#buddypress ul.item-list li .item-meta .activity,#buddypress ul.item-list li .meta{font-style:italic}#buddypress form#whats-new-form{margin:40px 0}#buddypress form#whats-new-form #whats-new-avatar{float:none;margin-bottom:20px;text-align:center}#buddypress form#whats-new-form #whats-new-content,#buddypress form#whats-new-form p.activity-greeting{margin-right:0;padding-right:0}#buddypress form#whats-new-form p.activity-greeting{clear:right;line-height:inherit;margin-bottom:5px}#buddypress form#whats-new-form textarea#whats-new{width:100%}#buddypress form#whats-new-form #whats-new-content #whats-new-options[style]{height:auto!important}@media screen and (max-width:594px){#buddypress form#whats-new-form #whats-new-content #whats-new-options{display:flex;flex-direction:column}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit{order:2}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit input{width:100%}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box{margin-top:10px;order:1}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box select{margin-top:5px;max-width:100%;width:100%}}@media screen and (min-width:594px){#buddypress form#whats-new-form #whats-new-avatar{float:right}#buddypress form#whats-new-form #whats-new-content,#buddypress form#whats-new-form p.activity-greeting{clear:none;overflow:hidden;padding-right:20px}}#buddypress #activity-stream{margin-top:40px}#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar{float:none;margin-bottom:10px;text-align:center}#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar{display:inline;float:none}#buddypress .activity-list li.mini .activity-avatar img.avatar{margin-right:0}#buddypress .activity-list li.mini .activity-meta a{font-size:12px;font-size:.75rem}#buddypress .activity-list .activity-content{margin:0}#buddypress .activity-list .activity-content .activity-header{margin:-.5em 0 0}#buddypress .activity-list .activity-content .activity-header>p{line-height:1.4;margin-top:-10px}#buddypress .activity-list .activity-content .activity-header img.avatar{margin-bottom:0!important;vertical-align:middle}#buddypress .activity-list .activity-content .activity-inner{margin:10px 0}@media screen and (min-width:594px){#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar{float:right;margin:0 0 0 20px}#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar{display:inline;float:none}#buddypress .activity-list li.mini .activity-avatar{margin:0 5% 0 10px}#buddypress .activity-list .activity-content{margin-right:0;overflow:hidden}}body.activity-permalink #buddypress{background:0 0}@media screen and (max-width:760px){body.activity-permalink #buddypress .activity-list li .activity-comments,body.activity-permalink #buddypress .activity-list li .activity-content{margin-right:0}}#buddypress .activity .activity-comments{margin-right:0;margin-top:5px}@media screen and (min-width:594px){#buddypress .activity .activity-comments{margin-right:70px}}#buddypress .activity .activity-comments ul{background:rgba(247,247,247,.6);margin:30px 2px 0 0}#buddypress .activity .activity-comments ul ul{border-right:1px solid rgba(0,0,0,.1);padding-right:2%}@media screen and (max-width:400px){#buddypress .activity .activity-comments .acomment-avatar{display:block;text-align:center}#buddypress .activity .activity-comments .acomment-avatar a,#buddypress .activity .activity-comments .acomment-avatar img.avatar{display:inline;float:none}#buddypress .activity .activity-comments .acomment-content,#buddypress .activity .activity-comments .acomment-meta,#buddypress .activity .activity-comments .acomment-options{margin:5px}#buddypress .activity .activity-comments .acomment-content{padding:0 10px}}#buddypress .activity .activity-comments .ac-form .ac-reply-cancel,#buddypress .activity .activity-comments .ac-form input[type=submit]{color:rgba(43,43,43,.8);display:inline-block;font-family:inherit;font-size:12px;font-size:.75rem;font-weight:400;line-height:1.2;padding:4px 10px;text-transform:lowercase;width:100px}#buddypress .activity .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(0,0,0,.2);text-align:center}#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:focus,#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:hover{background:#ededed}.bp-user .entry-title,.single-item.groups .entry-title{background:#4d4d4d;color:#fff;font-size:22px;font-size:1.375rem;margin-bottom:10px;padding:.2em}@media screen and (min-width:673px){.bp-user .entry-title,.single-item.groups .entry-title{font-size:28px;font-size:1.75rem}}#buddypress div#item-header{padding-bottom:10px}#buddypress div#item-header img.avatar{margin:0 0 10px 20px}#buddypress div#item-header #message{clear:both;margin-bottom:5px;padding-top:10px}#buddypress div#item-header #message p{margin-bottom:0}@media screen and (max-width:594px){.single-item.groups #buddypress div#item-header{display:flex;flex-direction:column}.single-item.groups #buddypress div#item-header #item-header-avatar{order:1;text-align:center}.single-item.groups #buddypress div#item-header #item-header-avatar a{border-bottom:0}.single-item.groups #buddypress div#item-header #item-header-avatar a img{display:inline-block;float:none}.single-item.groups #buddypress div#item-header #item-header-content{order:2}.single-item.groups #buddypress div#item-header #item-actions{margin-right:0;order:3;text-align:right}.single-item.groups #buddypress div#item-header #item-actions ul{margin-right:0}.single-item.groups #buddypress div#item-header #item-actions ul li{float:right}.single-item.groups #buddypress div#item-header #message{order:4}}.single-item.groups #buddypress #item-header #item-actions{float:none;margin:0 20px 0 0;width:auto}.single-item.groups #buddypress #item-header #item-actions h3{font-size:20px;font-size:1.25rem}.single-item.groups #buddypress #item-header #item-header-avatar{text-align:center}.single-item.groups #buddypress #item-header #item-header-content{float:none;overflow:hidden}@media screen and (min-width:594px){.single-item.groups #buddypress #item-header #item-actions{float:left}.single-item.groups #buddypress #item-header #item-header-avatar{float:right}.single-item.groups #buddypress #item-header #item-header-content{float:none;overflow:hidden}}.bp-user #buddypress #item-header #item-header-avatar{text-align:center;width:100%}.bp-user #buddypress #item-header #item-header-avatar img{float:none}.bp-user #buddypress #item-header #latest-update{margin-bottom:10px}@media screen and (max-width:594px){.bp-user #buddypress #item-header #item-buttons div.generic-button{display:inline-block;float:none;margin:0 0 5px;width:100%}.bp-user #buddypress #item-header #item-buttons div.generic-button a{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:100%}}@media screen and (min-width:673px){.bp-user #buddypress #item-header #item-header-avatar{float:right;overflow:hidden;text-align:right;width:20%}.bp-user #buddypress #item-header #item-header-avatar img{margin:0}.bp-user #buddypress #item-header #item-header-content{float:left;width:78%}.bp-user #buddypress #item-header #item-header-content #latest-update{margin-bottom:20px}}#create-group-form .radio strong,#group-settings-form .radio strong{font-size:18px;font-size:1.125rem}#create-group-form .radio ul,#group-settings-form .radio ul{color:#777}#create-group-form #group-creation-previous,#group-settings-form #group-creation-previous{margin:10px 0}.groups.manage-members #group-settings-form h4{margin-top:40px}.groups.manage-members #group-settings-form .item-list{background:#f7f7f7;border-top:0;padding:0 .5em}.groups.manage-members #group-settings-form .item-list li{border-bottom:1px solid rgba(0,0,0,.1)}.groups.manage-members #group-settings-form .item-list li h5>a,.groups.manage-members #group-settings-form .item-list li img>a,.groups.manage-members #group-settings-form .item-list li:last-child{border-bottom:0}.groups.manage-members #group-settings-form .item-list li h5,.groups.manage-members #group-settings-form .item-list li img{clear:none;float:right}#buddypress .profile #profile-edit-form .button-nav:after,.groups.group-members #subnav ul:after{clear:both}.groups.manage-members #group-settings-form .item-list li span.small{display:block;float:none;margin-top:10px;width:100%}.groups.manage-members #group-settings-form .item-list li span.small a{display:inline-block;margin:5px 0;width:100%}@media screen and (min-width:38.75em){.groups.manage-members #group-settings-form .item-list li span.small a{width:auto}}.groups.manage-members #group-settings-form .item-list li h5{margin:0}#buddypress #members-group-list .item-list h5{display:inline-block;margin:0}#buddypress #members-group-list .item-list span.activity{padding-right:10px}#buddypress #item-body #subnav li.groups-members-search:focus,#buddypress #item-body #subnav li.groups-members-search:hover,#buddypress #item-body #subnav li.last:focus,#buddypress #item-body #subnav li.last:hover{background:0 0}.groups.group-members #subnav ul:after,.groups.group-members #subnav ul:before{content:" ";display:table}.groups.group-members #subnav ul{padding:5px 0}.groups.group-members #subnav li #search-members-form{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:right}@media screen and (max-width:400px){.groups.group-members #subnav li{background:#fff;padding:10px 0;width:100%!important}.groups.group-members #subnav li #search-members-form{margin:0;width:100%}.groups.group-members #subnav li #search-members-form label input[type=text]{width:100%}}@media screen and (min-width:783px){.groups.group-members #subnav li #search-members-form{margin-right:3px}.send-invites #buddypress #item-body{border-top:1px solid #bebebe}}@media screen and (max-width:400px){.send-invites #buddypress #item-body .left-menu{float:none}.send-invites #buddypress #item-body .left-menu #invite-list{height:auto;width:auto}.send-invites #buddypress #item-body .main-column{margin-right:0}}.send-invites #buddypress #item-body li img.avatar{display:block;float:none;margin:10px auto}.send-invites #buddypress #item-body li .action{margin-top:10px;text-align:right;width:100%}@media screen and (min-width:38.75em){.send-invites #buddypress #item-body li .action{text-align:left}}@media screen and (min-width:594px){.send-invites #buddypress #item-body #invite-list{width:160px}.send-invites #buddypress #item-body .main-column{margin-right:190px}.send-invites #buddypress #item-body li img.avatar{float:right;margin:0 0 0 10px}}#buddypress .profile .bp-widget h4{background:#999;color:#fff;padding:.4em .2em}#buddypress .profile #profile-edit-form .button-nav:after,#buddypress .profile #profile-edit-form .button-nav:before{content:" ";display:table}#buddypress .profile #profile-edit-form ul.button-nav{border-bottom:1px solid rgba(0,0,0,.1);margin-right:0}#buddypress .profile #profile-edit-form ul.button-nav li{float:right;margin-bottom:0}#buddypress .profile #profile-edit-form ul.button-nav li.current{border:1px solid rgba(0,0,0,.1);border-bottom-color:#fff;margin-bottom:-1px}#buddypress .profile #profile-edit-form ul.button-nav a{background:0 0;border:0;font-size:18px;font-size:1.125rem}#buddypress .profile #profile-edit-form .field-visibility-settings,#buddypress .profile #profile-edit-form .field-visibility-settings-toggle{font-size:14px;font-size:.875rem}#buddypress .profile #profile-edit-form .field-visibility-settings-close,#buddypress .profile #profile-edit-form .visibility-toggle-link{background:#000;color:#fff;padding:.2em .5em}#buddypress table#message-threads{border-right:1px solid rgba(0,0,0,.2);border-left:1px solid rgba(0,0,0,.2)}#buddypress table#message-threads tbody>tr:first-child td.bulk-select-check,#buddypress table#message-threads tbody>tr:first-child td.thread-from{border-top:1px solid rgba(0,0,0,.2)}#buddypress table#message-threads tr td{background:#fff;border-left:0!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;float:right}#buddypress table#message-threads tr td.thread-options,#buddypress table#message-threads tr td.thread-star{border-bottom-color:rgba(0,0,0,.2);border-bottom-width:2px;border-right:0;height:2.4em;padding-bottom:.2em;padding-top:.2em}@media screen and (max-width:549px){#buddypress table#message-threads tr td.thread-options,#buddypress table#message-threads tr td.thread-star{padding-top:0}}#buddypress table#message-threads tr td.bulk-select-check,#buddypress table#message-threads tr td.thread-from{border-right:0;height:2.6em}#buddypress table#message-threads tr td.thread-from,#buddypress table#message-threads tr td.thread-options{border-right:0;width:-webkit-calc(100% - 30px);width:-moz-calc(100% - 30px);width:calc(100% - 30px);margin-right:0}#buddypress table#message-threads tr td.thread-info{border-right:0;padding-right:41px;width:100%}#buddypress table#message-threads tr td.thread-info a::after{content:" –  " attr(title);font-size:12px;font-size:.75rem}#buddypress table#message-threads tr td.thread-options{text-align:left}#buddypress table#message-threads tr td.thread-options a{font-size:12px;font-size:.75rem;line-height:2.2}#buddypress table#message-threads tr span.from{display:none}#buddypress table#message-threads tr span.activity{display:block;float:left;line-height:2}@media screen and (max-width:320px){#buddypress table#message-threads tr td.bulk-select-check,#buddypress table#message-threads tr td.thread-from{height:5.2em}#buddypress table#message-threads tr span.activity{clear:both;font-size:11px;font-size:.6875rem;width:100%}}#buddypress table#message-threads tr.unread td{background:#f1f4ff;border-color:rgba(0,0,0,.2);border-top:0;border-width:1px}#buddypress table#message-threads th{display:none}#buddypress table#message-threads th.bulk-select-all{border-bottom:0;display:inline-block;text-align:right}#buddypress table#message-threads td.bulk-select-check,#buddypress table#message-threads td.thread-star,#buddypress table#message-threads th.bulk-select-all{border-left:0;width:30px}#buddypress #message-threads.sitewide-notices td,#buddypress table.profile-settings{width:100%}#buddypress #message-thread #message-subject{background:#4d4d4d;color:#fff;padding:.5em}#buddypress #message-thread .message-box .message-metadata{margin-bottom:10px}#buddypress #message-thread .message-box .message-content{clear:right;margin-right:0}#buddypress #message-threads.sitewide-notices td strong{background:#4d4d4d;color:#fff;font-size:16px;font-size:1rem;display:block;margin-bottom:.4em;padding:.2em}#buddypress #message-threads.sitewide-notices td a{display:inline-block;line-height:initial}#buddypress #message-threads.sitewide-notices td:first-child{display:none}#buddypress #message-threads.sitewide-notices td:first-child+td+td{border-bottom:0}#buddypress #message-threads.sitewide-notices td:first-child+td+td span{line-height:1}#buddypress #message-threads.sitewide-notices td:last-child{border-bottom-color:rgba(0,0,0,.2);line-height:1;text-align:left}#buddypress #message-threads.sitewide-notices td:last-child a:last-child{line-height:0;margin-right:.7em;text-indent:-999em}#buddypress #message-threads.sitewide-notices td:last-child a:last-child::after{content:attr(title);display:block;line-height:initial;text-indent:0}#buddypress #settings-form>p{font-size:20px;font-size:1.25rem}#buddypress table.notification-settings td.no,#buddypress table.notification-settings td.yes{vertical-align:middle}#buddypress table.profile-settings td.field-name,#buddypress table.profile-settings th.field-group-name{width:50%}@media screen and (min-width:401px){#buddypress table.profile-settings td.field-name,#buddypress table.profile-settings th.field-group-name{width:70%}}#buddypress #send-reply.standard-form textarea,#buddypress .standard-form input[type=submit],#buddypress .standard-form input[type=text],#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form textarea,#buddypress table.profile-settings td.field-visibility select{width:100%}#buddypress input[type=submit],#buddypress input[type=text],#buddypress input[type=email],#buddypress input[type=password],#buddypress select,#buddypress textarea{border:1px solid rgba(0,0,0,.2)}#buddypress div.activity-comments form .ac-textarea{background:#f7f7f7;border:1px solid rgba(0,0,0,.2)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress div.dir-search,#buddypress div.message-search,#buddypress li.groups-members-search{clear:both;float:none;margin:10px 0}#buddypress div.dir-search form,#buddypress div.message-search form,#buddypress li.groups-members-search form{border:1px solid #ccc;overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:right;width:80%}#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit]{border:0;font-size:14px;font-size:.875rem;line-height:inherit}#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=text]{float:right;margin:0;width:80%;border-left:1px solid #ccc;padding:.2em .2em .2em 0}#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=submit]{float:left;font-weight:400;padding:.2em 1em;text-align:center;text-transform:none;width:20%}@media screen and (min-width:401px){#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form label{width:auto}#buddypress div.dir-search,#buddypress div.message-search{clear:none;float:left}#buddypress div.message-search{margin:3px 0 0}}#buddypress table{border-color:rgba(0,0,0,.2)}#buddypress div#message p{font-size:18px;font-size:1.125rem;font-weight:700}#buddypress div#message.info p{background:#c6e4ee;border:1px solid #78bed6;color:#1e5264}#buddypress div#message.updated p{background:#dee6b2;border:1px solid #becc66;color:#454d19}.delete-group #buddypress div#message.info p{background:#db7e7e;border:1px solid #be3535;color:#1f0808}#buddypress .acfb-holder li.friend-tab{background:#9fd1e2;border:inherit inherit inherit}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.css
new file mode 100644
index 0000000000000000000000000000000000000000..b00e3fe82a94a6769eaec5fcd082cf24a0a6c522
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.css
@@ -0,0 +1,1469 @@
+@charset "UTF-8";
+/*------------------------------------------------------------------------------
+
+This is the BuddyPress companion stylesheet for
+the WordPress Twentyfourteen theme.
+
+This sheet supports the primary BuddyPress styles in buddypress.css
+
+If you are running as a child theme of twentyfourteen this stylesheet will be
+loaded by default. If you want to modify the styles the normal BP Theme Compat
+hierarchy works and you can copy the file to buddypress/css/ or community/css/
+in your child themes root & either start over or modify the ruelesets.
+
+If you do not require the styles you can dequeue them from the themes functions file.
+
+Please see this codex article for more information:
+http://codex.buddypress.org/themes/buddypress-companion-stylesheets/
+
+--------------------------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+--------------------------------------------------------------------------------
+1.0 Theme Structural Elements
+2.0 - Navigation - General
+	2.1 - Navs - Object Nav / Sub Nav (item-list-tabs)
+	2.2 - Pagination
+3.0 - Images
+4.0 - BP Lists / Loops Generic
+	4.1 - Activity Loop
+		4.1.1 - Activity Whats new
+		4.1.2 - Activity Listing
+		4.1.3 - Activity Comments
+	4.2 - Members Loop
+	4.3 - Groups Loop
+	4.4 - Blogs Loop
+5.0 - Directories - Members, Groups, Blogs, Forums
+6.0 - Single Item screens: User Account & Single Group Screens
+	6.1 - Item Headers: Global
+		6.1.1 - Item-header: Groups;
+		6.1.2 -  item-header: User Accounts
+	6.2 - Item Body: Global
+		6.2.1 - item-body: Groups
+			6.2.1.1- Management settings screens
+			6.2.1.2 - Group members list
+			6.2.1.3 - Group Send Invites
+		6.2.2 - item-body: User Accounts
+			6.2.2.1 - classes, pag, filters
+			6.2.2.2 - Extended Profiles
+			6.2.2.3 - Groups
+			6.2.2.4 - friends
+			6.2.2.5 - Private Messaging Threads
+			6.2.2.6 - Settings
+7.0 - Forms  -  General
+8.0 - Tables -  General
+9.0 - Error / Success Messages
+10.0 - Ajax Loading
+11.0 - Widgets
+------------------------------------------------------------------------------*/
+/**
+*-------------------------------------------------------------------------------
+* @section - 1.0 - Theme - Structural Elements
+*-------------------------------------------------------------------------------
+*/
+#buddypress h1,
+#buddypress h2,
+#buddypress h3,
+#buddypress h4,
+#buddypress h5,
+#buddypress h6 {
+	clear: none;
+}
+
+.buddypress .site-content {
+	padding-bottom: 20px;
+	padding-top: 4%;
+}
+
+@media screen and (min-width: 59.6875em) {
+	.buddypress .site-content {
+		padding-top: 0;
+	}
+}
+
+.buddypress .site-content article {
+	margin: 0 4%;
+	padding-top: 0;
+}
+
+.buddypress .site-content article .entry-header,
+.buddypress .site-content article .entry-content {
+	max-width: 100%;
+	padding: 0;
+}
+
+.buddypress .site-content article #buddypress {
+	margin-bottom: 40px;
+}
+
+/**
+* ------------------------------------------------------------------------------
+* @section 2.0 - Navigation - General
+*-------------------------------------------------------------------------------
+*/
+/**
+*----------------------------------------------------------
+* @subsection 2.1 - Object Nav / Subnav (item-list-tabs)
+*
+* The main navigational elements for all BP screens
+*----------------------------------------------------------
+*/
+#buddypress .item-list-tabs ul li {
+	width: 100%;
+}
+
+@media screen and (min-width: 400px) {
+	#buddypress .item-list-tabs ul li {
+		width: 50%;
+	}
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress .item-list-tabs ul li {
+		width: auto;
+	}
+}
+
+.directory #buddypress .item-list-tabs ul:before,
+.directory #buddypress .item-list-tabs ul:after {
+	content: " ";
+	display: table;
+}
+
+.directory #buddypress .item-list-tabs ul:after {
+	clear: both;
+}
+
+.directory #buddypress .item-list-tabs ul {
+	border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+	padding-bottom: 10px;
+}
+
+@media screen and (min-width: 783px) {
+	.directory #buddypress .item-list-tabs ul {
+		padding-bottom: 0;
+	}
+	.directory #buddypress .item-list-tabs ul li.selected {
+		border: 1px solid rgba(0, 0, 0, 0.2);
+		border-bottom-color: #fff;
+		-webkit-border-top-right-radius: 4px;
+		border-top-right-radius: 4px;
+		-webkit-border-top-left-radius: 4px;
+		border-top-left-radius: 4px;
+		background-clip: padding-box;
+		margin-bottom: -1px;
+	}
+	.directory #buddypress .item-list-tabs ul li.selected a {
+		background: none;
+		outline: none;
+	}
+}
+
+.directory #buddypress #subnav ul {
+	border-bottom: 0;
+}
+
+/* List last filters global */
+#buddypress #subnav li#activity-filter-select.last {
+	line-height: 2.1;
+	margin-top: 0;
+}
+
+@media screen and (max-width: 783px) {
+	#buddypress #object-nav ul {
+		border-bottom: 1px solid rgba(0, 0, 0, 0.2);
+		overflow: hidden;
+		padding-bottom: 10px;
+	}
+	#buddypress div#subnav.item-list-tabs {
+		margin-bottom: 40px;
+	}
+	#buddypress div#subnav.item-list-tabs ul li {
+		width: auto;
+	}
+}
+
+/*__ Vertical Menu User Account Screens __*/
+@media screen and (min-width: 783px) {
+	.bp-user #buddypress,
+	.single-item.groups #buddypress {
+		background: #d8d8d8;
+	}
+	#buddypress #item-header,
+	#buddypress #item-body {
+		background: #fff;
+	}
+	#buddypress #item-body {
+		border-left: 1px solid #bebebe;
+	}
+	#buddypress #object-nav {
+		background: #d8d8d8;
+		border-right: 1px solid #bebebe;
+		float: left;
+		margin-right: -1px;
+		width: 200px;
+	}
+	#buddypress #object-nav ul {
+		border-bottom: 0;
+		border-top: 1px solid #bebebe;
+		padding: 0;
+	}
+	#buddypress #object-nav ul li {
+		float: none;
+		overflow: hidden;
+	}
+	#buddypress #object-nav ul li:focus,
+	#buddypress #object-nav ul li:hover {
+		background: #bebebe;
+	}
+	#buddypress #object-nav ul li span {
+		border-radius: 10%;
+		float: right;
+		margin-right: 15px;
+	}
+	#buddypress #object-nav ul li.current {
+		background: #f1f1f1;
+	}
+	#buddypress #item-body {
+		overflow: hidden;
+		padding: 0 20px;
+		width: auto;
+	}
+	#buddypress #item-body #subnav {
+		border: 1px solid #bebebe;
+		border-left: 0;
+		border-right: 0;
+		margin: 0 -20px 20px;
+	}
+	#buddypress #item-body #subnav li:focus,
+	#buddypress #item-body #subnav li:hover {
+		background: #bebebe;
+	}
+	#buddypress #item-body #subnav li.current {
+		background: #f1f1f1;
+	}
+	#buddypress #item-body #subnav li#activity-filter-select:focus,
+	#buddypress #item-body #subnav li#activity-filter-select:hover {
+		background: none;
+	}
+	#buddypress #item-body #subnav li#activity-filter-select select {
+		max-width: 130px;
+	}
+}
+
+/**
+*----------------------------------------------------------
+* @subsection 2.2 - Pagination
+*----------------------------------------------------------
+*/
+#buddypress div.pagination .pag-count {
+	margin-left: 0;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 4.0 - BP Lists / Loops Generic
+*-------------------------------------------------------------------------------
+*/
+#buddypress .item-list .item-title a {
+	display: block;
+	font-size: 22px;
+	font-size: 1.375rem;
+	text-decoration: none;
+}
+
+#buddypress .item-list .item-title span.update,
+#buddypress .item-list .item-title span a {
+	font-size: 12px;
+	font-size: 0.75rem;
+}
+
+#buddypress ul.item-list li {
+	overflow: hidden !important;
+}
+
+#buddypress ul.item-list li .item-avatar {
+	float: none;
+	margin-bottom: 20px;
+	text-align: center;
+}
+
+#buddypress ul.item-list li .item-avatar a img.avatar {
+	float: none;
+}
+
+#buddypress ul.item-list li div.item-title {
+	float: none;
+	width: 100%;
+}
+
+#buddypress ul.item-list li div.item-title > a {
+	text-align: center;
+}
+
+#buddypress ul.item-list li .item {
+	margin-left: 0;
+}
+
+#buddypress ul.item-list li div.item-desc {
+	margin-left: 0;
+	width: auto;
+}
+
+#buddypress ul.item-list li div.action {
+	clear: both;
+	float: none;
+	margin: 0;
+	position: relative;
+	text-align: left;
+}
+
+#buddypress ul.item-list li div.action div {
+	margin: 0 0 10px;
+}
+
+#buddypress ul.item-list li .activity-meta,
+#buddypress ul.item-list li .action {
+	float: none;
+}
+
+#buddypress ul.item-list li .activity-meta a,
+#buddypress ul.item-list li .activity-meta div,
+#buddypress ul.item-list li .action a,
+#buddypress ul.item-list li .action div {
+	display: block;
+	margin: 5px 0;
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress ul.item-list li .item-avatar {
+		float: left;
+		margin-bottom: 0;
+	}
+	#buddypress ul.item-list li div.item-title > a {
+		text-align: left;
+	}
+	#buddypress ul.item-list li .item {
+		float: right;
+		margin-left: 5%;
+		width: 80%;
+	}
+	#buddypress ul.item-list li .activity-meta {
+		clear: both;
+	}
+	#buddypress ul.item-list li .activity-meta a,
+	#buddypress ul.item-list li .activity-meta div {
+		display: inline-block;
+		margin: 5px 5px 0 0;
+	}
+}
+
+@media screen and (min-width: 783px) {
+	#buddypress ul.item-list li .item {
+		float: left;
+		width: 55%;
+	}
+	#buddypress ul.item-list li .item div.item-desc {
+		margin: 0;
+		width: auto;
+	}
+	#buddypress ul.item-list li div.action {
+		clear: none;
+		float: right;
+		top: 0;
+		width: 25%;
+	}
+	#buddypress ul.item-list li div.action div {
+		display: block;
+	}
+	#buddypress ul.item-list li div.action div a {
+		-webkit-box-sizing: border-box;
+		-moz-box-sizing: border-box;
+		box-sizing: border-box;
+		display: block;
+		width: 100%;
+	}
+	#buddypress ul.item-list li div.action .meta {
+		text-align: center;
+	}
+}
+
+#buddypress ul.item-list li .meta,
+#buddypress ul.item-list li .item-meta .activity {
+	font-style: italic;
+}
+
+/**
+*------------------------------------------------------------
+* @section 4.1 - Activity
+*------------------------------------------------------------
+*/
+/**
+*-------------------------------------------------
+* @subsection 4.1.1 - Activity What's New
+*-------------------------------------------------
+*/
+#buddypress form#whats-new-form {
+	margin: 40px 0;
+}
+
+#buddypress form#whats-new-form #whats-new-avatar {
+	float: none;
+	margin-bottom: 20px;
+	text-align: center;
+}
+
+#buddypress form#whats-new-form #whats-new-content,
+#buddypress form#whats-new-form p.activity-greeting {
+	margin-left: 0;
+	padding-left: 0;
+}
+
+#buddypress form#whats-new-form p.activity-greeting {
+	clear: left;
+	line-height: inherit;
+	margin-bottom: 5px;
+}
+
+#buddypress form#whats-new-form textarea#whats-new {
+	width: 100%;
+}
+
+#buddypress form#whats-new-form #whats-new-content #whats-new-options[style] {
+	height: auto !important;
+}
+
+@media screen and (max-width: 594px) {
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options {
+		display: flex;
+		flex-direction: column;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit {
+		order: 2;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit input {
+		width: 100%;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box {
+		margin-top: 10px;
+		order: 1;
+	}
+	#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box select {
+		margin-top: 5px;
+		max-width: 100%;
+		width: 100%;
+	}
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress form#whats-new-form #whats-new-avatar {
+		float: left;
+	}
+	#buddypress form#whats-new-form #whats-new-content,
+	#buddypress form#whats-new-form p.activity-greeting {
+		clear: none;
+		overflow: hidden;
+		padding-left: 20px;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.2 - Activity Listing
+*-------------------------------------------------
+*/
+#buddypress #activity-stream {
+	margin-top: 40px;
+}
+
+#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar {
+	float: none;
+	margin-bottom: 10px;
+	text-align: center;
+}
+
+#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar {
+	display: inline;
+	float: none;
+}
+
+#buddypress .activity-list li.mini .activity-avatar img.avatar {
+	margin-left: 0;
+}
+
+#buddypress .activity-list li.mini .activity-meta a {
+	font-size: 12px;
+	font-size: 0.75rem;
+}
+
+#buddypress .activity-list .activity-content {
+	margin: 0;
+}
+
+#buddypress .activity-list .activity-content .activity-header {
+	margin: -0.5em 0 0;
+}
+
+#buddypress .activity-list .activity-content .activity-header > p {
+	line-height: 1.4;
+	margin-top: -10px;
+}
+
+#buddypress .activity-list .activity-content .activity-header img.avatar {
+	margin-bottom: 0 !important;
+	vertical-align: middle;
+}
+
+#buddypress .activity-list .activity-content .activity-inner {
+	margin: 10px 0;
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar {
+		float: left;
+		margin: 0 20px 0 0;
+	}
+	#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar {
+		display: inline;
+		float: none;
+	}
+	#buddypress .activity-list li.mini .activity-avatar {
+		margin: 0 10px 0 5%;
+	}
+	#buddypress .activity-list .activity-content {
+		margin-left: 0;
+		overflow: hidden;
+	}
+}
+
+body.activity-permalink #buddypress {
+	background: transparent;
+}
+
+@media screen and (max-width: 760px) {
+	body.activity-permalink #buddypress .activity-list li .activity-content,
+	body.activity-permalink #buddypress .activity-list li .activity-comments {
+		margin-left: 0;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.3 - Activity Comments
+*-------------------------------------------------
+*/
+#buddypress .activity .activity-comments {
+	margin-left: 0;
+	margin-top: 5px;
+}
+
+@media screen and (min-width: 594px) {
+	#buddypress .activity .activity-comments {
+		margin-left: 70px;
+	}
+}
+
+#buddypress .activity .activity-comments ul {
+	background: rgba(247, 247, 247, 0.6);
+	margin: 30px 0 0 2px;
+}
+
+#buddypress .activity .activity-comments ul ul {
+	border-left: 1px solid rgba(0, 0, 0, 0.1);
+	padding-left: 2%;
+}
+
+@media screen and (max-width: 400px) {
+	#buddypress .activity .activity-comments .acomment-avatar {
+		display: block;
+		text-align: center;
+	}
+	#buddypress .activity .activity-comments .acomment-avatar a,
+	#buddypress .activity .activity-comments .acomment-avatar img.avatar {
+		display: inline;
+		float: none;
+	}
+	#buddypress .activity .activity-comments .acomment-content,
+	#buddypress .activity .activity-comments .acomment-meta,
+	#buddypress .activity .activity-comments .acomment-options {
+		margin: 5px;
+	}
+	#buddypress .activity .activity-comments .acomment-content {
+		padding: 0 10px;
+	}
+}
+
+#buddypress .activity .activity-comments .ac-form input[type="submit"],
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel {
+	color: rgba(43, 43, 43, 0.8);
+	display: inline-block;
+	font-family: inherit;
+	font-size: 12px;
+	font-size: 0.75rem;
+	font-weight: normal;
+	line-height: 1.2;
+	padding: 4px 10px;
+	text-transform: lowercase;
+	width: 100px;
+}
+
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel {
+	border: 1px solid rgba(0, 0, 0, 0.2);
+	text-align: center;
+}
+
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:focus,
+#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:hover {
+	background: #ededed;
+}
+
+/**
+*------------------------------------------------------------
+* @section 4.2 - Members Loop
+*------------------------------------------------------------
+*/
+/*
+*-------------------------------------------------------------------------------
+* @section 6.0 - Single Item screens
+*-------------------------------------------------------------------------------
+*/
+/* groups & user account page entry title */
+.single-item.groups .entry-title,
+.bp-user .entry-title {
+	background: #4d4d4d;
+	color: #fff;
+	font-size: 22px;
+	font-size: 1.375rem;
+	margin-bottom: 10px;
+	padding: 0.2em;
+}
+
+@media screen and (min-width: 673px) {
+	.single-item.groups .entry-title,
+	.bp-user .entry-title {
+		font-size: 28px;
+		font-size: 1.75rem;
+	}
+}
+
+/**
+*------------------------------------------------------------
+* @subsection 6.1 - Item Header: Global
+*------------------------------------------------------------
+*/
+#buddypress div#item-header {
+	padding-bottom: 10px;
+}
+
+#buddypress div#item-header img.avatar {
+	margin: 0 20px 10px 0;
+}
+
+#buddypress div#item-header #message {
+	clear: both;
+	margin-bottom: 5px;
+	padding-top: 10px;
+}
+
+#buddypress div#item-header #message p {
+	margin-bottom: 0;
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.1.1 - item-header: Groups
+*-------------------------------------------------
+*/
+@media screen and (max-width: 594px) {
+	.single-item.groups #buddypress div#item-header {
+		display: flex;
+		flex-direction: column;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar {
+		order: 1;
+		text-align: center;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a {
+		border-bottom: 0;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-avatar a img {
+		display: inline-block;
+		float: none;
+	}
+	.single-item.groups #buddypress div#item-header #item-header-content {
+		order: 2;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions {
+		margin-left: 0;
+		order: 3;
+		text-align: left;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions ul {
+		margin-left: 0;
+	}
+	.single-item.groups #buddypress div#item-header #item-actions ul li {
+		float: left;
+	}
+	.single-item.groups #buddypress div#item-header #message {
+		order: 4;
+	}
+}
+
+.single-item.groups #buddypress #item-header #item-actions {
+	float: none;
+	margin: 0 0 0 20px;
+	width: auto;
+}
+
+.single-item.groups #buddypress #item-header #item-actions h3 {
+	font-size: 20px;
+	font-size: 1.25rem;
+}
+
+.single-item.groups #buddypress #item-header #item-header-avatar {
+	text-align: center;
+}
+
+.single-item.groups #buddypress #item-header #item-header-content {
+	float: none;
+	overflow: hidden;
+}
+
+@media screen and (min-width: 594px) {
+	.single-item.groups #buddypress #item-header #item-actions {
+		float: right;
+	}
+	.single-item.groups #buddypress #item-header #item-header-avatar {
+		float: left;
+	}
+	.single-item.groups #buddypress #item-header #item-header-content {
+		float: none;
+		overflow: hidden;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.1.2 - item-header: User Accounts
+*-------------------------------------------------
+*/
+.bp-user #buddypress #item-header #item-header-avatar {
+	text-align: center;
+	width: 100%;
+}
+
+.bp-user #buddypress #item-header #item-header-avatar img {
+	float: none;
+}
+
+.bp-user #buddypress #item-header #latest-update {
+	margin-bottom: 10px;
+}
+
+@media screen and (max-width: 594px) {
+	.bp-user #buddypress #item-header #item-buttons div.generic-button {
+		display: inline-block;
+		float: none;
+		margin: 0 0 5px 0;
+		width: 100%;
+	}
+	.bp-user #buddypress #item-header #item-buttons div.generic-button a {
+		-webkit-box-sizing: border-box;
+		-moz-box-sizing: border-box;
+		box-sizing: border-box;
+		display: block;
+		width: 100%;
+	}
+}
+
+@media screen and (min-width: 673px) {
+	.bp-user #buddypress #item-header #item-header-avatar {
+		float: left;
+		overflow: hidden;
+		text-align: left;
+		width: 20%;
+	}
+	.bp-user #buddypress #item-header #item-header-avatar img {
+		margin: 0;
+	}
+	.bp-user #buddypress #item-header #item-header-content {
+		float: right;
+		width: 78%;
+	}
+	.bp-user #buddypress #item-header #item-header-content #latest-update {
+		margin-bottom: 20px;
+	}
+}
+
+/**
+*------------------------------------------------------------
+* @subsection 6.2 - Item Body: Global
+*------------------------------------------------------------
+*/
+/**
+*-------------------------------------------------
+* @subsection 6.2.1 - item-body: Groups
+*-------------------------------------------------
+*/
+/**
+	*------------------------------
+	* 6.2.1.1 - Groups Management
+	*------------------------------
+	*/
+/* Settings */
+#group-settings-form .radio strong,
+#create-group-form .radio strong {
+	font-size: 18px;
+	font-size: 1.125rem;
+}
+
+#group-settings-form .radio ul,
+#create-group-form .radio ul {
+	color: #777777;
+}
+
+#group-settings-form #group-creation-previous,
+#create-group-form #group-creation-previous {
+	margin: 10px 0;
+}
+
+/* Manage Members */
+.groups.manage-members #group-settings-form h4 {
+	margin-top: 40px;
+}
+
+.groups.manage-members #group-settings-form .item-list {
+	background: #f7f7f7;
+	border-top: 0;
+	padding: 0 0.5em;
+}
+
+.groups.manage-members #group-settings-form .item-list li {
+	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.groups.manage-members #group-settings-form .item-list li:last-child {
+	border-bottom: 0;
+}
+
+.groups.manage-members #group-settings-form .item-list li img,
+.groups.manage-members #group-settings-form .item-list li h5 {
+	clear: none;
+	float: left;
+}
+
+.groups.manage-members #group-settings-form .item-list li img > a,
+.groups.manage-members #group-settings-form .item-list li h5 > a {
+	border-bottom: 0;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small {
+	display: block;
+	float: none;
+	margin-top: 10px;
+	width: 100%;
+}
+
+.groups.manage-members #group-settings-form .item-list li span.small a {
+	display: inline-block;
+	margin: 5px 0;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.groups.manage-members #group-settings-form .item-list li span.small a {
+		width: auto;
+	}
+}
+
+.groups.manage-members #group-settings-form .item-list li h5 {
+	margin: 0;
+}
+
+/**
+	*------------------------------
+	* 6.2.1.2 - Group Members List
+	*------------------------------
+	*/
+#buddypress #members-group-list .item-list h5 {
+	display: inline-block;
+	margin: 0;
+}
+
+#buddypress #members-group-list .item-list span.activity {
+	padding-left: 10px;
+}
+
+#buddypress #item-body #subnav li.groups-members-search:focus,
+#buddypress #item-body #subnav li.groups-members-search:hover,
+#buddypress #item-body #subnav li.last:focus,
+#buddypress #item-body #subnav li.last:hover {
+	background: none;
+}
+
+.groups.group-members #subnav ul:before,
+.groups.group-members #subnav ul:after {
+	content: " ";
+	display: table;
+}
+
+.groups.group-members #subnav ul:after {
+	clear: both;
+}
+
+.groups.group-members #subnav ul {
+	padding: 5px 0;
+}
+
+@media screen and (max-width: 400px) {
+	.groups.group-members #subnav li {
+		background: #fff;
+		padding: 10px 0;
+		width: 100% !important;
+	}
+}
+
+.groups.group-members #subnav li #search-members-form {
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	float: left;
+}
+
+@media screen and (max-width: 400px) {
+	.groups.group-members #subnav li #search-members-form {
+		margin: 0;
+		width: 100%;
+	}
+	.groups.group-members #subnav li #search-members-form label input[type="text"] {
+		width: 100%;
+	}
+}
+
+@media screen and (min-width: 783px) {
+	.groups.group-members #subnav li #search-members-form {
+		margin-left: 3px;
+	}
+}
+
+/**
+	*------------------------------
+	* 6.2.1.3 - Groups Send Invites
+	*------------------------------
+	*/
+@media screen and (min-width: 783px) {
+	.send-invites #buddypress #item-body {
+		border-top: 1px solid #bebebe;
+	}
+}
+
+@media screen and (max-width: 400px) {
+	.send-invites #buddypress #item-body .left-menu {
+		float: none;
+	}
+	.send-invites #buddypress #item-body .left-menu #invite-list {
+		height: auto;
+		width: auto;
+	}
+	.send-invites #buddypress #item-body .main-column {
+		margin-left: 0;
+	}
+}
+
+.send-invites #buddypress #item-body li img.avatar {
+	display: block;
+	float: none;
+	margin: 10px auto;
+}
+
+.send-invites #buddypress #item-body li .action {
+	margin-top: 10px;
+	text-align: left;
+	width: 100%;
+}
+
+@media screen and (min-width: 38.75em) {
+	.send-invites #buddypress #item-body li .action {
+		text-align: right;
+	}
+}
+
+@media screen and (min-width: 594px) {
+	.send-invites #buddypress #item-body #invite-list {
+		width: 160px;
+	}
+	.send-invites #buddypress #item-body .main-column {
+		margin-left: 190px;
+	}
+	.send-invites #buddypress #item-body li img.avatar {
+		float: left;
+		margin: 0 10px 0 0;
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.2.2 - item-body: User Accounts
+*-------------------------------------------------
+*/
+/**
+	*------------------------------
+	* 6.2.2.2 - Extended Profiles
+	*------------------------------
+	*/
+#buddypress .profile .bp-widget h4 {
+	background: #999;
+	color: #fff;
+	padding: 0.4em 0.2em;
+}
+
+#buddypress .profile #profile-edit-form .button-nav:before,
+#buddypress .profile #profile-edit-form .button-nav:after {
+	content: " ";
+	display: table;
+}
+
+#buddypress .profile #profile-edit-form .button-nav:after {
+	clear: both;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav {
+	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+	margin-left: 0;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav li {
+	float: left;
+	margin-bottom: 0;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav li.current {
+	border: 1px solid rgba(0, 0, 0, 0.1);
+	border-bottom-color: #fff;
+	margin-bottom: -1px;
+}
+
+#buddypress .profile #profile-edit-form ul.button-nav a {
+	background: none;
+	border: 0;
+	font-size: 18px;
+	font-size: 1.125rem;
+}
+
+#buddypress .profile #profile-edit-form .field-visibility-settings-toggle,
+#buddypress .profile #profile-edit-form .field-visibility-settings {
+	font-size: 14px;
+	font-size: 0.875rem;
+}
+
+#buddypress .profile #profile-edit-form .field-visibility-settings-close,
+#buddypress .profile #profile-edit-form .visibility-toggle-link {
+	background: #000;
+	color: #fff;
+	padding: 0.2em 0.5em;
+}
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.5 - Messaging
+	*------------------------------
+	*/
+#buddypress {
+	/* Read Single thread */
+	/* Sitewide Notices loop */
+}
+
+#buddypress table#message-threads {
+	border-left: 1px solid rgba(0, 0, 0, 0.2);
+	border-right: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress table#message-threads tbody > tr:first-child td.bulk-select-check,
+#buddypress table#message-threads tbody > tr:first-child td.thread-from {
+	border-top: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress table#message-threads tr td {
+	background: #fff;
+	border-right: 0 !important;
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	display: inline-block;
+	float: left;
+}
+
+#buddypress table#message-threads tr td.thread-star,
+#buddypress table#message-threads tr td.thread-options {
+	border-bottom-color: rgba(0, 0, 0, 0.2);
+	border-bottom-width: 2px;
+	border-left: 0;
+	height: 2.4em;
+	padding-bottom: 0.2em;
+	padding-top: 0.2em;
+}
+
+@media screen and (max-width: 549px) {
+	#buddypress table#message-threads tr td.thread-star,
+	#buddypress table#message-threads tr td.thread-options {
+		padding-top: 0;
+	}
+}
+
+#buddypress table#message-threads tr td.bulk-select-check,
+#buddypress table#message-threads tr td.thread-from {
+	border-left: 0;
+	height: 2.6em;
+}
+
+@media screen and (max-width: 320px) {
+	#buddypress table#message-threads tr td.bulk-select-check,
+	#buddypress table#message-threads tr td.thread-from {
+		height: 5.2em;
+	}
+}
+
+#buddypress table#message-threads tr td.thread-from,
+#buddypress table#message-threads tr td.thread-options {
+	border-left: 0;
+	width: -webkit-calc(100% - 30px);
+	width: -moz-calc(100% - 30px);
+	width: calc(100% - 30px);
+	margin-left: 0;
+}
+
+#buddypress table#message-threads tr td.thread-info {
+	border-left: 0;
+	padding-left: 41px;
+	width: 100%;
+}
+
+#buddypress table#message-threads tr td.thread-info a::after {
+	content: " –  " attr(title);
+	font-size: 12px;
+	font-size: 0.75rem;
+}
+
+#buddypress table#message-threads tr td.thread-options {
+	text-align: right;
+}
+
+#buddypress table#message-threads tr td.thread-options a {
+	font-size: 12px;
+	font-size: 0.75rem;
+	line-height: 2.2;
+}
+
+#buddypress table#message-threads tr span.from {
+	display: none;
+}
+
+#buddypress table#message-threads tr span.activity {
+	display: block;
+	float: right;
+	line-height: 2;
+}
+
+@media screen and (max-width: 320px) {
+	#buddypress table#message-threads tr span.activity {
+		clear: both;
+		font-size: 11px;
+		font-size: 0.6875rem;
+		width: 100%;
+	}
+}
+
+#buddypress table#message-threads tr.unread td {
+	background: #f1f4ff;
+	border-color: rgba(0, 0, 0, 0.2);
+	border-top: 0;
+	border-width: 1px;
+}
+
+#buddypress table#message-threads th {
+	display: none;
+}
+
+#buddypress table#message-threads th.bulk-select-all {
+	border-bottom: 0;
+	display: inline-block;
+	text-align: left;
+}
+
+#buddypress table#message-threads th.bulk-select-all,
+#buddypress table#message-threads td.bulk-select-check,
+#buddypress table#message-threads td.thread-star {
+	border-right: 0;
+	width: 30px;
+}
+
+#buddypress #message-thread #message-subject {
+	background: #4d4d4d;
+	color: #fff;
+	padding: 0.5em;
+}
+
+#buddypress #message-thread .message-box .message-metadata {
+	margin-bottom: 10px;
+}
+
+#buddypress #message-thread .message-box .message-content {
+	clear: left;
+	margin-left: 0;
+}
+
+#buddypress #message-threads.sitewide-notices td {
+	width: 100%;
+}
+
+#buddypress #message-threads.sitewide-notices td strong {
+	background: #4d4d4d;
+	color: #fff;
+	font-size: 16px;
+	font-size: 1rem;
+	display: block;
+	margin-bottom: 0.4em;
+	padding: 0.2em;
+}
+
+#buddypress #message-threads.sitewide-notices td a {
+	display: inline-block;
+	line-height: initial;
+}
+
+#buddypress #message-threads.sitewide-notices td:first-child {
+	display: none;
+}
+
+#buddypress #message-threads.sitewide-notices td:first-child + td + td {
+	border-bottom: 0;
+}
+
+#buddypress #message-threads.sitewide-notices td:first-child + td + td span {
+	line-height: 1;
+}
+
+#buddypress #message-threads.sitewide-notices td:last-child {
+	border-bottom-color: rgba(0, 0, 0, 0.2);
+	line-height: 1;
+	text-align: right;
+}
+
+#buddypress #message-threads.sitewide-notices td:last-child a:last-child {
+	line-height: 0;
+	margin-left: 0.7em;
+	text-indent: -999em;
+}
+
+#buddypress #message-threads.sitewide-notices td:last-child a:last-child::after {
+	content: attr(title);
+	display: block;
+	line-height: initial;
+	text-indent: 0;
+}
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.6 - Settings
+	*------------------------------
+	*/
+#buddypress #settings-form > p {
+	font-size: 20px;
+	font-size: 1.25rem;
+}
+
+#buddypress table.notification-settings td.yes,
+#buddypress table.notification-settings td.no {
+	vertical-align: middle;
+}
+
+#buddypress table.profile-settings {
+	width: 100%;
+}
+
+#buddypress table.profile-settings th.field-group-name,
+#buddypress table.profile-settings td.field-name {
+	width: 50%;
+}
+
+@media screen and (min-width: 401px) {
+	#buddypress table.profile-settings th.field-group-name,
+	#buddypress table.profile-settings td.field-name {
+		width: 70%;
+	}
+}
+
+#buddypress table.profile-settings td.field-visibility select {
+	width: 100%;
+}
+
+/*------------------------------------------------------------------------------
+* @section - 7.0 - Forms  - General
+*-------------------------------------------------------------------------------
+*/
+#buddypress input[type="text"],
+#buddypress input[type="email"],
+#buddypress input[type="password"],
+#buddypress input[type="submit"],
+#buddypress select,
+#buddypress textarea {
+	border: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress .standard-form input[type="text"],
+#buddypress .standard-form input[type="email"],
+#buddypress .standard-form input[type="password"],
+#buddypress .standard-form input[type="submit"],
+#buddypress .standard-form textarea {
+	width: 100%;
+}
+
+#buddypress #send-reply.standard-form textarea {
+	width: 100%;
+}
+
+#buddypress div.activity-comments form .ac-textarea {
+	background: #f7f7f7;
+	border: 1px solid rgba(0, 0, 0, 0.2);
+}
+
+#buddypress div.activity-comments form .ac-textarea textarea {
+	background: none;
+	border: 0;
+}
+
+#buddypress div.dir-search,
+#buddypress div.message-search,
+#buddypress li.groups-members-search {
+	clear: both;
+	float: none;
+	margin: 10px 0;
+}
+
+#buddypress div.dir-search form,
+#buddypress div.message-search form,
+#buddypress li.groups-members-search form {
+	border: 1px solid #ccc;
+	overflow: hidden;
+}
+
+#buddypress div.dir-search form label,
+#buddypress div.message-search form label,
+#buddypress li.groups-members-search form label {
+	float: left;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress li.groups-members-search form input[type='text'] {
+	float: left;
+	margin: 0;
+	width: 80%;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='text'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress li.groups-members-search form input[type='text'],
+#buddypress li.groups-members-search form input[type='submit'] {
+	border: 0;
+	font-size: 14px;
+	font-size: 0.875rem;
+	line-height: inherit;
+}
+
+#buddypress div.dir-search form input[type='text'],
+#buddypress div.message-search form input[type='text'],
+#buddypress li.groups-members-search form input[type='text'] {
+	border-right: 1px solid #ccc;
+	padding: 0.2em 0 0.2em 0.2em;
+}
+
+#buddypress div.dir-search form input[type='submit'],
+#buddypress div.message-search form input[type='submit'],
+#buddypress li.groups-members-search form input[type='submit'] {
+	float: right;
+	font-weight: normal;
+	padding: 0.2em 1em;
+	text-align: center;
+	text-transform: none;
+	width: 20%;
+}
+
+@media screen and (min-width: 401px) {
+	#buddypress div.dir-search,
+	#buddypress div.message-search {
+		clear: none;
+		float: right;
+	}
+	#buddypress div.dir-search form label,
+	#buddypress div.dir-search form input[type='submit'],
+	#buddypress div.dir-search form input[type='text'],
+	#buddypress div.message-search form label,
+	#buddypress div.message-search form input[type='submit'],
+	#buddypress div.message-search form input[type='text'] {
+		width: auto;
+	}
+	#buddypress div.message-search {
+		margin: 3px 0 0;
+	}
+	#buddypress li.groups-members-search form label,
+	#buddypress li.groups-members-search form input[type='submit'],
+	#buddypress li.groups-members-search form input[type='text'] {
+		width: auto;
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 8.0 - Tables General
+*-------------------------------------------------------------------------------
+*/
+#buddypress table {
+	border-color: rgba(0, 0, 0, 0.2);
+}
+
+/*__ User Account tables __*/
+/**
+*-------------------------------------------------------------------------------
+* @section 9.0 - Error / Success messages
+*-------------------------------------------------------------------------------
+*/
+#buddypress div#message p {
+	font-size: 18px;
+	font-size: 1.125rem;
+	font-weight: bold;
+}
+
+#buddypress div#message.info p {
+	background: #c6e4ee;
+	border: 1px solid #78bed6;
+	color: #1e5264;
+}
+
+#buddypress div#message.updated p {
+	background: #dee6b2;
+	border: 1px solid #becc66;
+	color: #454d19;
+}
+
+.delete-group #buddypress div#message.info p {
+	background: #db7e7e;
+	border: 1px solid #be3535;
+	color: #1f0808;
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 10.0 - Ajax Loading, Widgets, General classes
+*-------------------------------------------------------------------------------
+*/
+#buddypress {
+	/* Auto Complete background */
+}
+
+#buddypress .acfb-holder li.friend-tab {
+	background: #9fd1e2;
+	border: inherit;
+}
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.min.css
new file mode 100644
index 0000000000000000000000000000000000000000..d53bb5feec471bc7ab8246bd5aa38266223355d2
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.min.css
@@ -0,0 +1 @@
+@charset "UTF-8";#buddypress h1,#buddypress h2,#buddypress h3,#buddypress h4,#buddypress h5,#buddypress h6{clear:none}.buddypress .site-content{padding-bottom:20px;padding-top:4%}@media screen and (min-width:59.6875em){.buddypress .site-content{padding-top:0}}.buddypress .site-content article{margin:0 4%;padding-top:0}.buddypress .site-content article .entry-content,.buddypress .site-content article .entry-header{max-width:100%;padding:0}.buddypress .site-content article #buddypress{margin-bottom:40px}#buddypress .item-list-tabs ul li{width:100%}@media screen and (min-width:400px){#buddypress .item-list-tabs ul li{width:50%}}@media screen and (min-width:594px){#buddypress .item-list-tabs ul li{width:auto}}.directory #buddypress .item-list-tabs ul:after,.directory #buddypress .item-list-tabs ul:before{content:" ";display:table}.directory #buddypress .item-list-tabs ul:after{clear:both}.directory #buddypress .item-list-tabs ul{border-bottom:1px solid rgba(0,0,0,.2);padding-bottom:10px}@media screen and (min-width:783px){.directory #buddypress .item-list-tabs ul{padding-bottom:0}.directory #buddypress .item-list-tabs ul li.selected{border:1px solid rgba(0,0,0,.2);border-bottom-color:#fff;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;background-clip:padding-box;margin-bottom:-1px}.directory #buddypress .item-list-tabs ul li.selected a{background:0 0;outline:0}}.directory #buddypress #subnav ul{border-bottom:0}#buddypress #subnav li#activity-filter-select.last{line-height:2.1;margin-top:0}@media screen and (max-width:783px){#buddypress #object-nav ul{border-bottom:1px solid rgba(0,0,0,.2);overflow:hidden;padding-bottom:10px}#buddypress div#subnav.item-list-tabs{margin-bottom:40px}#buddypress div#subnav.item-list-tabs ul li{width:auto}}@media screen and (min-width:783px){.bp-user #buddypress,.single-item.groups #buddypress{background:#d8d8d8}#buddypress #item-body,#buddypress #item-header{background:#fff}#buddypress #object-nav{background:#d8d8d8;border-right:1px solid #bebebe;float:left;margin-right:-1px;width:200px}#buddypress #object-nav ul{border-bottom:0;border-top:1px solid #bebebe;padding:0}#buddypress #object-nav ul li{float:none;overflow:hidden}#buddypress #object-nav ul li:focus,#buddypress #object-nav ul li:hover{background:#bebebe}#buddypress #object-nav ul li span{border-radius:10%;float:right;margin-right:15px}#buddypress #object-nav ul li.current{background:#f1f1f1}#buddypress #item-body{border-left:1px solid #bebebe;overflow:hidden;padding:0 20px;width:auto}#buddypress #item-body #subnav{border:1px solid #bebebe;border-left:0;border-right:0;margin:0 -20px 20px}#buddypress #item-body #subnav li:focus,#buddypress #item-body #subnav li:hover{background:#bebebe}#buddypress #item-body #subnav li.current{background:#f1f1f1}#buddypress #item-body #subnav li#activity-filter-select:focus,#buddypress #item-body #subnav li#activity-filter-select:hover{background:0 0}#buddypress #item-body #subnav li#activity-filter-select select{max-width:130px}}#buddypress div.pagination .pag-count,#buddypress ul.item-list li .item{margin-left:0}#buddypress .item-list .item-title a{display:block;font-size:22px;font-size:1.375rem;text-decoration:none}#buddypress .item-list .item-title span a,#buddypress .item-list .item-title span.update{font-size:12px;font-size:.75rem}#buddypress ul.item-list li{overflow:hidden!important}#buddypress ul.item-list li .item-avatar{float:none;margin-bottom:20px;text-align:center}#buddypress ul.item-list li .item-avatar a img.avatar{float:none}#buddypress ul.item-list li div.item-title{float:none;width:100%}#buddypress ul.item-list li div.item-title>a{text-align:center}#buddypress ul.item-list li div.item-desc{margin-left:0;width:auto}#buddypress ul.item-list li div.action{clear:both;float:none;margin:0;position:relative;text-align:left}#buddypress ul.item-list li div.action div{margin:0 0 10px}#buddypress ul.item-list li .action,#buddypress ul.item-list li .activity-meta{float:none}#buddypress ul.item-list li .action a,#buddypress ul.item-list li .action div,#buddypress ul.item-list li .activity-meta a,#buddypress ul.item-list li .activity-meta div{display:block;margin:5px 0}@media screen and (min-width:594px){#buddypress ul.item-list li .item-avatar{float:left;margin-bottom:0}#buddypress ul.item-list li div.item-title>a{text-align:left}#buddypress ul.item-list li .item{float:right;margin-left:5%;width:80%}#buddypress ul.item-list li .activity-meta{clear:both}#buddypress ul.item-list li .activity-meta a,#buddypress ul.item-list li .activity-meta div{display:inline-block;margin:5px 5px 0 0}}@media screen and (min-width:783px){#buddypress ul.item-list li .item{float:left;width:55%}#buddypress ul.item-list li .item div.item-desc{margin:0;width:auto}#buddypress ul.item-list li div.action{clear:none;float:right;top:0;width:25%}#buddypress ul.item-list li div.action div{display:block}#buddypress ul.item-list li div.action div a{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:100%}#buddypress ul.item-list li div.action .meta{text-align:center}}#buddypress ul.item-list li .item-meta .activity,#buddypress ul.item-list li .meta{font-style:italic}#buddypress form#whats-new-form{margin:40px 0}#buddypress form#whats-new-form #whats-new-avatar{float:none;margin-bottom:20px;text-align:center}#buddypress form#whats-new-form #whats-new-content,#buddypress form#whats-new-form p.activity-greeting{margin-left:0;padding-left:0}#buddypress form#whats-new-form p.activity-greeting{clear:left;line-height:inherit;margin-bottom:5px}#buddypress form#whats-new-form textarea#whats-new{width:100%}#buddypress form#whats-new-form #whats-new-content #whats-new-options[style]{height:auto!important}@media screen and (max-width:594px){#buddypress form#whats-new-form #whats-new-content #whats-new-options{display:flex;flex-direction:column}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit{order:2}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-submit input{width:100%}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box{margin-top:10px;order:1}#buddypress form#whats-new-form #whats-new-content #whats-new-options #whats-new-post-in-box select{margin-top:5px;max-width:100%;width:100%}}@media screen and (min-width:594px){#buddypress form#whats-new-form #whats-new-avatar{float:left}#buddypress form#whats-new-form #whats-new-content,#buddypress form#whats-new-form p.activity-greeting{clear:none;overflow:hidden;padding-left:20px}}#buddypress #activity-stream{margin-top:40px}#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar{float:none;margin-bottom:10px;text-align:center}#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar{display:inline;float:none}#buddypress .activity-list li.mini .activity-avatar img.avatar{margin-left:0}#buddypress .activity-list li.mini .activity-meta a{font-size:12px;font-size:.75rem}#buddypress .activity-list .activity-content{margin:0}#buddypress .activity-list .activity-content .activity-header{margin:-.5em 0 0}#buddypress .activity-list .activity-content .activity-header>p{line-height:1.4;margin-top:-10px}#buddypress .activity-list .activity-content .activity-header img.avatar{margin-bottom:0!important;vertical-align:middle}#buddypress .activity-list .activity-content .activity-inner{margin:10px 0}@media screen and (min-width:594px){#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar{float:left;margin:0 20px 0 0}#buddypress .activity-list li.activity-item:not(.mini) .activity-avatar img.avatar{display:inline;float:none}#buddypress .activity-list li.mini .activity-avatar{margin:0 10px 0 5%}#buddypress .activity-list .activity-content{margin-left:0;overflow:hidden}}body.activity-permalink #buddypress{background:0 0}@media screen and (max-width:760px){body.activity-permalink #buddypress .activity-list li .activity-comments,body.activity-permalink #buddypress .activity-list li .activity-content{margin-left:0}}#buddypress .activity .activity-comments{margin-left:0;margin-top:5px}@media screen and (min-width:594px){#buddypress .activity .activity-comments{margin-left:70px}}#buddypress .activity .activity-comments ul{background:rgba(247,247,247,.6);margin:30px 0 0 2px}#buddypress .activity .activity-comments ul ul{border-left:1px solid rgba(0,0,0,.1);padding-left:2%}@media screen and (max-width:400px){#buddypress .activity .activity-comments .acomment-avatar{display:block;text-align:center}#buddypress .activity .activity-comments .acomment-avatar a,#buddypress .activity .activity-comments .acomment-avatar img.avatar{display:inline;float:none}#buddypress .activity .activity-comments .acomment-content,#buddypress .activity .activity-comments .acomment-meta,#buddypress .activity .activity-comments .acomment-options{margin:5px}#buddypress .activity .activity-comments .acomment-content{padding:0 10px}}#buddypress .activity .activity-comments .ac-form .ac-reply-cancel,#buddypress .activity .activity-comments .ac-form input[type=submit]{color:rgba(43,43,43,.8);display:inline-block;font-family:inherit;font-size:12px;font-size:.75rem;font-weight:400;line-height:1.2;padding:4px 10px;text-transform:lowercase;width:100px}#buddypress .activity .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(0,0,0,.2);text-align:center}#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:focus,#buddypress .activity .activity-comments .ac-form .ac-reply-cancel:hover{background:#ededed}.bp-user .entry-title,.single-item.groups .entry-title{background:#4d4d4d;color:#fff;font-size:22px;font-size:1.375rem;margin-bottom:10px;padding:.2em}@media screen and (min-width:673px){.bp-user .entry-title,.single-item.groups .entry-title{font-size:28px;font-size:1.75rem}}#buddypress div#item-header{padding-bottom:10px}#buddypress div#item-header img.avatar{margin:0 20px 10px 0}#buddypress div#item-header #message{clear:both;margin-bottom:5px;padding-top:10px}#buddypress div#item-header #message p{margin-bottom:0}@media screen and (max-width:594px){.single-item.groups #buddypress div#item-header{display:flex;flex-direction:column}.single-item.groups #buddypress div#item-header #item-header-avatar{order:1;text-align:center}.single-item.groups #buddypress div#item-header #item-header-avatar a{border-bottom:0}.single-item.groups #buddypress div#item-header #item-header-avatar a img{display:inline-block;float:none}.single-item.groups #buddypress div#item-header #item-header-content{order:2}.single-item.groups #buddypress div#item-header #item-actions{margin-left:0;order:3;text-align:left}.single-item.groups #buddypress div#item-header #item-actions ul{margin-left:0}.single-item.groups #buddypress div#item-header #item-actions ul li{float:left}.single-item.groups #buddypress div#item-header #message{order:4}}.single-item.groups #buddypress #item-header #item-actions{float:none;margin:0 0 0 20px;width:auto}.single-item.groups #buddypress #item-header #item-actions h3{font-size:20px;font-size:1.25rem}.single-item.groups #buddypress #item-header #item-header-avatar{text-align:center}.single-item.groups #buddypress #item-header #item-header-content{float:none;overflow:hidden}@media screen and (min-width:594px){.single-item.groups #buddypress #item-header #item-actions{float:right}.single-item.groups #buddypress #item-header #item-header-avatar{float:left}.single-item.groups #buddypress #item-header #item-header-content{float:none;overflow:hidden}}.bp-user #buddypress #item-header #item-header-avatar{text-align:center;width:100%}.bp-user #buddypress #item-header #item-header-avatar img{float:none}.bp-user #buddypress #item-header #latest-update{margin-bottom:10px}@media screen and (max-width:594px){.bp-user #buddypress #item-header #item-buttons div.generic-button{display:inline-block;float:none;margin:0 0 5px;width:100%}.bp-user #buddypress #item-header #item-buttons div.generic-button a{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:100%}}@media screen and (min-width:673px){.bp-user #buddypress #item-header #item-header-avatar{float:left;overflow:hidden;text-align:left;width:20%}.bp-user #buddypress #item-header #item-header-avatar img{margin:0}.bp-user #buddypress #item-header #item-header-content{float:right;width:78%}.bp-user #buddypress #item-header #item-header-content #latest-update{margin-bottom:20px}}#create-group-form .radio strong,#group-settings-form .radio strong{font-size:18px;font-size:1.125rem}#create-group-form .radio ul,#group-settings-form .radio ul{color:#777}#create-group-form #group-creation-previous,#group-settings-form #group-creation-previous{margin:10px 0}.groups.manage-members #group-settings-form h4{margin-top:40px}.groups.manage-members #group-settings-form .item-list{background:#f7f7f7;border-top:0;padding:0 .5em}.groups.manage-members #group-settings-form .item-list li{border-bottom:1px solid rgba(0,0,0,.1)}.groups.manage-members #group-settings-form .item-list li h5>a,.groups.manage-members #group-settings-form .item-list li img>a,.groups.manage-members #group-settings-form .item-list li:last-child{border-bottom:0}.groups.manage-members #group-settings-form .item-list li h5,.groups.manage-members #group-settings-form .item-list li img{clear:none;float:left}#buddypress .profile #profile-edit-form .button-nav:after,.groups.group-members #subnav ul:after{clear:both}.groups.manage-members #group-settings-form .item-list li span.small{display:block;float:none;margin-top:10px;width:100%}.groups.manage-members #group-settings-form .item-list li span.small a{display:inline-block;margin:5px 0;width:100%}@media screen and (min-width:38.75em){.groups.manage-members #group-settings-form .item-list li span.small a{width:auto}}.groups.manage-members #group-settings-form .item-list li h5{margin:0}#buddypress #members-group-list .item-list h5{display:inline-block;margin:0}#buddypress #members-group-list .item-list span.activity{padding-left:10px}#buddypress #item-body #subnav li.groups-members-search:focus,#buddypress #item-body #subnav li.groups-members-search:hover,#buddypress #item-body #subnav li.last:focus,#buddypress #item-body #subnav li.last:hover{background:0 0}.groups.group-members #subnav ul:after,.groups.group-members #subnav ul:before{content:" ";display:table}.groups.group-members #subnav ul{padding:5px 0}.groups.group-members #subnav li #search-members-form{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left}@media screen and (max-width:400px){.groups.group-members #subnav li{background:#fff;padding:10px 0;width:100%!important}.groups.group-members #subnav li #search-members-form{margin:0;width:100%}.groups.group-members #subnav li #search-members-form label input[type=text]{width:100%}}@media screen and (min-width:783px){.groups.group-members #subnav li #search-members-form{margin-left:3px}.send-invites #buddypress #item-body{border-top:1px solid #bebebe}}@media screen and (max-width:400px){.send-invites #buddypress #item-body .left-menu{float:none}.send-invites #buddypress #item-body .left-menu #invite-list{height:auto;width:auto}.send-invites #buddypress #item-body .main-column{margin-left:0}}.send-invites #buddypress #item-body li img.avatar{display:block;float:none;margin:10px auto}.send-invites #buddypress #item-body li .action{margin-top:10px;text-align:left;width:100%}@media screen and (min-width:38.75em){.send-invites #buddypress #item-body li .action{text-align:right}}@media screen and (min-width:594px){.send-invites #buddypress #item-body #invite-list{width:160px}.send-invites #buddypress #item-body .main-column{margin-left:190px}.send-invites #buddypress #item-body li img.avatar{float:left;margin:0 10px 0 0}}#buddypress .profile .bp-widget h4{background:#999;color:#fff;padding:.4em .2em}#buddypress .profile #profile-edit-form .button-nav:after,#buddypress .profile #profile-edit-form .button-nav:before{content:" ";display:table}#buddypress .profile #profile-edit-form ul.button-nav{border-bottom:1px solid rgba(0,0,0,.1);margin-left:0}#buddypress .profile #profile-edit-form ul.button-nav li{float:left;margin-bottom:0}#buddypress .profile #profile-edit-form ul.button-nav li.current{border:1px solid rgba(0,0,0,.1);border-bottom-color:#fff;margin-bottom:-1px}#buddypress .profile #profile-edit-form ul.button-nav a{background:0 0;border:0;font-size:18px;font-size:1.125rem}#buddypress .profile #profile-edit-form .field-visibility-settings,#buddypress .profile #profile-edit-form .field-visibility-settings-toggle{font-size:14px;font-size:.875rem}#buddypress .profile #profile-edit-form .field-visibility-settings-close,#buddypress .profile #profile-edit-form .visibility-toggle-link{background:#000;color:#fff;padding:.2em .5em}#buddypress table#message-threads{border-left:1px solid rgba(0,0,0,.2);border-right:1px solid rgba(0,0,0,.2)}#buddypress table#message-threads tbody>tr:first-child td.bulk-select-check,#buddypress table#message-threads tbody>tr:first-child td.thread-from{border-top:1px solid rgba(0,0,0,.2)}#buddypress table#message-threads tr td{background:#fff;border-right:0!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;float:left}#buddypress table#message-threads tr td.thread-options,#buddypress table#message-threads tr td.thread-star{border-bottom-color:rgba(0,0,0,.2);border-bottom-width:2px;border-left:0;height:2.4em;padding-bottom:.2em;padding-top:.2em}@media screen and (max-width:549px){#buddypress table#message-threads tr td.thread-options,#buddypress table#message-threads tr td.thread-star{padding-top:0}}#buddypress table#message-threads tr td.bulk-select-check,#buddypress table#message-threads tr td.thread-from{border-left:0;height:2.6em}#buddypress table#message-threads tr td.thread-from,#buddypress table#message-threads tr td.thread-options{border-left:0;width:-webkit-calc(100% - 30px);width:-moz-calc(100% - 30px);width:calc(100% - 30px);margin-left:0}#buddypress table#message-threads tr td.thread-info{border-left:0;padding-left:41px;width:100%}#buddypress table#message-threads tr td.thread-info a::after{content:" –  " attr(title);font-size:12px;font-size:.75rem}#buddypress table#message-threads tr td.thread-options{text-align:right}#buddypress table#message-threads tr td.thread-options a{font-size:12px;font-size:.75rem;line-height:2.2}#buddypress table#message-threads tr span.from{display:none}#buddypress table#message-threads tr span.activity{display:block;float:right;line-height:2}@media screen and (max-width:320px){#buddypress table#message-threads tr td.bulk-select-check,#buddypress table#message-threads tr td.thread-from{height:5.2em}#buddypress table#message-threads tr span.activity{clear:both;font-size:11px;font-size:.6875rem;width:100%}}#buddypress table#message-threads tr.unread td{background:#f1f4ff;border-color:rgba(0,0,0,.2);border-top:0;border-width:1px}#buddypress table#message-threads th{display:none}#buddypress table#message-threads th.bulk-select-all{border-bottom:0;display:inline-block;text-align:left}#buddypress table#message-threads td.bulk-select-check,#buddypress table#message-threads td.thread-star,#buddypress table#message-threads th.bulk-select-all{border-right:0;width:30px}#buddypress #message-threads.sitewide-notices td,#buddypress table.profile-settings{width:100%}#buddypress #message-thread #message-subject{background:#4d4d4d;color:#fff;padding:.5em}#buddypress #message-thread .message-box .message-metadata{margin-bottom:10px}#buddypress #message-thread .message-box .message-content{clear:left;margin-left:0}#buddypress #message-threads.sitewide-notices td strong{background:#4d4d4d;color:#fff;font-size:16px;font-size:1rem;display:block;margin-bottom:.4em;padding:.2em}#buddypress #message-threads.sitewide-notices td a{display:inline-block;line-height:initial}#buddypress #message-threads.sitewide-notices td:first-child{display:none}#buddypress #message-threads.sitewide-notices td:first-child+td+td{border-bottom:0}#buddypress #message-threads.sitewide-notices td:first-child+td+td span{line-height:1}#buddypress #message-threads.sitewide-notices td:last-child{border-bottom-color:rgba(0,0,0,.2);line-height:1;text-align:right}#buddypress #message-threads.sitewide-notices td:last-child a:last-child{line-height:0;margin-left:.7em;text-indent:-999em}#buddypress #message-threads.sitewide-notices td:last-child a:last-child::after{content:attr(title);display:block;line-height:initial;text-indent:0}#buddypress #settings-form>p{font-size:20px;font-size:1.25rem}#buddypress table.notification-settings td.no,#buddypress table.notification-settings td.yes{vertical-align:middle}#buddypress table.profile-settings td.field-name,#buddypress table.profile-settings th.field-group-name{width:50%}@media screen and (min-width:401px){#buddypress table.profile-settings td.field-name,#buddypress table.profile-settings th.field-group-name{width:70%}}#buddypress #send-reply.standard-form textarea,#buddypress .standard-form input[type=submit],#buddypress .standard-form input[type=text],#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form textarea,#buddypress table.profile-settings td.field-visibility select{width:100%}#buddypress input[type=submit],#buddypress input[type=text],#buddypress input[type=email],#buddypress input[type=password],#buddypress select,#buddypress textarea{border:1px solid rgba(0,0,0,.2)}#buddypress div.activity-comments form .ac-textarea{background:#f7f7f7;border:1px solid rgba(0,0,0,.2)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress div.dir-search,#buddypress div.message-search,#buddypress li.groups-members-search{clear:both;float:none;margin:10px 0}#buddypress div.dir-search form,#buddypress div.message-search form,#buddypress li.groups-members-search form{border:1px solid #ccc;overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:left;width:80%}#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit]{border:0;font-size:14px;font-size:.875rem;line-height:inherit}#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=text]{float:left;margin:0;width:80%;border-right:1px solid #ccc;padding:.2em 0 .2em .2em}#buddypress div.dir-search form input[type=submit],#buddypress div.message-search form input[type=submit],#buddypress li.groups-members-search form input[type=submit]{float:right;font-weight:400;padding:.2em 1em;text-align:center;text-transform:none;width:20%}@media screen and (min-width:401px){#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form label{width:auto}#buddypress div.dir-search,#buddypress div.message-search{clear:none;float:right}#buddypress div.message-search{margin:3px 0 0}}#buddypress table{border-color:rgba(0,0,0,.2)}#buddypress div#message p{font-size:18px;font-size:1.125rem;font-weight:700}#buddypress div#message.info p{background:#c6e4ee;border:1px solid #78bed6;color:#1e5264}#buddypress div#message.updated p{background:#dee6b2;border:1px solid #becc66;color:#454d19}.delete-group #buddypress div#message.info p{background:#db7e7e;border:1px solid #be3535;color:#1f0808}#buddypress .acfb-holder li.friend-tab{background:#9fd1e2;border:inherit inherit inherit}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.scss b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.scss
new file mode 100644
index 0000000000000000000000000000000000000000..8b9872ff291685827764ca61fd33a4b8baf63a7c
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.scss
@@ -0,0 +1,1865 @@
+// Stylesheet Guidence Notes
+// Table of content represents a guide to sections of the sheet.
+// Note that not all sections may be described in the body of the
+// rulesets only those that require styles for a given theme.
+// Sub sections might not exist but can be added as required
+// as per BP Lists - 'activity' section.
+
+// We follow the dictats of the parent theme in respect of media queries,
+// font sizing etc. Media queries are used in a modular sense (OOCSS)
+// rather than described as blocks to the end of the sheet, this aids ease
+// of managing media queries, scalability & flexibility.
+
+// Twentyfourteen Media Queries / Breakpoints
+//@media screen and (max-width: 400px)
+//@media screen and (min-width: 401px)
+//@media screen and (min-width: 594px)
+//@media screen and (min-width: 673px)
+//@media screen and (min-width: 783px)
+//@media screen and (min-width: 810px)
+//@media screen and (min-width: 846px)
+//@media screen and (min-width: 1008px)
+//@media screen and (min-width: 1040px)
+//@media screen and (min-width: 1110px)
+
+// Mixins and Variables
+
+// Common margin values
+$spacing-val-lg: 40px;
+$spacing-val-md: 20px;
+$spacing-val-sm: 10px;
+$spacing-val-xs: 5px;
+
+// A simple mixin to handle font-sizing to match 2014 body 100% approach
+@mixin font-size($font-size: 16) {
+	$rem-font-value: ($font-size / 16);
+	font-size: ($font-size * 1px);
+	font-size: $rem-font-value + rem;
+}
+
+// To allow mixins to pass VendorPrefix scss-lint tests we disable lint-test
+// for specific blocks / rulesets
+// until such time as exemption lists can be built for the scss-lint.yml?
+// Any vendor prefix properties / mixins need to be in this block
+// scss-lint:disable VendorPrefix
+
+// Border border-radius mixins
+@mixin border-radius($radius) {
+	-webkit-border-radius: $radius;
+	-moz-border-radius: $radius;
+	-ms-border-radius: $radius;
+	border-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-top-radius($radius) {
+	-webkit-border-top-right-radius: $radius;
+	border-top-right-radius: $radius;
+	-webkit-border-top-left-radius: $radius;
+	border-top-left-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-right-radius($radius) {
+	-webkit-border-bottom-right-radius: $radius;
+	border-bottom-right-radius: $radius;
+	-webkit-border-top-right-radius: $radius;
+	border-top-right-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-bottom-radius($radius) {
+	-webkit-border-bottom-right-radius: $radius;
+	border-bottom-right-radius: $radius;
+	-webkit-border-bottom-left-radius: $radius;
+	border-bottom-left-radius: $radius;
+	background-clip: padding-box;
+}
+
+@mixin border-left-radius($radius) {
+	-webkit-border-bottom-left-radius: $radius;
+	border-bottom-left-radius: $radius;
+	-webkit-border-top-left-radius: $radius;
+	border-top-left-radius: $radius;
+	background-clip: padding-box;
+}
+
+// Box sizing
+@mixin box-model($box-model: border-box) {
+	-webkit-box-sizing: $box-model;
+	-moz-box-sizing: $box-model;
+	box-sizing: $box-model;
+}
+
+// Calc
+@mixin calc($property, $expression) {
+	#{$property}: -webkit-calc(#{$expression});
+	#{$property}: -moz-calc(#{$expression});
+	#{$property}: calc(#{$expression});
+}
+
+// Re-enable the VendorPrefix lint test
+// scss-lint:enable VendorPrefix
+
+// BP message boxes
+@mixin message-box($background, $text-color: null) {
+
+	@if $text-color {
+		// if a param was passed through
+		$text-color: $text-color;
+	} @else {
+		$text-color: darken($background, 50%);
+	}
+
+	background: lighten($background, 10%);
+	border: 1px solid darken($background, 10%);
+	color: $text-color;
+}
+
+// titles dark backgrounds
+@mixin title-background-dark() {
+	background: lighten($dark-background, 30%);
+	color: $dark-back-text-color;
+}
+
+// Variabals: color definitions
+$content-background:     #fff;
+$dark-back-text-color:   #fff;
+$light-background:       #f7f7f7;
+$medium-background:      #999;
+$dark-background:        #000;
+$border-color:           #000; // border color can be varied using rgba
+$border-med:             rgba(#000, 0.2);
+$border-light:           rgba(#000, 0.1); // BP dividers
+$body-text:              #2b2b2b; // 2015 body text color
+$bp-button-hover:        #ededed; // this is the default BP button hover background
+$notice-warning:         #d05656;
+$notice-info:            #9fd1e2;
+$notice-update:          #ced98c;
+$stripe-odd:             #ebf0ff;
+$stripe-even:            #dbe5ff;
+$unread:                 #cddaff;
+
+// 2014 font family
+@mixin default-font() {
+	font-family: Lato, sans-serif;
+}
+
+/*------------------------------------------------------------------------------
+
+This is the BuddyPress companion stylesheet for
+the WordPress Twentyfourteen theme.
+
+This sheet supports the primary BuddyPress styles in buddypress.css
+
+If you are running as a child theme of twentyfourteen this stylesheet will be
+loaded by default. If you want to modify the styles the normal BP Theme Compat
+hierarchy works and you can copy the file to buddypress/css/ or community/css/
+in your child themes root & either start over or modify the ruelesets.
+
+If you do not require the styles you can dequeue them from the themes functions file.
+
+Please see this codex article for more information:
+http://codex.buddypress.org/themes/buddypress-companion-stylesheets/
+
+--------------------------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+--------------------------------------------------------------------------------
+1.0 Theme Structural Elements
+2.0 - Navigation - General
+	2.1 - Navs - Object Nav / Sub Nav (item-list-tabs)
+	2.2 - Pagination
+3.0 - Images
+4.0 - BP Lists / Loops Generic
+	4.1 - Activity Loop
+		4.1.1 - Activity Whats new
+		4.1.2 - Activity Listing
+		4.1.3 - Activity Comments
+	4.2 - Members Loop
+	4.3 - Groups Loop
+	4.4 - Blogs Loop
+5.0 - Directories - Members, Groups, Blogs, Forums
+6.0 - Single Item screens: User Account & Single Group Screens
+	6.1 - Item Headers: Global
+		6.1.1 - Item-header: Groups;
+		6.1.2 -  item-header: User Accounts
+	6.2 - Item Body: Global
+		6.2.1 - item-body: Groups
+			6.2.1.1- Management settings screens
+			6.2.1.2 - Group members list
+			6.2.1.3 - Group Send Invites
+		6.2.2 - item-body: User Accounts
+			6.2.2.1 - classes, pag, filters
+			6.2.2.2 - Extended Profiles
+			6.2.2.3 - Groups
+			6.2.2.4 - friends
+			6.2.2.5 - Private Messaging Threads
+			6.2.2.6 - Settings
+7.0 - Forms  -  General
+8.0 - Tables -  General
+9.0 - Error / Success Messages
+10.0 - Ajax Loading
+11.0 - Widgets
+------------------------------------------------------------------------------*/
+
+/**
+*-------------------------------------------------------------------------------
+* @section - 1.0 - Theme - Structural Elements
+*-------------------------------------------------------------------------------
+*/
+
+// Twentyfourteen  adds a generic grouped ruleset of clear:both;
+// for all heading h# elements this is problematic where floats are concerned
+// We reset this here under our #buddypress namespace
+#buddypress {
+	h1,
+	h2,
+	h3,
+	h4,
+	h5,
+	h6 {
+		clear: none;
+	}
+}
+
+// As BP screens have specific content lets adjust the themes primary elements
+// to maximise the screen real estate for BP pages.
+
+.buddypress {
+
+	.site-content {
+		padding-bottom: $spacing-val-md;
+		padding-top: 4%;
+
+		@media screen and (min-width: 59.6875em) {
+			padding-top: 0;
+		}
+
+		article {
+			margin: 0 4%;
+			padding-top: 0;
+
+			.entry-header,
+			.entry-content {
+				max-width: 100%;
+				padding: 0;
+			}
+
+			#buddypress {
+				margin-bottom: $spacing-val-lg;
+			}
+
+		} // .article
+	} // .content
+} // .buddypress ( body class )
+
+/**
+* ------------------------------------------------------------------------------
+* @section 2.0 - Navigation - General
+*-------------------------------------------------------------------------------
+*/
+
+/**
+*----------------------------------------------------------
+* @subsection 2.1 - Object Nav / Subnav (item-list-tabs)
+*
+* The main navigational elements for all BP screens
+*----------------------------------------------------------
+*/
+#buddypress {
+	.item-list-tabs {
+		ul {
+
+			li {
+				width: 100%;
+			}
+
+			@media screen and (min-width: 400px) {
+				li {
+					width: 50%;
+				}
+			}
+			@media screen and (min-width: 594px) {
+				li {
+					width: auto;
+				}
+			}
+		}
+	}
+}
+
+.directory #buddypress {
+	.item-list-tabs {
+
+		ul:before,
+		ul:after {
+			content: " ";
+			display: table;
+		}
+
+		ul:after {
+			clear: both;
+		}
+
+		ul {
+			border-bottom: 1px solid $border-med;
+			padding-bottom: $spacing-val-sm;
+		}
+
+		@media screen and (min-width: 783px) {
+			ul {
+				padding-bottom: 0;
+
+				li.selected {
+					border: 1px solid $border-med;
+					border-bottom-color: $content-background;
+					@include border-top-radius(4px);
+					margin-bottom: -1px;
+
+					a {
+						background: none;
+						outline: none;
+					}
+				}
+			}
+		} // close @media
+	} // close .item-list-tabs
+
+	#subnav {
+		ul {
+			border-bottom: 0;
+		}
+
+	} // close #subnav
+} // close .directory #buddypress
+
+/* List last filters global */
+#buddypress {
+	#subnav {
+		li#activity-filter-select.last {
+			line-height: 2.1;
+			margin-top: 0;
+		}
+	}
+}
+
+// Add a little bottom margin & border seperation to object/subnav
+// & keep subnav to horizontal up to vert nav display for user/group screens
+
+@media screen and (max-width: 783px) {
+
+	#buddypress {
+		#object-nav {
+			ul {
+				border-bottom: 1px solid $border-med;
+				overflow: hidden;
+				padding-bottom: $spacing-val-sm;
+			}
+		}
+
+		div#subnav.item-list-tabs {
+			margin-bottom: $spacing-val-lg;
+
+			ul {
+				li {
+					width: auto;
+				}
+			}
+		}
+	}
+
+} // close @media
+
+/*__ Vertical Menu User Account Screens __*/
+
+// This block contains the rules to re-factor the item-body structural element
+// to sit alongside the vert menu & menu item styles.
+
+// Boders & backgrounds for user/group navs rely on one color
+// set this here for convenience of changing and clarity
+$nav-background-border: #bebebe;
+
+@media screen and (min-width: 783px) {
+
+	.bp-user,
+	.single-item.groups {
+		#buddypress {
+			background: lighten($nav-background-border, 10%);
+		}
+	}
+
+	#buddypress {
+
+		#item-header,
+		#item-body {
+			background: #fff;
+		}
+
+		#item-body {border-left: 1px solid $nav-background-border;}
+
+		#object-nav {
+			background: lighten($nav-background-border, 10%);
+			border-right: 1px solid $nav-background-border;
+			float: left;
+			margin-right: -1px;
+			width: 200px;
+
+			ul {
+				border-bottom: 0;
+				border-top: 1px solid $nav-background-border;
+				padding: 0;
+
+				li {
+					float: none;
+					overflow: hidden;
+
+					&:focus,
+					&:hover {
+						background: $nav-background-border;
+					}
+
+					span {
+						border-radius: 10%;
+						float: right;
+						margin-right: 15px;
+					}
+				}
+
+				li.current {
+					background: lighten($nav-background-border, 20%);
+				}
+			}
+		}
+
+		#item-body {
+			overflow: hidden;
+			padding: 0 $spacing-val-md;
+			width: auto;
+
+			#subnav {
+				border: 1px solid $nav-background-border;
+				border-left: 0;
+				border-right: 0;
+				margin: 0 (-$spacing-val-md) $spacing-val-md;
+
+				li:focus,
+				li:hover {
+					background: $nav-background-border;
+				}
+
+				li.current {
+					background: lighten($nav-background-border, 20%);
+				}
+
+				li#activity-filter-select {
+
+					&:focus,
+					&:hover {
+						background: none;
+					}
+
+					select {
+						max-width: 130px;
+					}
+				}
+
+			}
+		}
+	} // close  #buddypress
+} // close @media
+
+/**
+*----------------------------------------------------------
+* @subsection 2.2 - Pagination
+*----------------------------------------------------------
+*/
+
+#buddypress {
+	div.pagination {
+		.pag-count {
+			margin-left: 0;
+		}
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 4.0 - BP Lists / Loops Generic
+*-------------------------------------------------------------------------------
+*/
+#buddypress {
+	.item-list {
+		.item-title {
+
+			a {
+				display: block;
+				@include font-size(22);
+				text-decoration: none;
+			}
+
+			span.update,
+			span a {
+				@include font-size(12);
+			}
+		}
+	}
+}
+
+// This block:
+// - Manages li items, Stacks them small screen, floated left at wider screens.
+// - Adjusts display of action buttons at small screen
+
+#buddypress {
+	ul.item-list {
+		li {
+			overflow: hidden !important; // buddypress styles over specified
+
+			.item-avatar {
+				float: none;
+				margin-bottom: $spacing-val-md;
+				text-align: center;
+
+				a {
+					img.avatar {
+						float: none;
+					}
+				}
+			}
+
+			div.item-title {
+				float: none;
+				width: 100%;
+
+				> a {text-align: center;}
+			}
+
+			.item {
+				margin-left: 0;
+			}
+
+			// groups group description
+			div.item-desc {
+				margin-left: 0;
+				width: auto;
+			}
+
+			div.action {
+				clear: both;
+				float: none;
+				margin: 0;
+				position: relative;
+				text-align: left;
+
+				div {
+					margin: 0 0 $spacing-val-sm;
+				}
+
+			} // close .action
+
+			// item-list buttons blocked/full width for mobile/small screens
+
+			.activity-meta,
+			.action {
+				float: none;
+
+				a,
+				div {
+					display: block;
+					margin: $spacing-val-xs 0;
+				}
+			}
+
+			@media screen and (min-width: 594px) {
+				.item-avatar {
+					float: left;
+					margin-bottom: 0;
+				}
+
+				div.item-title > a {text-align: left;}
+
+				.item {
+					float: right;
+					margin-left: 5%;
+					width: 80%;
+				}
+
+				.activity-meta {
+					clear: both;
+
+					a,
+					div {
+						display: inline-block;
+						margin: $spacing-val-xs $spacing-val-xs 0 0;
+					}
+				}
+
+			} // close @media
+
+			@media screen and (min-width: 783px) {
+				.item {
+					float: left;
+					width: 55%;
+
+					div.item-desc {
+						margin: 0;
+						width: auto;
+					}
+				}
+
+				div.action {
+					clear: none;
+					float: right;
+					top: 0;
+					width: 25%;
+
+					div {
+						display: block;
+
+						a {
+							@include box-model(border-box);
+							display: block;
+							width: 100%;
+						}
+					}
+
+					.meta {
+						text-align: center;
+					}
+				} // close .action
+
+			} // close @media
+
+			.meta,
+			.item-meta .activity {
+				font-style: italic;
+			}
+
+		} // close li
+	} // ul.item-list
+} // close #budypress
+
+/**
+*------------------------------------------------------------
+* @section 4.1 - Activity
+*------------------------------------------------------------
+*/
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.1 - Activity What's New
+*-------------------------------------------------
+*/
+#buddypress {
+	form#whats-new-form {
+		margin: $spacing-val-lg 0;
+
+		#whats-new-avatar {
+			float: none;
+			margin-bottom: $spacing-val-md;
+			text-align: center;
+		}
+
+		#whats-new-content,
+		p.activity-greeting {
+			margin-left: 0;
+			padding-left: 0;
+		}
+
+		// Line-height issue inherited from BP rules, override.
+		p.activity-greeting {
+			clear: left;
+			line-height: inherit;
+			margin-bottom: $spacing-val-xs;
+		}
+
+		textarea#whats-new {
+			width: 100%;
+		}
+
+		#whats-new-content {
+
+			#whats-new-options[style] {
+				// Have to override the BP fixed height
+				height: auto !important;
+			}
+
+			@media screen and (max-width: 594px) {
+				#whats-new-options {
+					display: flex;
+					flex-direction: column;
+
+					#whats-new-submit {
+						order: 2;
+
+						input {
+							width: 100%;
+						}
+					}
+
+					#whats-new-post-in-box {
+						margin-top: $spacing-val-sm;
+						order: 1;
+
+						select {
+							margin-top: $spacing-val-xs;
+							max-width: 100%;
+							width: 100%;
+						}
+					}
+				}
+			}
+		} // close whats-new-content.active
+
+		@media screen and (min-width: 594px) {
+			#whats-new-avatar {
+				float: left;
+			}
+
+			#whats-new-content,
+			p.activity-greeting {
+				clear: none;
+				overflow: hidden;
+				padding-left: $spacing-val-md;
+			}
+		}
+	} // close form#whats-new-form
+
+} // close #buddypress
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.2 - Activity Listing
+*-------------------------------------------------
+*/
+
+#buddypress {
+	#activity-stream {margin-top: $spacing-val-lg;}
+	.activity-list {
+
+		li.activity-item:not(.mini) {
+			.activity-avatar {
+				float: none;
+				margin-bottom: $spacing-val-sm;
+				text-align: center;
+
+				img.avatar {
+					display: inline;
+					float: none;
+				}
+			}
+		}
+
+		li.mini {
+			.activity-avatar {
+				img.avatar {
+					margin-left: 0;
+				}
+			}
+
+			.activity-meta {
+				a {@include font-size(12);}
+			}
+		}
+
+		.activity-content {
+			margin: 0;
+
+			.activity-header {
+				margin: -0.5em 0 0;
+
+				> p {
+					line-height: 1.4;
+					margin-top: -$spacing-val-sm;
+				}
+
+				// BP adds !important. need to override prop val
+				img.avatar {
+					margin-bottom: 0 !important;
+					vertical-align: middle;
+				}
+			}
+
+			.activity-inner {margin: $spacing-val-sm 0;}
+		}
+
+		@media screen and (min-width: 594px) {
+			li.activity-item:not(.mini) {
+				.activity-avatar {
+					float: left;
+					margin: 0 $spacing-val-md 0 0;
+
+					img.avatar {
+						display: inline;
+						float: none;
+					}
+				}
+			}
+
+			li.mini {
+				.activity-avatar {
+					margin: 0 $spacing-val-sm 0 5%;
+				}
+			}
+
+			.activity-content {
+				margin-left: 0;
+				overflow: hidden;
+			}
+		}
+
+	} // close .activity-list
+} // close #buddypress
+
+// Activity Single Item 'Permalink' Page
+body.activity-permalink {
+	#buddypress {
+		// remove user account faux column background
+		background: transparent;
+
+		.activity-list {
+			li {
+				@media screen and (max-width: 760px) {
+					.activity-content,
+					.activity-comments {
+						margin-left: 0;
+					}
+				}
+			}
+		}
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 4.1.3 - Activity Comments
+*-------------------------------------------------
+*/
+
+#buddypress {
+	.activity {
+		.activity-comments {
+		//	border-left: 1px solid $border-light;
+			margin-left: 0;
+			margin-top: 5px;
+
+			@media screen and (min-width: 594px) {
+				margin-left: 70px;
+			}
+
+			ul {
+				background: rgba($light-background, 0.6);
+				margin: 30px 0 0 2px;
+			}
+
+			ul ul {
+				border-left: 1px solid $border-light;
+				padding-left: 2%;
+			}
+
+			// Display the user avatar stacked up to 594px
+			// reduce/widen the content margins
+			@media screen and (max-width: 400px) {
+				.acomment-avatar {
+					display: block;
+					text-align: center;
+
+					a,
+					img.avatar {display: inline; float: none;}
+				}
+
+				.acomment-content,
+				.acomment-meta,
+				.acomment-options {
+					margin: $spacing-val-xs;
+				}
+
+				.acomment-content {padding: 0 $spacing-val-sm;}
+			} // close @media
+
+			.ac-form {
+
+				input[type="submit"],
+				.ac-reply-cancel {
+					color: rgba($body-text, 0.8);
+					display: inline-block;
+					font-family: inherit;
+					@include font-size(12);
+					font-weight: normal;
+					line-height: 1.2;
+					padding: 4px 10px;
+					text-transform: lowercase;
+					width: 100px;
+				}
+
+				.ac-reply-cancel {
+					border: 1px solid $border-med;
+					text-align: center;
+
+					&:focus,
+					&:hover {
+						background: $bp-button-hover;
+					}
+				}
+
+			} // close .ac-form
+
+		} // close .activity-comments
+	} // close .activity
+
+} // close #buddypress
+
+
+/**
+*------------------------------------------------------------
+* @section 4.2 - Members Loop
+*------------------------------------------------------------
+*/
+
+
+
+/*
+*-------------------------------------------------------------------------------
+* @section 6.0 - Single Item screens
+*-------------------------------------------------------------------------------
+*/
+/* groups & user account page entry title */
+.single-item.groups,
+.bp-user {
+
+	.entry-title {
+		@include title-background-dark();
+		@include font-size(22);
+		margin-bottom: $spacing-val-sm;
+		padding: 0.2em;
+	}
+
+	@media screen and (min-width: 673px) {
+		.entry-title {
+			@include font-size(28);
+		}
+	}
+
+} // close #buddypress
+/**
+*------------------------------------------------------------
+* @subsection 6.1 - Item Header: Global
+*------------------------------------------------------------
+*/
+// override BP margins - users/groups manage their own styles later on
+#buddypress {
+	div#item-header {
+		padding-bottom: $spacing-val-sm;
+
+		img.avatar {
+			margin: 0 $spacing-val-md $spacing-val-sm 0;
+		}
+
+		// Prevent messages block abutting bottom of floats, with padding-top
+		#message {
+			clear: both;
+			margin-bottom: $spacing-val-xs;
+			padding-top: $spacing-val-sm;
+
+			p {margin-bottom: 0;}
+		}
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.1.1 - item-header: Groups
+*-------------------------------------------------
+*/
+.single-item.groups {
+	#buddypress {
+
+		@media screen and (max-width: 594px) {
+			div#item-header {
+				display: flex;
+				flex-direction: column;
+
+				#item-header-avatar {
+					order: 1;
+					text-align: center;
+
+					a {
+						border-bottom: 0;
+
+						img {
+							display: inline-block;
+							float: none;
+						}
+					}
+				}
+
+				#item-header-content {order: 2;}
+
+				#item-actions {
+					margin-left: 0;
+					order: 3;
+					text-align: left;
+
+					ul {
+						margin-left: 0;
+
+						li {
+							float: left;
+						}
+					}
+				} // close #item-actions
+
+				#message {
+					order: 4;
+				}
+
+			}
+		} // close @media
+
+		#item-header {
+
+			#item-actions {
+				float: none;
+				margin: 0 0 0 $spacing-val-md;
+				width: auto;
+
+				h3 {
+					@include font-size(20);
+				}
+			}
+
+			#item-header-avatar {
+				text-align: center;
+			}
+
+			#item-header-content {
+				float: none;
+				overflow: hidden;
+			}
+
+			@media screen and (min-width: 594px) {
+				#item-actions {
+					float: right;
+				}
+
+				#item-header-avatar {
+					float: left;
+				}
+
+				#item-header-content {
+					float: none;
+					overflow: hidden;
+				}
+			}// close @media
+
+		}
+	}
+} // close .single-item.groups
+
+/**
+*-------------------------------------------------
+* @subsection 6.1.2 - item-header: User Accounts
+*-------------------------------------------------
+*/
+
+.bp-user #buddypress {
+	#item-header {
+
+		#item-header-avatar {
+			text-align: center;
+			width: 100%;
+
+			img {
+				float: none;
+			}
+		}
+
+		#latest-update {
+			margin-bottom: $spacing-val-sm;
+		}
+
+		@media screen and (max-width: 594px) {
+			#item-buttons {
+				div.generic-button {
+					display: inline-block;
+					float: none;
+					margin: 0 0 $spacing-val-xs 0;
+					width: 100%;
+
+					a {
+						@include box-model();
+						display: block;
+						width: 100%;
+					}
+				}
+			}
+		}
+
+		@media screen and (min-width: 673px) {
+			#item-header-avatar {
+				float: left;
+				overflow: hidden;
+				text-align: left;
+				width: 20%;
+
+				img {margin: 0;}
+			}
+
+			#item-header-content {
+				float: right;
+				width: 78%;
+
+				#latest-update {
+					margin-bottom: $spacing-val-md;
+				}
+			}
+		}
+
+	} // close #item-header
+
+} // close .bp-user #buddypress
+
+/**
+*------------------------------------------------------------
+* @subsection 6.2 - Item Body: Global
+*------------------------------------------------------------
+*/
+
+/**
+*-------------------------------------------------
+* @subsection 6.2.1 - item-body: Groups
+*-------------------------------------------------
+*/
+
+/**
+	*------------------------------
+	* 6.2.1.1 - Groups Management
+	*------------------------------
+	*/
+
+/* Settings */
+
+#group-settings-form,
+#create-group-form {
+
+	.radio {
+		strong {
+			@include font-size(18);
+		}
+
+		ul {
+			color: lighten($body-text, 30%);
+		}
+	}
+
+	#group-creation-previous {margin: $spacing-val-sm 0;}
+}
+
+/* Manage Members */
+.groups.manage-members {
+	#group-settings-form {
+
+		h4 {margin-top: $spacing-val-lg;}
+
+		.item-list {
+			background: $light-background;
+			border-top: 0;
+			padding: 0 0.5em;
+
+			li {
+				border-bottom: 1px solid $border-light;
+				&:last-child {border-bottom: 0;}
+
+				img,
+				h5 {
+					clear: none;
+					float: left;
+					> a {border-bottom: 0;}
+				}
+
+				span.small {
+					display: block;
+					float: none;
+					margin-top: $spacing-val-sm;
+					width: 100%;
+
+					a {
+						display: inline-block;
+						margin: $spacing-val-xs 0;
+						width: 100%;
+
+						@media screen and (min-width: 38.75em) {
+							width: auto;
+						}
+					}
+				}
+
+				h5 {
+					margin: 0;
+				}
+
+			}
+		}
+	}
+} // close .groups.manage-members
+
+/**
+	*------------------------------
+	* 6.2.1.2 - Group Members List
+	*------------------------------
+	*/
+
+#buddypress {
+	#members-group-list {
+		.item-list {
+			h5 {
+				display: inline-block;
+				margin: 0;
+			}
+
+			span.activity {
+				padding-left: $spacing-val-sm;
+			}
+		}
+	}
+} // close #buddypress
+
+#buddypress {
+	#item-body {
+		#subnav {
+			li.groups-members-search:focus,
+			li.groups-members-search:hover,
+			li.last:focus,
+			li.last:hover {
+				background: none;
+			}
+		}
+	}
+}
+
+// Need to target groups members via body classes
+.groups.group-members {
+	#subnav {
+
+		ul:before,
+		ul:after {
+			content: " ";
+			display: table;
+		}
+
+		ul:after {clear: both; }
+
+		ul {
+			padding: $spacing-val-xs 0;
+		}
+
+
+		li {
+
+			@media screen and (max-width: 400px) {
+				background: $content-background;
+				padding: $spacing-val-sm 0;
+				width: 100% !important;
+			}
+
+			#search-members-form {
+				@include box-model(border-box);
+				float: left;
+				@media screen and (max-width: 400px) {
+					margin: 0;
+					width: 100%;
+
+					label {
+						input[type="text"] {width: 100%;}
+					}
+				}
+				@media screen and (min-width: 783px) {
+					margin-left: 3px;
+				}
+			}
+
+		}
+
+	} // close #subnav
+} // close .groups.group-members
+
+/**
+	*------------------------------
+	* 6.2.1.3 - Groups Send Invites
+	*------------------------------
+	*/
+
+.send-invites {
+	#buddypress {
+		#item-body {
+			@media screen and (min-width: 783px) {
+				border-top: 1px solid $nav-background-border;
+			}
+
+			@media screen and (max-width: 400px) {
+				.left-menu {
+					float: none;
+
+					#invite-list {
+						height: auto;
+						width: auto;
+					}
+				}
+
+				.main-column {
+					margin-left: 0;
+				}
+			}
+
+			li {
+				img.avatar {
+					display: block;
+					float: none;
+					margin: $spacing-val-sm auto;
+				}
+
+				.action {
+					margin-top: $spacing-val-sm;
+					text-align: left;
+					width: 100%;
+
+					@media screen and (min-width: 38.75em) {
+						text-align: right;
+					}
+				}
+			}
+
+			@media screen and (min-width: 594px) {
+				#invite-list {width: 160px;}
+				.main-column {margin-left: 190px;}
+
+				li {
+					img.avatar {
+						float: left;
+						margin: 0 $spacing-val-sm 0 0;
+					}
+				}
+			}
+
+		}
+	}
+}
+
+/**
+*-------------------------------------------------
+* @subsection 6.2.2 - item-body: User Accounts
+*-------------------------------------------------
+*/
+
+
+/**
+	*------------------------------
+	* 6.2.2.2 - Extended Profiles
+	*------------------------------
+	*/
+
+
+#buddypress {
+	.profile {
+
+		.bp-widget {
+			h4 {
+				background: $medium-background;
+				color: #fff;
+				padding: 0.4em 0.2em;
+			}
+		}
+
+		// Edit profile
+
+		#profile-edit-form {
+			.button-nav:before,
+			.button-nav:after {
+				content: " ";
+				display: table;
+			}
+
+			.button-nav:after {
+				clear: both;
+			}
+
+			ul.button-nav {
+				border-bottom: 1px solid $border-light;
+				margin-left: 0;
+
+				li {
+					float: left;
+					margin-bottom: 0;
+
+					&.current {
+						border: 1px solid $border-light;
+						border-bottom-color: #fff;
+						margin-bottom: -1px;
+					}
+				} // li
+
+				a {
+					background: none;
+					border: 0;
+					@include font-size(18)
+				}
+			} //.button-nav
+
+			.field-visibility-settings-toggle,
+			.field-visibility-settings {
+				@include font-size(14);
+			}
+
+			.field-visibility-settings-close,
+			.visibility-toggle-link {
+				background: $dark-background;
+				color: #fff;
+				padding: 0.2em 0.5em;
+			}
+		} // close profile form
+
+	} // close .profile
+} // close #buddypress - user acounts item-body
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.5 - Messaging
+	*------------------------------
+	*/
+
+#buddypress {
+
+	table#message-threads {
+		border-left: 1px solid $border-med;
+		border-right: 1px solid $border-med;
+
+		tbody > tr:first-child {
+			td.bulk-select-check,
+			td.thread-from {
+				border-top: 1px solid $border-med;
+		 }
+		}
+
+		tr {
+
+			td {
+				background: $content-background;
+				border-right: 0 !important;
+				@include box-model(border-box);
+				display: inline-block;
+				float: left;
+			}
+
+			td.thread-star,
+			td.thread-options {
+				border-bottom-color: darken($border-med, 5%);
+				border-bottom-width: 2px;
+				border-left: 0;
+				height: 2.4em;
+				padding-bottom: 0.2em;
+				padding-top: 0.2em;
+
+				@media screen and (max-width: 549px) {
+					padding-top: 0;
+				}
+			}
+
+			td.bulk-select-check,
+			td.thread-from {
+				border-left: 0;
+				height: 2.6em;
+				@media screen and (max-width: 320px) {
+					height: 5.2em;
+				}
+			}
+
+			td.thread-from,
+			td.thread-options {
+				border-left: 0;
+				@include calc(width, "100% - 30px");
+				margin-left: 0;
+			}
+
+			td.thread-info {
+				border-left: 0;
+				padding-left: 41px;
+				width: 100%;
+
+				a::after {
+					content: " \2013 \00a0"attr(title);
+					@include font-size(12);
+				}
+			}
+
+			td.thread-options {
+				text-align: right;
+
+				a {
+					@include font-size(12);
+					line-height: 2.2;
+				}
+			}
+
+			span.from {
+				display: none;
+			}
+
+			span.activity {
+				display: block;
+				float: right;
+				line-height: 2;
+				@media screen and (max-width: 320px) {
+					clear: both;
+					@include font-size(11);
+					width: 100%;
+				}
+			}
+		}
+
+		tr.unread {
+			td {
+				background: lighten($unread, 7%);
+				border-color: $border-med;
+				border-top: 0;
+				border-width: 1px;
+			}
+		}
+
+		th {
+			display: none;
+		}
+
+		th.bulk-select-all {
+			border-bottom: 0;
+			display: inline-block;
+			text-align: left;
+		}
+
+		th.bulk-select-all,
+		td.bulk-select-check,
+		td.thread-star {
+			border-right: 0;
+			width: 30px;
+		}
+
+	} // close #messages-threads
+
+	/* Read Single thread */
+	#message-thread {
+
+		#message-subject {
+			@include title-background-dark();
+			padding: 0.5em;
+		}
+
+		.message-box {
+			.message-metadata {
+				margin-bottom: $spacing-val-sm;
+			}
+
+			.message-content {
+				clear: left;
+				margin-left: 0;
+			}
+		}
+	}
+
+	/* Sitewide Notices loop */
+	#message-threads.sitewide-notices {
+		td {
+			width: 100%;
+
+			strong {
+				@include title-background-dark();
+				@include font-size(16);
+				display: block;
+				margin-bottom: 0.4em;
+				padding: 0.2em;
+			}
+
+			a {
+				display: inline-block;
+				line-height: initial;
+			}
+		}
+
+		td:first-child {
+			display: none;
+		}
+
+		td:first-child + td + td {
+		// notice date
+			border-bottom: 0;
+
+			span {
+				line-height: 1;
+			}
+		}
+
+		td:last-child {
+		// notice actions
+			border-bottom-color: $border-med;
+			line-height: 1;
+			text-align: right;
+
+			a:last-child {
+			// hide the 'x' text
+				line-height: 0;
+				margin-left: 0.7em;
+				text-indent: -999em;
+			}
+
+			a:last-child::after {
+				content: attr(title);
+				display: block;
+				line-height: initial;
+				text-indent: 0;
+			}
+		}
+	}
+
+} // close #buddypress - user acounts item-body
+
+/**
+	*------------------------------
+	* @subsection 6.2.2.6 - Settings
+	*------------------------------
+	*/
+
+#buddypress {
+	#settings-form {
+		// 'p' = email notification screen sub heading
+		> p { @include font-size(20); }
+	}
+
+	table.notification-settings {
+		td.yes,
+		td.no {
+			vertical-align: middle;
+		}
+	}
+	// Profile table td widths
+	table.profile-settings {
+		width: 100%;
+
+		th.field-group-name,
+		td.field-name {
+			width: 50%;
+		}
+
+		@media screen and (min-width: 401px) {
+			th.field-group-name,
+			td.field-name {
+				width: 70%;
+			}
+		}
+
+		td.field-visibility {
+			select {width: 100%;}
+		}
+	}
+} // close #buddypress - user acounts item-body
+
+/*------------------------------------------------------------------------------
+* @section - 7.0 - Forms  - General
+*-------------------------------------------------------------------------------
+*/
+
+// Match BP form elements to Themes(2014) styling where styles
+// are not inherited or being overriden.
+#buddypress {
+
+	input[type="text"],
+	input[type="email"],
+	input[type="password"],
+	input[type="submit"],
+	select,
+	textarea {
+		border: 1px solid $border-med;
+	}
+
+	.standard-form {
+		input[type="text"],
+		input[type="email"],
+		input[type="password"],
+		input[type="submit"],
+		textarea {
+			width: 100%;
+		}
+	}
+
+	// BP :(
+	#send-reply.standard-form textarea {width: 100%;}
+
+	div.activity-comments {
+		form {
+			.ac-textarea {
+				background: $light-background;
+				border: 1px solid $border-med;
+
+				textarea {
+					background: none;
+					border: 0;
+				}
+			}
+		}
+	}
+
+} // close #buddypress
+
+#buddypress {
+
+	div.dir-search,
+	div.message-search,
+	li.groups-members-search {
+		clear: both;
+		float: none;
+		margin: $spacing-val-sm 0;
+
+// Stylise the seach form elements, in part this deals with padding
+// issues on the submit & sizing issues between bp styles & twentyfourteen
+		form {
+			border: 1px solid #ccc;
+			overflow: hidden;
+
+			label {
+				float: left;
+				width: 80%;
+			}
+
+			input[type='text'] {
+				float: left;
+				margin: 0;
+				width: 80%;
+			}
+
+			input[type='text'],
+			input[type='submit'] {
+				border: 0;
+				@include font-size(14);
+				line-height: inherit;
+			}
+
+			input[type='text'] {
+				border-right: 1px solid #ccc;
+				padding: 0.2em 0 0.2em 0.2em;
+			}
+
+			input[type='submit'] {
+				float: right;
+				font-weight: normal;
+				padding: 0.2em 1em;
+				text-align: center;
+				text-transform: none;
+				width: 20%;
+			}
+
+			}// close form
+
+	} // close .dir-search, .message-search
+
+	// Shift the search parent to the right and allow to shrinkwrap
+	@media screen and (min-width: 401px) {
+		div.dir-search,
+		div.message-search {
+			clear: none;
+			float: right;
+
+			form {
+				label,
+				input[type='submit'],
+				input[type='text'] {
+					width: auto;
+				}
+			}
+		}
+
+		div.message-search { margin: 3px 0 0;}
+
+		li.groups-members-search {
+			form {
+				label,
+				input[type='submit'],
+				input[type='text'] {
+					width: auto;
+				}
+			}
+		}
+
+	} // close @media
+
+} // close #buddypress
+
+/**
+*-------------------------------------------------------------------------------
+* @section 8.0 - Tables General
+*-------------------------------------------------------------------------------
+*/
+#buddypress {
+	table {
+		border-color: $border-med;
+	}
+}
+/*__ User Account tables __*/
+
+/**
+*-------------------------------------------------------------------------------
+* @section 9.0 - Error / Success messages
+*-------------------------------------------------------------------------------
+*/
+// message args ($variable-color, text-color)
+// Leave text-color undefined to automagically set text color
+// to background color darker by 50%
+#buddypress {
+
+	div#message {
+		p {
+			@include font-size(18);
+			font-weight: bold;
+		}
+
+		&.info {
+			p {
+				@include message-box($notice-info);
+			}
+		}
+
+		&.updated {
+			p {
+				@include message-box($notice-update);
+			}
+		}
+
+	} // close #message
+
+} // close  #buddypress
+
+// Without direct classes on our messages ( 'warning' )
+// we need to use the body classes
+// todo: If this is class .warning is included in main BP styles remove from here
+.delete-group {
+	#buddypress {
+		div#message.info {
+			p {
+				@include message-box($notice-warning);
+			}
+		}
+	}
+}
+
+/**
+*-------------------------------------------------------------------------------
+* @section 10.0 - Ajax Loading, Widgets, General classes
+*-------------------------------------------------------------------------------
+*/
+
+#buddypress {
+	/* Auto Complete background */
+	.acfb-holder {
+
+		li.friend-tab {
+			background: $notice-info;
+			border: inherit;
+	 }
+	}
+}
+
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js
index 1107c9f7398e19541b3553c04b296b22e73e34eb..373d6261c75a570eae137fe5a9708bee24e0a7a0 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js
@@ -5,7 +5,7 @@ var jq = jQuery;
 // Global variable to prevent multiple AJAX requests
 var bp_ajax_request = null;
 
-// Global variables to temporarly store newest activities
+// Global variables to temporarily store newest activities
 var newest_activities = '';
 var activity_last_recorded  = 0;
 
@@ -33,7 +33,7 @@ jq(document).ready( function() {
 		var $member_nicename = $whats_new.val();
 
 		jq('#whats-new-options').animate({
-			height:'40px'
+			height:'50px'
 		});
 
 		$whats_new.animate({
@@ -53,7 +53,7 @@ jq(document).ready( function() {
 	/* Textarea focus */
 	$whats_new.focus( function(){
 		jq('#whats-new-options').animate({
-			height:'40px'
+			height:'50px'
 		});
 		jq('#whats-new-form textarea').animate({
 			height:'50px'
@@ -71,7 +71,7 @@ jq(document).ready( function() {
 		// to avoid inconsistencies with the heartbeat integration
 		if ( $activity_all.length  ) {
 			if ( ! $activity_all.hasClass( 'selected' ) ) {
-				// reset to everyting
+				// reset to everything
 				jq( '#activity-filter-select select' ).val( '-1' );
 				$activity_all.children( 'a' ).trigger( 'click' );
 			} else if ( '-1' !== jq( '#activity-filter-select select' ).val() ) {
@@ -87,7 +87,7 @@ jq(document).ready( function() {
 			if (!this.value.match(/\S+/)) {
 				this.value = '';
 				jq('#whats-new-options').animate({
-					height:'40px'
+					height:'0'
 				});
 				jq('form#whats-new-form textarea').animate({
 					height:'20px'
@@ -616,7 +616,7 @@ jq(document).ready( function() {
 							}
 						}
 
-						/* Preceeding whitespace breaks output with jQuery 1.9.0 */
+						/* Preceding whitespace breaks output with jQuery 1.9.0 */
 						var the_comment = jq.trim( response );
 
 						activity_comments.children('ul').append( jq( the_comment ).hide().fadeIn( 200 ) );
@@ -820,7 +820,7 @@ jq(document).ready( function() {
 			template = null;
 
 			// The Group Members page specifies its own template
-			if ( 'members' === object && 'groups' === css_id[1] ) {
+			if ( event.currentTarget.className === 'groups-members-search' ) {
 				object = 'group_members';
 				template = 'groups/single/members';
 			}
@@ -835,7 +835,7 @@ jq(document).ready( function() {
 
 	/* When a navigation tab is clicked - e.g. | All Groups | My Groups | */
 	jq('div.item-list-tabs').on( 'click', function(event) {
-		if ( jq(this).hasClass('no-ajax') )  {
+		if ( jq(this).hasClass('no-ajax')  || jq( event.target ).hasClass('no-ajax') )  {
 			return;
 		}
 
@@ -889,6 +889,8 @@ jq(document).ready( function() {
 		$gm_search = jq( '.groups-members-search input' );
 		if ( $gm_search.length ) {
 			search_terms = $gm_search.val();
+			object = 'members';
+			scope = 'groups';
 		}
 
 		// On the Groups Members page, we specify a template
@@ -910,7 +912,8 @@ jq(document).ready( function() {
 	jq('#buddypress').on( 'click', function(event) {
 		var target = jq(event.target),
 			el,
-			css_id, object, search_terms, pagination_id, template, page_number,
+			css_id, object, search_terms, pagination_id, template,
+			url_parameters,	page_number,
 			$gm_search,
 			caller;
 
@@ -935,12 +938,18 @@ jq(document).ready( function() {
 			pagination_id = jq(target).closest('.pagination-links').attr('id');
 			template = null;
 
-			page_number = target.attr('href').split( '=' );
+			url_parameters = target.attr('href').split( '&' );
+			// The page number is the first parameter.
+			page_number = url_parameters[0].split( '=' );
 			page_number = page_number[1];
 
 			// Search terms
 			if ( jq('div.dir-search input').length ) {
-				search_terms =  jq('.dir-search input').prop('placeholder') ? jq('.dir-search input').prop('placeholder') : jq('.dir-search input').val();
+				search_terms =  jq('.dir-search input').val();
+
+				if ( ! search_terms && bp_get_querystring('s') ) {
+					search_terms = jq('.dir-search input').prop('placeholder');
+				}
 			}
 
 			// The Group Members page has a different selector for
@@ -948,6 +957,7 @@ jq(document).ready( function() {
 			$gm_search = jq( '.groups-members-search input' );
 			if ( $gm_search.length ) {
 				search_terms = $gm_search.val();
+				object = 'members';
 			}
 
 			// On the Groups Members page, we specify a template
@@ -1201,7 +1211,7 @@ jq(document).ready( function() {
 	});
 
 	/* Add / Remove friendship buttons */
-	jq( '#members-dir-list, #members-group-list' ).on('click', '.friendship-button a', function() {
+	jq( '#members-dir-list, #members-group-list, #item-header' ).on('click', '.friendship-button a', function() {
 		jq(this).parent().addClass('loading');
 		var fid   = jq(this).attr('id'),
 			nonce   = jq(this).attr('href'),
@@ -1288,7 +1298,7 @@ jq(document).ready( function() {
 
 			// user groups page
 			if ( ! jq('body.directory').length ) {
-				location.href = location.href;
+				window.location.reload();
 
 			// groups directory
 			} else {
@@ -1332,9 +1342,25 @@ jq(document).ready( function() {
 		return false;
 	});
 
+	/** Registration ***********************************************/
+
+	if ( jq('body').hasClass('register') ) {
+		var blog_checked = jq('#signup_with_blog');
+
+		// hide "Blog Details" block if not checked by default
+		if ( ! blog_checked.prop('checked') ) {
+			jq('#blog-details').toggle();
+		}
+
+		// toggle "Blog Details" block whenever checkbox is checked
+		blog_checked.change(function() {
+			jq('#blog-details').toggle();
+		});
+	}
+
 	/** Private Messaging ******************************************/
 
-	/** Message search*/
+	/** Message search */
 	jq('.message-search').on( 'click', function(event) {
 		if ( jq(this).hasClass('no-ajax') ) {
 			return;
@@ -1343,11 +1369,17 @@ jq(document).ready( function() {
 		var target = jq(event.target),
 			object;
 
-		if ( target.attr('type') === 'submit' ) {
-			//var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
+		if ( target.attr('type') === 'submit' || target.attr('type') === 'button' ) {
 			object = 'messages';
 
-			bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') );
+			bp_filter_request(
+				object,
+				jq.cookie('bp-' + object + '-filter'),
+				jq.cookie('bp-' + object + '-scope'),
+				'div.' + object, jq('#messages_search').val(),
+				1,
+				jq.cookie('bp-' + object + '-extras')
+			);
 
 			return false;
 		}
@@ -1525,6 +1557,126 @@ jq(document).ready( function() {
 		return false;
 	});
 
+	/* Selecting/Deselecting all messages */
+	jq('#select-all-messages').click(function(event) {
+		if( this.checked ) {
+			jq('.message-check').each(function() {
+				this.checked = true;
+			});
+		} else {
+			jq('.message-check').each(function() {
+				this.checked = false;
+			});
+		}
+	});
+
+	/* Make sure a 'Bulk Action' is selected before submitting the messages bulk action form */
+	jq('#messages-bulk-manage').attr('disabled', 'disabled');
+
+	/* Remove the disabled attribute from the messages form submit button when bulk action has a value */
+	jq('#messages-select').on('change', function(){
+		jq('#messages-bulk-manage').attr('disabled', jq(this).val().length <= 0);
+	});
+
+	/* Star action function */
+	starAction = function() {
+		var link = jq(this);
+
+		jq.post( ajaxurl, {
+			action: 'messages_star',
+			'message_id': link.data('message-id'),
+			'star_status': link.data('star-status'),
+			'nonce': link.data('star-nonce'),
+			'bulk': link.data('star-bulk')
+		},
+		function(response) {
+			if ( 1 === parseInt( response, 10 ) ) {
+				if ( 'unstar' === link.data('star-status') ) {
+					link.data('star-status', 'star');
+					link.removeClass('message-action-unstar').addClass('message-action-star');
+					link.find('.bp-screen-reader-text').text( BP_PM_Star.strings.text_star );
+
+					if ( 1 === BP_PM_Star.is_single_thread ) {
+						link.prop('title', BP_PM_Star.strings.title_star );
+					} else {
+						link.prop('title', BP_PM_Star.strings.title_star_thread );
+					}
+
+				} else {
+					link.data('star-status', 'unstar');
+					link.removeClass('message-action-star').addClass('message-action-unstar');
+					link.find('.bp-screen-reader-text').text(BP_PM_Star.strings.text_unstar);
+
+					if ( 1 === BP_PM_Star.is_single_thread ) {
+						link.prop('title', BP_PM_Star.strings.title_unstar );
+					} else {
+						link.prop('title', BP_PM_Star.strings.title_unstar_thread );
+					}
+				}
+			}
+		});
+		return false;
+	};
+
+	/* Star actions */
+	jq('#message-threads').on('click', 'td.thread-star a', starAction );
+	jq('#message-thread').on('click', '.message-star-actions a', starAction );
+
+	/* Star bulk manage - Show only the valid action based on the starred item. */
+	jq('#message-threads td.bulk-select-check :checkbox').on('change', function() {
+		var box = jq(this),
+			star = box.closest('tr').find('.thread-star a');
+
+		if ( box.prop('checked') ) {
+			if( 'unstar' === star.data('star-status') ) {
+				BP_PM_Star.star_counter++;
+			} else {
+				BP_PM_Star.unstar_counter++;
+			}
+		} else {
+			if( 'unstar' === star.data('star-status') ) {
+				BP_PM_Star.star_counter--;
+			} else {
+				BP_PM_Star.unstar_counter--;
+			}
+		}
+
+		if ( BP_PM_Star.star_counter > 0 && parseInt( BP_PM_Star.unstar_counter, 10 ) === 0 ) {
+			jq('option[value="star"]').hide();
+		} else {
+			jq('option[value="star"]').show();
+		}
+
+		if ( BP_PM_Star.unstar_counter > 0 && parseInt( BP_PM_Star.star_counter, 10 ) === 0 ) {
+			jq('option[value="unstar"]').hide();
+		} else {
+			jq('option[value="unstar"]').show();
+		}
+	});
+
+	/** Notifications **********************************************/
+
+	/* Selecting/Deselecting all notifications */
+	jq('#select-all-notifications').click(function(event) {
+		if( this.checked ) {
+			jq('.notification-check').each(function() {
+				this.checked = true;
+			});
+		} else {
+			jq('.notification-check').each(function() {
+				this.checked = false;
+			});
+		}
+	});
+
+	/* Make sure a 'Bulk Action' is selected before submitting the form */
+	jq('#notification-bulk-manage').attr('disabled', 'disabled');
+
+	/* Remove the disabled attribute from the form submit button when bulk action has a value */
+	jq('#notification-select').on('change', function(){
+		jq('#notification-bulk-manage').attr('disabled', jq(this).val().length <= 0);
+	});
+
 	/* Close site wide notices in the sidebar */
 	jq('#close-notice').on( 'click', function() {
 		jq(this).addClass('loading');
@@ -1547,7 +1699,7 @@ jq(document).ready( function() {
 		return false;
 	});
 
-	/* Toolbar & wp_list_pages Javascript IE6 hover class */
+	/* Toolbar & wp_list_pages JavaScript IE6 hover class */
 	jq('#wp-admin-bar ul.main-nav li, #nav li').mouseover( function() {
 		jq(this).addClass('sfhover');
 	});
@@ -1557,7 +1709,7 @@ jq(document).ready( function() {
 	});
 
 	/* Clear BP cookies on logout */
-	jq('a.logout').on( 'click', function() {
+	jq('#wp-admin-bar-logout, a.logout').on( 'click', function() {
 		jq.removeCookie('bp-activity-scope', {
 			path: '/'
 		});
@@ -1602,9 +1754,10 @@ jq(document).ready( function() {
 	}
 
 	// Set the last id to request after
+	var first_item_recorded = 0;
 	jq( document ).on( 'heartbeat-send.buddypress', function( e, data ) {
 
-		firstrow = 0;
+		first_item_recorded = 0;
 
 		// First row is default latest activity id
 		if ( jq( '#buddypress ul.activity-list li' ).first().prop( 'id' ) ) {
@@ -1612,12 +1765,12 @@ jq(document).ready( function() {
 			timestamp = jq( '#buddypress ul.activity-list li' ).first().prop( 'class' ).match( /date-recorded-([0-9]+)/ );
 
 			if ( timestamp ) {
-				firstrow = timestamp[1];
+				first_item_recorded = timestamp[1];
 			}
 		}
 
-		if ( 0 === activity_last_recorded || Number( firstrow ) > activity_last_recorded ) {
-			activity_last_recorded = Number( firstrow );
+		if ( 0 === activity_last_recorded || Number( first_item_recorded ) > activity_last_recorded ) {
+			activity_last_recorded = Number( first_item_recorded );
 		}
 
 		data.bp_activity_last_recorded = activity_last_recorded;
@@ -1655,12 +1808,12 @@ function bp_init_activity() {
 		path: '/'
 	} );
 
-	if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length ) {
+	if ( null !== jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length ) {
 		jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
 	}
 
 	/* Activity Tab Set */
-	if ( null != jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
+	if ( null !== jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
 		jq('.activity-type-tabs li').each( function() {
 			jq(this).removeClass('selected');
 		});
@@ -1671,11 +1824,11 @@ function bp_init_activity() {
 /* Setup object scope and filter based on the current cookie settings for the object. */
 function bp_init_objects(objects) {
 	jq(objects).each( function(i) {
-		if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length ) {
+		if ( null !== jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length ) {
 			jq('#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
 		}
 
-		if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
+		if ( null !== jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
 			jq('.item-list-tabs li').each( function() {
 				jq(this).removeClass('selected');
 			});
@@ -1804,7 +1957,7 @@ function bp_activity_request(scope, filter) {
 		});
 
 		/* Update the feed link */
-		if ( null != response.feed_url ) {
+		if ( null !== response.feed_url ) {
 			jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url);
 		}
 
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.min.js b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.min.js
index 6e9e61ecb46dcf7ce2c1cf7ff6bf9a97a0832e77..e05fb8830017b329db8d15152559798cb10dbe20 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.min.js
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.min.js
@@ -1,2 +1,3 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-function bp_init_activity(){jq.cookie("bp-activity-oldestpage",1,{path:"/"}),null!=jq.cookie("bp-activity-filter")&&jq("#activity-filter-select").length&&jq('#activity-filter-select select option[value="'+jq.cookie("bp-activity-filter")+'"]').prop("selected",!0),null!=jq.cookie("bp-activity-scope")&&jq(".activity-type-tabs").length&&(jq(".activity-type-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#activity-"+jq.cookie("bp-activity-scope")+", .item-list-tabs li.current").addClass("selected"))}function bp_init_objects(a){jq(a).each(function(b){null!=jq.cookie("bp-"+a[b]+"-filter")&&jq("#"+a[b]+"-order-select select").length&&jq("#"+a[b]+'-order-select select option[value="'+jq.cookie("bp-"+a[b]+"-filter")+'"]').prop("selected",!0),null!=jq.cookie("bp-"+a[b]+"-scope")&&jq("div."+a[b]).length&&(jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+a[b]+"-"+jq.cookie("bp-"+a[b]+"-scope")+", #object-nav li.current").addClass("selected"))})}function bp_filter_request(a,b,c,d,e,f,g,h,i){return"activity"===a?!1:(null===c&&(c="all"),jq.cookie("bp-"+a+"-scope",c,{path:"/"}),jq.cookie("bp-"+a+"-filter",b,{path:"/"}),jq.cookie("bp-"+a+"-extras",g,{path:"/"}),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+a+"-"+c+", #object-nav li.current").addClass("selected"),jq(".item-list-tabs li.selected").addClass("loading"),jq('.item-list-tabs select option[value="'+b+'"]').prop("selected",!0),("friends"===a||"group_members"===a)&&(a="members"),bp_ajax_request&&bp_ajax_request.abort(),void(bp_ajax_request=jq.post(ajaxurl,{action:a+"_filter",cookie:bp_get_cookies(),object:a,filter:b,search_terms:e,scope:c,page:f,extras:g,template:i},function(a){if("pag-bottom"===h&&jq("#subnav").length){var b=jq("#subnav").parent();jq("html,body").animate({scrollTop:b.offset().top},"slow",function(){jq(d).fadeOut(100,function(){jq(this).html(a),jq(this).fadeIn(100)})})}else jq(d).fadeOut(100,function(){jq(this).html(a),jq(this).fadeIn(100)});jq(".item-list-tabs li.selected").removeClass("loading")})))}function bp_activity_request(a,b){jq.cookie("bp-activity-scope",a,{path:"/"}),jq.cookie("bp-activity-filter",b,{path:"/"}),jq.cookie("bp-activity-oldestpage",1,{path:"/"}),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected loading")}),jq("#activity-"+a+", .item-list-tabs li.current").addClass("selected"),jq("#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected").addClass("loading"),jq('#activity-filter-select select option[value="'+b+'"]').prop("selected",!0),jq(".widget_bp_activity_widget h2 span.ajax-loader").show(),bp_ajax_request&&bp_ajax_request.abort(),bp_ajax_request=jq.post(ajaxurl,{action:"activity_widget_filter",cookie:bp_get_cookies(),_wpnonce_activity_filter:jq("#_wpnonce_activity_filter").val(),scope:a,filter:b},function(a){jq(".widget_bp_activity_widget h2 span.ajax-loader").hide(),jq("div.activity").fadeOut(100,function(){jq(this).html(a.contents),jq(this).fadeIn(100),bp_legacy_theme_hide_comments()}),null!=a.feed_url&&jq(".directory #subnav li.feed a, .home-page #subnav li.feed a").attr("href",a.feed_url),jq(".item-list-tabs li.selected").removeClass("loading")},"json")}function bp_legacy_theme_hide_comments(){var a,b,c,d=jq("div.activity-comments");return d.length?void d.each(function(){jq(this).children("ul").children("li").length<5||(comments_div=jq(this),a=comments_div.parents("#activity-stream > li"),b=jq(this).children("ul").children("li"),c=" ",jq("#"+a.attr("id")+" a.acomment-reply span").length&&(c=jq("#"+a.attr("id")+" a.acomment-reply span").html()),b.each(function(d){d<b.length-5&&(jq(this).addClass("hidden"),jq(this).toggle(),d||jq(this).before('<li class="show-all"><a href="#'+a.attr("id")+'/show-all/" title="'+BP_DTheme.show_all_comments+'">'+BP_DTheme.show_x_comments.replace("%d",c)+"</a></li>"))}))}):!1}function checkAll(){var a,b=document.getElementsByTagName("input");for(a=0;a<b.length;a++)"checkbox"===b[a].type&&(b[a].checked=""===$("check_all").checked?"":"checked")}function clear(a){if(a=document.getElementById(a)){var b=a.getElementsByTagName("INPUT"),c=a.getElementsByTagName("OPTION"),d=0;if(b)for(d=0;d<b.length;d++)b[d].checked="";if(c)for(d=0;d<c.length;d++)c[d].selected=!1}}function bp_get_cookies(){var a,b,c,d,e,f=document.cookie.split(";"),g={},h="bp-";for(a=0;a<f.length;a++)b=f[a],c=b.indexOf("="),d=jq.trim(unescape(b.slice(0,c))),e=unescape(b.slice(c+1)),0===d.indexOf(h)&&(g[d]=e);return encodeURIComponent(jq.param(g))}var jq=jQuery,bp_ajax_request=null,newest_activities="",activity_last_recorded=0;jq(document).ready(function(){"-1"===window.location.search.indexOf("new")&&jq("div.forums").length?jq("#new-topic-post").hide():jq("#new-topic-post").show(),bp_init_activity();var a=["members","groups","blogs","forums","group_members"],b=jq("#whats-new");if(bp_init_objects(a),b.length&&bp_get_querystring("r")){var c=b.val();jq("#whats-new-options").animate({height:"40px"}),b.animate({height:"50px"}),jq.scrollTo(b,500,{offset:-125,easing:"swing"}),b.val("").focus().val(c)}b.focus(function(){jq("#whats-new-options").animate({height:"40px"}),jq("#whats-new-form textarea").animate({height:"50px"}),jq("#aw-whats-new-submit").prop("disabled",!1);var a=jq("form#whats-new-form"),b=jq("#activity-all");a.hasClass("submitted")&&a.removeClass("submitted"),b.length&&(b.hasClass("selected")?"-1"!==jq("#activity-filter-select select").val()&&(jq("#activity-filter-select select").val("-1"),jq("#activity-filter-select select").trigger("change")):(jq("#activity-filter-select select").val("-1"),b.children("a").trigger("click")))}),b.blur(function(){document.activeElement!==this&&(this.value.match(/\S+/)||(this.value="",jq("#whats-new-options").animate({height:"40px"}),jq("form#whats-new-form textarea").animate({height:"20px"}),jq("#aw-whats-new-submit").prop("disabled",!0)))}),jq("#aw-whats-new-submit").on("click",function(){var a=0,b=jq(this),c=b.closest("form#whats-new-form");return c.children().each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!0)}),jq("div.error").remove(),b.addClass("loading"),b.prop("disabled",!0),c.addClass("submitted"),object="",item_id=jq("#whats-new-post-in").val(),content=jq("#whats-new").val(),firstrow=jq("#buddypress ul.activity-list li").first(),activity_row=firstrow,timestamp=null,firstrow.length&&(activity_row.hasClass("load-newest")&&(activity_row=firstrow.next()),timestamp=activity_row.prop("class").match(/date-recorded-([0-9]+)/)),timestamp&&(a=timestamp[1]),item_id>0&&(object=jq("#whats-new-post-object").val()),jq.post(ajaxurl,{action:"post_update",cookie:bp_get_cookies(),_wpnonce_post_update:jq("#_wpnonce_post_update").val(),content:content,object:object,item_id:item_id,since:a,_bp_as_nonce:jq("#_bp_as_nonce").val()||""},function(b){if(c.children().each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!1)}),b[0]+b[1]==="-1")c.prepend(b.substr(2,b.length)),jq("#"+c.attr("id")+" div.error").hide().fadeIn(200);else{if(0===jq("ul.activity-list").length&&(jq("div.error").slideUp(100).remove(),jq("#message").slideUp(100).remove(),jq("div.activity").append('<ul id="activity-stream" class="activity-list item-list">')),firstrow.hasClass("load-newest")&&firstrow.remove(),jq("#activity-stream").prepend(b),a||jq("#activity-stream li:first").addClass("new-update just-posted"),0!==jq("#latest-update").length){var d=jq("#activity-stream li.new-update .activity-content .activity-inner p").html(),e=jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr("href"),f=jq("#activity-stream li.new-update .activity-content .activity-inner p").text(),g="";""!==f&&(g=d+" "),g+='<a href="'+e+'" rel="nofollow">'+BP_DTheme.view+"</a>",jq("#latest-update").slideUp(300,function(){jq("#latest-update").html(g),jq("#latest-update").slideDown(300)})}jq("li.new-update").hide().slideDown(300),jq("li.new-update").removeClass("new-update"),jq("#whats-new").val(""),newest_activities="",activity_last_recorded=0}jq("#whats-new-options").animate({height:"0px"}),jq("#whats-new-form textarea").animate({height:"20px"}),jq("#aw-whats-new-submit").prop("disabled",!0).removeClass("loading")}),!1}),jq("div.activity-type-tabs").on("click",function(a){var b,c,d=jq(a.target).parent();if("STRONG"===a.target.nodeName||"SPAN"===a.target.nodeName)d=d.parent();else if("A"!==a.target.nodeName)return!1;return jq.cookie("bp-activity-oldestpage",1,{path:"/"}),b=d.attr("id").substr(9,d.attr("id").length),c=jq("#activity-filter-select select").val(),"mentions"===b&&jq("#"+d.attr("id")+" a strong").remove(),bp_activity_request(b,c),!1}),jq("#activity-filter-select select").change(function(){var a,b=jq("div.activity-type-tabs li.selected"),c=jq(this).val();return a=b.length?b.attr("id").substr(9,b.attr("id").length):null,bp_activity_request(a,c),!1}),jq("div.activity").on("click",function(a){var b,c,d,e,f,g,h,i,j,k,l=jq(a.target);return l.hasClass("fav")||l.hasClass("unfav")?(b=l.hasClass("fav")?"fav":"unfav",c=l.closest(".activity-item"),d=c.attr("id").substr(9,c.attr("id").length),l.addClass("loading"),jq.post(ajaxurl,{action:"activity_mark_"+b,cookie:bp_get_cookies(),id:d},function(a){l.removeClass("loading"),l.fadeOut(200,function(){jq(this).html(a),jq(this).attr("title","fav"===b?BP_DTheme.remove_fav:BP_DTheme.mark_as_fav),jq(this).fadeIn(200)}),"fav"===b?(jq(".item-list-tabs #activity-favs-personal-li").length||(jq(".item-list-tabs #activity-favorites").length||jq(".item-list-tabs ul #activity-mentions").before('<li id="activity-favorites"><a href="#">'+BP_DTheme.my_favs+" <span>0</span></a></li>"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())+1)),l.removeClass("fav"),l.addClass("unfav")):(l.removeClass("unfav"),l.addClass("fav"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())-1),Number(jq(".item-list-tabs ul #activity-favorites span").html())||(jq(".item-list-tabs ul #activity-favorites").hasClass("selected")&&bp_activity_request(null,null),jq(".item-list-tabs ul #activity-favorites").remove())),"activity-favorites"===jq(".item-list-tabs li.selected").attr("id")&&l.closest(".activity-item").slideUp(100)}),!1):l.hasClass("delete-activity")?(e=l.parents("div.activity ul li"),f=e.attr("id").substr(9,e.attr("id").length),g=l.attr("href"),h=g.split("_wpnonce="),i=e.prop("class").match(/date-recorded-([0-9]+)/),h=h[1],l.addClass("loading"),jq.post(ajaxurl,{action:"delete_activity",cookie:bp_get_cookies(),id:f,_wpnonce:h},function(a){a[0]+a[1]==="-1"?(e.prepend(a.substr(2,a.length)),e.children("#message").hide().fadeIn(300)):(e.slideUp(300),i&&activity_last_recorded===i[1]&&(newest_activities="",activity_last_recorded=0))}),!1):l.hasClass("spam-activity")?(e=l.parents("div.activity ul li"),i=e.prop("class").match(/date-recorded-([0-9]+)/),l.addClass("loading"),jq.post(ajaxurl,{action:"bp_spam_activity",cookie:encodeURIComponent(document.cookie),id:e.attr("id").substr(9,e.attr("id").length),_wpnonce:l.attr("href").split("_wpnonce=")[1]},function(a){a[0]+a[1]==="-1"?(e.prepend(a.substr(2,a.length)),e.children("#message").hide().fadeIn(300)):(e.slideUp(300),i&&activity_last_recorded===i[1]&&(newest_activities="",activity_last_recorded=0))}),!1):l.parent().hasClass("load-more")?(bp_ajax_request&&bp_ajax_request.abort(),jq("#buddypress li.load-more").addClass("loading"),null===jq.cookie("bp-activity-oldestpage")&&jq.cookie("bp-activity-oldestpage",1,{path:"/"}),j=1*jq.cookie("bp-activity-oldestpage")+1,k=[],jq(".activity-list li.just-posted").each(function(){k.push(jq(this).attr("id").replace("activity-",""))}),load_more_args={action:"activity_get_older_updates",cookie:bp_get_cookies(),page:j,exclude_just_posted:k.join(",")},load_more_search=bp_get_querystring("s"),load_more_search&&(load_more_args.search_terms=load_more_search),bp_ajax_request=jq.post(ajaxurl,load_more_args,function(a){jq("#buddypress li.load-more").removeClass("loading"),jq.cookie("bp-activity-oldestpage",j,{path:"/"}),jq("#buddypress ul.activity-list").append(a.contents),l.parent().hide()},"json"),!1):void(l.parent().hasClass("load-newest")&&(a.preventDefault(),l.parent().hide(),activity_html=jq.parseHTML(newest_activities),jq.each(activity_html,function(a,b){"LI"===b.nodeName&&jq(b).hasClass("just-posted")&&jq("#"+jq(b).attr("id")).length&&jq("#"+jq(b).attr("id")).remove()}),jq("#buddypress ul.activity-list").prepend(newest_activities),newest_activities=""))}),jq("div.activity").on("click",".activity-read-more a",function(a){var b,c,d=jq(a.target),e=d.parent().attr("id").split("-"),f=e[3],g=e[0];return b="acomment"===g?"acomment-content":"activity-inner",c=jq("#"+g+"-"+f+" ."+b+":first"),jq(d).addClass("loading"),jq.post(ajaxurl,{action:"get_single_activity_content",activity_id:f},function(a){jq(c).slideUp(300).html(a).slideDown(300)}),!1}),jq("form.ac-form").hide(),jq(".activity-comments").length&&bp_legacy_theme_hide_comments(),jq("div.activity").on("click",function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=jq(a.target);return r.hasClass("acomment-reply")||r.parent().hasClass("acomment-reply")?(r.parent().hasClass("acomment-reply")&&(r=r.parent()),b=r.attr("id"),c=b.split("-"),d=c[2],e=r.attr("href").substr(10,r.attr("href").length),f=jq("#ac-form-"+d),f.css("display","none"),f.removeClass("root"),jq(".ac-form").hide(),f.children("div").each(function(){jq(this).hasClass("error")&&jq(this).hide()}),"comment"!==c[1]?jq("#acomment-"+e).append(f):jq("#activity-"+d+" .activity-comments").append(f),f.parent().hasClass("activity-comments")&&f.addClass("root"),f.slideDown(200),jq.scrollTo(f,500,{offset:-100,easing:"swing"}),jq("#ac-form-"+c[2]+" textarea").focus(),!1):"ac_form_submit"===r.attr("name")?(f=r.parents("form"),g=f.parent(),h=f.attr("id").split("-"),g.hasClass("activity-comments")?j=h[2]:(i=g.attr("id").split("-"),j=i[1]),content=jq("#"+f.attr("id")+" textarea"),jq("#"+f.attr("id")+" div.error").hide(),r.addClass("loading").prop("disabled",!0),content.addClass("loading").prop("disabled",!0),k={action:"new_activity_comment",cookie:bp_get_cookies(),_wpnonce_new_activity_comment:jq("#_wpnonce_new_activity_comment").val(),comment_id:j,form_id:h[2],content:content.val()},l=jq("#_bp_as_nonce_"+j).val(),l&&(k["_bp_as_nonce_"+j]=l),jq.post(ajaxurl,k,function(a){if(r.removeClass("loading"),content.removeClass("loading"),a[0]+a[1]==="-1")f.append(jq(a.substr(2,a.length)).hide().fadeIn(200));else{var b=f.parent();f.fadeOut(200,function(){0===b.children("ul").length&&(b.hasClass("activity-comments")?b.prepend("<ul></ul>"):b.append("<ul></ul>"));var c=jq.trim(a);b.children("ul").append(jq(c).hide().fadeIn(200)),f.children("textarea").val(""),b.parent().addClass("has-comments")}),jq("#"+f.attr("id")+" textarea").val(""),jq("#activity-"+h[2]+" a.acomment-reply span").html(Number(jq("#activity-"+h[2]+" a.acomment-reply span").html())+1),m=b.find(".show-all").find("a"),m&&(n=jq("li#activity-"+h[2]+" a.acomment-reply span").html(),m.html(BP_DTheme.show_x_comments.replace("%d",n)))}jq(r).prop("disabled",!1),jq(content).prop("disabled",!1)}),!1):r.hasClass("acomment-delete")?(o=r.attr("href"),p=r.parent().parent(),f=p.parents("div.activity-comments").children("form"),q=o.split("_wpnonce="),q=q[1],j=o.split("cid="),j=j[1].split("&"),j=j[0],r.addClass("loading"),jq(".activity-comments ul .error").remove(),p.parents(".activity-comments").append(f),jq.post(ajaxurl,{action:"delete_activity_comment",cookie:bp_get_cookies(),_wpnonce:q,id:j},function(a){if(a[0]+a[1]==="-1")p.prepend(jq(a.substr(2,a.length)).hide().fadeIn(200));else{var b,c,d,e=jq("#"+p.attr("id")+" ul").children("li"),f=0;jq(e).each(function(){jq(this).is(":hidden")||f++}),p.fadeOut(200,function(){p.remove()}),b=jq("#"+p.parents("#activity-stream > li").attr("id")+" a.acomment-reply span"),c=b.html()-(1+f),b.html(c),d=p.siblings(".show-all").find("a"),d&&d.html(BP_DTheme.show_x_comments.replace("%d",c)),0===c&&jq(p.parents("#activity-stream > li")).removeClass("has-comments")}}),!1):r.hasClass("spam-activity-comment")?(o=r.attr("href"),p=r.parent().parent(),r.addClass("loading"),jq(".activity-comments ul div.error").remove(),p.parents(".activity-comments").append(p.parents(".activity-comments").children("form")),jq.post(ajaxurl,{action:"bp_spam_activity_comment",cookie:encodeURIComponent(document.cookie),_wpnonce:o.split("_wpnonce=")[1],id:o.split("cid=")[1].split("&")[0]},function(a){if(a[0]+a[1]==="-1")p.prepend(jq(a.substr(2,a.length)).hide().fadeIn(200));else{var b,c=jq("#"+p.attr("id")+" ul").children("li"),d=0;jq(c).each(function(){jq(this).is(":hidden")||d++}),p.fadeOut(200),b=p.parents("#activity-stream > li"),jq("#"+b.attr("id")+" a.acomment-reply span").html(jq("#"+b.attr("id")+" a.acomment-reply span").html()-(1+d))}}),!1):r.parent().hasClass("show-all")?(r.parent().addClass("loading"),setTimeout(function(){r.parent().parent().children("li").fadeIn(200,function(){r.parent().remove()})},600),!1):r.hasClass("ac-reply-cancel")?(jq(r).closest(".ac-form").slideUp(200),!1):void 0}),jq(document).keydown(function(a){if(a=a||window.event,a.target?element=a.target:a.srcElement&&(element=a.srcElement),3===element.nodeType&&(element=element.parentNode),a.ctrlKey!==!0&&a.altKey!==!0&&a.metaKey!==!0){var b=a.keyCode?a.keyCode:a.which;27===b&&"TEXTAREA"===element.tagName&&jq(element).hasClass("ac-input")&&jq(element).parent().parent().parent().slideUp(200)}}),jq(".dir-search, .groups-members-search").on("click",function(a){if(!jq(this).hasClass("no-ajax")){var b,c,d,e=jq(a.target);return"submit"===e.attr("type")?(b=jq(".item-list-tabs li.selected").attr("id").split("-"),c=b[0],d=null,"members"===c&&"groups"===b[1]&&(c="group_members",d="groups/single/members"),bp_filter_request(c,jq.cookie("bp-"+c+"-filter"),jq.cookie("bp-"+c+"-scope"),"div."+c,e.parent().children("label").children("input").val(),1,jq.cookie("bp-"+c+"-extras"),null,d),!1):void 0}}),jq("div.item-list-tabs").on("click",function(a){if(!jq(this).hasClass("no-ajax")){var b,c,d,e,f,g="SPAN"===a.target.nodeName?a.target.parentNode:a.target,h=jq(g).parent();return"LI"!==h[0].nodeName||h.hasClass("last")?void 0:(b=h.attr("id").split("-"),c=b[0],"activity"===c?!1:(d=b[1],e=jq("#"+c+"-order-select select").val(),f=jq("#"+c+"_search").val(),bp_filter_request(c,e,d,"div."+c,f,1,jq.cookie("bp-"+c+"-extras")),!1))}}),jq("li.filter select").change(function(){var a,b,c,d,e,f,g,h;return a=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":this),b=a.attr("id").split("-"),c=b[0],d=b[1],e=jq(this).val(),f=!1,g=null,jq(".dir-search input").length&&(f=jq(".dir-search input").val()),h=jq(".groups-members-search input"),h.length&&(f=h.val()),"members"===c&&"groups"===d&&(c="group_members",g="groups/single/members"),"friends"===c&&(c="members"),bp_filter_request(c,e,d,"div."+c,f,1,jq.cookie("bp-"+c+"-extras"),null,g),!1}),jq("#buddypress").on("click",function(a){var b,c,d,e,f,g,h,i,j,k=jq(a.target);return k.hasClass("button")?!0:k.parent().parent().hasClass("pagination")&&!k.parent().parent().hasClass("no-ajax")?k.hasClass("dots")||k.hasClass("current")?!1:(b=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":"li.filter select"),c=b.attr("id").split("-"),d=c[0],e=!1,f=jq(k).closest(".pagination-links").attr("id"),g=null,h=k.attr("href").split("="),h=h[1],jq("div.dir-search input").length&&(e=jq(".dir-search input").prop("placeholder")?jq(".dir-search input").prop("placeholder"):jq(".dir-search input").val()),i=jq(".groups-members-search input"),i.length&&(e=i.val()),"members"===d&&"groups"===c[1]&&(d="group_members",g="groups/single/members"),"admin"===d&&jq("body").hasClass("membership-requests")&&(d="requests"),j=-1!==f.indexOf("pag-bottom")?"pag-bottom":null,bp_filter_request(d,jq.cookie("bp-"+d+"-filter"),jq.cookie("bp-"+d+"-scope"),"div."+d,e,h,jq.cookie("bp-"+d+"-extras"),j,g),!1):void 0}),jq("a.show-hide-new").on("click",function(){return jq("#new-topic-post").length?(jq("#new-topic-post").is(":visible")?jq("#new-topic-post").slideUp(200):jq("#new-topic-post").slideDown(200,function(){jq("#topic_title").focus()}),!1):!1}),jq("#submit_topic_cancel").on("click",function(){return jq("#new-topic-post").length?(jq("#new-topic-post").slideUp(200),!1):!1}),jq("#forum-directory-tags a").on("click",function(){return bp_filter_request("forums","tags",jq.cookie("bp-forums-scope"),"div.forums",jq(this).html().replace(/&nbsp;/g,"-"),1,jq.cookie("bp-forums-extras")),!1}),jq("#send-invite-form").on("click","#invite-list input",function(){var a,b,c=jq("#send-invite-form > .invite").length;jq(".ajax-loader").toggle(),c&&jq(this).parents("ul").find("input").prop("disabled",!0),a=jq(this).val(),b=jq(this).prop("checked")===!0?"invite":"uninvite",c||jq(".item-list-tabs li.selected").addClass("loading"),jq.post(ajaxurl,{action:"groups_invite_user",friend_action:b,cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:a,group_id:jq("#group_id").val()},function(d){jq("#message")&&jq("#message").hide(),c?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),"invite"===b?jq("#friend-list").append(d):"uninvite"===b&&jq("#friend-list li#uid-"+a).remove(),jq(".item-list-tabs li.selected").removeClass("loading"))})}),jq("#send-invite-form").on("click","a.remove",function(){var a=jq("#send-invite-form > .invite").length,b=jq(this).attr("id");return jq(".ajax-loader").toggle(),b=b.split("-"),b=b[1],jq.post(ajaxurl,{action:"groups_invite_user",friend_action:"uninvite",cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:b,group_id:jq("#group_id").val()},function(){a?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),jq("#friend-list #uid-"+b).remove(),jq("#invite-list #f-"+b).prop("checked",!1))}),!1}),jq(".visibility-toggle-link").on("click",function(a){a.preventDefault(),jq(this).parent().hide().addClass("field-visibility-settings-hide").siblings(".field-visibility-settings").show().addClass("field-visibility-settings-open")}),jq(".field-visibility-settings-close").on("click",function(a){a.preventDefault();var b=jq(this).parent(),c=b.find("input:checked").parent().text();b.hide().removeClass("field-visibility-settings-open").siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(c).end().show().removeClass("field-visibility-settings-hide")}),jq("#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select").change(function(){var a=!0;jq("#profile-edit-form input:submit, #signup_form input:submit").on("click",function(){a=!1}),window.onbeforeunload=function(){return a?BP_DTheme.unsaved_changes:void 0}}),jq("#friend-list a.accept, #friend-list a.reject").on("click",function(){var a,b=jq(this),c=jq(this).parents("#friend-list li"),d=jq(this).parents("li div.action"),e=c.attr("id").substr(11,c.attr("id").length),f=b.attr("href"),g=f.split("_wpnonce=")[1];return jq(this).hasClass("accepted")||jq(this).hasClass("rejected")?!1:(jq(this).hasClass("accept")?(a="accept_friendship",d.children("a.reject").css("visibility","hidden")):(a="reject_friendship",d.children("a.accept").css("visibility","hidden")),b.addClass("loading"),jq.post(ajaxurl,{action:a,cookie:bp_get_cookies(),id:e,_wpnonce:g},function(a){b.removeClass("loading"),a[0]+a[1]==="-1"?(c.prepend(a.substr(2,a.length)),c.children("#message").hide().fadeIn(200)):b.fadeOut(100,function(){jq(this).hasClass("accept")?(d.children("a.reject").hide(),jq(this).html(BP_DTheme.accepted).contents().unwrap()):(d.children("a.accept").hide(),jq(this).html(BP_DTheme.rejected).contents().unwrap())})}),!1)}),jq("#members-dir-list, #members-group-list").on("click",".friendship-button a",function(){jq(this).parent().addClass("loading");var a=jq(this).attr("id"),b=jq(this).attr("href"),c=jq(this);return a=a.split("-"),a=a[1],b=b.split("?_wpnonce="),b=b[1].split("&"),b=b[0],jq.post(ajaxurl,{action:"addremove_friend",cookie:bp_get_cookies(),fid:a,_wpnonce:b},function(a){var b=c.attr("rel");parentdiv=c.parent(),"add"===b?jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("add_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("pending_friend"),parentdiv.fadeIn(200).html(a)}):"remove"===b&&jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("remove_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("add"),parentdiv.fadeIn(200).html(a)})}),!1}),jq("#buddypress").on("click",".group-button .leave-group",function(){return!1===confirm(BP_DTheme.leave_group_confirm)?!1:void 0}),jq("#groups-dir-list").on("click",".group-button a",function(){var a=jq(this).parent().attr("id"),b=jq(this).attr("href"),c=jq(this);return a=a.split("-"),a=a[1],b=b.split("?_wpnonce="),b=b[1].split("&"),b=b[0],c.hasClass("leave-group")&&!1===confirm(BP_DTheme.leave_group_confirm)?!1:(jq.post(ajaxurl,{action:"joinleave_group",cookie:bp_get_cookies(),gid:a,_wpnonce:b},function(a){var b=c.parent();jq("body.directory").length?jq(b).fadeOut(200,function(){b.fadeIn(200).html(a);var d=jq("#groups-personal span"),e=1;c.hasClass("leave-group")?(b.hasClass("hidden")&&b.closest("li").slideUp(200),e=0):c.hasClass("request-membership")&&(e=!1),d.length&&e!==!1&&d.text(e?(d.text()>>0)+1:(d.text()>>0)-1)}):location.href=location.href}),!1)}),jq("#buddypress").on("click",".pending",function(){return!1}),jq(".message-search").on("click",function(a){if(!jq(this).hasClass("no-ajax")){var b,c=jq(a.target);return"submit"===c.attr("type")?(b="messages",bp_filter_request(b,jq.cookie("bp-"+b+"-filter"),jq.cookie("bp-"+b+"-scope"),"div."+b,c.parent().children("label").children("input").val(),1,jq.cookie("bp-"+b+"-extras")),!1):void 0}}),jq("#send_reply_button").click(function(){var a=jq("#messages_order").val()||"ASC",b=jq("#message-recipients").offset(),c=jq("#send_reply_button");return jq(c).addClass("loading"),jq.post(ajaxurl,{action:"messages_send_reply",cookie:bp_get_cookies(),_wpnonce:jq("#send_message_nonce").val(),content:jq("#message_content").val(),send_to:jq("#send_to").val(),subject:jq("#subject").val(),thread_id:jq("#thread_id").val()},function(d){d[0]+d[1]==="-1"?jq("#send-reply").prepend(d.substr(2,d.length)):(jq("#send-reply #message").remove(),jq("#message_content").val(""),"ASC"===a?jq("#send-reply").before(d):(jq("#message-recipients").after(d),jq(window).scrollTop(b.top)),jq(".new-message").hide().slideDown(200,function(){jq(".new-message").removeClass("new-message")})),jq(c).removeClass("loading")}),!1}),jq("#mark_as_read, #mark_as_unread").click(function(){var a,b,c,d,e,f,g,h,i="",j=jq('#message-threads tr td input[type="checkbox"]');return"mark_as_unread"===jq(this).attr("id")?(a="read",b="unread",c=1,d=0,e="inline",f="messages_markunread"):(a="unread",b="read",c=0,d=1,e="none",f="messages_markread"),j.each(function(d){jq(this).is(":checked")&&jq("#m-"+jq(this).attr("value")).hasClass(a)&&(i+=jq(this).attr("value"),jq("#m-"+jq(this).attr("value")).removeClass(a),jq("#m-"+jq(this).attr("value")).addClass(b),h=jq("#m-"+jq(this).attr("value")+" td span.unread-count").html(),jq("#m-"+jq(this).attr("value")+" td span.unread-count").html(c),jq("#m-"+jq(this).attr("value")+" td span.unread-count").css("display",e),g=jq("tr.unread").length,jq("#user-messages span").html(g),d!==j.length-1&&(i+=","))}),jq.post(ajaxurl,{action:f,thread_ids:i}),!1}),jq("body.messages #item-body div.messages").on("change","#message-type-select",function(){var a=this.value,b=jq('td input[type="checkbox"]'),c="checked";switch(b.each(function(a){b[a].checked=""}),a){case"unread":b=jq('tr.unread td input[type="checkbox"]');break;case"read":b=jq('tr.read td input[type="checkbox"]');break;case"":c=""}b.each(function(a){b[a].checked=c})}),jq("body.messages #item-body div.messages").on("click",".messages-options-nav a",function(){return-1!==jq.inArray(this.id,Array("delete_sentbox_messages","delete_inbox_messages"))?(checkboxes_tosend="",checkboxes=jq('#message-threads tr td input[type="checkbox"]'),jq("#message").remove(),jq(this).addClass("loading"),jq(checkboxes).each(function(){jq(this).is(":checked")&&(checkboxes_tosend+=jq(this).attr("value")+",")}),""===checkboxes_tosend?(jq(this).removeClass("loading"),!1):(jq.post(ajaxurl,{action:"messages_delete",thread_ids:checkboxes_tosend},function(a){a[0]+a[1]==="-1"?jq("#message-threads").prepend(a.substr(2,a.length)):(jq("#message-threads").before('<div id="message" class="updated"><p>'+a+"</p></div>"),jq(checkboxes).each(function(){jq(this).is(":checked")&&(jq(this).attr("checked",!1),jq(this).parent().parent().fadeOut(150))})),jq("#message").hide().slideDown(150),jq("#delete_inbox_messages, #delete_sentbox_messages").removeClass("loading")}),!1)):void 0}),jq("#close-notice").on("click",function(){return jq(this).addClass("loading"),jq("#sidebar div.error").remove(),jq.post(ajaxurl,{action:"messages_close_notice",notice_id:jq(".notice").attr("rel").substr(2,jq(".notice").attr("rel").length)},function(a){jq("#close-notice").removeClass("loading"),a[0]+a[1]==="-1"?(jq(".notice").prepend(a.substr(2,a.length)),jq("#sidebar div.error").hide().fadeIn(200)):jq(".notice").slideUp(100)}),!1}),jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover(function(){jq(this).addClass("sfhover")}),jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout(function(){jq(this).removeClass("sfhover")}),jq("a.logout").on("click",function(){jq.removeCookie("bp-activity-scope",{path:"/"}),jq.removeCookie("bp-activity-filter",{path:"/"}),jq.removeCookie("bp-activity-oldestpage",{path:"/"});var a=["members","groups","blogs","forums"];jq(a).each(function(b){jq.removeCookie("bp-"+a[b]+"-scope",{path:"/"}),jq.removeCookie("bp-"+a[b]+"-filter",{path:"/"}),jq.removeCookie("bp-"+a[b]+"-extras",{path:"/"})})}),jq("body").hasClass("no-js")&&jq("body").attr("class",jq("body").attr("class").replace(/no-js/,"js")),"undefined"!=typeof wp&&"undefined"!=typeof wp.heartbeat&&"undefined"!=typeof BP_DTheme.pulse&&(wp.heartbeat.interval(Number(BP_DTheme.pulse)),jq.fn.extend({"heartbeat-send":function(){return this.bind("heartbeat-send.buddypress")}})),jq(document).on("heartbeat-send.buddypress",function(a,b){firstrow=0,jq("#buddypress ul.activity-list li").first().prop("id")&&(timestamp=jq("#buddypress ul.activity-list li").first().prop("class").match(/date-recorded-([0-9]+)/),timestamp&&(firstrow=timestamp[1])),(0===activity_last_recorded||Number(firstrow)>activity_last_recorded)&&(activity_last_recorded=Number(firstrow)),b.bp_activity_last_recorded=activity_last_recorded,last_recorded_search=bp_get_querystring("s"),last_recorded_search&&(b.bp_activity_last_recorded_search_terms=last_recorded_search)}),jq(document).on("heartbeat-tick",function(a,b){b.bp_activity_newest_activities&&(newest_activities=b.bp_activity_newest_activities.activities+newest_activities,activity_last_recorded=Number(b.bp_activity_newest_activities.last_recorded),jq("#buddypress ul.activity-list li").first().hasClass("load-newest")||jq("#buddypress ul.activity-list").prepend('<li class="load-newest"><a href="#newest">'+BP_DTheme.newest+"</a></li>"))})});
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+function bp_init_activity(){jq.cookie("bp-activity-oldestpage",1,{path:"/"}),null!==jq.cookie("bp-activity-filter")&&jq("#activity-filter-select").length&&jq('#activity-filter-select select option[value="'+jq.cookie("bp-activity-filter")+'"]').prop("selected",!0),null!==jq.cookie("bp-activity-scope")&&jq(".activity-type-tabs").length&&(jq(".activity-type-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#activity-"+jq.cookie("bp-activity-scope")+", .item-list-tabs li.current").addClass("selected"))}function bp_init_objects(a){jq(a).each(function(b){null!==jq.cookie("bp-"+a[b]+"-filter")&&jq("#"+a[b]+"-order-select select").length&&jq("#"+a[b]+'-order-select select option[value="'+jq.cookie("bp-"+a[b]+"-filter")+'"]').prop("selected",!0),null!==jq.cookie("bp-"+a[b]+"-scope")&&jq("div."+a[b]).length&&(jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+a[b]+"-"+jq.cookie("bp-"+a[b]+"-scope")+", #object-nav li.current").addClass("selected"))})}function bp_filter_request(a,b,c,d,e,f,g,h,i){return"activity"===a?!1:(null===c&&(c="all"),jq.cookie("bp-"+a+"-scope",c,{path:"/"}),jq.cookie("bp-"+a+"-filter",b,{path:"/"}),jq.cookie("bp-"+a+"-extras",g,{path:"/"}),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+a+"-"+c+", #object-nav li.current").addClass("selected"),jq(".item-list-tabs li.selected").addClass("loading"),jq('.item-list-tabs select option[value="'+b+'"]').prop("selected",!0),("friends"===a||"group_members"===a)&&(a="members"),bp_ajax_request&&bp_ajax_request.abort(),void(bp_ajax_request=jq.post(ajaxurl,{action:a+"_filter",cookie:bp_get_cookies(),object:a,filter:b,search_terms:e,scope:c,page:f,extras:g,template:i},function(a){if("pag-bottom"===h&&jq("#subnav").length){var b=jq("#subnav").parent();jq("html,body").animate({scrollTop:b.offset().top},"slow",function(){jq(d).fadeOut(100,function(){jq(this).html(a),jq(this).fadeIn(100)})})}else jq(d).fadeOut(100,function(){jq(this).html(a),jq(this).fadeIn(100)});jq(".item-list-tabs li.selected").removeClass("loading")})))}function bp_activity_request(a,b){jq.cookie("bp-activity-scope",a,{path:"/"}),jq.cookie("bp-activity-filter",b,{path:"/"}),jq.cookie("bp-activity-oldestpage",1,{path:"/"}),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected loading")}),jq("#activity-"+a+", .item-list-tabs li.current").addClass("selected"),jq("#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected").addClass("loading"),jq('#activity-filter-select select option[value="'+b+'"]').prop("selected",!0),jq(".widget_bp_activity_widget h2 span.ajax-loader").show(),bp_ajax_request&&bp_ajax_request.abort(),bp_ajax_request=jq.post(ajaxurl,{action:"activity_widget_filter",cookie:bp_get_cookies(),_wpnonce_activity_filter:jq("#_wpnonce_activity_filter").val(),scope:a,filter:b},function(a){jq(".widget_bp_activity_widget h2 span.ajax-loader").hide(),jq("div.activity").fadeOut(100,function(){jq(this).html(a.contents),jq(this).fadeIn(100),bp_legacy_theme_hide_comments()}),null!==a.feed_url&&jq(".directory #subnav li.feed a, .home-page #subnav li.feed a").attr("href",a.feed_url),jq(".item-list-tabs li.selected").removeClass("loading")},"json")}function bp_legacy_theme_hide_comments(){var a,b,c,d=jq("div.activity-comments");return d.length?void d.each(function(){jq(this).children("ul").children("li").length<5||(comments_div=jq(this),a=comments_div.parents("#activity-stream > li"),b=jq(this).children("ul").children("li"),c=" ",jq("#"+a.attr("id")+" a.acomment-reply span").length&&(c=jq("#"+a.attr("id")+" a.acomment-reply span").html()),b.each(function(d){d<b.length-5&&(jq(this).addClass("hidden"),jq(this).toggle(),d||jq(this).before('<li class="show-all"><a href="#'+a.attr("id")+'/show-all/" title="'+BP_DTheme.show_all_comments+'">'+BP_DTheme.show_x_comments.replace("%d",c)+"</a></li>"))}))}):!1}function checkAll(){var a,b=document.getElementsByTagName("input");for(a=0;a<b.length;a++)"checkbox"===b[a].type&&(b[a].checked=""===$("check_all").checked?"":"checked")}function clear(a){if(a=document.getElementById(a)){var b=a.getElementsByTagName("INPUT"),c=a.getElementsByTagName("OPTION"),d=0;if(b)for(d=0;d<b.length;d++)b[d].checked="";if(c)for(d=0;d<c.length;d++)c[d].selected=!1}}function bp_get_cookies(){var a,b,c,d,e,f=document.cookie.split(";"),g={},h="bp-";for(a=0;a<f.length;a++)b=f[a],c=b.indexOf("="),d=jq.trim(unescape(b.slice(0,c))),e=unescape(b.slice(c+1)),0===d.indexOf(h)&&(g[d]=e);return encodeURIComponent(jq.param(g))}var jq=jQuery,bp_ajax_request=null,newest_activities="",activity_last_recorded=0;jq(document).ready(function(){"-1"===window.location.search.indexOf("new")&&jq("div.forums").length?jq("#new-topic-post").hide():jq("#new-topic-post").show(),bp_init_activity();var a=["members","groups","blogs","forums","group_members"],b=jq("#whats-new");if(bp_init_objects(a),b.length&&bp_get_querystring("r")){var c=b.val();jq("#whats-new-options").animate({height:"50px"}),b.animate({height:"50px"}),jq.scrollTo(b,500,{offset:-125,easing:"swing"}),b.val("").focus().val(c)}if(b.focus(function(){jq("#whats-new-options").animate({height:"50px"}),jq("#whats-new-form textarea").animate({height:"50px"}),jq("#aw-whats-new-submit").prop("disabled",!1);var a=jq("form#whats-new-form"),b=jq("#activity-all");a.hasClass("submitted")&&a.removeClass("submitted"),b.length&&(b.hasClass("selected")?"-1"!==jq("#activity-filter-select select").val()&&(jq("#activity-filter-select select").val("-1"),jq("#activity-filter-select select").trigger("change")):(jq("#activity-filter-select select").val("-1"),b.children("a").trigger("click")))}),b.blur(function(){document.activeElement!==this&&(this.value.match(/\S+/)||(this.value="",jq("#whats-new-options").animate({height:"0"}),jq("form#whats-new-form textarea").animate({height:"20px"}),jq("#aw-whats-new-submit").prop("disabled",!0)))}),jq("#aw-whats-new-submit").on("click",function(){var a=0,b=jq(this),c=b.closest("form#whats-new-form");return c.children().each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!0)}),jq("div.error").remove(),b.addClass("loading"),b.prop("disabled",!0),c.addClass("submitted"),object="",item_id=jq("#whats-new-post-in").val(),content=jq("#whats-new").val(),firstrow=jq("#buddypress ul.activity-list li").first(),activity_row=firstrow,timestamp=null,firstrow.length&&(activity_row.hasClass("load-newest")&&(activity_row=firstrow.next()),timestamp=activity_row.prop("class").match(/date-recorded-([0-9]+)/)),timestamp&&(a=timestamp[1]),item_id>0&&(object=jq("#whats-new-post-object").val()),jq.post(ajaxurl,{action:"post_update",cookie:bp_get_cookies(),_wpnonce_post_update:jq("#_wpnonce_post_update").val(),content:content,object:object,item_id:item_id,since:a,_bp_as_nonce:jq("#_bp_as_nonce").val()||""},function(b){if(c.children().each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!1)}),b[0]+b[1]==="-1")c.prepend(b.substr(2,b.length)),jq("#"+c.attr("id")+" div.error").hide().fadeIn(200);else{if(0===jq("ul.activity-list").length&&(jq("div.error").slideUp(100).remove(),jq("#message").slideUp(100).remove(),jq("div.activity").append('<ul id="activity-stream" class="activity-list item-list">')),firstrow.hasClass("load-newest")&&firstrow.remove(),jq("#activity-stream").prepend(b),a||jq("#activity-stream li:first").addClass("new-update just-posted"),0!==jq("#latest-update").length){var d=jq("#activity-stream li.new-update .activity-content .activity-inner p").html(),e=jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr("href"),f=jq("#activity-stream li.new-update .activity-content .activity-inner p").text(),g="";""!==f&&(g=d+" "),g+='<a href="'+e+'" rel="nofollow">'+BP_DTheme.view+"</a>",jq("#latest-update").slideUp(300,function(){jq("#latest-update").html(g),jq("#latest-update").slideDown(300)})}jq("li.new-update").hide().slideDown(300),jq("li.new-update").removeClass("new-update"),jq("#whats-new").val(""),newest_activities="",activity_last_recorded=0}jq("#whats-new-options").animate({height:"0px"}),jq("#whats-new-form textarea").animate({height:"20px"}),jq("#aw-whats-new-submit").prop("disabled",!0).removeClass("loading")}),!1}),jq("div.activity-type-tabs").on("click",function(a){var b,c,d=jq(a.target).parent();if("STRONG"===a.target.nodeName||"SPAN"===a.target.nodeName)d=d.parent();else if("A"!==a.target.nodeName)return!1;return jq.cookie("bp-activity-oldestpage",1,{path:"/"}),b=d.attr("id").substr(9,d.attr("id").length),c=jq("#activity-filter-select select").val(),"mentions"===b&&jq("#"+d.attr("id")+" a strong").remove(),bp_activity_request(b,c),!1}),jq("#activity-filter-select select").change(function(){var a,b=jq("div.activity-type-tabs li.selected"),c=jq(this).val();return a=b.length?b.attr("id").substr(9,b.attr("id").length):null,bp_activity_request(a,c),!1}),jq("div.activity").on("click",function(a){var b,c,d,e,f,g,h,i,j,k,l=jq(a.target);return l.hasClass("fav")||l.hasClass("unfav")?(b=l.hasClass("fav")?"fav":"unfav",c=l.closest(".activity-item"),d=c.attr("id").substr(9,c.attr("id").length),l.addClass("loading"),jq.post(ajaxurl,{action:"activity_mark_"+b,cookie:bp_get_cookies(),id:d},function(a){l.removeClass("loading"),l.fadeOut(200,function(){jq(this).html(a),jq(this).attr("title","fav"===b?BP_DTheme.remove_fav:BP_DTheme.mark_as_fav),jq(this).fadeIn(200)}),"fav"===b?(jq(".item-list-tabs #activity-favs-personal-li").length||(jq(".item-list-tabs #activity-favorites").length||jq(".item-list-tabs ul #activity-mentions").before('<li id="activity-favorites"><a href="#">'+BP_DTheme.my_favs+" <span>0</span></a></li>"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())+1)),l.removeClass("fav"),l.addClass("unfav")):(l.removeClass("unfav"),l.addClass("fav"),jq(".item-list-tabs ul #activity-favorites span").html(Number(jq(".item-list-tabs ul #activity-favorites span").html())-1),Number(jq(".item-list-tabs ul #activity-favorites span").html())||(jq(".item-list-tabs ul #activity-favorites").hasClass("selected")&&bp_activity_request(null,null),jq(".item-list-tabs ul #activity-favorites").remove())),"activity-favorites"===jq(".item-list-tabs li.selected").attr("id")&&l.closest(".activity-item").slideUp(100)}),!1):l.hasClass("delete-activity")?(e=l.parents("div.activity ul li"),f=e.attr("id").substr(9,e.attr("id").length),g=l.attr("href"),h=g.split("_wpnonce="),i=e.prop("class").match(/date-recorded-([0-9]+)/),h=h[1],l.addClass("loading"),jq.post(ajaxurl,{action:"delete_activity",cookie:bp_get_cookies(),id:f,_wpnonce:h},function(a){a[0]+a[1]==="-1"?(e.prepend(a.substr(2,a.length)),e.children("#message").hide().fadeIn(300)):(e.slideUp(300),i&&activity_last_recorded===i[1]&&(newest_activities="",activity_last_recorded=0))}),!1):l.hasClass("spam-activity")?(e=l.parents("div.activity ul li"),i=e.prop("class").match(/date-recorded-([0-9]+)/),l.addClass("loading"),jq.post(ajaxurl,{action:"bp_spam_activity",cookie:encodeURIComponent(document.cookie),id:e.attr("id").substr(9,e.attr("id").length),_wpnonce:l.attr("href").split("_wpnonce=")[1]},function(a){a[0]+a[1]==="-1"?(e.prepend(a.substr(2,a.length)),e.children("#message").hide().fadeIn(300)):(e.slideUp(300),i&&activity_last_recorded===i[1]&&(newest_activities="",activity_last_recorded=0))}),!1):l.parent().hasClass("load-more")?(bp_ajax_request&&bp_ajax_request.abort(),jq("#buddypress li.load-more").addClass("loading"),null===jq.cookie("bp-activity-oldestpage")&&jq.cookie("bp-activity-oldestpage",1,{path:"/"}),j=1*jq.cookie("bp-activity-oldestpage")+1,k=[],jq(".activity-list li.just-posted").each(function(){k.push(jq(this).attr("id").replace("activity-",""))}),load_more_args={action:"activity_get_older_updates",cookie:bp_get_cookies(),page:j,exclude_just_posted:k.join(",")},load_more_search=bp_get_querystring("s"),load_more_search&&(load_more_args.search_terms=load_more_search),bp_ajax_request=jq.post(ajaxurl,load_more_args,function(a){jq("#buddypress li.load-more").removeClass("loading"),jq.cookie("bp-activity-oldestpage",j,{path:"/"}),jq("#buddypress ul.activity-list").append(a.contents),l.parent().hide()},"json"),!1):void(l.parent().hasClass("load-newest")&&(a.preventDefault(),l.parent().hide(),activity_html=jq.parseHTML(newest_activities),jq.each(activity_html,function(a,b){"LI"===b.nodeName&&jq(b).hasClass("just-posted")&&jq("#"+jq(b).attr("id")).length&&jq("#"+jq(b).attr("id")).remove()}),jq("#buddypress ul.activity-list").prepend(newest_activities),newest_activities=""))}),jq("div.activity").on("click",".activity-read-more a",function(a){var b,c,d=jq(a.target),e=d.parent().attr("id").split("-"),f=e[3],g=e[0];return b="acomment"===g?"acomment-content":"activity-inner",c=jq("#"+g+"-"+f+" ."+b+":first"),jq(d).addClass("loading"),jq.post(ajaxurl,{action:"get_single_activity_content",activity_id:f},function(a){jq(c).slideUp(300).html(a).slideDown(300)}),!1}),jq("form.ac-form").hide(),jq(".activity-comments").length&&bp_legacy_theme_hide_comments(),jq("div.activity").on("click",function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=jq(a.target);return r.hasClass("acomment-reply")||r.parent().hasClass("acomment-reply")?(r.parent().hasClass("acomment-reply")&&(r=r.parent()),b=r.attr("id"),c=b.split("-"),d=c[2],e=r.attr("href").substr(10,r.attr("href").length),f=jq("#ac-form-"+d),f.css("display","none"),f.removeClass("root"),jq(".ac-form").hide(),f.children("div").each(function(){jq(this).hasClass("error")&&jq(this).hide()}),"comment"!==c[1]?jq("#acomment-"+e).append(f):jq("#activity-"+d+" .activity-comments").append(f),f.parent().hasClass("activity-comments")&&f.addClass("root"),f.slideDown(200),jq.scrollTo(f,500,{offset:-100,easing:"swing"}),jq("#ac-form-"+c[2]+" textarea").focus(),!1):"ac_form_submit"===r.attr("name")?(f=r.parents("form"),g=f.parent(),h=f.attr("id").split("-"),g.hasClass("activity-comments")?j=h[2]:(i=g.attr("id").split("-"),j=i[1]),content=jq("#"+f.attr("id")+" textarea"),jq("#"+f.attr("id")+" div.error").hide(),r.addClass("loading").prop("disabled",!0),content.addClass("loading").prop("disabled",!0),k={action:"new_activity_comment",cookie:bp_get_cookies(),_wpnonce_new_activity_comment:jq("#_wpnonce_new_activity_comment").val(),comment_id:j,form_id:h[2],content:content.val()},l=jq("#_bp_as_nonce_"+j).val(),l&&(k["_bp_as_nonce_"+j]=l),jq.post(ajaxurl,k,function(a){if(r.removeClass("loading"),content.removeClass("loading"),a[0]+a[1]==="-1")f.append(jq(a.substr(2,a.length)).hide().fadeIn(200));else{var b=f.parent();f.fadeOut(200,function(){0===b.children("ul").length&&(b.hasClass("activity-comments")?b.prepend("<ul></ul>"):b.append("<ul></ul>"));var c=jq.trim(a);b.children("ul").append(jq(c).hide().fadeIn(200)),f.children("textarea").val(""),b.parent().addClass("has-comments")}),jq("#"+f.attr("id")+" textarea").val(""),jq("#activity-"+h[2]+" a.acomment-reply span").html(Number(jq("#activity-"+h[2]+" a.acomment-reply span").html())+1),m=b.find(".show-all").find("a"),m&&(n=jq("li#activity-"+h[2]+" a.acomment-reply span").html(),m.html(BP_DTheme.show_x_comments.replace("%d",n)))}jq(r).prop("disabled",!1),jq(content).prop("disabled",!1)}),!1):r.hasClass("acomment-delete")?(o=r.attr("href"),p=r.parent().parent(),f=p.parents("div.activity-comments").children("form"),q=o.split("_wpnonce="),q=q[1],j=o.split("cid="),j=j[1].split("&"),j=j[0],r.addClass("loading"),jq(".activity-comments ul .error").remove(),p.parents(".activity-comments").append(f),jq.post(ajaxurl,{action:"delete_activity_comment",cookie:bp_get_cookies(),_wpnonce:q,id:j},function(a){if(a[0]+a[1]==="-1")p.prepend(jq(a.substr(2,a.length)).hide().fadeIn(200));else{var b,c,d,e=jq("#"+p.attr("id")+" ul").children("li"),f=0;jq(e).each(function(){jq(this).is(":hidden")||f++}),p.fadeOut(200,function(){p.remove()}),b=jq("#"+p.parents("#activity-stream > li").attr("id")+" a.acomment-reply span"),c=b.html()-(1+f),b.html(c),d=p.siblings(".show-all").find("a"),d&&d.html(BP_DTheme.show_x_comments.replace("%d",c)),0===c&&jq(p.parents("#activity-stream > li")).removeClass("has-comments")}}),!1):r.hasClass("spam-activity-comment")?(o=r.attr("href"),p=r.parent().parent(),r.addClass("loading"),jq(".activity-comments ul div.error").remove(),p.parents(".activity-comments").append(p.parents(".activity-comments").children("form")),jq.post(ajaxurl,{action:"bp_spam_activity_comment",cookie:encodeURIComponent(document.cookie),_wpnonce:o.split("_wpnonce=")[1],id:o.split("cid=")[1].split("&")[0]},function(a){if(a[0]+a[1]==="-1")p.prepend(jq(a.substr(2,a.length)).hide().fadeIn(200));else{var b,c=jq("#"+p.attr("id")+" ul").children("li"),d=0;jq(c).each(function(){jq(this).is(":hidden")||d++}),p.fadeOut(200),b=p.parents("#activity-stream > li"),jq("#"+b.attr("id")+" a.acomment-reply span").html(jq("#"+b.attr("id")+" a.acomment-reply span").html()-(1+d))}}),!1):r.parent().hasClass("show-all")?(r.parent().addClass("loading"),setTimeout(function(){r.parent().parent().children("li").fadeIn(200,function(){r.parent().remove()})},600),!1):r.hasClass("ac-reply-cancel")?(jq(r).closest(".ac-form").slideUp(200),!1):void 0}),jq(document).keydown(function(a){if(a=a||window.event,a.target?element=a.target:a.srcElement&&(element=a.srcElement),3===element.nodeType&&(element=element.parentNode),a.ctrlKey!==!0&&a.altKey!==!0&&a.metaKey!==!0){var b=a.keyCode?a.keyCode:a.which;27===b&&"TEXTAREA"===element.tagName&&jq(element).hasClass("ac-input")&&jq(element).parent().parent().parent().slideUp(200)}}),jq(".dir-search, .groups-members-search").on("click",function(a){if(!jq(this).hasClass("no-ajax")){var b,c,d,e=jq(a.target);return"submit"===e.attr("type")?(b=jq(".item-list-tabs li.selected").attr("id").split("-"),c=b[0],d=null,"groups-members-search"===a.currentTarget.className&&(c="group_members",d="groups/single/members"),bp_filter_request(c,jq.cookie("bp-"+c+"-filter"),jq.cookie("bp-"+c+"-scope"),"div."+c,e.parent().children("label").children("input").val(),1,jq.cookie("bp-"+c+"-extras"),null,d),!1):void 0}}),jq("div.item-list-tabs").on("click",function(a){if(!jq(this).hasClass("no-ajax")&&!jq(a.target).hasClass("no-ajax")){var b,c,d,e,f,g="SPAN"===a.target.nodeName?a.target.parentNode:a.target,h=jq(g).parent();return"LI"!==h[0].nodeName||h.hasClass("last")?void 0:(b=h.attr("id").split("-"),c=b[0],"activity"===c?!1:(d=b[1],e=jq("#"+c+"-order-select select").val(),f=jq("#"+c+"_search").val(),bp_filter_request(c,e,d,"div."+c,f,1,jq.cookie("bp-"+c+"-extras")),!1))}}),jq("li.filter select").change(function(){var a,b,c,d,e,f,g,h;return a=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":this),b=a.attr("id").split("-"),c=b[0],d=b[1],e=jq(this).val(),f=!1,g=null,jq(".dir-search input").length&&(f=jq(".dir-search input").val()),h=jq(".groups-members-search input"),h.length&&(f=h.val(),c="members",d="groups"),"members"===c&&"groups"===d&&(c="group_members",g="groups/single/members"),"friends"===c&&(c="members"),bp_filter_request(c,e,d,"div."+c,f,1,jq.cookie("bp-"+c+"-extras"),null,g),!1}),jq("#buddypress").on("click",function(a){var b,c,d,e,f,g,h,i,j,k,l=jq(a.target);return l.hasClass("button")?!0:l.parent().parent().hasClass("pagination")&&!l.parent().parent().hasClass("no-ajax")?l.hasClass("dots")||l.hasClass("current")?!1:(b=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":"li.filter select"),c=b.attr("id").split("-"),d=c[0],e=!1,f=jq(l).closest(".pagination-links").attr("id"),g=null,h=l.attr("href").split("&"),i=h[0].split("="),i=i[1],jq("div.dir-search input").length&&(e=jq(".dir-search input").val(),!e&&bp_get_querystring("s")&&(e=jq(".dir-search input").prop("placeholder"))),j=jq(".groups-members-search input"),j.length&&(e=j.val(),d="members"),"members"===d&&"groups"===c[1]&&(d="group_members",g="groups/single/members"),"admin"===d&&jq("body").hasClass("membership-requests")&&(d="requests"),k=-1!==f.indexOf("pag-bottom")?"pag-bottom":null,bp_filter_request(d,jq.cookie("bp-"+d+"-filter"),jq.cookie("bp-"+d+"-scope"),"div."+d,e,i,jq.cookie("bp-"+d+"-extras"),k,g),!1):void 0}),jq("a.show-hide-new").on("click",function(){return jq("#new-topic-post").length?(jq("#new-topic-post").is(":visible")?jq("#new-topic-post").slideUp(200):jq("#new-topic-post").slideDown(200,function(){jq("#topic_title").focus()}),!1):!1}),jq("#submit_topic_cancel").on("click",function(){return jq("#new-topic-post").length?(jq("#new-topic-post").slideUp(200),!1):!1}),jq("#forum-directory-tags a").on("click",function(){return bp_filter_request("forums","tags",jq.cookie("bp-forums-scope"),"div.forums",jq(this).html().replace(/&nbsp;/g,"-"),1,jq.cookie("bp-forums-extras")),!1}),jq("#send-invite-form").on("click","#invite-list input",function(){var a,b,c=jq("#send-invite-form > .invite").length;jq(".ajax-loader").toggle(),c&&jq(this).parents("ul").find("input").prop("disabled",!0),a=jq(this).val(),b=jq(this).prop("checked")===!0?"invite":"uninvite",c||jq(".item-list-tabs li.selected").addClass("loading"),jq.post(ajaxurl,{action:"groups_invite_user",friend_action:b,cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:a,group_id:jq("#group_id").val()},function(d){jq("#message")&&jq("#message").hide(),c?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),"invite"===b?jq("#friend-list").append(d):"uninvite"===b&&jq("#friend-list li#uid-"+a).remove(),jq(".item-list-tabs li.selected").removeClass("loading"))})}),jq("#send-invite-form").on("click","a.remove",function(){var a=jq("#send-invite-form > .invite").length,b=jq(this).attr("id");return jq(".ajax-loader").toggle(),b=b.split("-"),b=b[1],jq.post(ajaxurl,{action:"groups_invite_user",friend_action:"uninvite",cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:b,group_id:jq("#group_id").val()},function(){a?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),jq("#friend-list #uid-"+b).remove(),jq("#invite-list #f-"+b).prop("checked",!1))}),!1}),jq(".visibility-toggle-link").on("click",function(a){a.preventDefault(),jq(this).parent().hide().addClass("field-visibility-settings-hide").siblings(".field-visibility-settings").show().addClass("field-visibility-settings-open")}),jq(".field-visibility-settings-close").on("click",function(a){a.preventDefault();var b=jq(this).parent(),c=b.find("input:checked").parent().text();b.hide().removeClass("field-visibility-settings-open").siblings(".field-visibility-settings-toggle").children(".current-visibility-level").text(c).end().show().removeClass("field-visibility-settings-hide")}),jq("#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select").change(function(){var a=!0;jq("#profile-edit-form input:submit, #signup_form input:submit").on("click",function(){a=!1}),window.onbeforeunload=function(){return a?BP_DTheme.unsaved_changes:void 0}}),jq("#friend-list a.accept, #friend-list a.reject").on("click",function(){var a,b=jq(this),c=jq(this).parents("#friend-list li"),d=jq(this).parents("li div.action"),e=c.attr("id").substr(11,c.attr("id").length),f=b.attr("href"),g=f.split("_wpnonce=")[1];return jq(this).hasClass("accepted")||jq(this).hasClass("rejected")?!1:(jq(this).hasClass("accept")?(a="accept_friendship",d.children("a.reject").css("visibility","hidden")):(a="reject_friendship",d.children("a.accept").css("visibility","hidden")),b.addClass("loading"),jq.post(ajaxurl,{action:a,cookie:bp_get_cookies(),id:e,_wpnonce:g},function(a){b.removeClass("loading"),a[0]+a[1]==="-1"?(c.prepend(a.substr(2,a.length)),c.children("#message").hide().fadeIn(200)):b.fadeOut(100,function(){jq(this).hasClass("accept")?(d.children("a.reject").hide(),jq(this).html(BP_DTheme.accepted).contents().unwrap()):(d.children("a.accept").hide(),jq(this).html(BP_DTheme.rejected).contents().unwrap())})}),!1)}),jq("#members-dir-list, #members-group-list, #item-header").on("click",".friendship-button a",function(){jq(this).parent().addClass("loading");var a=jq(this).attr("id"),b=jq(this).attr("href"),c=jq(this);return a=a.split("-"),a=a[1],b=b.split("?_wpnonce="),b=b[1].split("&"),b=b[0],jq.post(ajaxurl,{action:"addremove_friend",cookie:bp_get_cookies(),fid:a,_wpnonce:b},function(a){var b=c.attr("rel");parentdiv=c.parent(),"add"===b?jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("add_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("pending_friend"),parentdiv.fadeIn(200).html(a)}):"remove"===b&&jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("remove_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("add"),parentdiv.fadeIn(200).html(a)})}),!1}),jq("#buddypress").on("click",".group-button .leave-group",function(){return!1===confirm(BP_DTheme.leave_group_confirm)?!1:void 0}),jq("#groups-dir-list").on("click",".group-button a",function(){var a=jq(this).parent().attr("id"),b=jq(this).attr("href"),c=jq(this);return a=a.split("-"),a=a[1],b=b.split("?_wpnonce="),b=b[1].split("&"),b=b[0],c.hasClass("leave-group")&&!1===confirm(BP_DTheme.leave_group_confirm)?!1:(jq.post(ajaxurl,{action:"joinleave_group",cookie:bp_get_cookies(),gid:a,_wpnonce:b},function(a){var b=c.parent();jq("body.directory").length?jq(b).fadeOut(200,function(){b.fadeIn(200).html(a);var d=jq("#groups-personal span"),e=1;c.hasClass("leave-group")?(b.hasClass("hidden")&&b.closest("li").slideUp(200),e=0):c.hasClass("request-membership")&&(e=!1),d.length&&e!==!1&&d.text(e?(d.text()>>0)+1:(d.text()>>0)-1)}):window.location.reload()}),!1)}),jq("#buddypress").on("click",".pending",function(){return!1}),jq("body").hasClass("register")){var d=jq("#signup_with_blog");d.prop("checked")||jq("#blog-details").toggle(),d.change(function(){jq("#blog-details").toggle()})}jq(".message-search").on("click",function(a){if(!jq(this).hasClass("no-ajax")){var b,c=jq(a.target);return"submit"===c.attr("type")||"button"===c.attr("type")?(b="messages",bp_filter_request(b,jq.cookie("bp-"+b+"-filter"),jq.cookie("bp-"+b+"-scope"),"div."+b,jq("#messages_search").val(),1,jq.cookie("bp-"+b+"-extras")),!1):void 0}}),jq("#send_reply_button").click(function(){var a=jq("#messages_order").val()||"ASC",b=jq("#message-recipients").offset(),c=jq("#send_reply_button");return jq(c).addClass("loading"),jq.post(ajaxurl,{action:"messages_send_reply",cookie:bp_get_cookies(),_wpnonce:jq("#send_message_nonce").val(),content:jq("#message_content").val(),send_to:jq("#send_to").val(),subject:jq("#subject").val(),thread_id:jq("#thread_id").val()},function(d){d[0]+d[1]==="-1"?jq("#send-reply").prepend(d.substr(2,d.length)):(jq("#send-reply #message").remove(),jq("#message_content").val(""),"ASC"===a?jq("#send-reply").before(d):(jq("#message-recipients").after(d),jq(window).scrollTop(b.top)),jq(".new-message").hide().slideDown(200,function(){jq(".new-message").removeClass("new-message")})),jq(c).removeClass("loading")}),!1}),jq("#mark_as_read, #mark_as_unread").click(function(){var a,b,c,d,e,f,g,h,i="",j=jq('#message-threads tr td input[type="checkbox"]');return"mark_as_unread"===jq(this).attr("id")?(a="read",b="unread",c=1,d=0,e="inline",f="messages_markunread"):(a="unread",b="read",c=0,d=1,e="none",f="messages_markread"),j.each(function(d){jq(this).is(":checked")&&jq("#m-"+jq(this).attr("value")).hasClass(a)&&(i+=jq(this).attr("value"),jq("#m-"+jq(this).attr("value")).removeClass(a),jq("#m-"+jq(this).attr("value")).addClass(b),h=jq("#m-"+jq(this).attr("value")+" td span.unread-count").html(),jq("#m-"+jq(this).attr("value")+" td span.unread-count").html(c),jq("#m-"+jq(this).attr("value")+" td span.unread-count").css("display",e),g=jq("tr.unread").length,jq("#user-messages span").html(g),d!==j.length-1&&(i+=","))}),jq.post(ajaxurl,{action:f,thread_ids:i}),!1}),jq("body.messages #item-body div.messages").on("change","#message-type-select",function(){var a=this.value,b=jq('td input[type="checkbox"]'),c="checked";switch(b.each(function(a){b[a].checked=""}),a){case"unread":b=jq('tr.unread td input[type="checkbox"]');break;case"read":b=jq('tr.read td input[type="checkbox"]');break;case"":c=""}b.each(function(a){b[a].checked=c})}),jq("body.messages #item-body div.messages").on("click",".messages-options-nav a",function(){return-1!==jq.inArray(this.id,Array("delete_sentbox_messages","delete_inbox_messages"))?(checkboxes_tosend="",checkboxes=jq('#message-threads tr td input[type="checkbox"]'),jq("#message").remove(),jq(this).addClass("loading"),jq(checkboxes).each(function(){jq(this).is(":checked")&&(checkboxes_tosend+=jq(this).attr("value")+",")}),""===checkboxes_tosend?(jq(this).removeClass("loading"),!1):(jq.post(ajaxurl,{action:"messages_delete",thread_ids:checkboxes_tosend},function(a){a[0]+a[1]==="-1"?jq("#message-threads").prepend(a.substr(2,a.length)):(jq("#message-threads").before('<div id="message" class="updated"><p>'+a+"</p></div>"),jq(checkboxes).each(function(){jq(this).is(":checked")&&(jq(this).attr("checked",!1),jq(this).parent().parent().fadeOut(150))})),jq("#message").hide().slideDown(150),jq("#delete_inbox_messages, #delete_sentbox_messages").removeClass("loading")}),!1)):void 0}),jq("#select-all-messages").click(function(){jq(".message-check").each(this.checked?function(){this.checked=!0}:function(){this.checked=!1})}),jq("#messages-bulk-manage").attr("disabled","disabled"),jq("#messages-select").on("change",function(){jq("#messages-bulk-manage").attr("disabled",jq(this).val().length<=0)}),starAction=function(){var a=jq(this);return jq.post(ajaxurl,{action:"messages_star",message_id:a.data("message-id"),star_status:a.data("star-status"),nonce:a.data("star-nonce"),bulk:a.data("star-bulk")},function(b){1===parseInt(b,10)&&("unstar"===a.data("star-status")?(a.data("star-status","star"),a.removeClass("message-action-unstar").addClass("message-action-star"),a.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_star),1===BP_PM_Star.is_single_thread?a.prop("title",BP_PM_Star.strings.title_star):a.prop("title",BP_PM_Star.strings.title_star_thread)):(a.data("star-status","unstar"),a.removeClass("message-action-star").addClass("message-action-unstar"),a.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_unstar),1===BP_PM_Star.is_single_thread?a.prop("title",BP_PM_Star.strings.title_unstar):a.prop("title",BP_PM_Star.strings.title_unstar_thread)))}),!1},jq("#message-threads").on("click","td.thread-star a",starAction),jq("#message-thread").on("click",".message-star-actions a",starAction),jq("#message-threads td.bulk-select-check :checkbox").on("change",function(){var a=jq(this),b=a.closest("tr").find(".thread-star a");a.prop("checked")?"unstar"===b.data("star-status")?BP_PM_Star.star_counter++:BP_PM_Star.unstar_counter++:"unstar"===b.data("star-status")?BP_PM_Star.star_counter--:BP_PM_Star.unstar_counter--,BP_PM_Star.star_counter>0&&0===parseInt(BP_PM_Star.unstar_counter,10)?jq('option[value="star"]').hide():jq('option[value="star"]').show(),BP_PM_Star.unstar_counter>0&&0===parseInt(BP_PM_Star.star_counter,10)?jq('option[value="unstar"]').hide():jq('option[value="unstar"]').show()}),jq("#select-all-notifications").click(function(){jq(".notification-check").each(this.checked?function(){this.checked=!0}:function(){this.checked=!1})}),jq("#notification-bulk-manage").attr("disabled","disabled"),jq("#notification-select").on("change",function(){jq("#notification-bulk-manage").attr("disabled",jq(this).val().length<=0)}),jq("#close-notice").on("click",function(){return jq(this).addClass("loading"),jq("#sidebar div.error").remove(),jq.post(ajaxurl,{action:"messages_close_notice",notice_id:jq(".notice").attr("rel").substr(2,jq(".notice").attr("rel").length)},function(a){jq("#close-notice").removeClass("loading"),a[0]+a[1]==="-1"?(jq(".notice").prepend(a.substr(2,a.length)),jq("#sidebar div.error").hide().fadeIn(200)):jq(".notice").slideUp(100)}),
+!1}),jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover(function(){jq(this).addClass("sfhover")}),jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout(function(){jq(this).removeClass("sfhover")}),jq("#wp-admin-bar-logout, a.logout").on("click",function(){jq.removeCookie("bp-activity-scope",{path:"/"}),jq.removeCookie("bp-activity-filter",{path:"/"}),jq.removeCookie("bp-activity-oldestpage",{path:"/"});var a=["members","groups","blogs","forums"];jq(a).each(function(b){jq.removeCookie("bp-"+a[b]+"-scope",{path:"/"}),jq.removeCookie("bp-"+a[b]+"-filter",{path:"/"}),jq.removeCookie("bp-"+a[b]+"-extras",{path:"/"})})}),jq("body").hasClass("no-js")&&jq("body").attr("class",jq("body").attr("class").replace(/no-js/,"js")),"undefined"!=typeof wp&&"undefined"!=typeof wp.heartbeat&&"undefined"!=typeof BP_DTheme.pulse&&(wp.heartbeat.interval(Number(BP_DTheme.pulse)),jq.fn.extend({"heartbeat-send":function(){return this.bind("heartbeat-send.buddypress")}}));var e=0;jq(document).on("heartbeat-send.buddypress",function(a,b){e=0,jq("#buddypress ul.activity-list li").first().prop("id")&&(timestamp=jq("#buddypress ul.activity-list li").first().prop("class").match(/date-recorded-([0-9]+)/),timestamp&&(e=timestamp[1])),(0===activity_last_recorded||Number(e)>activity_last_recorded)&&(activity_last_recorded=Number(e)),b.bp_activity_last_recorded=activity_last_recorded,last_recorded_search=bp_get_querystring("s"),last_recorded_search&&(b.bp_activity_last_recorded_search_terms=last_recorded_search)}),jq(document).on("heartbeat-tick",function(a,b){b.bp_activity_newest_activities&&(newest_activities=b.bp_activity_newest_activities.activities+newest_activities,activity_last_recorded=Number(b.bp_activity_newest_activities.last_recorded),jq("#buddypress ul.activity-list li").first().hasClass("load-newest")||jq("#buddypress ul.activity-list").prepend('<li class="load-newest"><a href="#newest">'+BP_DTheme.newest+"</a></li>"))})});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/password-verify.min.js b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/password-verify.min.js
index a5fd26d8172ae9d90ba4f964d6b42853a8e70cf2..97c73d77dc6854d0c094c6f0d33f9edef25bdba0 100644
--- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/password-verify.min.js
+++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/password-verify.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
 !function(a){function b(){var b,c=a(".password-entry").val(),d=a(".password-entry-confirm").val();if(a("#pass-strength-result").removeClass("short bad good strong"),!c)return void a("#pass-strength-result").html(pwsL10n.empty);switch(b=wp.passwordStrength.meter(c,wp.passwordStrength.userInputBlacklist(),d)){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}a(document).ready(function(){a(".password-entry").val("").keyup(b),a(".password-entry-confirm").val("").keyup(b)})}(jQuery);
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js
index 40d6e43cd1e4dd1e8e71d98501643112518f4d2e..6e0be1301f14006c443f5c6fd2f651aaa30e7bcf 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js
@@ -56,7 +56,7 @@ jq(document).ready( function() {
 
 		var $whats_new_form = jq("form#whats-new-form");
 		if ( $whats_new_form.hasClass("submitted") ) {
-			$whats_new_form.removeClass("submitted");	
+			$whats_new_form.removeClass("submitted");
 		}
 	});
 
@@ -329,7 +329,7 @@ jq(document).ready( function() {
 			var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
 
 			var just_posted = [];
-			
+
 			jq('.activity-list li.just-posted').each( function(){
 				just_posted.push( jq(this).attr('id').replace( 'activity-','' ) );
 			});
@@ -554,7 +554,7 @@ jq(document).ready( function() {
 					var count_span = jq('li#' + comment_li.parents('ul#activity-stream > li').attr('id') + ' a.acomment-reply span');
 					var new_count = count_span.html() - ( 1 + child_count );
 					count_span.html(new_count);
-	
+
 					// Change the 'Show all x comments' text
 					var show_all_a = comment_li.siblings('.show-all').find('a');
 					if ( show_all_a ) {
@@ -753,7 +753,7 @@ jq(document).ready( function() {
 				var page_number = Number( jq('.pagination span.current').html() ) - 1;
 			else
 				var page_number = Number( jq(target).html() );
-			
+
 			if ( pagination_id.indexOf( 'pag-bottom' ) !== -1 ) {
 				var caller = 'pag-bottom';
 			} else {
@@ -867,24 +867,23 @@ jq(document).ready( function() {
 
 	/** Profile Visibility Settings *********************************/
 	jq('.field-visibility-settings').hide();
-	jq('.visibility-toggle-link').on( 'click', function() {
-		var toggle_div = jq(this).parent();
+	jq( '.visibility-toggle-link' ).on( 'click', function( event ) {
+		event.preventDefault();
 
-		jq(toggle_div).fadeOut( 600, function(){
-			jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
-		});
-
-		return false;
+		jq( this ).parent().hide().addClass( 'field-visibility-settings-hide' )
+			.siblings( '.field-visibility-settings' ).show().addClass( 'field-visibility-settings-open' );
 	} );
 
-	jq('.field-visibility-settings-close').on( 'click', function() {
-		var settings_div = jq(this).parent();
+	jq( '.field-visibility-settings-close' ).on( 'click', function( event ) {
+		event.preventDefault();
 
-		jq(settings_div).slideUp( 400, function(){
-			jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
-		});
+		var settings_div = jq( this ).parent(),
+			vis_setting_text = settings_div.find( 'input:checked' ).parent().text();
 
-		return false;
+		settings_div.hide().removeClass( 'field-visibility-settings-open' )
+			.siblings( '.field-visibility-settings-toggle' )
+				.children( '.current-visibility-level' ).text( vis_setting_text ).end()
+			.show().removeClass( 'field-visibility-settings-hide' );
 	} );
 
 	jq("#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select").change( function() {
@@ -893,7 +892,7 @@ jq(document).ready( function() {
 		jq('#profile-edit-form input:submit, #signup_form input:submit').on( 'click', function() {
 			shouldconfirm = false;
 		});
-		
+
 		window.onbeforeunload = function(e) {
 			if ( shouldconfirm ) {
 				return BP_DTheme.unsaved_changes;
@@ -1214,13 +1213,13 @@ jq(document).ready( function() {
 			checkboxes[i].checked = checked_value;
 		});
 	});
-	
+
 	/* Bulk delete messages */
 	jq( 'body.messages #item-body div.messages' ).on( 'click', '.messages-options-nav a', function() {
-		if ( -1 == jq.inArray( this.id ), Array( 'delete_sentbox_messages', 'delete_inbox_messages' ) ) {
+		if ( -1 == jq.inArray( this.id, Array( 'delete_sentbox_messages', 'delete_inbox_messages' ) ) ) {
 			return;
 		}
-		
+
 		checkboxes_tosend = '';
 		checkboxes = jq("#message-threads tr td input[type='checkbox']");
 
@@ -1236,7 +1235,7 @@ jq(document).ready( function() {
 			jq(this).removeClass('loading');
 			return false;
 		}
-		
+
 		jq.post( ajaxurl, {
 			action: 'messages_delete',
 			'thread_ids': checkboxes_tosend
@@ -1249,7 +1248,7 @@ jq(document).ready( function() {
 				jq(checkboxes).each( function(i) {
 					if( jq(this).is(':checked') ) {
 						// We need to uncheck because message is only hidden
-						// Otherwise, AJAX will be fired again with same data 
+						// Otherwise, AJAX will be fired again with same data
 						jq(this).attr( 'checked', false );
 						jq(this).parent().parent().fadeOut(150);
 					}
@@ -1411,7 +1410,7 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e
 					jq(this).html(response);
 					jq(this).fadeIn(100);
 			 	});
-			});	
+			});
 
 		} else {
 			jq(target).fadeOut( 100, function() {
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php
index 5c728ae45e18b34c3e53fe735fdd7795670b0fe3..9feebffab4f84b2fe70df09c746333d7d79937e2 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/admin.php
@@ -230,7 +230,7 @@
 	<div class="bp-widget">
 		<h4><?php _e("Members", "buddypress"); ?></h4>
 
-		<?php if ( bp_group_has_members( 'per_page=15&exclude_banned=false' ) ) : ?>
+		<?php if ( bp_group_has_members( 'per_page=15&exclude_banned=0' ) ) : ?>
 
 			<?php if ( bp_group_member_needs_pagination() ) : ?>
 
diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php
index a70cdabc30aa1e0df3383af1b1ad25fae36e4412..de156be02b35a62ab6f31d08f1d6b4361c8aadae 100644
--- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php
+++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum/topic.php
@@ -138,7 +138,7 @@
 
 					<h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4>
 
-					<textarea name="reply_text" id="reply_text"></textarea>
+					<textarea name="reply_text" id="reply_text" class="bp-suggestions"></textarea>
 
 					<div class="submit">
 						<input type="submit" name="submit_reply" id="submit" value="<?php esc_attr_e( 'Post Reply', 'buddypress' ); ?>" />
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.css
index 9730a358ab0001b07da7599d7594afb888f4d8c1..ec28f76432780d1025b09cae244857a814b4e94e 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.css
@@ -1,15 +1,30 @@
 /* Profile field group main admin page */
-#tabs-bottom {
-	background: #f5f5f5;
-	height: 32px;
-	border: 1px solid #dedede;
+@-o-keyframes tab-throb {
+    from { box-shadow: 0 0 10px #1e8cbe; }
+    50%  { box-shadow: 0 0 0    #1e8cbe; }
+    to   { box-shadow: 0 0 10px #1e8cbe; }
+}
+@-webkit-keyframes tab-throb {
+    from { box-shadow: 0 0 10px #1e8cbe; }
+    50%  { box-shadow: 0 0 0    #1e8cbe; }
+    to   { box-shadow: 0 0 10px #1e8cbe; }
+}
+
+@-moz-keyframes tab-throb {
+    from { box-shadow: 0 0 10px #1e8cbe; }
+    50%  { box-shadow: 0 0 0    #1e8cbe; }
+    to   { box-shadow: 0 0 10px #1e8cbe; }
+}
+
+#profile-field-form {
+	margin-top: 12px;
 }
 
 #tabs {
 	position: relative;
 	}
 	p.nofields {
-		margin: 20px 20px 0;
+		margin: 20px 0 0;
 	}
 
 	/* Field group tabs */
@@ -24,30 +39,32 @@
 			margin-left: 8px;
 			margin-bottom: -1px;
 		}
-		ul#field-group-tabs li.ui-state-hover a {
-			background-color: #fafafa;
-		}
 		ul#field-group-tabs li.ui-state-hover a.ui-tab {
-			border-color: #dedede #dedede #f5f5f5 #dedede;
 			color: #d54e21;
 		}
-		ul#field-group-tabs li.ui-state-acceptable a.ui-tab {
-			border-color: #5a5 #5a5 #ccc #5a5;
-			color: #8a8;
-			background-color: #efe;
+		ul#field-group-tabs li.ui-state-acceptable:not(.ui-state-active) a.ui-tab {
+			-webkit-animation: tab-throb 2s infinite;
+			-moz-animation: tab-throb 2s infinite;
+			-o-animation: tab-throb 2s infinite;
+			animation: tab-throb 2s infinite;
 		}
-		ul#field-group-tabs li.drop-candidate a.ui-tab {
-			background-color: #ffc;
-			border-color: #aa5 #aa5 #ccc #aa5;
-			color: #aa8;
+		ul#field-group-tabs li.drop-candidate.ui-state-acceptable:not(.ui-state-active) a.ui-tab {
+			-webkit-box-shadow: 0 0 10px green;
+			-moz-box-shadow: 0 0 10px green;
+			-o-box-shadow: 0 0 10px green;
+			box-shadow: 0 0 10px green;
+			-webkit-animation: none;
+			-moz-animation: none;
+			-o-animation: none;
+			animation: none;
+			color: #000;
 		}
 		ul#field-group-tabs li a.ui-tab {
 			font-size: 14px;
 			display: block;
 			margin-top: 3px;
-			padding: 5px 10px 5px;
-			border: 1px solid #dedede;
-			border-bottom: none;
+			padding: 5px 10px 6px;
+			border: 1px solid #e5e5e5;
 			background-color: #f5f5f5;
 			text-decoration: none;
 			color: #000;
@@ -56,21 +73,24 @@
 
 		/* Selected tab */
 		ul#field-group-tabs li.ui-state-active a.ui-tab {
-			background-color: #f5f5f5;
-			margin-top: -1px;
+			background-color: #fff;
+			margin-top: 0;
 			padding: 7px 10px 7px;
-			border: 1px solid #dedede;
 			border-bottom: 1px solid transparent;
 			color: #000;
 		}
 
 	/* Toolbar */
 	.tab-toolbar {
-		background: #f5f5f5;
-		border-width: 0 0 1px;
-		border-color: #dedede;
+		clear: right;
+		background: #fff;
+		border-width: 1px;
+		border-color: #e5e5e5;
 		border-style: solid;
+		-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+		box-shadow: 0 1px 1px rgba(0,0,0,0.04);
 		padding: 10px;
+		margin-bottom: 10px;
 	}
 
 	.bp-option a.delete,
@@ -85,46 +105,37 @@
 	div.delete-button {
 		float: left;
 		line-height: 28px;
-		margin: 0 0 0 10px;
 	}
 
-	div.tab-wrapper {
-		background-color: #fff;
-		border: 1px solid #dedede;
-		border-bottom: none;
+	div.field-group {
 		clear: right;
-		padding-bottom: 20px;
 	}
 
-	.tab-wrapper fieldset {
-		position: relative;
+	.field-group {
 		cursor: default;
+		border: 1px solid #e5e5e5;
+		background: #fff;
+		-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+		box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+		margin-top: 10px;
+		padding: 0 20px 20px;
 	}
-		.tab-wrapper fieldset legend {
-			font-weight: bold;
-		}
-	.tab-wrapper .xprofile-field {
+	.field-group .xprofile-field {
 		position: relative;
 	}
-	.tab-wrapper fieldset fieldset {
+	.field-group fieldset {
 		position: relative;
 		border: 1px solid #ddd;
-		margin: 20px 20px 0;
+		margin: 20px 0 0;
 		cursor: move;
 		background: #fafafa;
 		padding: 10px 0 0 ;
 	}
-	.tab-wrapper fieldset fieldset legend {
-		position: absolute;
-		top: 10px;
-		right: 10px;
-		padding: 0;
-	}
-		.field-group fieldset:hover {
-			border-color: #999;
-		}
-		fieldset div.field-wrapper {
-			padding: 25px 10px 10px;
+		.field-group fieldset legend {
+			position: absolute;
+			top: 10px;
+			right: 10px;
+			padding: 0;
 		}
 	fieldset.radio div div label,
 	fieldset.checkbox div label {
@@ -134,6 +145,9 @@
 	fieldset.clear-value {
 		margin-right: 10px;
 	}
+	fieldset div.field-wrapper {
+		padding: 25px 10px 10px;
+	}
 	.field-group div.actions {
 		float: none;
 		border-top: 1px solid #ddd;
@@ -145,6 +159,9 @@
 	.field-group div.actions input {
 		float: none;
 	}
+	.field-group fieldset:hover {
+		border-color: #999;
+	}
 	.field-group fieldset:hover div.actions {
 		display: block;
 	}
@@ -249,3 +266,11 @@ textarea#group_description {
 	border: 1px solid #ddd;
 	width: 100%;
 }
+
+#bp-xprofile-add-field .titlewrap,
+#bp-xprofile-add-field-group .titlewrap {
+	margin-bottom: 20px;
+}
+#bp-xprofile-add-field #post-body-content {
+	margin-bottom: 0;
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.min.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.min.css
index f2f3a2f5d465e8e3321ca7d2aafa2919e834400e..e341c453a22b489fea52ac2d16cb846b022cb54e 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.min.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-#tabs-bottom{background:#f5f5f5;height:32px;border:1px solid #dedede}#tabs{position:relative}p.nofields{margin:20px 20px 0}ul#field-group-tabs{float:right;padding:0 15px 0 0;margin:0;display:none}ul#field-group-tabs li{float:right;margin-left:8px;margin-bottom:-1px}ul#field-group-tabs li.ui-state-hover a{background-color:#fafafa}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#dedede #dedede #f5f5f5;color:#d54e21}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc;color:#8a8;background-color:#efe}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc;color:#aa8}ul#field-group-tabs li a.ui-tab{font-size:14px;display:block;margin-top:3px;padding:5px 10px;border:1px solid #dedede;border-bottom:none;background-color:#f5f5f5;text-decoration:none;color:#000;outline:0}ul#field-group-tabs li.ui-state-active a.ui-tab{background-color:#f5f5f5;margin-top:-1px;padding:7px 10px;border:1px solid #dedede;border-bottom:1px solid transparent;color:#000}.tab-toolbar{background:#f5f5f5;border-width:0 0 1px;border-color:#dedede;border-style:solid;padding:10px}.bp-option a.delete,.field-wrapper a.deletion,.tab-toolbar a.deletion{color:red;border-bottom:1px solid red;text-decoration:none;padding:0}div.delete-button{float:left;line-height:28px;margin:0 0 0 10px}div.tab-wrapper{background-color:#fff;border:1px solid #dedede;border-bottom:none;clear:right;padding-bottom:20px}.tab-wrapper fieldset{position:relative;cursor:default}.tab-wrapper fieldset legend{font-weight:700}.tab-wrapper .xprofile-field{position:relative}.tab-wrapper fieldset fieldset{position:relative;border:1px solid #ddd;margin:20px 20px 0;cursor:move;background:#fafafa;padding:10px 0 0}.tab-wrapper fieldset fieldset legend{position:absolute;top:10px;right:10px;padding:0}.field-group fieldset:hover{border-color:#999}fieldset div.field-wrapper{padding:25px 10px 10px}fieldset.checkbox div label,fieldset.radio div div label{margin-left:20px}fieldset.clear-value{margin-right:10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:10px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover div.actions{display:block}#field-group-tabs .ui-sortable-placeholder,.bp-options-box .ui-sortable-placeholder,.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#fff;visibility:visible!important}#field-group-tabs .ui-sortable-placeholder{background:0 0;border-bottom:none;margin:-1px 0 -1px 6px}ul.forTab{list-style:none;padding:0;margin:0 1em 0 0}ul.forTab li{margin:0 0 1em}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}ul.multi-checkbox{margin:0 0 0 5px;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:1px solid #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.bp-option{background:#fafafa;border:1px solid #dfdfdf;margin:10px 0;padding:10px 5px}div.bp-option:hover{border:1px solid #999}.bp-option-icon{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 2px 0 0;top:5px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div.bp-option .grabber:before{content:"\f329"}th a{background:#fff;padding:2px 5px;top:-2px}textarea#description,textarea#group_description{border:1px solid #ddd;width:100%}
\ No newline at end of file
+#tabs,.field-group .xprofile-field{position:relative}@-o-keyframes tab-throb{from,to{box-shadow:0 0 10px #1e8cbe}50%{box-shadow:0 0 0 #1e8cbe}}@-webkit-keyframes tab-throb{from,to{box-shadow:0 0 10px #1e8cbe}50%{box-shadow:0 0 0 #1e8cbe}}@-moz-keyframes tab-throb{from,to{box-shadow:0 0 10px #1e8cbe}50%{box-shadow:0 0 0 #1e8cbe}}#profile-field-form{margin-top:12px}p.nofields{margin:20px 0 0}ul#field-group-tabs{float:right;padding:0 15px 0 0;margin:0;display:none}ul#field-group-tabs li{float:right;margin-left:8px;margin-bottom:-1px}ul#field-group-tabs li.ui-state-hover a.ui-tab{color:#d54e21}ul#field-group-tabs li.ui-state-acceptable:not(.ui-state-active) a.ui-tab{-webkit-animation:tab-throb 2s infinite;-moz-animation:tab-throb 2s infinite;-o-animation:tab-throb 2s infinite;animation:tab-throb 2s infinite}ul#field-group-tabs li.drop-candidate.ui-state-acceptable:not(.ui-state-active) a.ui-tab{-webkit-box-shadow:0 0 10px green;-moz-box-shadow:0 0 10px green;-o-box-shadow:0 0 10px green;box-shadow:0 0 10px green;-webkit-animation:none;-moz-animation:none;-o-animation:none;animation:none;color:#000}ul#field-group-tabs li a.ui-tab{font-size:14px;display:block;margin-top:3px;padding:5px 10px 6px;border:1px solid #e5e5e5;background-color:#f5f5f5;text-decoration:none;color:#000;outline:0}ul#field-group-tabs li.ui-state-active a.ui-tab{background-color:#fff;margin-top:0;padding:7px 10px;border-bottom:1px solid transparent;color:#000}.tab-toolbar{clear:right;border-width:1px;border-color:#e5e5e5;border-style:solid;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px;margin-bottom:10px}.field-group,.tab-toolbar{background:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04)}.bp-option a.delete,.field-wrapper a.deletion,.tab-toolbar a.deletion{color:red;border-bottom:1px solid red;text-decoration:none;padding:0}div.delete-button{float:left;line-height:28px}div.field-group{clear:right}.field-group{cursor:default;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-top:10px;padding:0 20px 20px}.field-group fieldset{position:relative;border:1px solid #ddd;margin:20px 0 0;cursor:move;background:#fafafa;padding:10px 0 0}.field-group fieldset legend{position:absolute;top:10px;right:10px;padding:0}fieldset.checkbox div label,fieldset.radio div div label{margin-left:20px}fieldset.clear-value{margin-right:10px}fieldset div.field-wrapper{padding:25px 10px 10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:10px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover{border-color:#999}.field-group fieldset:hover div.actions{display:block}#field-group-tabs .ui-sortable-placeholder,.bp-options-box .ui-sortable-placeholder,.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#fff;visibility:visible!important}#field-group-tabs .ui-sortable-placeholder{background:0 0;border-bottom:none;margin:-1px 0 -1px 6px}ul.forTab{list-style:none;padding:0;margin:0 1em 0 0}ul.forTab li{margin:0 0 1em}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}ul.multi-checkbox{margin:0 0 0 5px;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:1px solid #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.bp-option{background:#fafafa;border:1px solid #dfdfdf;margin:10px 0;padding:10px 5px}div.bp-option:hover{border:1px solid #999}.bp-option-icon{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 2px 0 0;top:5px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div.bp-option .grabber:before{content:"\f329"}th a{background:#fff;padding:2px 5px;top:-2px}textarea#description,textarea#group_description{border:1px solid #ddd;width:100%}#bp-xprofile-add-field .titlewrap,#bp-xprofile-add-field-group .titlewrap{margin-bottom:20px}#bp-xprofile-add-field #post-body-content{margin-bottom:0}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
index 5be6ad24a6949e37d5cc7971bed51a429635d190..f7374f7bbe2fd86be38e6d5dc6aec60df271fb43 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css
@@ -1,15 +1,30 @@
 /* Profile field group main admin page */
-#tabs-bottom {
-	background: #f5f5f5;
-	height: 32px;
-	border: 1px solid #dedede;
+@-o-keyframes tab-throb {
+    from { box-shadow: 0 0 10px #1e8cbe; }
+    50%  { box-shadow: 0 0 0    #1e8cbe; }
+    to   { box-shadow: 0 0 10px #1e8cbe; }
+}
+@-webkit-keyframes tab-throb {
+    from { box-shadow: 0 0 10px #1e8cbe; }
+    50%  { box-shadow: 0 0 0    #1e8cbe; }
+    to   { box-shadow: 0 0 10px #1e8cbe; }
+}
+
+@-moz-keyframes tab-throb {
+    from { box-shadow: 0 0 10px #1e8cbe; }
+    50%  { box-shadow: 0 0 0    #1e8cbe; }
+    to   { box-shadow: 0 0 10px #1e8cbe; }
+}
+
+#profile-field-form {
+	margin-top: 12px;
 }
 
 #tabs {
 	position: relative;
 	}
 	p.nofields {
-		margin: 20px 20px 0;
+		margin: 20px 0 0;
 	}
 
 	/* Field group tabs */
@@ -24,30 +39,32 @@
 			margin-right: 8px;
 			margin-bottom: -1px;
 		}
-		ul#field-group-tabs li.ui-state-hover a {
-			background-color: #fafafa;
-		}
 		ul#field-group-tabs li.ui-state-hover a.ui-tab {
-			border-color: #dedede #dedede #f5f5f5 #dedede;
 			color: #d54e21;
 		}
-		ul#field-group-tabs li.ui-state-acceptable a.ui-tab {
-			border-color: #5a5 #5a5 #ccc #5a5;
-			color: #8a8;
-			background-color: #efe;
+		ul#field-group-tabs li.ui-state-acceptable:not(.ui-state-active) a.ui-tab {
+			-webkit-animation: tab-throb 2s infinite;
+			-moz-animation: tab-throb 2s infinite;
+			-o-animation: tab-throb 2s infinite;
+			animation: tab-throb 2s infinite;
 		}
-		ul#field-group-tabs li.drop-candidate a.ui-tab {
-			background-color: #ffc;
-			border-color: #aa5 #aa5 #ccc #aa5;
-			color: #aa8;
+		ul#field-group-tabs li.drop-candidate.ui-state-acceptable:not(.ui-state-active) a.ui-tab {
+			-webkit-box-shadow: 0 0 10px green;
+			-moz-box-shadow: 0 0 10px green;
+			-o-box-shadow: 0 0 10px green;
+			box-shadow: 0 0 10px green;
+			-webkit-animation: none;
+			-moz-animation: none;
+			-o-animation: none;
+			animation: none;
+			color: #000;
 		}
 		ul#field-group-tabs li a.ui-tab {
 			font-size: 14px;
 			display: block;
 			margin-top: 3px;
-			padding: 5px 10px 5px;
-			border: 1px solid #dedede;
-			border-bottom: none;
+			padding: 5px 10px 6px;
+			border: 1px solid #e5e5e5;
 			background-color: #f5f5f5;
 			text-decoration: none;
 			color: #000;
@@ -56,21 +73,24 @@
 
 		/* Selected tab */
 		ul#field-group-tabs li.ui-state-active a.ui-tab {
-			background-color: #f5f5f5;
-			margin-top: -1px;
+			background-color: #fff;
+			margin-top: 0;
 			padding: 7px 10px 7px;
-			border: 1px solid #dedede;
 			border-bottom: 1px solid transparent;
 			color: #000;
 		}
 
 	/* Toolbar */
 	.tab-toolbar {
-		background: #f5f5f5;
-		border-width: 0 0 1px;
-		border-color: #dedede;
+		clear: left;
+		background: #fff;
+		border-width: 1px;
+		border-color: #e5e5e5;
 		border-style: solid;
+		-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+		box-shadow: 0 1px 1px rgba(0,0,0,0.04);
 		padding: 10px;
+		margin-bottom: 10px;
 	}
 
 	.bp-option a.delete,
@@ -85,46 +105,37 @@
 	div.delete-button {
 		float: right;
 		line-height: 28px;
-		margin: 0 10px 0 0;
 	}
 
-	div.tab-wrapper {
-		background-color: #fff;
-		border: 1px solid #dedede;
-		border-bottom: none;
+	div.field-group {
 		clear: left;
-		padding-bottom: 20px;
 	}
 
-	.tab-wrapper fieldset {
-		position: relative;
+	.field-group {
 		cursor: default;
+		border: 1px solid #e5e5e5;
+		background: #fff;
+		-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+		box-shadow: 0 1px 1px rgba(0,0,0,0.04);
+		margin-top: 10px;
+		padding: 0 20px 20px;
 	}
-		.tab-wrapper fieldset legend {
-			font-weight: bold;
-		}
-	.tab-wrapper .xprofile-field {
+	.field-group .xprofile-field {
 		position: relative;
 	}
-	.tab-wrapper fieldset fieldset {
+	.field-group fieldset {
 		position: relative;
 		border: 1px solid #ddd;
-		margin: 20px 20px 0;
+		margin: 20px 0 0;
 		cursor: move;
 		background: #fafafa;
 		padding: 10px 0 0 ;
 	}
-	.tab-wrapper fieldset fieldset legend {
-		position: absolute;
-		top: 10px;
-		left: 10px;
-		padding: 0;
-	}
-		.field-group fieldset:hover {
-			border-color: #999;
-		}
-		fieldset div.field-wrapper {
-			padding: 25px 10px 10px;
+		.field-group fieldset legend {
+			position: absolute;
+			top: 10px;
+			left: 10px;
+			padding: 0;
 		}
 	fieldset.radio div div label,
 	fieldset.checkbox div label {
@@ -134,6 +145,9 @@
 	fieldset.clear-value {
 		margin-left: 10px;
 	}
+	fieldset div.field-wrapper {
+		padding: 25px 10px 10px;
+	}
 	.field-group div.actions {
 		float: none;
 		border-top: 1px solid #ddd;
@@ -145,6 +159,9 @@
 	.field-group div.actions input {
 		float: none;
 	}
+	.field-group fieldset:hover {
+		border-color: #999;
+	}
 	.field-group fieldset:hover div.actions {
 		display: block;
 	}
@@ -249,3 +266,11 @@ textarea#group_description {
 	border: 1px solid #ddd;
 	width: 100%;
 }
+
+#bp-xprofile-add-field .titlewrap,
+#bp-xprofile-add-field-group .titlewrap {
+	margin-bottom: 20px;
+}
+#bp-xprofile-add-field #post-body-content {
+	margin-bottom: 0;
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css
index 716777cd54376625d22975bd8b302f0801dd28fa..79326fac4dfa7e0b7e870982151274c0e43a6f0f 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css
@@ -1,2 +1 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:09 PM UTC - https://wordpress.org/plugins/buddypress/ */
-#tabs-bottom{background:#f5f5f5;height:32px;border:1px solid #dedede}#tabs{position:relative}p.nofields{margin:20px 20px 0}ul#field-group-tabs{float:left;padding:0 0 0 15px;margin:0;display:none}ul#field-group-tabs li{float:left;margin-right:8px;margin-bottom:-1px}ul#field-group-tabs li.ui-state-hover a{background-color:#fafafa}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#dedede #dedede #f5f5f5;color:#d54e21}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc;color:#8a8;background-color:#efe}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc;color:#aa8}ul#field-group-tabs li a.ui-tab{font-size:14px;display:block;margin-top:3px;padding:5px 10px;border:1px solid #dedede;border-bottom:none;background-color:#f5f5f5;text-decoration:none;color:#000;outline:0}ul#field-group-tabs li.ui-state-active a.ui-tab{background-color:#f5f5f5;margin-top:-1px;padding:7px 10px;border:1px solid #dedede;border-bottom:1px solid transparent;color:#000}.tab-toolbar{background:#f5f5f5;border-width:0 0 1px;border-color:#dedede;border-style:solid;padding:10px}.bp-option a.delete,.field-wrapper a.deletion,.tab-toolbar a.deletion{color:red;border-bottom:1px solid red;text-decoration:none;padding:0}div.delete-button{float:right;line-height:28px;margin:0 10px 0 0}div.tab-wrapper{background-color:#fff;border:1px solid #dedede;border-bottom:none;clear:left;padding-bottom:20px}.tab-wrapper fieldset{position:relative;cursor:default}.tab-wrapper fieldset legend{font-weight:700}.tab-wrapper .xprofile-field{position:relative}.tab-wrapper fieldset fieldset{position:relative;border:1px solid #ddd;margin:20px 20px 0;cursor:move;background:#fafafa;padding:10px 0 0}.tab-wrapper fieldset fieldset legend{position:absolute;top:10px;left:10px;padding:0}.field-group fieldset:hover{border-color:#999}fieldset div.field-wrapper{padding:25px 10px 10px}fieldset.checkbox div label,fieldset.radio div div label{margin-right:20px}fieldset.clear-value{margin-left:10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:10px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover div.actions{display:block}#field-group-tabs .ui-sortable-placeholder,.bp-options-box .ui-sortable-placeholder,.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#fff;visibility:visible!important}#field-group-tabs .ui-sortable-placeholder{background:0 0;border-bottom:none;margin:-1px 6px -1px 0}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em}ul.forTab li{margin:0 0 1em}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:1px solid #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.bp-option{background:#fafafa;border:1px solid #dfdfdf;margin:10px 0;padding:10px 5px}div.bp-option:hover{border:1px solid #999}.bp-option-icon{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 2px;top:5px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div.bp-option .grabber:before{content:"\f329"}th a{background:#fff;padding:2px 5px;top:-2px}textarea#description,textarea#group_description{border:1px solid #ddd;width:100%}
\ No newline at end of file
+#tabs,.field-group .xprofile-field{position:relative}@-o-keyframes tab-throb{from,to{box-shadow:0 0 10px #1e8cbe}50%{box-shadow:0 0 0 #1e8cbe}}@-webkit-keyframes tab-throb{from,to{box-shadow:0 0 10px #1e8cbe}50%{box-shadow:0 0 0 #1e8cbe}}@-moz-keyframes tab-throb{from,to{box-shadow:0 0 10px #1e8cbe}50%{box-shadow:0 0 0 #1e8cbe}}#profile-field-form{margin-top:12px}p.nofields{margin:20px 0 0}ul#field-group-tabs{float:left;padding:0 0 0 15px;margin:0;display:none}ul#field-group-tabs li{float:left;margin-right:8px;margin-bottom:-1px}ul#field-group-tabs li.ui-state-hover a.ui-tab{color:#d54e21}ul#field-group-tabs li.ui-state-acceptable:not(.ui-state-active) a.ui-tab{-webkit-animation:tab-throb 2s infinite;-moz-animation:tab-throb 2s infinite;-o-animation:tab-throb 2s infinite;animation:tab-throb 2s infinite}ul#field-group-tabs li.drop-candidate.ui-state-acceptable:not(.ui-state-active) a.ui-tab{-webkit-box-shadow:0 0 10px green;-moz-box-shadow:0 0 10px green;-o-box-shadow:0 0 10px green;box-shadow:0 0 10px green;-webkit-animation:none;-moz-animation:none;-o-animation:none;animation:none;color:#000}ul#field-group-tabs li a.ui-tab{font-size:14px;display:block;margin-top:3px;padding:5px 10px 6px;border:1px solid #e5e5e5;background-color:#f5f5f5;text-decoration:none;color:#000;outline:0}ul#field-group-tabs li.ui-state-active a.ui-tab{background-color:#fff;margin-top:0;padding:7px 10px;border-bottom:1px solid transparent;color:#000}.tab-toolbar{clear:left;border-width:1px;border-color:#e5e5e5;border-style:solid;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px;margin-bottom:10px}.field-group,.tab-toolbar{background:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04)}.bp-option a.delete,.field-wrapper a.deletion,.tab-toolbar a.deletion{color:red;border-bottom:1px solid red;text-decoration:none;padding:0}div.delete-button{float:right;line-height:28px}div.field-group{clear:left}.field-group{cursor:default;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-top:10px;padding:0 20px 20px}.field-group fieldset{position:relative;border:1px solid #ddd;margin:20px 0 0;cursor:move;background:#fafafa;padding:10px 0 0}.field-group fieldset legend{position:absolute;top:10px;left:10px;padding:0}fieldset.checkbox div label,fieldset.radio div div label{margin-right:20px}fieldset.clear-value{margin-left:10px}fieldset div.field-wrapper{padding:25px 10px 10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:10px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover{border-color:#999}.field-group fieldset:hover div.actions{display:block}#field-group-tabs .ui-sortable-placeholder,.bp-options-box .ui-sortable-placeholder,.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#fff;visibility:visible!important}#field-group-tabs .ui-sortable-placeholder{background:0 0;border-bottom:none;margin:-1px 6px -1px 0}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em}ul.forTab li{margin:0 0 1em}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:1px solid #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.bp-option{background:#fafafa;border:1px solid #dfdfdf;margin:10px 0;padding:10px 5px}div.bp-option:hover{border:1px solid #999}.bp-option-icon{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 0 0 2px;top:5px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;color:#888}div.bp-option .grabber:before{content:"\f329"}th a{background:#fff;padding:2px 5px;top:-2px}textarea#description,textarea#group_description{border:1px solid #ddd;width:100%}#bp-xprofile-add-field .titlewrap,#bp-xprofile-add-field-group .titlewrap{margin-bottom:20px}#bp-xprofile-add-field #post-body-content{margin-bottom:0}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
index c92248c08e4e440107e22d822c0328905020f73a..31ae10c9604e87f01a5ac0bcbe72d9f6a55914b6 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js
@@ -1,6 +1,6 @@
 /* exported add_option, show_options, hide, fixHelper */
 /* jshint scripturl: true */
-/* global XProfileAdmin */
+/* global XProfileAdmin, ajaxurl */
 
 /**
  * Add option for the forWhat type.
@@ -59,7 +59,7 @@ function add_option(forWhat) {
 	newDiv.appendChild( toDeleteWrap );
 	holder.appendChild( newDiv );
 
-	// re-initialize the sorable ui
+	// re-initialize the sortable ui
 	enableSortableFieldOptions( forWhat );
 
 	// set focus on newly created element
@@ -119,11 +119,39 @@ function destroySortableFieldOptions() {
 	jQuery( '.sortable, .sortable span' ).css( 'cursor', 'default' );
 }
 
+function titleHint( id ) {
+	id = id || 'title';
+
+	var title = jQuery('#' + id), titleprompt = jQuery('#' + id + '-prompt-text');
+
+	if ( '' === title.val() ) {
+		titleprompt.removeClass('screen-reader-text');
+	} else {
+		titleprompt.addClass('screen-reader-text');
+	}
+
+	titleprompt.click(function(){
+		jQuery(this).addClass('screen-reader-text');
+		title.focus();
+	});
+
+	title.blur(function(){
+		if ( '' === this.value ) {
+			titleprompt.removeClass('screen-reader-text');
+		}
+	}).focus(function(){
+		titleprompt.addClass('screen-reader-text');
+	}).keydown(function(e){
+		titleprompt.addClass('screen-reader-text');
+		jQuery(this).unbind(e);
+	});
+}
+
 jQuery( document ).ready( function() {
 
 	// Set focus in Field Title, if we're on the right page
 	jQuery( '#bp-xprofile-add-field #title' ).focus();
-	
+
 	// Set up deleting options ajax
 	jQuery( 'a.ajax-option-delete' ).on( 'click', function() {
 		var theId = this.id.split( '-' );
@@ -172,9 +200,9 @@ jQuery( document ).ready( function() {
 	// Allow reordering of fields within groups
 	jQuery( 'fieldset.field-group' ).sortable({
 		cursor: 'move',
-		opacity: 1,
+		opacity: 0.7,
 		items: 'fieldset',
-		tolerance: 'ponter',
+		tolerance: 'pointer',
 
 		update: function() {
 			jQuery.post( ajaxurl, {
@@ -189,14 +217,14 @@ jQuery( document ).ready( function() {
 	})
 
 	// Disallow text selection
-	.disableSelection()
-
-	// Change cursor to move if JS is enabled
-	.css( 'cursor', 'move' );
+	.disableSelection();
 
 	// Allow reordering of field options
 	enableSortableFieldOptions( jQuery('#fieldtype :selected').val() );
 
+	// Handle title placeholder text the WordPress way
+	titleHint( 'title' );
+
 	// tabs init with a custom tab template and an "add" callback filling in the content
 	var $tab_items,
 		$tabs = jQuery( '#tabs' ).tabs();
diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js
index 56750e1813ac3bcf6190001d53c7ef751d0fde45..3b1c204dc3a1beaca65addcec2d060af4ca1ca54 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js
+++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js
@@ -1,2 +1,2 @@
-/*! buddypress - v2.1.0 - 2014-10-06 9:39:07 PM UTC - https://wordpress.org/plugins/buddypress/ */
-function add_option(a){var b=document.getElementById(a+"_more"),c=document.getElementById(a+"_option_number").value,d=document.createElement("div"),e=document.createElement("span"),f=document.createElement("input"),g=document.createElement("label"),h=document.createElement("input"),i=document.createTextNode("Default Value"),j=document.createTextNode("Delete"),k=document.createElement("div"),l=document.createElement("a");d.setAttribute("id",a+"_div"+c),d.setAttribute("class","bp-option sortable"),e.setAttribute("class","bp-option-icon grabber"),f.setAttribute("type","text"),f.setAttribute("name",a+"_option["+c+"]"),f.setAttribute("id",a+"_option"+c),"checkbox"===a||"multiselectbox"===a?(h.setAttribute("type","checkbox"),h.setAttribute("name","isDefault_"+a+"_option["+c+"]")):(h.setAttribute("type","radio"),h.setAttribute("name","isDefault_"+a+"_option")),h.setAttribute("value",c),l.setAttribute("href",'javascript:hide("'+a+"_div"+c+'")'),l.setAttribute("class","delete"),l.appendChild(j),k.setAttribute("class","delete-button"),k.appendChild(l),g.appendChild(document.createTextNode(" ")),g.appendChild(h),g.appendChild(document.createTextNode(" ")),g.appendChild(i),g.appendChild(document.createTextNode(" ")),d.appendChild(e),d.appendChild(document.createTextNode(" ")),d.appendChild(f),d.appendChild(g),d.appendChild(k),b.appendChild(d),enableSortableFieldOptions(a),document.getElementById(a+"_option"+c).focus(),c++,document.getElementById(a+"_option_number").value=c}function show_options(a){for(var b=0;b<XProfileAdmin.supports_options_field_types.length;b++)document.getElementById(XProfileAdmin.supports_options_field_types[b]).style.display="none";XProfileAdmin.supports_options_field_types.indexOf(a)>=0&&(document.getElementById(a).style.display="")}function hide(a){if(!document.getElementById(a))return!1;document.getElementById(a).style.display="none";var b=a.replace("div","option");document.getElementById(b).value=""}function enableSortableFieldOptions(){jQuery(".bp-options-box").sortable({cursor:"move",items:"div.sortable",tolerance:"intersect",axis:"y"}),jQuery(".sortable, .sortable span").css("cursor","move")}function destroySortableFieldOptions(){jQuery(".bp-options-box").sortable("destroy"),jQuery(".sortable, .sortable span").css("cursor","default")}var fixHelper=function(a,b){return b.children().each(function(){jQuery(this).width(jQuery(this).width())}),b};jQuery(document).ready(function(){function a(a){b=jQuery("ul:first li",a).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(c,d){var e=jQuery(this),f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate"),d.draggable.hide("slow",function(){a.tabs("option","active",b.index(e)),jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500),f=jQuery(e.find("a").attr("href")).find(".connectedSortable"),jQuery(f).find("p.nofields").hide("slow"),jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(){})})},over:function(){jQuery(this).addClass("drop-candidate")},out:function(){jQuery(this).removeClass("drop-candidate")}})}jQuery("#bp-xprofile-add-field #title").focus(),jQuery("a.ajax-option-delete").on("click",function(){var a=this.id.split("-");a=a[1],jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:a},function(){})}),jQuery('[id^="sort_order_"]').change(function(){"custom"!==jQuery(this).val()?destroySortableFieldOptions():enableSortableFieldOptions(jQuery("#fieldtype :selected").val())}),jQuery("ul#field-group-tabs").show(),jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:1,items:"li",tolerance:"intersect",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(){})}}).disableSelection(),jQuery("fieldset.field-group").sortable({cursor:"move",opacity:1,items:"fieldset",tolerance:"ponter",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(){})}}).disableSelection().css("cursor","move"),enableSortableFieldOptions(jQuery("#fieldtype :selected").val());var b,c=jQuery("#tabs").tabs();a(c)});
\ No newline at end of file
+/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
+function add_option(a){var b=document.getElementById(a+"_more"),c=document.getElementById(a+"_option_number").value,d=document.createElement("div"),e=document.createElement("span"),f=document.createElement("input"),g=document.createElement("label"),h=document.createElement("input"),i=document.createTextNode("Default Value"),j=document.createTextNode("Delete"),k=document.createElement("div"),l=document.createElement("a");d.setAttribute("id",a+"_div"+c),d.setAttribute("class","bp-option sortable"),e.setAttribute("class","bp-option-icon grabber"),f.setAttribute("type","text"),f.setAttribute("name",a+"_option["+c+"]"),f.setAttribute("id",a+"_option"+c),"checkbox"===a||"multiselectbox"===a?(h.setAttribute("type","checkbox"),h.setAttribute("name","isDefault_"+a+"_option["+c+"]")):(h.setAttribute("type","radio"),h.setAttribute("name","isDefault_"+a+"_option")),h.setAttribute("value",c),l.setAttribute("href",'javascript:hide("'+a+"_div"+c+'")'),l.setAttribute("class","delete"),l.appendChild(j),k.setAttribute("class","delete-button"),k.appendChild(l),g.appendChild(document.createTextNode(" ")),g.appendChild(h),g.appendChild(document.createTextNode(" ")),g.appendChild(i),g.appendChild(document.createTextNode(" ")),d.appendChild(e),d.appendChild(document.createTextNode(" ")),d.appendChild(f),d.appendChild(g),d.appendChild(k),b.appendChild(d),enableSortableFieldOptions(a),document.getElementById(a+"_option"+c).focus(),c++,document.getElementById(a+"_option_number").value=c}function show_options(a){for(var b=0;b<XProfileAdmin.supports_options_field_types.length;b++)document.getElementById(XProfileAdmin.supports_options_field_types[b]).style.display="none";XProfileAdmin.supports_options_field_types.indexOf(a)>=0&&(document.getElementById(a).style.display="")}function hide(a){if(!document.getElementById(a))return!1;document.getElementById(a).style.display="none";var b=a.replace("div","option");document.getElementById(b).value=""}function enableSortableFieldOptions(){jQuery(".bp-options-box").sortable({cursor:"move",items:"div.sortable",tolerance:"intersect",axis:"y"}),jQuery(".sortable, .sortable span").css("cursor","move")}function destroySortableFieldOptions(){jQuery(".bp-options-box").sortable("destroy"),jQuery(".sortable, .sortable span").css("cursor","default")}function titleHint(a){a=a||"title";var b=jQuery("#"+a),c=jQuery("#"+a+"-prompt-text");""===b.val()?c.removeClass("screen-reader-text"):c.addClass("screen-reader-text"),c.click(function(){jQuery(this).addClass("screen-reader-text"),b.focus()}),b.blur(function(){""===this.value&&c.removeClass("screen-reader-text")}).focus(function(){c.addClass("screen-reader-text")}).keydown(function(a){c.addClass("screen-reader-text"),jQuery(this).unbind(a)})}var fixHelper=function(a,b){return b.children().each(function(){jQuery(this).width(jQuery(this).width())}),b};jQuery(document).ready(function(){function a(a){b=jQuery("ul:first li",a).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(c,d){var e=jQuery(this),f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate"),d.draggable.hide("slow",function(){a.tabs("option","active",b.index(e)),jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500),f=jQuery(e.find("a").attr("href")).find(".connectedSortable"),jQuery(f).find("p.nofields").hide("slow"),jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(){})})},over:function(){jQuery(this).addClass("drop-candidate")},out:function(){jQuery(this).removeClass("drop-candidate")}})}jQuery("#bp-xprofile-add-field #title").focus(),jQuery("a.ajax-option-delete").on("click",function(){var a=this.id.split("-");a=a[1],jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:a},function(){})}),jQuery('[id^="sort_order_"]').change(function(){"custom"!==jQuery(this).val()?destroySortableFieldOptions():enableSortableFieldOptions(jQuery("#fieldtype :selected").val())}),jQuery("ul#field-group-tabs").show(),jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:1,items:"li",tolerance:"intersect",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(){})}}).disableSelection(),jQuery("fieldset.field-group").sortable({cursor:"move",opacity:.7,items:"fieldset",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(){})}}).disableSelection(),enableSortableFieldOptions(jQuery("#fieldtype :selected").val()),titleHint("title");var b,c=jQuery("#tabs").tabs();a(c)});
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
index d45211e20691f412781f27fcc1f26927e67f8d42..54d73674ad68ab0d2aec16e732b6edb7145ba7fe 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * This function runs when an action is set for a screen:
@@ -38,7 +38,7 @@ function xprofile_action_delete_avatar() {
 	if ( bp_core_delete_existing_avatar( array( 'item_id' => bp_displayed_user_id() ) ) )
 		bp_core_add_message( __( 'Your profile photo was deleted successfully!', 'buddypress' ) );
 	else
-		bp_core_add_message( __( 'There was a problem deleting your profile photo; please try again.', 'buddypress' ), 'error' );
+		bp_core_add_message( __( 'There was a problem deleting your profile photo. Please try again.', 'buddypress' ), 'error' );
 
 	bp_core_redirect( wp_get_referer() );
 }
@@ -47,7 +47,7 @@ add_action( 'bp_actions', 'xprofile_action_delete_avatar' );
 /**
  * Handles the saving of xprofile field visibilities
  *
- * @since BuddyPress (1.9)
+ * @since BuddyPress (1.9.0)
  */
 function bp_xprofile_action_settings() {
 
@@ -75,6 +75,11 @@ function bp_xprofile_action_settings() {
 	// Nonce check
 	check_admin_referer( 'bp_xprofile_settings' );
 
+	/**
+	 * Fires before saving xprofile field visibilities.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
 	do_action( 'bp_xprofile_settings_before_save' );
 
 	/** Save ******************************************************************/
@@ -111,6 +116,11 @@ function bp_xprofile_action_settings() {
 
 	/** Other *****************************************************************/
 
+	/**
+	 * Fires after saving xprofile field visibilities.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
 	do_action( 'bp_xprofile_settings_after_save' );
 
 	// Redirect to the root domain
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
index 82c147a0b0ad3ba694b3937f53b5434bfcd71603..f03363feb07845199f842f338dd0766c8830763c 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php
@@ -11,7 +11,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Register the activity actions for the Extended Profile component
@@ -33,20 +33,8 @@ function xprofile_register_activity_actions() {
 		__( 'Updated Profile Photos', 'buddypress' )
 	);
 
-	// Get the profile component ID
-	$profile_id = buddypress()->profile->id;
-
-	bp_activity_set_action(
-		$profile_id,
-		'new_member',
-		__( 'New member registered', 'buddypress' ),
-		'bp_xprofile_format_activity_action_new_member',
-		__( 'New Members', 'buddypress' ),
-		array( 'activity' )
-	);
-
 	bp_activity_set_action(
-		$profile_id,
+		buddypress()->profile->id,
 		'updated_profile',
 		__( 'Updated Profile', 'buddypress' ),
 		'bp_xprofile_format_activity_action_updated_profile',
@@ -54,6 +42,11 @@ function xprofile_register_activity_actions() {
 		array( 'activity' )
 	);
 
+	/**
+	 * Fires after the registration of default activity actions for Extended Profile component.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 */
 	do_action( 'xprofile_register_activity_actions' );
 }
 add_action( 'bp_register_activity_actions', 'xprofile_register_activity_actions' );
@@ -76,30 +69,17 @@ function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) {
 		$action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id );
 	}
 
+	/**
+	 * Filters the formatted 'new_avatar' activity stream action.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   Formatted action for activity stream.
+	 * @param object $activity Activity object.
+	 */
 	return apply_filters( 'bp_xprofile_format_activity_action_new_avatar', $action, $activity );
 }
 
-/**
- * Format 'new_member' activity actions.
- *
- * @since BuddyPress (2.0.0)
- *
- * @param string $action Static activity action.
- * @param object $activity Activity object.
- * @return string
- */
-function bp_xprofile_format_activity_action_new_member( $action, $activity ) {
-	$userlink = bp_core_get_userlink( $activity->user_id );
-	$action   = sprintf( __( '%s became a registered member', 'buddypress' ), $userlink );
-
-	// Legacy filter - pass $user_id instead of $activity
-	if ( has_filter( 'bp_core_activity_registered_member_action' ) ) {
-		$action = apply_filters( 'bp_core_activity_registered_member_action', $action, $activity->user_id );
-	}
-
-	return apply_filters( 'bp_xprofile_format_activity_action_new_member', $action, $activity );
-}
-
 /**
  * Format 'updated_profile' activity actions.
  *
@@ -118,6 +98,14 @@ function bp_xprofile_format_activity_action_updated_profile( $action, $activity
 	$profile_link = trailingslashit( bp_core_get_user_domain( $activity->user_id ) . buddypress()->profile->slug );
 	$action	      = sprintf( __( '%s&#8217;s profile was updated', 'buddypress' ), '<a href="' . $profile_link . '">' . bp_core_get_user_displayname( $activity->user_id ) . '</a>' );
 
+	/**
+	 * Filters the formatted 'updated_profile' activity stream action.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $action   Formatted action for activity stream.
+	 * @param object $activity Activity object.
+	 */
 	return apply_filters( 'bp_xprofile_format_activity_action_updated_profile', $action, $activity );
 }
 
@@ -199,6 +187,15 @@ function xprofile_register_activity_action( $key, $value ) {
 		return false;
 	}
 
+	/**
+	 * Filters the return value of bp_activity_set_action.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool   $value Whether or not an action was successfully registered.
+	 * @param string $key   Key used for the registered action.
+	 * @param string $value Value used for the registered action.
+	 */
 	return apply_filters( 'xprofile_register_activity_action', bp_activity_set_action( buddypress()->profile->id, $key, $value ), $key, $value );
 }
 
@@ -218,7 +215,13 @@ function bp_xprofile_new_avatar_activity() {
 		return false;
 	}
 
-	// Allow user ID to be filtered
+	/**
+	 * Filters the user ID when a user has uploaded a new avatar.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param int $value ID of the displayed user.
+	 */
 	$user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', bp_displayed_user_id() );
 
 	// Add the activity
@@ -295,6 +298,14 @@ function bp_xprofile_updated_profile_activity( $user_id, $field_ids = array(), $
 
 	// Default throttle time is 2 hours. Filter to change (in seconds)
 	if ( ! empty( $existing['activities'] ) ) {
+
+		/**
+		 * Filters the throttle time, in seconds, used to prevent excessive activity posting.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param int $value Throttle time, in seconds.
+		 */
 		$throttle_period = apply_filters( 'bp_xprofile_updated_profile_activity_throttle_time', HOUR_IN_SECONDS * 2 );
 		$then            = strtotime( $existing['activities'][0]->date_recorded );
 		$now             = strtotime( bp_core_current_time() );
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
index 8c907a492ebfdfa7fa0d575be524f950d7a0c2e7..1fb255ae86eea30850e9a32d1746eec15cbe9628 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php
@@ -8,7 +8,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Creates the administration interface menus and checks to see if the DB
@@ -21,8 +21,10 @@ if ( !defined( 'ABSPATH' ) ) exit;
  */
 function xprofile_add_admin_menu() {
 
-	if ( !bp_current_user_can( 'bp_moderate' ) )
+	// Bail if current user cannot moderate community
+	if ( ! bp_current_user_can( 'bp_moderate' ) ) {
 		return false;
+	}
 
 	add_users_page( _x( 'Profile Fields', 'xProfile admin page title', 'buddypress' ), _x( 'Profile Fields', 'Admin Users menu', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );
 }
@@ -34,34 +36,51 @@ add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' );
  */
 function xprofile_admin( $message = '', $type = 'error' ) {
 
-	$type = preg_replace( '|[^a-z]|i', '', $type );
-
-	$groups = bp_xprofile_get_groups( array(
-		'fetch_fields' => true
-	) );
-
-	if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'add_field' == $_GET['mode'] )
+	if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'add_field' == $_GET['mode'] ) {
 		xprofile_admin_manage_field( $_GET['group_id'] );
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] )
+	} elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] ) {
 		xprofile_admin_manage_field( $_GET['group_id'], $_GET['field_id'] );
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] )
+	} elseif ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] ) {
 		xprofile_admin_delete_field( $_GET['field_id'], 'field');
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] )
+	} elseif ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] ) {
 		xprofile_admin_delete_field( $_GET['option_id'], 'option' );
 
-	else if ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] )
+	} elseif ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] ) {
 		xprofile_admin_manage_group();
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] )
+	} elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] ) {
 		xprofile_admin_delete_group( $_GET['group_id'] );
 
-	else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] )
+	} elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] ) {
 		xprofile_admin_manage_group( $_GET['group_id'] );
 
-	else { ?>
+	} else {
+		xprofile_admin_screen( $message, $type );
+	}
+}
+
+/**
+ * Output the main XProfile management screen
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param string $message Feedback message
+ * @param string $type    Feedback type
+ *
+ * @todo Improve error message output
+ */
+function xprofile_admin_screen( $message = '', $type = 'error' ) {
+
+	// Validate type
+	$type = preg_replace( '|[^a-z]|i', '', $type );
+
+	// Get all of the profile groups & fields
+	$groups = bp_xprofile_get_groups( array(
+		'fetch_fields' => true
+	) ); ?>
 
 	<div class="wrap">
 
@@ -72,8 +91,6 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 			<a id="add_group" class="add-new-h2" href="users.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>
 		</h2>
 
-		<p><?php echo sprintf( __( 'Fields in the "%s" group will appear on the signup page.', 'buddypress' ), esc_html( stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) ) ?></p>
-
 		<form action="" id="profile-field-form" method="post">
 
 			<?php
@@ -85,7 +102,7 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 				$type = ( $type == 'error' ) ? 'error' : 'updated'; ?>
 
 				<div id="message" class="<?php echo $type; ?> fade">
-					<p><?php echo esc_html( esc_attr( $message ) ); ?></p>
+					<p><?php echo esc_html( $message ); ?></p>
 				</div>
 
 			<?php endif; ?>
@@ -95,7 +112,16 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 
 					<?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : ?>
 
-						<li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress'); endif; ?></a></li>
+						<li id="group_<?php echo esc_attr( $group->id ); ?>">
+							<a href="#tabs-<?php echo esc_attr( $group->id ); ?>" class="ui-tab">
+								<?php echo esc_attr( $group->name ); ?>
+
+								<?php if ( !$group->can_delete ) : ?>
+									<?php _e( '(Primary)', 'buddypress'); ?>
+								<?php endif; ?>
+
+							</a>
+						</li>
 
 					<?php endforeach; endif; ?>
 
@@ -107,7 +133,7 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 						<h3><?php echo esc_attr( $group->name ); ?></h3>
 					</noscript>
 
-					<div id="tabs-<?php echo $group->id; ?>" class="tab-wrapper">
+					<div id="tabs-<?php echo esc_attr( $group->id ); ?>" class="tab-wrapper">
 						<div class="tab-toolbar">
 							<div class="tab-toolbar-left">
 								<a class="button-primary" href="users.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $group->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>
@@ -115,20 +141,37 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 
 								<?php if ( $group->can_delete ) : ?>
 
-									<a class="confirm submitdelete deletion ajax-option-delete" href="users.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>
+									<div class="delete-button">
+										<a class="confirm submitdelete deletion ajax-option-delete" href="users.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>
+									</div>
 
 								<?php endif; ?>
 
+								<?php
+
+								/**
+								 * Fires at end of action buttons in xprofile management admin.
+								 *
+								 * @since BuddyPress (2.2.0)
+								 *
+								 * @param BP_XProfile_Group $group BP_XProfile_Group object
+								 *                                 for the current group.
+								 */
+								do_action( 'xprofile_admin_group_action', $group ); ?>
+
 							</div>
 						</div>
 
-						<fieldset id="<?php echo $group->id; ?>" class="connectedSortable field-group">
+						<?php if ( ! empty( $group->description ) ) : ?>
 
-							<?php if ( $group->description ) : ?>
+							<p><?php echo esc_html( $group->description ); ?></p>
 
-								<legend><?php echo esc_attr( $group->description ) ?></legend>
+						<?php endif; ?>
+
+						<fieldset id="<?php echo esc_attr( $group->id ); ?>" class="connectedSortable field-group">
+							<legend class="screen-reader-text"><?php printf( esc_html__( 'Fields for "%s" Group', 'buddypress' ), $group->name ); ?></legend>
 
-							<?php endif;
+							<?php
 
 							if ( !empty( $group->fields ) ) :
 								foreach ( $group->fields as $field ) {
@@ -137,12 +180,14 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 									$field = new BP_XProfile_Field( $field->id );
 
 									$class = '';
-									if ( !$field->can_delete )
+									if ( empty( $field->can_delete ) ) {
 										$class = ' core nodrag';
+									}
 
-									/* This function handles the WYSIWYG profile field
-									* display for the xprofile admin setup screen
-									*/
+									/**
+									 * This function handles the WYSIWYG profile field
+									 * display for the xprofile admin setup screen
+									 */
 									xprofile_admin_field( $field, $group, $class );
 
 								} // end for
@@ -154,6 +199,13 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 							<?php endif; // end $group->fields ?>
 
 						</fieldset>
+
+						<?php if ( empty( $group->can_delete ) ) : ?>
+
+							<p><?php esc_html_e( '* Fields in this group appear on the signup page.', 'buddypress' ); ?></p>
+
+						<?php endif; ?>
+
 					</div>
 
 				<?php endforeach; else : ?>
@@ -163,13 +215,11 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 
 				<?php endif; ?>
 
-				<div id="tabs-bottom">&nbsp;</div>
 			</div>
 		</form>
 	</div>
 
 <?php
-	}
 }
 
 /**
@@ -178,23 +228,47 @@ function xprofile_admin( $message = '', $type = 'error' ) {
 function xprofile_admin_manage_group( $group_id = null ) {
 	global $message, $type;
 
+	// Get the field group
 	$group = new BP_XProfile_Group( $group_id );
 
+	// Updating
 	if ( isset( $_POST['save_group'] ) ) {
-		if ( BP_XProfile_Group::admin_validate( $_POST ) ) {
-			$group->name		= wp_filter_kses( $_POST['group_name'] );
-			$group->description	= !empty( $_POST['group_description'] ) ? wp_filter_kses( $_POST['group_description'] ) : '';
 
-			if ( !$group->save() ) {
-				$message = __( 'There was an error saving the group. Please try again', 'buddypress' );
+		// Validate $_POSTed data
+		if ( BP_XProfile_Group::admin_validate() ) {
+
+			// Set the group name
+			$group->name = $_POST['group_name'];
+
+			// Set the group description
+			if ( ! empty( $_POST['group_description'] ) ) {
+				$group->description = $_POST['group_description'];
+			} else {
+				$group->description = '';
+			}
+
+			// Attempt to save the field group
+			if ( false === $group->save() ) {
+				$message = __( 'There was an error saving the group. Please try again.', 'buddypress' );
 				$type    = 'error';
+
+			// Save successful
 			} else {
 				$message = __( 'The group was saved successfully.', 'buddypress' );
 				$type    = 'success';
 
-				if ( 1 == $group_id )
+				// @todo remove these old options
+				if ( 1 == $group_id ) {
 					bp_update_option( 'bp-xprofile-base-group-name', $group->name );
+				}
 
+				/**
+				 * Fires at the end of the group adding/saving process, if successful.
+				 *
+				 * @since BuddyPress (1.0.0)
+				 *
+				 * @param BP_XProfile_Group $group Current BP_XProfile_Group object.
+				 */
 				do_action( 'xprofile_groups_saved_group', $group );
 			}
 
@@ -218,12 +292,19 @@ function xprofile_admin_delete_group( $group_id ) {
 	$group = new BP_XProfile_Group( $group_id );
 
 	if ( !$group->delete() ) {
-		$message = __( 'There was an error deleting the group. Please try again', 'buddypress' );
+		$message = __( 'There was an error deleting the group. Please try again.', 'buddypress' );
 		$type    = 'error';
 	} else {
 		$message = __( 'The group was deleted successfully.', 'buddypress' );
 		$type    = 'success';
 
+		/**
+		 * Fires at the end of group deletion process, if successful.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_XProfile_Group $group Current BP_XProfile_Group object.
+		 */
 		do_action( 'xprofile_groups_deleted_group', $group );
 	}
 
@@ -235,61 +316,84 @@ function xprofile_admin_delete_group( $group_id ) {
  * Handles the adding or editing of profile field data for a user.
  */
 function xprofile_admin_manage_field( $group_id, $field_id = null ) {
-	global $bp, $wpdb, $message, $groups;
+	global $wpdb, $message, $groups;
+
+	$bp = buddypress();
 
 	$field           = new BP_XProfile_Field( $field_id );
 	$field->group_id = $group_id;
 
 	if ( isset( $_POST['saveField'] ) ) {
 		if ( BP_XProfile_Field::admin_validate() ) {
-			$field->name        = wp_filter_kses( $_POST['title'] );
-			$field->description = !empty( $_POST['description'] ) ? wp_filter_kses( $_POST['description'] ) : '';
-			$field->is_required = wp_filter_kses( $_POST['required'] );
-			$field->type        = wp_filter_kses( $_POST['fieldtype'] );
+			$field->is_required = $_POST['required'];
+			$field->type        = $_POST['fieldtype'];
+			$field->name        = $_POST['title'];
 
-			if ( !empty( $_POST["sort_order_{$field->type}"] ) )
-				$field->order_by = wp_filter_kses( $_POST["sort_order_{$field->type}"] );
+			if ( ! empty( $_POST['description'] ) ) {
+				$field->description = $_POST['description'];
+			} else {
+				$field->description = '';
+			}
 
-			$field->field_order = $wpdb->get_var( $wpdb->prepare( "SELECT field_order FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ) );
+			if ( ! empty( $_POST["sort_order_{$field->type}"] ) ) {
+				$field->order_by = $_POST["sort_order_{$field->type}"];
+			}
 
-			if ( !$field->field_order ) {
+			$field->field_order = $wpdb->get_var( $wpdb->prepare( "SELECT field_order FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ) );
+			if ( empty( $field->field_order ) || is_wp_error( $field->field_order ) ) {
 				$field->field_order = (int) $wpdb->get_var( $wpdb->prepare( "SELECT max(field_order) FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $group_id ) );
 				$field->field_order++;
 			}
 
-			// For new profile fields, set the $field_id. For existing profile fields,
-			// this will overwrite $field_id with the same value.
+			// For new profile fields, set the $field_id. For existing profile
+			// fields, this will overwrite $field_id with the same value.
 			$field_id = $field->save();
 
-			if ( !$field_id ) {
-				$message = __( 'There was an error saving the field. Please try again', 'buddypress' );
-				$type = 'error';
-
-				unset( $_GET['mode'] );
-
-				xprofile_admin( $message, $type );
+			if ( empty( $field_id ) ) {
+				$message = __( 'There was an error saving the field. Please try again.', 'buddypress' );
+				$type    = 'error';
 			} else {
 				$message = __( 'The field was saved successfully.', 'buddypress' );
-				$type = 'success';
+				$type    = 'success';
 
-				if ( 1 == $field_id )
+				// @todo remove these old options
+				if ( 1 == $field_id ) {
 					bp_update_option( 'bp-xprofile-fullname-field-name', $field->name );
+				}
 
-				if ( !empty( $_POST['default-visibility'] ) ) {
+				// Validate default visibility
+				if ( ! empty( $_POST['default-visibility'] ) && in_array( $_POST['default-visibility'], wp_list_pluck( bp_xprofile_get_visibility_levels(), 'id' ) ) ) {
 					bp_xprofile_update_field_meta( $field_id, 'default_visibility', $_POST['default-visibility'] );
 				}
 
-				if ( !empty( $_POST['allow-custom-visibility'] ) ) {
+				// Validate custom visibility
+				if ( ! empty( $_POST['allow-custom-visibility'] ) && in_array( $_POST['allow-custom-visibility'], array( 'allowed', 'disabled' ) ) ) {
 					bp_xprofile_update_field_meta( $field_id, 'allow_custom_visibility', $_POST['allow-custom-visibility'] );
 				}
 
-				unset( $_GET['mode'] );
+				// Validate signup
+				if ( ! empty( $_POST['signup-position'] ) ) {
+					bp_xprofile_update_field_meta( $field_id, 'signup_position', (int) $_POST['signup-position'] );
+				} else {
+					bp_xprofile_delete_meta( $field_id, 'field', 'signup_position' );
+				}
 
+				/**
+				 * Fires at the end of the process to save a field for a user, if successful.
+				 *
+				 * @since BuddyPress (1.0.0)
+				 *
+				 * @param BP_XProfile_Field $field Current BP_XProfile_Field object.
+				 */
 				do_action( 'xprofile_fields_saved_field', $field );
 
 				$groups = bp_xprofile_get_groups();
-				xprofile_admin( $message, $type );
 			}
+
+			unset( $_GET['mode'] );
+
+			xprofile_admin( $message, $type );
+
 		} else {
 			$field->render_admin_form( $message );
 		}
@@ -301,7 +405,7 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) {
 /**
  * Handles the deletion of a profile field (or field option)
  *
- * @since BuddyPress (1.0)
+ * @since BuddyPress (1.0.0)
  * @global string $message The feedback message to show
  * @global $type The type of feedback message to show
  * @param int $field_id The field to delete
@@ -317,12 +421,19 @@ function xprofile_admin_delete_field( $field_id, $field_type = 'field', $delete_
 	$field       = new BP_XProfile_Field( $field_id );
 
 	if ( !$field->delete( (bool) $delete_data ) ) {
-		$message = sprintf( __( 'There was an error deleting the %s. Please try again', 'buddypress' ), $field_type );
+		$message = sprintf( __( 'There was an error deleting the %s. Please try again.', 'buddypress' ), $field_type );
 		$type    = 'error';
 	} else {
 		$message = sprintf( __( 'The %s was deleted successfully!', 'buddypress' ), $field_type );
 		$type    = 'success';
 
+		/**
+		 * Fires at the end of the field deletion process, if successful.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_XProfile_Field $field Current BP_XProfile_Field object.
+		 */
 		do_action( 'xprofile_fields_deleted_field', $field );
 	}
 
@@ -338,8 +449,9 @@ function xprofile_ajax_reorder_fields() {
 	// Check the nonce
 	check_admin_referer( 'bp_reorder_fields', '_wpnonce_reorder_fields' );
 
-	if ( empty( $_POST['field_order'] ) )
+	if ( empty( $_POST['field_order'] ) ) {
 		return false;
+	}
 
 	parse_str( $_POST['field_order'], $order );
 
@@ -359,8 +471,9 @@ function xprofile_ajax_reorder_field_groups() {
 	// Check the nonce
 	check_admin_referer( 'bp_reorder_groups', '_wpnonce_reorder_groups' );
 
-	if ( empty( $_POST['group_order'] ) )
+	if ( empty( $_POST['group_order'] ) ) {
 		return false;
+	}
 
 	parse_str( $_POST['group_order'], $order );
 
@@ -379,15 +492,44 @@ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) {
 	$field = $admin_field; ?>
 
 	<fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>">
-		<legend><span><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(Required)', 'buddypress' ) ?><?php endif; ?></span></legend>
+		<legend>
+			<span>
+				<?php bp_the_profile_field_name(); ?>
+
+				<?php if ( empty( $field->can_delete )                                    ) : ?><?php esc_html_e( '(Primary)',  'buddypress' ); endif; ?>
+				<?php if ( bp_get_the_profile_field_is_required()                         ) : ?><?php esc_html_e( '(Required)', 'buddypress' ); endif; ?>
+				<?php if ( bp_xprofile_get_meta( $field->id, 'field', 'signup_position' ) ) : ?><?php esc_html_e( '(Sign-up)',  'buddypress' ); endif; ?>
+
+				<?php
+
+				/**
+				 * Fires at end of legend above the name field in base xprofile group.
+				 *
+				 * @since BuddyPress (2.2.0)
+				 *
+				 * @param BP_XProfile_Field $field Current BP_XProfile_Field
+				 *                                 object being rendered.
+				 */
+				do_action( 'xprofile_admin_field_name_legend', $field ); ?>
+			</span>
+		</legend>
 		<div class="field-wrapper">
 
 			<?php
 			if ( in_array( $field->type, array_keys( bp_xprofile_get_field_types() ) ) ) {
 				$field_type = bp_xprofile_create_field_type( $field->type );
 				$field_type->admin_field_html();
-
 			} else {
+
+				/**
+				 * Fires after the input if the current field is not in default field types.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param BP_XProfile_Field $field Current BP_XProfile_Field
+				 *                                 object being rendered.
+				 * @param int               $value Integer 1.
+				 */
 				do_action( 'xprofile_admin_field', $field, 1 );
 			}
 			?>
@@ -408,6 +550,19 @@ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) {
 					</div>
 
 				<?php endif; ?>
+
+				<?php
+
+				/**
+				 * Fires at end of field management links in xprofile management admin.
+				 *
+				 * @since BuddyPress (2.2.0)
+				 *
+				 * @param BP_XProfile_Group $group BP_XProfile_Group object
+				 *                                 for the current group.
+				 */
+				do_action( 'xprofile_admin_field_action', $field ); ?>
+
 			</div>
 		</div>
 	</fieldset>
@@ -518,6 +673,8 @@ class BP_XProfile_User_Admin {
 	 * @since BuddyPress (2.0.0)
 	 */
 	private function setup_actions() {
+		// Enqueue scripts
+		add_action( 'bp_members_admin_enqueue_scripts',  array( $this, 'enqueue_scripts'    ), 10, 1 );
 
 		// Register the metabox in Member's community admin profile
 		add_action( 'bp_members_admin_xprofile_metabox', array( $this, 'register_metaboxes' ), 10, 3 );
@@ -526,6 +683,36 @@ class BP_XProfile_User_Admin {
 		add_action( 'bp_members_admin_update_user',      array( $this, 'user_admin_load'    ), 10, 4 );
 	}
 
+	/**
+	 * Enqueue needed scripts.
+	 *
+	 * @access public
+	 * @since BuddyPress (2.3.0)
+	 */
+	public function enqueue_scripts( $screen_id ) {
+		if ( ( false === strpos( $screen_id, 'users_page_bp-profile-edit' ) 
+			&& false === strpos( $screen_id, 'profile_page_bp-profile-edit' ) ) 
+			|| bp_core_get_root_option( 'bp-disable-avatar-uploads' ) 
+			|| ! buddypress()->avatar->show_avatars
+			|| ! bp_attachments_is_wp_version_supported() ) {
+			return;
+		}
+
+		/**
+		 * Get Thickbox
+		 *
+		 * We cannot simply use add_thickbox() here as WordPress is not playing
+		 * nice with Thickbox width/height see https://core.trac.wordpress.org/ticket/17249
+		 * Using media-upload might be interesting in the future for the send to editor stuff
+		 * and we make sure the tb_window is wide enougth
+		 */
+		wp_enqueue_style ( 'thickbox' );
+		wp_enqueue_script( 'media-upload' );
+
+		// Get Avatar Uploader
+		bp_attachments_enqueue_scripts( 'BP_Attachment_Avatar' );
+	}
+
 	/**
 	 * Register the xProfile metabox on Community Profile admin page.
 	 *
@@ -585,15 +772,17 @@ class BP_XProfile_User_Admin {
 			);
 		}
 
-		// Avatar Metabox
-		add_meta_box(
-			'bp_xprofile_user_admin_avatar',
-			_x( 'Profile Photo', 'xprofile user-admin edit screen', 'buddypress' ),
-			array( $this, 'user_admin_avatar_metabox' ),
-			$screen_id,
-			'side',
-			'low'
-		);
+		if ( buddypress()->avatar->show_avatars ) {
+			// Avatar Metabox
+			add_meta_box(
+				'bp_xprofile_user_admin_avatar',
+				_x( 'Profile Photo', 'xprofile user-admin edit screen', 'buddypress' ),
+				array( $this, 'user_admin_avatar_metabox' ),
+				$screen_id,
+				'side',
+				'low'
+			);
+		}
 	}
 
 	/**
@@ -676,12 +865,23 @@ class BP_XProfile_User_Admin {
 			// Now we've checked for required fields, let's save the values.
 			foreach ( (array) $posted_field_ids as $field_id ) {
 
-				// Certain types of fields (checkboxes, multiselects) may come through empty. Save them as an empty array so that they don't get overwritten by the default on the next edit.
+				// Certain types of fields (checkboxes, multiselects) may come
+				// through empty. Save them as an empty array so that they don't
+				// get overwritten by the default on the next edit.
 				$value = isset( $_POST['field_' . $field_id] ) ? $_POST['field_' . $field_id] : '';
 
 				if ( ! xprofile_set_field_data( $field_id, $user_id, $value, $is_required[ $field_id ] ) ) {
 					$errors = true;
 				} else {
+
+					/**
+					 * Fires after the saving of each profile field, if successful.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 *
+					 * @param int    $field_id ID of the field being updated.
+					 * @param string $value    Value that was saved to the field.
+					 */
 					do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
 				}
 
@@ -690,6 +890,15 @@ class BP_XProfile_User_Admin {
 				xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
 			}
 
+			/**
+			 * Fires after all of the profile fields have been saved.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int   $user_id          ID of the user whose data is being saved.
+			 * @param array $posted_field_ids IDs of the fields that were submitted.
+			 * @param bool  $errors           Whether or not errors occurred during saving.
+			 */
 			do_action( 'xprofile_updated_profile', $user_id, $posted_field_ids, $errors );
 
 			// Set the feedback messages
@@ -759,6 +968,11 @@ class BP_XProfile_User_Admin {
 
 					<?php endif;
 
+					/**
+					 * Fires before display of visibility form elements for profile metaboxes.
+					 *
+					 * @since BuddyPress (1.7.0)
+					 */
 					do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
 
 					$can_change_visibility = bp_current_user_can( 'bp_xprofile_change_field_visibility' ); ?>
@@ -788,7 +1002,14 @@ class BP_XProfile_User_Admin {
 
 					<?php endif; ?>
 
-					<?php do_action( 'bp_custom_profile_edit_fields' ); ?>
+					<?php
+
+					/**
+					 * Fires at end of custom profile field items on your xprofile screen tab.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 */
+					do_action( 'bp_custom_profile_edit_fields' ); ?>
 
 				</div>
 
@@ -850,6 +1071,14 @@ class BP_XProfile_User_Admin {
 
 				<a href="<?php echo esc_url( $delete_link ); ?>" title="<?php esc_attr_e( 'Delete Profile Photo', 'buddypress' ); ?>" class="bp-xprofile-avatar-user-admin"><?php esc_html_e( 'Delete Profile Photo', 'buddypress' ); ?></a></li>
 
+			<?php endif;
+
+			// Load the Avatar UI templates if user avatar uploads are enabled and current WordPress version is supported
+			if ( ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ) && bp_attachments_is_wp_version_supported() ) : ?>
+				<a href="#TB_inline?width=800px&height=400px&inlineId=bp-xprofile-avatar-editor" title="<?php esc_attr_e( 'Edit Profile Photo', 'buddypress' );?>" class="thickbox bp-xprofile-avatar-user-edit"><?php esc_html_e( 'Edit Profile Photo', 'buddypress' ); ?></a>
+				<div id="bp-xprofile-avatar-editor" style="display:none;">
+					<?php bp_attachments_get_template_part( 'avatars/index' ); ?>
+				</div>
 			<?php endif; ?>
 
 		</div>
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
index 0ad410363b3d86f3c1e23f519709875e29c9d35f..07e0ec1eee086b054eb648209546726b2a8c9059 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php
@@ -10,7 +10,30 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Determine which xprofile fields do not have cached values for a user.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param int   $user_id   User ID to check
+ * @param array $field_ids XProfile field IDs.
+ * @return array
+ */
+function bp_xprofile_get_non_cached_field_ids( $user_id = 0, $field_ids = array() ) {
+	$uncached_fields = array();
+
+	foreach ( $field_ids as $field_id ) {
+		$field_id  = (int) $field_id;
+		$cache_key = "{$user_id}:{$field_id}";
+		if ( false === wp_cache_get( $cache_key, 'bp_xprofile_data' ) ) {
+			$uncached_fields[] = $field_id;
+		}
+	}
+
+	return $uncached_fields;
+}
 
 /**
  * Slurp up xprofilemeta for a specified set of profile objects.
@@ -29,108 +52,152 @@ if ( !defined( 'ABSPATH' ) ) exit;
  * @param array $object_ids Multi-dimensional array of object_ids, keyed by
  *        object type ('group', 'field', 'data')
  */
-function bp_xprofile_update_meta_cache( $object_ids = array(), $user_id = 0 ) {
+function bp_xprofile_update_meta_cache( $object_ids = array() ) {
 	global $wpdb;
 
+	// Bail if no objects
 	if ( empty( $object_ids ) ) {
 		return false;
 	}
 
-	// $object_ids is a multi-dimensional array
+	$bp = buddypress();
+
+	// Define the array where uncached object IDs will be stored
 	$uncached_object_ids = array(
-		'group' => array(),
-		'field' => array(),
-		'data'   => array(),
+		'group',
+		'field',
+		'data'
 	);
 
+	// Define the cache groups for the 3 types of XProfile metadata
 	$cache_groups = array(
 		'group' => 'xprofile_group_meta',
 		'field' => 'xprofile_field_meta',
 		'data'  => 'xprofile_data_meta',
 	);
 
+	// No reason to query yet
 	$do_query = false;
-	foreach ( $uncached_object_ids as $object_type => $uncached_object_type_ids ) {
-		if ( ! empty( $object_ids[ $object_type ] ) ) {
-			// Sanitize $object_ids passed to the function
-			$object_type_ids = wp_parse_id_list( $object_ids[ $object_type ] );
-
-			// Get non-cached IDs for each object type
-			$uncached_object_ids[ $object_type ] = bp_get_non_cached_ids( $object_type_ids, $cache_groups[ $object_type ] );
-
-			// Set the flag to do the meta query
-			if ( ! empty( $uncached_object_ids[ $object_type ] ) && ! $do_query ) {
-				$do_query = true;
-			}
+
+	// Loop through object types and look for uncached data
+	foreach ( $uncached_object_ids as $object_type ) {
+
+		// Skip if empty object type
+		if ( empty( $object_ids[ $object_type ] ) ) {
+			continue;
 		}
+
+		// Sanitize $object_ids passed to the function
+		$object_type_ids = wp_parse_id_list( $object_ids[ $object_type ] );
+
+		// Get non-cached IDs for each object type
+		$uncached_object_ids[ $object_type ] = bp_get_non_cached_ids( $object_type_ids, $cache_groups[ $object_type ] );
+
+		// Set the flag to do the meta query
+		if ( ! empty( $uncached_object_ids[ $object_type ] ) && ( false === $do_query ) ) {
+			$do_query = true;
+		}
+	}
+
+	// Bail if no uncached items
+	if ( false === $do_query ) {
+		return;
 	}
 
-	// If there are uncached items, go ahead with the query
-	if ( $do_query ) {
-		$where = array();
-		foreach ( $uncached_object_ids as $otype => $oids ) {
-			if ( empty( $oids ) ) {
-				continue;
-			}
+	// Setup where conditions for query
+	$where_sql        = '';
+	$where_conditions = array();
 
-			$oids_sql = implode( ',', wp_parse_id_list( $oids ) );
-			$where[]  = $wpdb->prepare( "( object_type = %s AND object_id IN ({$oids_sql}) )", $otype );
+	// Loop through uncached objects and prepare to query for them
+	foreach ( $uncached_object_ids as $otype => $oids ) {
+
+		// Skip empty object IDs
+		if ( empty( $oids ) ) {
+			continue;
 		}
-		$where_sql = implode( " OR ", $where );
+
+		// Compile WHERE query conditions for uncached metadata
+		$oids_sql           = implode( ',', wp_parse_id_list( $oids ) );
+		$where_conditions[] = $wpdb->prepare( "( object_type = %s AND object_id IN ({$oids_sql}) )", $otype );
 	}
 
+	// Bail if no where conditions
+	if ( empty( $where_conditions ) ) {
+		return;
+	}
 
-	$bp = buddypress();
+	// Setup the WHERE query part
+	$where_sql = implode( " OR ", $where_conditions );
+
+	// Attempt to query meta values
 	$meta_list = $wpdb->get_results( "SELECT object_id, object_type, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE {$where_sql}" );
 
-	if ( ! empty( $meta_list ) ) {
-		$object_type_caches = array(
-			'group' => array(),
-			'field' => array(),
-			'data'  => array(),
-		);
-
-		foreach ( $meta_list as $meta ) {
-			$oid    = $meta->object_id;
-			$otype  = $meta->object_type;
-			$okey   = $meta->meta_key;
-			$ovalue = $meta->meta_value;
-
-			// Force subkeys to be array type
-			if ( ! isset( $cache[ $otype ][ $oid ] ) || ! is_array( $cache[ $otype ][ $oid ] ) ) {
-				$cache[ $otype ][ $oid ] = array();
-			}
-
-			if ( ! isset( $cache[ $otype ][ $oid ][ $okey ] ) || ! is_array( $cache[ $otype ][ $oid ][ $okey ] ) ) {
-				$cache[ $otype ][ $oid ][ $okey ] = array();
-			}
-
-			// Add to the cache array
-			$cache[ $otype ][ $oid ][ $okey ][] = maybe_unserialize( $ovalue );
+	// Bail if no results found
+	if ( empty( $meta_list ) || is_wp_error( $meta_list ) ) {
+		return;
+	}
+
+	// Setup empty cache array
+	$cache = array();
+
+	// Loop through metas
+	foreach ( $meta_list as $meta ) {
+		$oid    = $meta->object_id;
+		$otype  = $meta->object_type;
+		$okey   = $meta->meta_key;
+		$ovalue = $meta->meta_value;
+
+		// Force subkeys to be array type
+		if ( ! isset( $cache[ $otype ][ $oid ] ) || ! is_array( $cache[ $otype ][ $oid ] ) ) {
+			$cache[ $otype ][ $oid ] = array();
 		}
 
-		foreach ( $cache as $object_type => $object_caches ) {
-			$cache_group = $cache_groups[ $object_type ];
-			foreach ( $object_caches as $object_id => $object_cache ) {
-				wp_cache_set( $object_id, $object_cache, $cache_group );
-			}
+		if ( ! isset( $cache[ $otype ][ $oid ][ $okey ] ) || ! is_array( $cache[ $otype ][ $oid ][ $okey ] ) ) {
+			$cache[ $otype ][ $oid ][ $okey ] = array();
 		}
+
+		// Add to the cache array
+		$cache[ $otype ][ $oid ][ $okey ][] = maybe_unserialize( $ovalue );
 	}
 
-	return;
+	// Loop through data and cache to the appropriate object
+	foreach ( $cache as $object_type => $object_caches ) {
+
+		// Determine the cache group for this data
+		$cache_group = $cache_groups[ $object_type ];
+
+		// Loop through objects and cache appropriately
+		foreach ( $object_caches as $object_id => $object_cache ) {
+			wp_cache_set( $object_id, $object_cache, $cache_group );
+		}
+	}
 }
 
+/**
+ * Clear cached XProfile field group data
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @param object $group_obj
+ */
 function xprofile_clear_profile_groups_object_cache( $group_obj ) {
-	wp_cache_delete( 'xprofile_groups_inc_empty',        'bp' );
-	wp_cache_delete( 'xprofile_group_' . $group_obj->id, 'bp' );
+	wp_cache_delete( 'all',          'bp_xprofile_groups' );
+	wp_cache_delete( $group_obj->id, 'bp_xprofile_groups' );
 }
 add_action( 'xprofile_group_after_delete', 'xprofile_clear_profile_groups_object_cache' );
 add_action( 'xprofile_group_after_save',   'xprofile_clear_profile_groups_object_cache' );
 
-function xprofile_clear_profile_data_object_cache( $group_id ) {
-	wp_cache_delete( 'bp_user_fullname_' . bp_loggedin_user_id(), 'bp' );
+/**
+ * Clear cached XProfile fullname data for user
+ *
+ * @since BuddyPress (2.1.0)
+ *
+ * @param int $user_id ID of user whose fullname cache to delete
+ */
+function xprofile_clear_profile_data_object_cache( $user_id = 0 ) {
+	wp_cache_delete( 'bp_user_fullname_' . $user_id, 'bp' );
 }
-add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object_cache'   );
+add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object_cache' );
 
 /**
  * Clear the fullname cache when field 1 is updated.
@@ -155,16 +222,17 @@ add_action( 'xprofile_data_after_save', 'xprofile_clear_fullname_cache_on_profil
  * @param BP_XProfile_Field
  */
 function xprofile_clear_profile_field_object_cache( $field_obj ) {
+
 	// Clear default visibility level cache
-	wp_cache_delete( 'xprofile_default_visibility_levels', 'bp' );
+	wp_cache_delete( 'default_visibility_levels', 'bp_xprofile' );
 
 	// Modified fields can alter parent group status, in particular when
 	// the group goes from empty to non-empty. Bust its cache, as well as
-	// the global group_inc_empty cache
-	wp_cache_delete( 'xprofile_group_' . $field_obj->group_id, 'bp' );
-	wp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
+	// the global 'all' cache
+	wp_cache_delete( 'all',                'bp_xprofile_groups' );
+	wp_cache_delete( $field_obj->group_id, 'bp_xprofile_groups' );
 }
-add_action( 'xprofile_fields_saved_field', 'xprofile_clear_profile_field_object_cache' );
+add_action( 'xprofile_fields_saved_field',   'xprofile_clear_profile_field_object_cache' );
 add_action( 'xprofile_fields_deleted_field', 'xprofile_clear_profile_field_object_cache' );
 
 /**
@@ -175,9 +243,9 @@ add_action( 'xprofile_fields_deleted_field', 'xprofile_clear_profile_field_objec
  * @param BP_XProfile_ProfileData $data_obj
  */
 function xprofile_clear_profiledata_object_cache( $data_obj ) {
-	wp_cache_delete( $data_obj->field_id, 'bp_xprofile_data_' . $data_obj->user_id );
+	wp_cache_delete( "{$data_obj->user_id}:{$data_obj->field_id}", 'bp_xprofile_data' );
 }
-add_action( 'xprofile_data_after_save', 'xprofile_clear_profiledata_object_cache' );
+add_action( 'xprofile_data_after_save',   'xprofile_clear_profiledata_object_cache' );
 add_action( 'xprofile_data_after_delete', 'xprofile_clear_profiledata_object_cache' );
 
 /**
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php
index eebb3f762f488f6e5c6be1b7055c99647f54e381..24014f397822ddcc140e75ccf5a0193b73f5ac00 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php
@@ -4,16 +4,16 @@
  * Roles and capabilities logic for the XProfile component
  *
  * @package BuddyPress
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  */
 
 // Exit if accessed directly
-if ( ! defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Maps XProfile caps to built in WordPress caps
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  *
  * @param array $caps Capabilities for meta capability
  * @param string $cap Capability name
@@ -55,6 +55,16 @@ function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) {
 			break;
 	}
 
+	/**
+	 * Filters the XProfile caps to built in WordPress caps.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array  $caps    Capabilities for meta capability.
+	 * @param string $cap     Capability name.
+	 * @param int    $user_id User ID being mapped.
+	 * @param mixed  $args    Capability arguments.
+	 */
 	return apply_filters( 'bp_xprofile_map_meta_caps', $caps, $cap, $user_id, $args );
 }
 add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 );
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
index 9a29173e71541cfc2378486c8d383286d8100aba..6f8d8e9fd809296573f29dd00a8dbae450ea526a 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * BuddyPress XProfile Classes
  *
@@ -8,3251 +7,21 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
-
-class BP_XProfile_Group {
-	public $id = null;
-	public $name;
-	public $description;
-	public $can_delete;
-	public $group_order;
-	public $fields;
-
-	public function __construct( $id = null ) {
-		if ( !empty( $id ) )
-			$this->populate( $id );
-	}
-
-	public function populate( $id ) {
-		global $wpdb, $bp;
-
-		$group = wp_cache_get( 'xprofile_group_' . $this->id, 'bp' );
-
-		if ( false === $group ) {
-			$group = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_groups} WHERE id = %d", $id ) );
-		}
-
-		if ( empty( $group ) ) {
-			return false;
-		}
-
-		$this->id          = $group->id;
-		$this->name        = stripslashes( $group->name );
-		$this->description = stripslashes( $group->description );
-		$this->can_delete  = $group->can_delete;
-		$this->group_order = $group->group_order;
-	}
-
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->name        = apply_filters( 'xprofile_group_name_before_save',        $this->name,        $this->id );
-		$this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id );
-
-		do_action_ref_array( 'xprofile_group_before_save', array( &$this ) );
-
-		if ( $this->id )
-			$sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id );
-		else
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description );
-
-		if ( is_wp_error( $wpdb->query( $sql ) ) )
-			return false;
-
-		// If not set, update the ID in the group object
-		if ( ! $this->id )
-			$this->id = $wpdb->insert_id;
-
-		do_action_ref_array( 'xprofile_group_after_save', array( &$this ) );
-
-		return $this->id;
-	}
-
-	public function delete() {
-		global $wpdb, $bp;
-
-		if ( empty( $this->can_delete ) )
-			return false;
-
-		do_action_ref_array( 'xprofile_group_before_delete', array( &$this ) );
-
-		// Delete field group
-		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id ) ) ) {
-			return false;
-		} else {
-
-			// Remove the group's fields.
-			if ( BP_XProfile_Field::delete_for_group( $this->id ) ) {
-
-				// Remove profile data for the groups fields
-				for ( $i = 0, $count = count( $this->fields ); $i < $count; ++$i ) {
-					BP_XProfile_ProfileData::delete_for_field( $this->fields[$i]->id );
-				}
-			}
-
-			do_action_ref_array( 'xprofile_group_after_delete', array( &$this ) );
-
-			return true;
-		}
-	}
-
-	/** Static Methods ********************************************************/
-
-	/**
-	 * get()
-	 *
-	 * Populates the BP_XProfile_Group object with profile field groups, fields, and field data
-	 *
-	 * @package BuddyPress XProfile
-	 *
-	 * @global $wpdb WordPress DB access object.
-	 * @global BuddyPress $bp The one true BuddyPress instance
-	 *
-	 * @param array $args {
-	 *	Array of optional arguments:
-	 *	@type int $profile_group_id Limit results to a single profile
-	 *	      group.
-	 *      @type int $user_id Required if you want to load a specific
-	 *            user's data. Default: displayed user's ID.
-	 *      @type bool $hide_empty_groups True to hide groups that don't
-	 *            have any fields. Default: false.
-	 *	@type bool $hide_empty_fields True to hide fields where the
-	 *	      user has not provided data. Default: false.
-	 *      @type bool $fetch_fields Whether to fetch each group's fields.
-	 *            Default: false.
-	 *      @type bool $fetch_field_data Whether to fetch data for each
-	 *            field. Requires a $user_id. Default: false.
-	 *      @type array $exclude_groups Comma-separated list or array of
-	 *            group IDs to exclude.
-	 *      @type array $exclude_fields Comma-separated list or array of
-	 *            field IDs to exclude.
-	 *      @type bool $update_meta_cache Whether to pre-fetch xprofilemeta
-	 *            for all retrieved groups, fields, and data. Default: true.
-	 * }
-	 * @return array $groups
-	 */
-	public static function get( $args = array() ) {
-		global $wpdb, $bp;
-
-		$defaults = array(
-			'profile_group_id'       => false,
-			'user_id'                => bp_displayed_user_id(),
-			'hide_empty_groups'      => false,
-			'hide_empty_fields'      => false,
-			'fetch_fields'           => false,
-			'fetch_field_data'       => false,
-			'fetch_visibility_level' => false,
-			'exclude_groups'         => false,
-			'exclude_fields'         => false,
-			'update_meta_cache'      => true,
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
-
-		// Keep track of object IDs for cache-priming
-		$object_ids = array(
-			'group' => array(),
-			'field' => array(),
-			'data'  => array(),
-		);
-
-		$where_sql = '';
-
-		if ( ! empty( $profile_group_id ) ) {
-			$where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
-		} else if ( $exclude_groups ) {
-			$exclude_groups = join( ',', wp_parse_id_list( $exclude_groups ) );
-			$where_sql = "WHERE g.id NOT IN ({$exclude_groups})";
-		}
-
-		if ( ! empty( $hide_empty_groups ) ) {
-			$group_ids = $wpdb->get_col( "SELECT DISTINCT g.id FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" );
-		} else {
-			$group_ids = $wpdb->get_col( "SELECT DISTINCT g.id FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" );
-		}
-
-		$groups = self::get_group_data( $group_ids );
-
-		if ( empty( $fetch_fields ) )
-			return $groups;
-
-		// Get the group ids
-		$group_ids = array();
-		foreach( (array) $groups as $group ) {
-			$group_ids[] = $group->id;
-		}
-
-		// Store for meta cache priming
-		$object_ids['group'] = $group_ids;
-
-		$group_ids = implode( ',', (array) $group_ids );
-
-		if ( empty( $group_ids ) )
-			return $groups;
-
-		// Support arrays and comma-separated strings
-		$exclude_fields_cs = wp_parse_id_list( $exclude_fields );
-
-		// Visibility - Handled here so as not to be overridden by sloppy use of the
-		// exclude_fields parameter. See bp_xprofile_get_hidden_fields_for_user()
-		$exclude_fields_cs = array_merge( $exclude_fields_cs, bp_xprofile_get_hidden_fields_for_user( $user_id ) );
-		$exclude_fields_cs = implode( ',', $exclude_fields_cs );
-
-		if ( !empty( $exclude_fields_cs ) ) {
-			$exclude_fields_sql = "AND id NOT IN ({$exclude_fields_cs})";
-		} else {
-			$exclude_fields_sql = '';
-		}
-
-		// Fetch the fields
-		$fields = $wpdb->get_results( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" );
-
-		// Store field IDs for meta cache priming
-		$object_ids['field'] = wp_list_pluck( $fields, 'id' );
-
-		if ( empty( $fields ) )
-			return $groups;
-
-		// Maybe fetch field data
-		if ( ! empty( $fetch_field_data ) ) {
-
-			// Fetch the field data for the user.
-			foreach( (array) $fields as $field ) {
-				$field_ids[] = $field->id;
-			}
-
-			$field_ids_sql = implode( ',', (array) $field_ids );
-
-			if ( ! empty( $field_ids ) && ! empty( $user_id ) ) {
-				$field_data = BP_XProfile_ProfileData::get_data_for_user( $user_id, $field_ids );
-			}
-
-			// Remove data-less fields, if necessary
-			if ( !empty( $hide_empty_fields ) && ! empty( $field_ids ) && ! empty( $field_data ) ) {
-
-				// Loop through the results and find the fields that have data.
-				foreach( (array) $field_data as $data ) {
-
-					// Empty fields may contain a serialized empty array
-					$maybe_value = maybe_unserialize( $data->value );
-
-					// Valid field values of 0 or '0' get caught by empty(), so we have an extra check for these. See #BP5731
-					if ( ( ! empty( $maybe_value ) || '0' == $maybe_value ) && false !== $key = array_search( $data->field_id, $field_ids ) ) {
-
-						// Fields that have data get removed from the list
-						unset( $field_ids[$key] );
-					}
-				}
-
-				// The remaining members of $field_ids are empty. Remove them.
-				foreach( $fields as $field_key => $field ) {
-					if ( in_array( $field->id, $field_ids ) ) {
-						unset( $fields[$field_key] );
-					}
-				}
-
-				// Reset indexes
-				$fields = array_values( $fields );
-			}
-
-			// Field data was found
-			if ( ! empty( $fields ) && !empty( $field_data ) && !is_wp_error( $field_data ) ) {
-
-				// Loop through fields
-				foreach( (array) $fields as $field_key => $field ) {
-
-					// Loop throught the data in each field
-					foreach( (array) $field_data as $data ) {
-
-						// Assign correct data value to the field
-						if ( $field->id == $data->field_id ) {
-							$fields[$field_key]->data        = new stdClass;
-							$fields[$field_key]->data->value = $data->value;
-							$fields[$field_key]->data->id    = $data->id;
-						}
-
-						// Store for meta cache priming
-						$object_ids['data'][] = $data->id;
-					}
-				}
-			}
-		}
-
-		// Prime the meta cache, if necessary
-		if ( $update_meta_cache ) {
-			bp_xprofile_update_meta_cache( $object_ids );
-		}
-
-		// Maybe fetch visibility levels
-		if ( !empty( $fetch_visibility_level ) ) {
-			$fields = self::fetch_visibility_level( $user_id, $fields );
-		}
-
-		// Merge the field array back in with the group array
-		foreach( (array) $groups as $group ) {
-
-			// Indexes may have been shifted after previous deletions, so we get a
-			// fresh one each time through the loop
-			$index = array_search( $group, $groups );
-
-			foreach( (array) $fields as $field ) {
-				if ( $group->id == $field->group_id ) {
-					$groups[$index]->fields[] = $field;
-				}
-			}
-
-			// When we unset fields above, we may have created empty groups.
-			// Remove them, if necessary.
-			if ( empty( $group->fields ) && $hide_empty_groups ) {
-				unset( $groups[$index] );
-			}
-
-			// Reset indexes
-			$groups = array_values( $groups );
-		}
-
-		return $groups;
-	}
-
-	/**
-	 * Get data about a set of groups, based on IDs.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 *
-	 * @param array $group_ids Array of IDs.
-	 * @return array
-	 */
-	protected static function get_group_data( $group_ids ) {
-		global $wpdb;
-
-		// Bail if no group IDs are passed
-		if ( empty( $group_ids ) ) {
-			return array();
-		}
-
-		$groups        = array();
-		$uncached_gids = array();
-
-		foreach ( $group_ids as $group_id ) {
-
-			// If cached data is found, use it
-			if ( $group_data = wp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
-				$groups[ $group_id ] = $group_data;
-
-			// Otherwise leave a placeholder so we don't lose the order
-			} else {
-				$groups[ $group_id ] = '';
-
-				// Add to the list of items to be queried
-				$uncached_gids[] = $group_id;
-			}
-		}
-
-		// Fetch uncached data from the DB if necessary
-		if ( ! empty( $uncached_gids ) ) {
-			$uncached_gids_sql = implode( ',', wp_parse_id_list( $uncached_gids ) );
-
-			$bp = buddypress();
-
-			// Fetch data, preserving order
-			$queried_gdata = $wpdb->get_results( "SELECT * FROM {$bp->profile->table_name_groups} WHERE id IN ({$uncached_gids_sql}) ORDER BY FIELD( id, {$uncached_gids_sql} )");
-
-			// Put queried data into the placeholders created earlier,
-			// and add it to the cache
-			foreach ( (array) $queried_gdata as $gdata ) {
-				$groups[ $gdata->id ] = $gdata;
-				wp_cache_set( 'xprofile_group_' . $gdata->id, $gdata, 'bp' );
-			}
-		}
-
-		// Reset indexes
-		$groups = array_values( $groups );
-
-		return $groups;
-	}
-
-	public static function admin_validate() {
-		global $message;
-
-		/* Validate Form */
-		if ( empty( $_POST['group_name'] ) ) {
-			$message = __( 'Please make sure you give the group a name.', 'buddypress' );
-			return false;
-		} else {
-			return true;
-		}
-	}
-
-	public static function update_position( $field_group_id, $position ) {
-		global $wpdb, $bp;
-
-		if ( !is_numeric( $position ) ) {
-			return false;
-		}
-
-		// purge profile field group cache
-		wp_cache_delete( 'xprofile_groups_inc_empty', 'bp' );
-
-		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
-	}
-
-	/**
-	 * Fetch the field visibility level for the fields returned by the query
-	 *
-	 * @since BuddyPress (1.6)
-	 *
-	 * @param int $user_id The profile owner's user_id
-	 * @param array $fields The database results returned by the get() query
-	 * @return array $fields The database results, with field_visibility added
-	 */
-	public static function fetch_visibility_level( $user_id = 0, $fields = array() ) {
-
-		// Get the user's visibility level preferences
-		$visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
-
-		foreach( (array) $fields as $key => $field ) {
-
-			// Does the admin allow this field to be customized?
-			$allow_custom = 'disabled' !== bp_xprofile_get_meta( $field->id, 'field', 'allow_custom_visibility' );
-
-			// Look to see if the user has set the visibility for this field
-			if ( $allow_custom && isset( $visibility_levels[$field->id] ) ) {
-				$field_visibility = $visibility_levels[$field->id];
-
-			// If no admin-set default is saved, fall back on a global default
-			} else {
-				$fallback_visibility = bp_xprofile_get_meta( $field->id, 'field', 'default_visibility' );
-				$field_visibility = ! empty( $fallback_visibility ) ? $fallback_visibility : apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
-			}
-
-			$fields[$key]->visibility_level = $field_visibility;
-		}
-
-		return $fields;
-	}
-
-	/**
-	 * Fetch the admin-set preferences for all fields.
-	 *
-	 * @since BuddyPress (1.6.0)
-	 *
-	 * @return array $default_visibility_levels An array, keyed by
-	 *         field_id, of default visibility level + allow_custom
-	 *         (whether the admin allows this field to be set by user)
-	 */
-	public static function fetch_default_visibility_levels() {
-		global $wpdb, $bp;
-
-		$default_visibility_levels = wp_cache_get( 'xprofile_default_visibility_levels', 'bp' );
-
-		if ( false === $default_visibility_levels ) {
-			$levels = $wpdb->get_results( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" );
-
-			// Arrange so that the field id is the key and the visibility level the value
-			$default_visibility_levels = array();
-			foreach ( $levels as $level ) {
-				if ( 'default_visibility' == $level->meta_key ) {
-					$default_visibility_levels[ $level->object_id ]['default'] = $level->meta_value;
-				} else if ( 'allow_custom_visibility' == $level->meta_key ) {
-					$default_visibility_levels[ $level->object_id ]['allow_custom'] = $level->meta_value;
-				}
-			}
-
-			wp_cache_set( 'xprofile_default_visibility_levels', $default_visibility_levels, 'bp' );
-		}
-
-		return $default_visibility_levels;
-	}
-
-	public function render_admin_form() {
-		global $message;
-
-		if ( empty( $this->id ) ) {
-			$title	= __( 'Add New Field Group', 'buddypress' );
-			$action	= "users.php?page=bp-profile-setup&amp;mode=add_group";
-			$button	= __( 'Create Field Group', 'buddypress' );
-		} else {
-			$title  = __( 'Edit Field Group', 'buddypress' );
-			$action = "users.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=" . $this->id;
-			$button	= __( 'Save Changes', 'buddypress' );
-		} ?>
-
-		<div class="wrap">
-
-			<?php screen_icon( 'users' ); ?>
-
-			<h2><?php echo esc_html( $title ); ?></h2>
-
-			<?php if ( !empty( $message ) ) :
-					$type = ( 'error' == $type ) ? 'error' : 'updated'; ?>
-
-				<div id="message" class="<?php echo esc_attr( $type ); ?> fade">
-					<p><?php echo esc_html( $message ); ?></p>
-				</div>
-
-			<?php endif; ?>
-
-			<form action="<?php echo esc_url( $action ); ?>" method="post">
-				<div id="poststuff">
-					<div id="post-body" class="metabox-holder columns-2">
-						<div id="post-body-content">
-							<div id="titlediv">
-								<div id="titlewrap">
-									<label class="screen-reader-text" id="title-prompt-text" for="title"><?php esc_html_e( 'Field Group Title', 'buddypress') ?></label>
-									<input type="text" name="group_name" autocomplete="off" id="title" value="<?php echo esc_attr( $this->name ); ?>" placeholder="<?php echo esc_attr_x( 'Group Name', 'XProfile admin edit group', 'buddypress' ); ?>" />
-								</div>
-							</div>
-
-							<div id="postdiv">
-								<div class="postbox">
-									<div id="titlediv"><h3 class="hndle"><?php _e( 'Group Description', 'buddypress' ); ?></h3></div>
-									<div class="inside">
-										<textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea>
-									</div>
-								</div>
-							</div>
-						</div>
-						<div id="postbox-container-1" class="postbox-container">
-							<div id="side-sortables" class="meta-box-sortables ui-sortable">
-
-								<?php
-								/**
-								 * Fires before XProfile Group submit metabox.
-								 *
-								 * @since BuddyPress (2.1.0)
-								 *
-								 * @param BP_XProfile_Group $this Current XProfile group.
-								 */
-								do_action( 'xprofile_group_before_submitbox', $this );
-								?>
-
-								<div id="submitdiv" class="postbox">
-									<div id="handlediv"><h3 class="hndle"><?php _e( 'Save', 'buddypress' ); ?></h3></div>
-									<div class="inside">
-										<div id="submitcomment" class="submitbox">
-											<div id="major-publishing-actions">
-
-												<?php
-												/**
-												 * Fires at the beginning of the XProfile Group publishing actions section.
-												 *
-												 * @since BuddyPress (2.1.0)
-												 *
-												 * @param BP_XProfile_Group $this Current XProfile group.
-												 */
-												do_action( 'xprofile_group_submitbox_start', $this );
-												?>
-
-												<div id="delete-action">
-													<a href="users.php?page=bp-profile-setup" class="submitdelete deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
-												</div>
-												<div id="publishing-action">
-													<input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/>
-												</div>
-												<input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" />
-												<div class="clear"></div>
-											</div>
-										</div>
-									</div>
-								</div>
-
-								<?php
-								/**
-								 * Fires after XProfile Group submit metabox.
-								 *
-								 * @since BuddyPress (2.1.0)
-								 *
-								 * @param BP_XProfile_Group $this Current XProfile group.
-								 */
-								do_action( 'xprofile_group_after_submitbox', $this );
-								?>
-							</div>
-						</div>
-					</div>
-				</div>
-			</form>
-		</div>
-
-<?php
-	}
-}
-
-class BP_XProfile_Field {
-	public $id;
-	public $group_id;
-	public $parent_id;
-	public $type;
-	public $name;
-	public $description;
-	public $is_required;
-	public $can_delete = '1';
-	public $field_order;
-	public $option_order;
-	public $order_by;
-	public $is_default_option;
-	public $default_visibility = 'public';
-	public $allow_custom_visibility = 'allowed';
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var BP_XProfile_Field_Type Field type object used for validation
-	 */
-	public $type_obj = null;
-
-	public $data;
-	public $message = null;
-	public $message_type = 'err';
-
-	public function __construct( $id = null, $user_id = null, $get_data = true ) {
-		if ( !empty( $id ) ) {
-			$this->populate( $id, $user_id, $get_data );
-
-		// Initialise the type obj to prevent fatals when creating new profile fields
-		} else {
-			$this->type_obj            = bp_xprofile_create_field_type( 'textbox' );
-			$this->type_obj->field_obj = $this;
-		}
-	}
-
-	public function populate( $id, $user_id, $get_data ) {
-		global $wpdb, $userdata, $bp;
-
-		if ( empty( $user_id ) ) {
-			$user_id = isset( $userdata->ID ) ? $userdata->ID : 0;
-		}
-
-		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE id = %d", $id );
-
-		if ( $field = $wpdb->get_row( $sql ) ) {
-			$this->id               = $field->id;
-			$this->group_id          = $field->group_id;
-			$this->parent_id         = $field->parent_id;
-			$this->type              = $field->type;
-			$this->name              = stripslashes( $field->name );
-			$this->description       = stripslashes( $field->description );
-			$this->is_required       = $field->is_required;
-			$this->can_delete        = $field->can_delete;
-			$this->field_order       = $field->field_order;
-			$this->option_order      = $field->option_order;
-			$this->order_by          = $field->order_by;
-			$this->is_default_option = $field->is_default_option;
-
-			// Create the field type and store a reference back to this object.
-			$this->type_obj            = bp_xprofile_create_field_type( $field->type );
-			$this->type_obj->field_obj = $this;
-
-			if ( $get_data && $user_id ) {
-				$this->data          = $this->get_field_data( $user_id );
-			}
-
-			$this->default_visibility = bp_xprofile_get_meta( $id, 'field', 'default_visibility' );
-
-			if ( empty( $this->default_visibility ) ) {
-				$this->default_visibility = 'public';
-			}
-
-			$this->allow_custom_visibility = 'disabled' == bp_xprofile_get_meta( $id, 'field', 'allow_custom_visibility' ) ? 'disabled' : 'allowed';
-		}
-	}
-
-	public function delete( $delete_data = false ) {
-		global $wpdb, $bp;
-
-		// Prevent deletion if no ID is present
-		// Prevent deletion by url when can_delete is false.
-		// Prevent deletion of option 1 since this invalidates fields with options.
-		if ( empty( $this->id ) || empty( $this->can_delete ) || ( $this->parent_id && $this->option_order == 1 ) )
-			return false;
-
-		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE id = %d OR parent_id = %d", $this->id, $this->id ) ) )
-			return false;
-
-		// delete the data in the DB for this field
-		if ( true === $delete_data )
-			BP_XProfile_ProfileData::delete_for_field( $this->id );
-
-		return true;
-	}
-
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->group_id    = apply_filters( 'xprofile_field_group_id_before_save',    $this->group_id,    $this->id );
-		$this->parent_id   = apply_filters( 'xprofile_field_parent_id_before_save',   $this->parent_id,   $this->id );
-		$this->type        = apply_filters( 'xprofile_field_type_before_save',        $this->type,        $this->id );
-		$this->name        = apply_filters( 'xprofile_field_name_before_save',        $this->name,        $this->id );
-		$this->description = apply_filters( 'xprofile_field_description_before_save', $this->description, $this->id );
-		$this->is_required = apply_filters( 'xprofile_field_is_required_before_save', $this->is_required, $this->id );
-		$this->order_by	   = apply_filters( 'xprofile_field_order_by_before_save',    $this->order_by,    $this->id );
-		$this->field_order = apply_filters( 'xprofile_field_field_order_before_save', $this->field_order, $this->id );
-		$this->option_order = apply_filters( 'xprofile_field_option_order_before_save', $this->option_order, $this->id );
-		$this->can_delete  = apply_filters( 'xprofile_field_can_delete_before_save',  $this->can_delete,  $this->id );
-		$this->type_obj    = bp_xprofile_create_field_type( $this->type );
-
-		do_action_ref_array( 'xprofile_field_before_save', array( $this ) );
-
-		if ( $this->id != null ) {
-			$sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET group_id = %d, parent_id = 0, type = %s, name = %s, description = %s, is_required = %d, order_by = %s, field_order = %d, option_order = %d, can_delete = %d WHERE id = %d", $this->group_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order, $this->option_order, $this->can_delete, $this->id );
-		} else {
-			$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, order_by, field_order, option_order, can_delete ) VALUES (%d, %d, %s, %s, %s, %d, %s, %d, %d, %d )", $this->group_id, $this->parent_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order, $this->option_order, $this->can_delete );
-		}
-
-		/**
-		 * Check for null so field options can be changed without changing any other part of the field.
-		 * The described situation will return 0 here.
-		 */
-		if ( $wpdb->query( $sql ) !== null ) {
-
-			if ( !empty( $this->id ) ) {
-				$field_id = $this->id;
-			} else {
-				$field_id = $wpdb->insert_id;
-			}
-
-			// Only do this if we are editing an existing field
-			if ( $this->id != null ) {
-
-				/**
-				 * Remove any radio or dropdown options for this
-				 * field. They will be re-added if needed.
-				 * This stops orphan options if the user changes a
-				 * field from a radio button field to a text box.
-				 */
-				$this->delete_children();
-			}
-
-			/**
-			 * Check to see if this is a field with child options.
-			 * We need to add the options to the db, if it is.
-			 */
-			if ( $this->type_obj->supports_options ) {
-
-				if ( !empty( $this->id ) ) {
-					$parent_id = $this->id;
-				} else {
-					$parent_id = $wpdb->insert_id;
-				}
-
-				// Allow plugins to filter the field's child options (i.e. the items in a selectbox).
-				$post_option  = ! empty( $_POST["{$this->type}_option"] ) ? $_POST["{$this->type}_option"] : '';
-				$post_default = ! empty( $_POST["isDefault_{$this->type}_option"] ) ? $_POST["isDefault_{$this->type}_option"] : '';
-				$options      = apply_filters( 'xprofile_field_options_before_save', $post_option,  $this->type );
-				$defaults     = apply_filters( 'xprofile_field_default_before_save', $post_default, $this->type );
-
-				$counter = 1;
-				if ( !empty( $options ) ) {
-					foreach ( (array) $options as $option_key => $option_value ) {
-						$is_default = 0;
-
-						if ( is_array( $defaults ) ) {
-							if ( isset( $defaults[$option_key] ) )
-								$is_default = 1;
-						} else {
-							if ( (int) $defaults == $option_key )
-								$is_default = 1;
-						}
-
-						if ( '' != $option_value ) {
-							if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'option', %s, '', 0, %d, %d)", $this->group_id, $parent_id, $option_value, $counter, $is_default ) ) ) {
-								return false;
-							}
-						}
-
-						$counter++;
-					}
-				}
-			}
-
-			do_action_ref_array( 'xprofile_field_after_save', array( $this ) );
-
-			// Recreate type_obj in case someone changed $this->type via a filter
-	 		$this->type_obj            = bp_xprofile_create_field_type( $this->type );
-	 		$this->type_obj->field_obj = $this;
-
-			return $field_id;
-		} else {
-			return false;
-		}
-	}
-
-	public function get_field_data( $user_id ) {
-		return new BP_XProfile_ProfileData( $this->id, $user_id );
-	}
-
-	public function get_children( $for_editing = false ) {
-		global $wpdb, $bp;
-
-		// This is done here so we don't have problems with sql injection
-		if ( 'asc' == $this->order_by && empty( $for_editing ) ) {
-			$sort_sql = 'ORDER BY name ASC';
-		} elseif ( 'desc' == $this->order_by && empty( $for_editing ) ) {
-			$sort_sql = 'ORDER BY name DESC';
-		} else {
-			$sort_sql = 'ORDER BY option_order ASC';
-		}
-
-		// This eliminates a problem with getting all fields when there is no id for the object
-		if ( empty( $this->id ) ) {
-			$parent_id = -1;
-		} else {
-			$parent_id = $this->id;
-		}
-
-		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE parent_id = %d AND group_id = %d $sort_sql", $parent_id, $this->group_id );
-
-		$children = $wpdb->get_results( $sql );
-
-		return apply_filters( 'bp_xprofile_field_get_children', $children, $for_editing );
-	}
-
-	public function delete_children() {
-		global $wpdb, $bp;
-
-		$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE parent_id = %d", $this->id );
-
-		$wpdb->query( $sql );
-	}
-
-	/** Static Methods ********************************************************/
-
-	public static function get_type( $field_id ) {
-		global $wpdb, $bp;
-
-		if ( !empty( $field_id ) ) {
-			$sql = $wpdb->prepare( "SELECT type FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id );
-
-			if ( !$field_type = $wpdb->get_var( $sql ) ) {
-				return false;
-			}
-
-			return $field_type;
-		}
-
-		return false;
-	}
-
-	public static function delete_for_group( $group_id ) {
-		global $wpdb, $bp;
-
-		if ( !empty( $group_id ) ) {
-			$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $group_id );
-
-			if ( $wpdb->get_var( $sql ) === false ) {
-				return false;
-			}
-
-			return true;
-		}
-
-		return false;
-	}
-
-	public static function get_id_from_name( $field_name ) {
-		global $wpdb, $bp;
-
-		if ( empty( $bp->profile->table_name_fields ) || !isset( $field_name ) )
-			return false;
-
-		return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) );
-	}
-
-	public static function update_position( $field_id, $position, $field_group_id ) {
-		global $wpdb, $bp;
-
-		if ( !is_numeric( $position ) || !is_numeric( $field_group_id ) )
-			return false;
-
-		// Update $field_id with new $position and $field_group_id
-		if ( $parent = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET field_order = %d, group_id = %d WHERE id = %d", $position, $field_group_id, $field_id ) ) ) {;
-
-			// Update any children of this $field_id
-			$children = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET group_id = %d WHERE parent_id = %d", $field_group_id, $field_id ) );
-
-			return $parent;
-		}
-
-		return false;
-	}
-
-	/**
-	 * This function populates the items for radio buttons checkboxes and drop down boxes
-	 */
-	public function render_admin_form_children() {
-		foreach ( array_keys( bp_xprofile_get_field_types() ) as $field_type ) {
-			$type_obj = bp_xprofile_create_field_type( $field_type );
-			$type_obj->admin_new_field_html( $this );
-		}
-	}
-
-	public function render_admin_form( $message = '' ) {
-		if ( empty( $this->id ) ) {
-			$title  = __( 'Add Field', 'buddypress' );
-			$action	= "users.php?page=bp-profile-setup&amp;group_id=" . $this->group_id . "&amp;mode=add_field#tabs-" . $this->group_id;
-
-			if ( !empty( $_POST['saveField'] ) ) {
-				$this->name        = $_POST['title'];
-				$this->description = $_POST['description'];
-				$this->is_required = $_POST['required'];
-				$this->type        = $_POST['fieldtype'];
-				$this->order_by    = $_POST["sort_order_{$this->type}"];
-				$this->field_order = $_POST['field_order'];
-			}
-		} else {
-			$title  = __( 'Edit Field', 'buddypress' );
-			$action = "users.php?page=bp-profile-setup&amp;mode=edit_field&amp;group_id=" . $this->group_id . "&amp;field_id=" . $this->id . "#tabs-" . $this->group_id;
-		} ?>
-
-		<div class="wrap">
-			<div id="icon-users" class="icon32"><br /></div>
-			<h2><?php echo esc_html( $title ); ?></h2>
-
-			<?php if ( !empty( $message ) ) : ?>
-
-				<div id="message" class="error fade">
-					<p><?php echo esc_html( $message ); ?></p>
-				</div>
-
-			<?php endif; ?>
-
-			<form id="bp-xprofile-add-field" action="<?php echo esc_url( $action ); ?>" method="post">
-				<div id="poststuff">
-					<div id="post-body" class="metabox-holder columns-<?php echo ( 1 == get_current_screen()->get_columns() ) ? '1' : '2'; ?>">
-						<div id="post-body-content">
-							<div id="titlediv">
-								<input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" placeholder="<?php echo esc_attr_x( 'Field Name', 'XProfile admin edit field', 'buddypress' ); ?>" />
-							</div>
-							<div class="postbox">
-								<h3><?php _e( 'Field Description', 'buddypress' ); ?></h3>
-								<div class="inside">
-									<textarea name="description" id="description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea>
-								</div>
-							</div>
-						</div><!-- #post-body-content -->
-
-						<div id="postbox-container-1" class="postbox-container">
-
-							<?php
-							/**
-							 * Fires before XProfile Field submit metabox.
-							 *
-							 * @since BuddyPress (2.1.0)
-							 *
-							 * @param BP_XProfile_Field $this Current XProfile field.
-							 */
-							do_action( 'xprofile_field_before_submitbox', $this );
-							?>
-
-							<div id="submitdiv" class="postbox">
-								<h3><?php _e( 'Submit', 'buddypress' ); ?></h3>
-								<div class="inside">
-									<div id="submitcomment" class="submitbox">
-										<div id="major-publishing-actions">
-
-											<?php
-											/**
-											 * Fires at the beginning of the XProfile Field publishing actions section.
-											 *
-											 * @since BuddyPress (2.1.0)
-											 *
-											 * @param BP_XProfile_Field $this Current XProfile field.
-											 */
-											do_action( 'xprofile_field_submitbox_start', $this );
-											?>
-
-											<input type="hidden" name="field_order" id="field_order" value="<?php echo esc_attr( $this->field_order ); ?>" />
-											<div id="publishing-action">
-												<input type="submit" value="<?php esc_attr_e( 'Save', 'buddypress' ); ?>" name="saveField" id="saveField" style="font-weight: bold" class="button-primary" />
-											</div>
-											<div id="delete-action">
-												<a href="users.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
-											</div>
-											<?php wp_nonce_field( 'xprofile_delete_option' ); ?>
-											<div class="clear"></div>
-										</div>
-									</div>
-								</div>
-							</div>
-
-							<?php
-							/**
-							 * Fires after XProfile Field submit metabox.
-							 *
-							 * @since BuddyPress (2.1.0)
-							 *
-							 * @param BP_XProfile_Field $this Current XProfile field.
-							 */
-							do_action( 'xprofile_field_after_submitbox', $this );
-							?>
-
-							<?php /* Field 1 is the fullname field, which cannot have custom visibility */ ?>
-							<?php if ( 1 != $this->id ) : ?>
-
-								<div class="postbox">
-									<h3><label for="default-visibility"><?php _e( 'Default Visibility', 'buddypress' ); ?></label></h3>
-									<div class="inside">
-										<ul>
-
-											<?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?>
-
-												<li>
-													<input type="radio" id="default-visibility[<?php echo esc_attr( $level['id'] ) ?>]" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ); ?> />
-													<label for="default-visibility[<?php echo esc_attr( $level['id'] ) ?>]"><?php echo esc_html( $level['label'] ) ?></label>
-												</li>
-
-											<?php endforeach ?>
-
-										</ul>
-									</div>
-								</div>
-
-								<div class="postbox">
-									<h3><label for="allow-custom-visibility"><?php _e( 'Per-Member Visibility', 'buddypress' ); ?></label></h3>
-									<div class="inside">
-										<ul>
-											<li>
-												<input type="radio" id="allow-custom-visibility-allowed" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ); ?> />
-												<label for="allow-custom-visibility-allowed"><?php _e( "Let members change this field's visibility", 'buddypress' ); ?></label>
-											</li>
-											<li>
-												<input type="radio" id="allow-custom-visibility-disabled" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ); ?> />
-												<label for="allow-custom-visibility-disabled"><?php _e( 'Enforce the default visibility for all members', 'buddypress' ); ?></label>
-											</li>
-										</ul>
-									</div>
-								</div>
-
-							<?php endif ?>
-						</div>
-
-						<div id="postbox-container-2" class="postbox-container">
-
-							<?php /* Field 1 is the fullname field, which cannot be altered */ ?>
-							<?php if ( 1 != $this->id ) : ?>
-
-								<div class="postbox">
-									<h3><label for="required"><?php _e( "Field Requirement", 'buddypress' ); ?></label></h3>
-									<div class="inside">
-										<select name="required" id="required" style="width: 30%">
-											<option value="0"<?php selected( $this->is_required, '0' ); ?>><?php _e( 'Not Required', 'buddypress' ); ?></option>
-											<option value="1"<?php selected( $this->is_required, '1' ); ?>><?php _e( 'Required',     'buddypress' ); ?></option>
-										</select>
-									</div>
-								</div>
-
-								<div class="postbox">
-									<h3><label for="fieldtype"><?php _e( 'Field Type', 'buddypress'); ?></label></h3>
-									<div class="inside">
-										<select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%">
-											<?php bp_xprofile_admin_form_field_types( $this->type ); ?>
-										</select>
-
-										<?php
-										// Deprecated filter, don't use. Go look at {@link BP_XProfile_Field_Type::admin_new_field_html()}.
-										do_action( 'xprofile_field_additional_options', $this );
-
-										$this->render_admin_form_children();
-										?>
-									</div>
-								</div>
-
-							<?php else : ?>
-
-								<input type="hidden" name="required"  id="required"  value="1"       />
-								<input type="hidden" name="fieldtype" id="fieldtype" value="textbox" />
-
-							<?php endif; ?>
-
-						</div>
-					</div><!-- #post-body -->
-
-				</div><!-- #poststuff -->
-
-			</form>
-		</div>
-
-<?php
-	}
-
-	public static function admin_validate() {
-		global $message;
-
-		// Validate Form
-		if ( '' == $_POST['title'] || '' == $_POST['required'] || '' == $_POST['fieldtype'] ) {
-			$message = __( 'Please make sure you fill out all required fields.', 'buddypress' );
-			return false;
-
-		} elseif ( empty( $_POST['field_file'] ) ) {
-			$field_type  = bp_xprofile_create_field_type( $_POST['fieldtype'] );
-			$option_name = "{$_POST['fieldtype']}_option";
-
-			if ( $field_type->supports_options && isset( $_POST[$option_name] ) && empty( $_POST[$option_name][1] ) ) {
-				$message = __( 'This field type require at least one option. Please add options below.', 'buddypress' );
-				return false;
-			}
-		}
-
-		return true;
-	}
-}
-
-class BP_XProfile_ProfileData {
-	public $id;
-	public $user_id;
-	public $field_id;
-	public $value;
-	public $last_updated;
-
-	public function __construct( $field_id = null, $user_id = null ) {
-		if ( !empty( $field_id ) ) {
-			$this->populate( $field_id, $user_id );
-		}
-	}
-
-	public function populate( $field_id, $user_id )  {
-		global $wpdb, $bp;
-
-		$cache_group = 'bp_xprofile_data_' . $user_id;
-		$profiledata = wp_cache_get( $field_id, $cache_group );
-
-		if ( false === $profiledata ) {
-			$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
-			$profiledata = $wpdb->get_row( $sql );
-
-			if ( $profiledata ) {
-				wp_cache_set( $field_id, $profiledata, $cache_group );
-			}
-		}
-
-		if ( $profiledata ) {
-			$this->id           = $profiledata->id;
-			$this->user_id      = $profiledata->user_id;
-			$this->field_id     = $profiledata->field_id;
-			$this->value        = stripslashes( $profiledata->value );
-			$this->last_updated = $profiledata->last_updated;
-
-		} else {
-			// When no row is found, we'll need to set these properties manually
-			$this->field_id	    = $field_id;
-			$this->user_id	    = $user_id;
-		}
-	}
-
-	/**
-	 * Check if there is data already for the user.
-	 *
-	 * @global object $wpdb
-	 * @global array $bp
-	 * @return bool
-	 */
-	public function exists() {
-		global $wpdb, $bp;
-
-		// Check cache first
-		$cached = wp_cache_get( $this->field_id, 'bp_xprofile_data_' . $this->user_id );
-
-		if ( $cached && ! empty( $cached->id ) ) {
-			$retval = true;
-		} else {
-			$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $this->user_id, $this->field_id ) );
-		}
-
-		return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );
-	}
-
-	/**
-	 * Check if this data is for a valid field.
-	 *
-	 * @global object $wpdb
-	 * @global array $bp
-	 * @return bool
-	 */
-	public function is_valid_field() {
-		global $wpdb, $bp;
-
-		$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d", $this->field_id ) );
-
-		return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) );
-	}
-
-	public function save() {
-		global $wpdb, $bp;
-
-		$this->user_id      = apply_filters( 'xprofile_data_user_id_before_save',      $this->user_id,         $this->id );
-		$this->field_id     = apply_filters( 'xprofile_data_field_id_before_save',     $this->field_id,        $this->id );
-		$this->value        = apply_filters( 'xprofile_data_value_before_save',        $this->value,           $this->id, true, $this );
-		$this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', bp_core_current_time(), $this->id );
-
-		do_action_ref_array( 'xprofile_data_before_save', array( $this ) );
-
-		if ( $this->is_valid_field() ) {
-			if ( $this->exists() && strlen( trim( $this->value ) ) ) {
-				$result   = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
-
-			} else if ( $this->exists() && empty( $this->value ) ) {
-				// Data removed, delete the entry.
-				$result   = $this->delete();
-
-			} else {
-				$result   = $wpdb->query( $wpdb->prepare("INSERT INTO {$bp->profile->table_name_data} (user_id, field_id, value, last_updated) VALUES (%d, %d, %s, %s)", $this->user_id, $this->field_id, $this->value, $this->last_updated ) );
-				$this->id = $wpdb->insert_id;
-			}
-
-			if ( false === $result )
-				return false;
-
-			do_action_ref_array( 'xprofile_data_after_save', array( $this ) );
-
-			return true;
-		}
-
-		return false;
-	}
-
-	/**
-	 * Delete specific XProfile field data
-	 *
-	 * @global object $wpdb
-	 * @return boolean
-	 */
-	public function delete() {
-		global $wpdb;
-
-		$bp = buddypress();
-
-		do_action_ref_array( 'xprofile_data_before_delete', array( $this ) );
-
-		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id ) ) )
-			return false;
-
-		do_action_ref_array( 'xprofile_data_after_delete', array( $this ) );
-
-		return true;
-	}
-
-	/** Static Methods ********************************************************/
-
-	/**
-	 * Get a user's profile data for a set of fields.
-	 *
-	 * @param int $user_id
-	 * @param array $field_ids
-	 * @return array
-	 */
-	public static function get_data_for_user( $user_id, $field_ids ) {
-		global $wpdb;
-
-		$data = array();
-
-		$cache_group = 'bp_xprofile_data_' . $user_id;
-
-		$uncached_field_ids = bp_get_non_cached_ids( $field_ids, $cache_group );
-
-		// Prime the cache
-		if ( ! empty( $uncached_field_ids ) ) {
-			$bp = buddypress();
-			$uncached_field_ids_sql = implode( ',', wp_parse_id_list( $uncached_field_ids ) );
-			$uncached_data = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, field_id, value, last_updated FROM {$bp->profile->table_name_data} WHERE field_id IN ({$uncached_field_ids_sql}) AND user_id = %d", $user_id ) );
-
-			// Rekey
-			$queried_data = array();
-			foreach ( $uncached_data as $ud ) {
-				$d               = new stdClass;
-				$d->id           = $ud->id;
-				$d->user_id      = $ud->user_id;
-				$d->field_id     = $ud->field_id;
-				$d->value        = $ud->value;
-				$d->last_updated = $ud->last_updated;
-
-				$queried_data[ $ud->field_id ] = $d;
-			}
-
-			// Set caches
-			foreach ( $uncached_field_ids as $field_id ) {
-
-				// If a value was found, cache it
-				if ( isset( $queried_data[ $field_id ] ) ) {
-					wp_cache_set( $field_id, $queried_data[ $field_id ], $cache_group );
-
-				// If no value was found, cache an empty item
-				// to avoid future cache misses
-				} else {
-					$d               = new stdClass;
-					$d->id           = '';
-					$d->user_id      = '';
-					$d->field_id     = $field_id;
-					$d->value        = '';
-					$d->last_updated = '';
-
-					wp_cache_set( $field_id, $d, $cache_group );
-				}
-			}
-		}
-
-		// Now that all items are cached, fetch them
-		foreach ( $field_ids as $field_id ) {
-			$data[] = wp_cache_get( $field_id, $cache_group );
-		}
-
-		return $data;
-	}
-
-	/**
-	 * Get all of the profile information for a specific user.
-	 *
-	 * @param int $user_id ID of the user.
-	 * @return array
-	 */
-	public static function get_all_for_user( $user_id ) {
-		global $wpdb, $bp;
-
-		$groups = bp_xprofile_get_groups( array(
-			'user_id'                => $user_id,
-			'hide_empty_groups'      => true,
-			'hide_empty_fields'      => true,
-			'fetch_fields'           => true,
-			'fetch_field_data'       => true,
-		) );
-
-		$profile_data = array();
-
-		if ( ! empty( $groups ) ) {
-			$user = new WP_User( $user_id );
-
-			$profile_data['user_login']    = $user->user_login;
-			$profile_data['user_nicename'] = $user->user_nicename;
-			$profile_data['user_email']    = $user->user_email;
-
-			foreach ( (array) $groups as $group ) {
-				if ( empty( $group->fields ) ) {
-					continue;
-				}
-
-				foreach ( (array) $group->fields as $field ) {
-					$profile_data[ $field->name ] = array(
-						'field_group_id'   => $group->id,
-						'field_group_name' => $group->name,
-						'field_id'         => $field->id,
-						'field_type'       => $field->type,
-						'field_data'       => $field->data->value,
-					);
-				}
-			}
-		}
-
-		return $profile_data;
-	}
-
-	/**
-	 * Get the user's field data id by the id of the xprofile field.
-	 *
-	 * @param int $field_id
-	 * @param int $user_id
-	 * @return int $fielddata_id
-	 */
-	public static function get_fielddataid_byid( $field_id, $user_id ) {
-		global $wpdb, $bp;
-
-		if ( empty( $field_id ) || empty( $user_id ) ) {
-			$fielddata_id = 0;
-		} else {
-
-			// Check cache first
-			$fielddata = wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id );
-			if ( false === $fielddata || empty( $fielddata->id ) ) {
-				$fielddata_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ) );
-			} else {
-				$fielddata_id = $fielddata->id;
-			}
-		}
-
-		return $fielddata_id;
-	}
-
-	/**
-	 * Get profile field values by field ID and user IDs.
-	 *
-	 * Supports multiple user IDs.
-	 *
-	 * @param int $field_id ID of the field.
-	 * @param int|array $user_ids ID or IDs of user(s).
-	 * @return string|array Single value if a single user is queried,
-	 *         otherwise an array of results.
-	 */
-	public static function get_value_byid( $field_id, $user_ids = null ) {
-		global $wpdb, $bp;
-
-		if ( empty( $user_ids ) ) {
-			$user_ids = bp_displayed_user_id();
-		}
-
-		$is_single = false;
-		if ( ! is_array( $user_ids ) ) {
-			$user_ids  = array( $user_ids );
-			$is_single = true;
-		}
-
-		// Assemble uncached IDs
-		$uncached_ids = array();
-		foreach ( $user_ids as $user_id ) {
-			if ( false === wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id ) ) {
-				$uncached_ids[] = $user_id;
-			}
-		}
-
-		// Prime caches
-		if ( ! empty( $uncached_ids ) ) {
-			$uncached_ids_sql = implode( ',', $uncached_ids );
-			$queried_data = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, field_id, value, last_updated FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id IN ({$uncached_ids_sql})", $field_id ) );
-
-			// Rekey
-			$qd = array();
-			foreach ( $queried_data as $data ) {
-				$qd[ $data->user_id ] = $data;
-			}
-
-			foreach ( $uncached_ids as $id ) {
-				// The value was successfully fetched
-				if ( isset( $qd[ $id ] ) ) {
-					$d = $qd[ $id ];
-
-				// No data found for the user, so we fake it to
-				// avoid cache misses and PHP notices
-				} else {
-					$d = new stdClass;
-					$d->id           = '';
-					$d->user_id      = $id;
-					$d->field_id     = '';
-					$d->value        = '';
-					$d->last_updated = '';
-				}
-
-				wp_cache_set( $field_id, $d, 'bp_xprofile_data_' . $d->user_id );
-			}
-		}
-
-		// Now that the cache is primed with all data, fetch it
-		$data = array();
-		foreach ( $user_ids as $user_id ) {
-			$data[] = wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id );
-		}
-
-		// If a single ID was passed, just return the value
-		if ( $is_single ) {
-			return $data[0]->value;
-
-		// Otherwise return the whole array
-		} else {
-			return $data;
-		}
-	}
-
-	public static function get_value_byfieldname( $fields, $user_id = null ) {
-		global $bp, $wpdb;
-
-		if ( empty( $fields ) )
-			return false;
-
-		if ( empty( $user_id ) )
-			$user_id = bp_displayed_user_id();
-
-		$field_sql = '';
-
-		if ( is_array( $fields ) ) {
-			for ( $i = 0, $count = count( $fields ); $i < $count; ++$i ) {
-				if ( $i == 0 ) {
-					$field_sql .= $wpdb->prepare( "AND ( f.name = %s ", $fields[$i] );
-				} else {
-					$field_sql .= $wpdb->prepare( "OR f.name = %s ", $fields[$i] );
-				}
-			}
-
-			$field_sql .= ')';
-		} else {
-			$field_sql .= $wpdb->prepare( "AND f.name = %s", $fields );
-		}
-
-		$sql = $wpdb->prepare( "SELECT d.value, f.name FROM {$bp->profile->table_name_data} d, {$bp->profile->table_name_fields} f WHERE d.field_id = f.id AND d.user_id = %d AND f.parent_id = 0 $field_sql", $user_id );
-
-		if ( !$values = $wpdb->get_results( $sql ) )
-			return false;
-
-		$new_values = array();
-
-		if ( is_array( $fields ) ) {
-			for ( $i = 0, $count = count( $values ); $i < $count; ++$i ) {
-				for ( $j = 0; $j < count( $fields ); $j++ ) {
-					if ( $values[$i]->name == $fields[$j] ) {
-						$new_values[$fields[$j]] = $values[$i]->value;
-					} else if ( !array_key_exists( $fields[$j], $new_values ) ) {
-						$new_values[$fields[$j]] = NULL;
-					}
-				}
-			}
-		} else {
-			$new_values = $values[0]->value;
-		}
-
-		return $new_values;
-	}
-
-	public static function delete_for_field( $field_id ) {
-		global $wpdb, $bp;
-
-		if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d", $field_id ) ) )
-			return false;
-
-		return true;
-	}
-
-	public static function get_last_updated( $user_id ) {
-		global $wpdb, $bp;
-
-		$last_updated = $wpdb->get_var( $wpdb->prepare( "SELECT last_updated FROM {$bp->profile->table_name_data} WHERE user_id = %d ORDER BY last_updated LIMIT 1", $user_id ) );
-
-		return $last_updated;
-	}
-
-	public static function delete_data_for_user( $user_id ) {
-		global $wpdb, $bp;
-
-		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d", $user_id ) );
-	}
-
-	public static function get_random( $user_id, $exclude_fullname ) {
-		global $wpdb, $bp;
-
-		$exclude_sql = ! empty( $exclude_fullname ) ? ' AND pf.id != 1' : '';
-
-		return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) );
-	}
-
-	public static function get_fullname( $user_id = 0 ) {
-
-		if ( empty( $user_id ) )
-			$user_id = bp_displayed_user_id();
-
-		$data = xprofile_get_field_data( bp_xprofile_fullname_field_id(), $user_id );
-
-		return $data[$field_name];
-	}
-}
-
-/** Field Types ***************************************************************/
-
-/**
- * Datebox xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the datebox field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Date Selector', 'xprofile field type', 'buddypress' );
-
-		$this->set_format( '/^\d{4}-\d{1,2}-\d{1,2} 00:00:00$/', 'replace' ); // "Y-m-d 00:00:00"
-
-		do_action( 'bp_xprofile_field_type_datebox', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that we pass to
-		// {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			$user_id = (int) $raw_properties['user_id'];
-			unset( $raw_properties['user_id'] );
-		} else {
-			$user_id = bp_displayed_user_id();
-		}
-
-		$day_r = bp_parse_args( $raw_properties, array(
-			'id'   => bp_get_the_profile_field_input_name() . '_day',
-			'name' => bp_get_the_profile_field_input_name() . '_day'
-		) );
-
-		$month_r = bp_parse_args( $raw_properties, array(
-			'id'   => bp_get_the_profile_field_input_name() . '_month',
-			'name' => bp_get_the_profile_field_input_name() . '_month'
-		) );
-
-		$year_r = bp_parse_args( $raw_properties, array(
-			'id'   => bp_get_the_profile_field_input_name() . '_year',
-			'name' => bp_get_the_profile_field_input_name() . '_year'
-		) ); ?>
-
-		<div class="datebox">
-
-			<label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
-			<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-			<select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
-				<?php bp_the_profile_field_options( array(
-					'type'    => 'day',
-					'user_id' => $user_id
-				) ); ?>
-			</select>
-
-			<select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
-				<?php bp_the_profile_field_options( array(
-					'type'    => 'month',
-					'user_id' => $user_id
-				) ); ?>
-			</select>
-
-			<select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
-				<?php bp_the_profile_field_options( array(
-					'type'    => 'year',
-					'user_id' => $user_id
-				) ); ?>
-			</select>
-
-		</div>
-	<?php
-	}
-
-	/**
-	 * Output the edit field options HTML for this field type.
-	 *
-	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
-	 * These are stored separately in the database, and their templating is handled seperately.
-	 *
-	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
-	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_options_html( array $args = array() ) {
-
-		$date       = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
-		$day        = 0;
-		$month      = 0;
-		$year       = 0;
-		$html       = '';
-		$eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
-
-		// Set day, month, year defaults
-		if ( ! empty( $date ) ) {
-
-			// If Unix timestamp
-			if ( is_numeric( $date ) ) {
-				$day   = date( 'j', $date );
-				$month = date( 'F', $date );
-				$year  = date( 'Y', $date );
-
-			// If MySQL timestamp
-			} else {
-				$day   = mysql2date( 'j', $date );
-				$month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below
-				$year  = mysql2date( 'Y', $date );
-			}
-		}
-
-		// Check for updated posted values, and errors preventing them from
-		// being saved first time.
-		if ( ! empty( $_POST['field_' . $this->field_obj->id . '_day'] ) ) {
-			$new_day = (int) $_POST['field_' . $this->field_obj->id . '_day'];
-			$day     = ( $day != $new_day ) ? $new_day : $day;
-		}
-
-		if ( ! empty( $_POST['field_' . $this->field_obj->id . '_month'] ) ) {
-			if ( in_array( $_POST['field_' . $this->field_obj->id . '_month'], $eng_months ) ) {
-				$new_month = $_POST['field_' . $this->field_obj->id . '_month'];
-			} else {
-				$new_month = $month;
-			}
-
-			$month = ( $month !== $new_month ) ? $new_month : $month;
-		}
-
-		if ( ! empty( $_POST['field_' . $this->field_obj->id . '_year'] ) ) {
-			$new_year = (int) $_POST['field_' . $this->field_obj->id . '_year'];
-			$year     = ( $year != $new_year ) ? $new_year : $year;
-		}
-
-		// $type will be passed by calling function when needed
-		switch ( $args['type'] ) {
-			case 'day':
-				$html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $day, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) );
-
-				for ( $i = 1; $i < 32; ++$i ) {
-					$html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', (int) $i, selected( $day, $i, false ), (int) $i );
-				}
-			break;
-
-			case 'month':
-				$months = array(
-					__( 'January',   'buddypress' ),
-					__( 'February',  'buddypress' ),
-					__( 'March',     'buddypress' ),
-					__( 'April',     'buddypress' ),
-					__( 'May',       'buddypress' ),
-					__( 'June',      'buddypress' ),
-					__( 'July',      'buddypress' ),
-					__( 'August',    'buddypress' ),
-					__( 'September', 'buddypress' ),
-					__( 'October',   'buddypress' ),
-					__( 'November',  'buddypress' ),
-					__( 'December',  'buddypress' )
-				);
-
-				$html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $month, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) );
-
-				for ( $i = 0; $i < 12; ++$i ) {
-					$html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $eng_months[$i] ), selected( $month, $eng_months[$i], false ), $months[$i] );
-				}
-			break;
-
-			case 'year':
-				$html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $year, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) );
-
-				for ( $i = 2037; $i > 1901; $i-- ) {
-					$html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', (int) $i, selected( $year, $i, false ), (int) $i );
-				}
-			break;
-		}
-
-		echo apply_filters( 'bp_get_the_profile_field_datebox', $html, $args['type'], $day, $month, $year, $this->field_obj->id, $date );
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-
-		$day_r = bp_parse_args( $raw_properties, array(
-			'id'   => bp_get_the_profile_field_input_name() . '_day',
-			'name' => bp_get_the_profile_field_input_name() . '_day'
-		) );
-
-		$month_r = bp_parse_args( $raw_properties, array(
-			'id'   => bp_get_the_profile_field_input_name() . '_month',
-			'name' => bp_get_the_profile_field_input_name() . '_month'
-		) );
-
-		$year_r = bp_parse_args( $raw_properties, array(
-			'id'   => bp_get_the_profile_field_input_name() . '_year',
-			'name' => bp_get_the_profile_field_input_name() . '_year'
-		) ); ?>
-
-		<select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
-			<?php bp_the_profile_field_options( array( 'type' => 'day' ) ); ?>
-		</select>
-
-		<select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
-			<?php bp_the_profile_field_options( array( 'type' => 'month' ) ); ?>
-		</select>
-
-		<select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
-			<?php bp_the_profile_field_options( array( 'type' => 'year' ) ); ?>
-		</select>
-
-	<?php
-	}
-
-	/**
-	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
-	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
-
-	/**
-	 * Format Date values for display.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param string $field_value The date value, as saved in the database.
-	 *        Typically, this is a MySQL-formatted date string (Y-m-d H:i:s).
-	 * @return string Date formatted by bp_format_time().
-	 */
-	public static function display_filter( $field_value ) {
-
-		// If Unix timestamp
-		if ( ! is_numeric( $field_value ) ) {
-			$field_value = strtotime( $field_value );
-		}
-
-		return bp_format_time( $field_value, true, false );
-	}
-}
-
-/**
- * Checkbox xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the checkbox field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Checkboxes', 'xprofile field type', 'buddypress' );
-
-		$this->supports_multiple_defaults = true;
-		$this->accepts_null_value         = true;
-		$this->supports_options           = true;
-
-		$this->set_format( '/^.+$/', 'replace' );
-		do_action( 'bp_xprofile_field_type_checkbox', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.checkbox.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that we pass to
-		// {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			$user_id = (int) $raw_properties['user_id'];
-			unset( $raw_properties['user_id'] );
-		} else {
-			$user_id = bp_displayed_user_id();
-		} ?>
-
-		<div class="checkbox">
-			<label for="<?php bp_the_profile_field_input_name(); ?>">
-				<?php bp_the_profile_field_name(); ?>
-				<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-					<?php esc_html_e( '(required)', 'buddypress' ); ?>
-				<?php endif; ?>
-			</label>
-
-			<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-			<?php bp_the_profile_field_options( array(
-				'user_id' => $user_id
-			) ); ?>
-
-		</div>
-
-		<?php
-	}
-
-	/**
-	 * Output the edit field options HTML for this field type.
-	 *
-	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
-	 * These are stored separately in the database, and their templating is handled seperately.
-	 *
-	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
-	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_options_html( array $args = array() ) {
-		$options       = $this->field_obj->get_children();
-		$option_values = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
-		$option_values = (array) maybe_unserialize( $option_values );
-
-		$html = '';
-
-		// Check for updated posted values, but errors preventing them from
-		// being saved first time
-		if ( isset( $_POST['field_' . $this->field_obj->id] ) && $option_values != maybe_serialize( $_POST['field_' . $this->field_obj->id] ) ) {
-			if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
-				$option_values = array_map( 'sanitize_text_field', $_POST['field_' . $this->field_obj->id] );
-			}
-		}
-
-		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
-			$selected = '';
-
-			// First, check to see whether the user's saved values match the option
-			for ( $j = 0, $count_values = count( $option_values ); $j < $count_values; ++$j ) {
-
-				// Run the allowed option name through the before_save filter,
-				// so we'll be sure to get a match
-				$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
-
-				if ( $option_values[$j] === $allowed_options || in_array( $allowed_options, $option_values ) ) {
-					$selected = ' checked="checked"';
-					break;
-				}
-			}
-
-			// If the user has not yet supplied a value for this field, check to
-			// see whether there is a default value available
-			if ( ! is_array( $option_values ) && empty( $option_values ) && empty( $selected ) && ! empty( $options[$k]->is_default_option ) ) {
-				$selected = ' checked="checked"';
-			}
-
-			$new_html = sprintf( '<label><input %1$s type="checkbox" name="%2$s" id="%3$s" value="%4$s">%5$s</label>',
-				$selected,
-				esc_attr( "field_{$this->field_obj->id}[]" ),
-				esc_attr( "field_{$options[$k]->id}_{$k}" ),
-				esc_attr( stripslashes( $options[$k]->name ) ),
-				esc_html( stripslashes( $options[$k]->name ) )
-			);
-			$html .= apply_filters( 'bp_get_the_profile_field_options_checkbox', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
-		}
-
-		echo $html;
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-		bp_the_profile_field_options();
-	}
-
-	/**
-	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
-		parent::admin_new_field_html( $current_field, 'checkbox' );
-	}
-}
-
-/**
- * Radio button xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the radio button field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Radio Buttons', 'xprofile field type', 'buddypress' );
-
-		$this->supports_options = true;
-
-		$this->set_format( '/^.+$/', 'replace' );
-		do_action( 'bp_xprofile_field_type_radiobutton', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.radio.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that we pass to
-		// {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			$user_id = (int) $raw_properties['user_id'];
-			unset( $raw_properties['user_id'] );
-		} else {
-			$user_id = bp_displayed_user_id();
-		} ?>
-
-		<div class="radio">
-
-			<label for="<?php bp_the_profile_field_input_name(); ?>">
-				<?php bp_the_profile_field_name(); ?>
-				<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-					<?php esc_html_e( '(required)', 'buddypress' ); ?>
-				<?php endif; ?>
-			</label>
-
-			<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-			<?php bp_the_profile_field_options( array( 'user_id' => $user_id ) );
-
-			if ( ! bp_get_the_profile_field_is_required() ) : ?>
-
-				<a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>' );">
-					<?php esc_html_e( 'Clear', 'buddypress' ); ?>
-				</a>
-
-			<?php endif; ?>
-
-		</div>
-
-		<?php
-	}
-
-	/**
-	 * Output the edit field options HTML for this field type.
-	 *
-	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
-	 * These are stored separately in the database, and their templating is handled seperately.
-	 *
-	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
-	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_options_html( array $args = array() ) {
-		$option_value = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
-		$options      = $this->field_obj->get_children();
-
-		$html = sprintf( '<div id="%s">', esc_attr( 'field_' . $this->field_obj->id ) );
-
-		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
-
-			// Check for updated posted values, but errors preventing them from
-			// being saved first time
-			if ( isset( $_POST['field_' . $this->field_obj->id] ) && $option_value != $_POST['field_' . $this->field_obj->id] ) {
-				if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
-					$option_value = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
-				}
-			}
-
-			// Run the allowed option name through the before_save filter, so
-			// we'll be sure to get a match
-			$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
-			$selected        = '';
-
-			if ( $option_value === $allowed_options || ( empty( $option_value ) && ! empty( $options[$k]->is_default_option ) ) ) {
-				$selected = ' checked="checked"';
-			}
-
-			$new_html = sprintf( '<label><input %1$s type="radio" name="%2$s" id="%3$s" value="%4$s">%5$s</label>',
-				$selected,
-				esc_attr( "field_{$this->field_obj->id}" ),
-				esc_attr( "option_{$options[$k]->id}" ),
-				esc_attr( stripslashes( $options[$k]->name ) ),
-				esc_html( stripslashes( $options[$k]->name ) )
-			);
-			$html .= apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
-		}
-
-		echo $html . '</div>';
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-		bp_the_profile_field_options();
-
-		if ( bp_get_the_profile_field_is_required() ) {
-			return;
-		} ?>
-
-		<a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>' );">
-			<?php esc_html_e( 'Clear', 'buddypress' ); ?>
-		</a>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
-		parent::admin_new_field_html( $current_field, 'radio' );
-	}
-}
-
-/**
- * Multi-selectbox xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the multi-selectbox field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Multi Select Box', 'xprofile field type', 'buddypress' );
-
-		$this->supports_multiple_defaults = true;
-		$this->accepts_null_value         = true;
-		$this->supports_options           = true;
-
-		$this->set_format( '/^.+$/', 'replace' );
-		do_action( 'bp_xprofile_field_type_multiselectbox', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/select.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that we pass to
-		// {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			$user_id = (int) $raw_properties['user_id'];
-			unset( $raw_properties['user_id'] );
-		} else {
-			$user_id = bp_displayed_user_id();
-		}
-
-		$r = bp_parse_args( $raw_properties, array(
-			'multiple' => 'multiple',
-			'id'       => bp_get_the_profile_field_input_name() . '[]',
-			'name'     => bp_get_the_profile_field_input_name() . '[]',
-		) ); ?>
-
-		<label for="<?php bp_the_profile_field_input_name(); ?>[]"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
-
-		<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-		<select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-			<?php bp_the_profile_field_options( array(
-				'user_id' => $user_id
-			) ); ?>
-		</select>
-
-		<?php if ( ! bp_get_the_profile_field_is_required() ) : ?>
-
-			<a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>[]' );">
-				<?php esc_html_e( 'Clear', 'buddypress' ); ?>
-			</a>
-
-		<?php endif; ?>
-	<?php
-	}
-
-	/**
-	 * Output the edit field options HTML for this field type.
-	 *
-	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
-	 * These are stored separately in the database, and their templating is handled seperately.
-	 *
-	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
-	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_options_html( array $args = array() ) {
-		$original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ) );
-
-		$options = $this->field_obj->get_children();
-		$html    = '';
-
-		if ( empty( $original_option_values ) && ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
-			$original_option_values = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
-		}
-
-		$option_values = (array) $original_option_values;
-		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
-			$selected = '';
-
-			// Check for updated posted values, but errors preventing them from
-			// being saved first time
-			foreach( $option_values as $i => $option_value ) {
-				if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id][$i] != $option_value ) {
-					if ( ! empty( $_POST['field_' . $this->field_obj->id][$i] ) ) {
-						$option_values[] = sanitize_text_field( $_POST['field_' . $this->field_obj->id][$i] );
-					}
-				}
-			}
-
-			// Run the allowed option name through the before_save filter, so
-			// we'll be sure to get a match
-			$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
-
-			// First, check to see whether the user-entered value matches
-			if ( in_array( $allowed_options, $option_values ) ) {
-				$selected = ' selected="selected"';
-			}
-
-			// Then, if the user has not provided a value, check for defaults
-			if ( ! is_array( $original_option_values ) && empty( $option_values ) && ! empty( $options[$k]->is_default_option ) ) {
-				$selected = ' selected="selected"';
-			}
-
-			$html .= apply_filters( 'bp_get_the_profile_field_options_multiselect', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_html( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $this->field_obj->id, $selected, $k );
-		}
-
-		echo $html;
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-		$r = bp_parse_args( $raw_properties, array(
-			'multiple' => 'multiple'
-		) ); ?>
-
-		<select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-			<?php bp_the_profile_field_options(); ?>
-		</select>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
-		parent::admin_new_field_html( $current_field, 'checkbox' );
-	}
-}
-
-/**
- * Selectbox xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the selectbox field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Drop Down Select Box', 'xprofile field type', 'buddypress' );
-
-		$this->supports_options = true;
-
-		$this->set_format( '/^.+$/', 'replace' );
-		do_action( 'bp_xprofile_field_type_selectbox', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/select.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that we pass to
-		// {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			$user_id = (int) $raw_properties['user_id'];
-			unset( $raw_properties['user_id'] );
-		} else {
-			$user_id = bp_displayed_user_id();
-		} ?>
-
-		<label for="<?php bp_the_profile_field_input_name(); ?>">
-			<?php bp_the_profile_field_name(); ?>
-			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-				<?php esc_html_e( '(required)', 'buddypress' ); ?>
-			<?php endif; ?>
-		</label>
-
-		<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-		<select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
-			<?php bp_the_profile_field_options( array( 'user_id' => $user_id ) ); ?>
-		</select>
-
-		<?php
-	}
-
-	/**
-	 * Output the edit field options HTML for this field type.
-	 *
-	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
-	 * These are stored separately in the database, and their templating is handled seperately.
-	 *
-	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
-	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_options_html( array $args = array() ) {
-		$original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ) );
-
-		$options = $this->field_obj->get_children();
-		$html    = '<option value="">' . /* translators: no option picked in select box */ esc_html__( '----', 'buddypress' ) . '</option>';
-
-		if ( empty( $original_option_values ) && !empty( $_POST['field_' . $this->field_obj->id] ) ) {
-			$original_option_values = sanitize_text_field(  $_POST['field_' . $this->field_obj->id] );
-		}
-
-		$option_values = (array) $original_option_values;
-		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
-			$selected = '';
-
-			// Check for updated posted values, but errors preventing them from
-			// being saved first time
-			foreach( $option_values as $i => $option_value ) {
-				if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id] != $option_value ) {
-					if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
-						$option_values[$i] = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
-					}
-				}
-			}
-
-			// Run the allowed option name through the before_save filter, so
-			// we'll be sure to get a match
-			$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
-
-			// First, check to see whether the user-entered value matches
-			if ( in_array( $allowed_options, $option_values ) ) {
-				$selected = ' selected="selected"';
-			}
-
-			// Then, if the user has not provided a value, check for defaults
-			if ( ! is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option ) {
-				$selected = ' selected="selected"';
-			}
-
-			$html .= apply_filters( 'bp_get_the_profile_field_options_select', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_html( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $this->field_obj->id, $selected, $k );
-		}
-
-		echo $html;
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-		?>
-
-		<select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
-			<?php bp_the_profile_field_options(); ?>
-		</select>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
-		parent::admin_new_field_html( $current_field, 'radio' );
-	}
-}
-
-/**
- * Textarea xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the textarea field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Multi-line Text Area', 'xprofile field type', 'buddypress' );
-
-		$this->set_format( '/^.*$/m', 'replace' );
-		do_action( 'bp_xprofile_field_type_textarea', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that certain other fields
-		// types pass to {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			unset( $raw_properties['user_id'] );
-		}
-
-		$r = bp_parse_args( $raw_properties, array(
-			'cols' => 40,
-			'rows' => 5,
-		) ); ?>
-
-		<label for="<?php bp_the_profile_field_input_name(); ?>">
-			<?php bp_the_profile_field_name(); ?>
-			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-				<?php esc_html_e( '(required)', 'buddypress' ); ?>
-			<?php endif; ?>
-		</label>
-
-		<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-		<textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>><?php bp_the_profile_field_edit_value(); ?></textarea>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-		$r = bp_parse_args( $raw_properties, array(
-			'cols' => 40,
-			'rows' => 5,
-		) ); ?>
-
-		<textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>></textarea>
-
-		<?php
-	}
-
-	/**
-	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
-	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
-}
-
-/**
- * Textbox xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the textbox field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Text Box', 'xprofile field type', 'buddypress' );
-
-		$this->set_format( '/^.*$/', 'replace' );
-		do_action( 'bp_xprofile_field_type_textbox', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that certain other fields
-		// types pass to {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			unset( $raw_properties['user_id'] );
-		}
-
-		$r = bp_parse_args( $raw_properties, array(
-			'type'  => 'text',
-			'value' => bp_get_the_profile_field_edit_value(),
-		) ); ?>
-
-		<label for="<?php bp_the_profile_field_input_name(); ?>">
-			<?php bp_the_profile_field_name(); ?>
-			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-				<?php esc_html_e( '(required)', 'buddypress' ); ?>
-			<?php endif; ?>
-		</label>
-
-		<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-
-		$r = bp_parse_args( $raw_properties, array(
-			'type' => 'text'
-		) ); ?>
-
-		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-
-		<?php
-	}
-
-	/**
-	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
-	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
-}
-
-/**
- * Number xprofile field type.
- *
- * @since BuddyPress (2.0.0)
- */
-class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the number field type
-	 *
-	 * @since BuddyPress (2.0.0)
- 	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'Number', 'xprofile field type', 'buddypress' );
-
-		$this->set_format( '/^\d+|-\d+$/', 'replace' );
-		do_action( 'bp_xprofile_field_type_number', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// user_id is a special optional parameter that certain other fields
-		// types pass to {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			unset( $raw_properties['user_id'] );
-		}
-
-		$r = bp_parse_args( $raw_properties, array(
-			'type'  => 'number',
-			'value' =>  bp_get_the_profile_field_edit_value()
-		) ); ?>
-
-		<label for="<?php bp_the_profile_field_input_name(); ?>">
-			<?php bp_the_profile_field_name(); ?>
-			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-				<?php esc_html_e( '(required)', 'buddypress' ); ?>
-			<?php endif; ?>
-		</label>
-
-		<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-		$r = bp_parse_args( $raw_properties, array(
-			'type' => 'number'
-		) ); ?>
-
-		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-	<?php
-	}
-
-	/**
-	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
-	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
-}
-
-/**
- * URL xprofile field type.
- *
- * @since BuddyPress (2.1.0)
- */
-class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the URL field type
-	 *
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function __construct() {
-		parent::__construct();
-
-		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
-		$this->name     = _x( 'URL', 'xprofile field type', 'buddypress' );
-
-		$this->set_format( '_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS', 'replace' );
-
-		do_action( 'bp_xprofile_field_type_url', $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of
-	 *        {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes}
-	 *        that you want to add.
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-
-		// `user_id` is a special optional parameter that certain other
-		// fields types pass to {@link bp_the_profile_field_options()}.
-		if ( isset( $raw_properties['user_id'] ) ) {
-			unset( $raw_properties['user_id'] );
-		}
-
-		$r = bp_parse_args( $raw_properties, array(
-			'type'      => 'text',
-			'inputmode' => 'url',
-			'value'     => esc_url( bp_get_the_profile_field_edit_value() ),
-		) ); ?>
-
-		<label for="<?php bp_the_profile_field_input_name(); ?>">
-			<?php bp_the_profile_field_name(); ?>
-			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
-				<?php esc_html_e( '(required)', 'buddypress' ); ?>
-			<?php endif; ?>
-		</label>
-
-		<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
-
-		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-
-		<?php
-	}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted
-	 *        attributes that you want to add.
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-
-		$r = bp_parse_args( $raw_properties, array(
-			'type' => 'url'
-		) ); ?>
-
-		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
-
-		<?php
-	}
-
-	/**
-	 * This method usually outputs HTML for this field type's children options
-	 * on the wp-admin Profile Fields "Add Field" and "Edit Field" screens, but
-	 * for this field type, we don't want it, so it's stubbed out.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.1.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
-
-	/**
-	 * Modify submitted URL values before validation.
-	 *
-	 * The URL validation regex requires a http(s) protocol, so that all
-	 * values saved in the database are fully-formed URLs. However, we
-	 * still want to allow users to enter URLs without a protocol, for a
-	 * better user experience. So we catch submitted URL values, and if
-	 * the protocol is missing, we prepend 'http://' before passing to
-	 * is_valid().
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param string $submitted_value Raw value submitted by the user.
-	 * @return string
-	 */
-	public static function pre_validate_filter( $submitted_value = '' ) {
-
-		// Allow empty URL values
-		if ( empty( $submitted_value ) ) {
-			return '';
-		}
-
-		// Run some checks on the submitted value
-		if ( false === strpos( $submitted_value, ':'  )
-		     && substr( $submitted_value, 0, 1 ) !== '/'
-		     && substr( $submitted_value, 0, 1 ) !== '#'
-		     && ! preg_match( '/^[a-z0-9-]+?\.php/i', $submitted_value )
-		) {
-			$submitted_value = 'http://' . $submitted_value;
-		}
-
-		return $submitted_value;
-	}
-
-	/**
-	 * Format URL values for display.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param string $field_value The URL value, as saved in the database.
-	 * @return string URL converted to a link.
-	 */
-	public static function display_filter( $field_value ) {
-		$link      = strip_tags( $field_value );
-		$no_scheme = preg_replace( '#^https?://#', '', rtrim( $link, '/' ) );
-		$url_text  = str_replace( $link, $no_scheme, $field_value );
-		return '<a href="' . esc_url( $field_value ) . '" rel="nofollow">' . esc_html( $url_text ) . '</a>';
-	}
-}
-
-/**
- * A placeholder xprofile field type. Doesn't do anything.
- *
- * Used if an existing field has an unknown type (e.g. one provided by a missing third-party plugin).
- *
- * @since BuddyPress (2.0.1)
- */
-class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type {
-
-	/**
-	 * Constructor for the placeholder field type.
-	 *
-	 * @since BuddyPress (2.0.1)
-	 */
-	public function __construct() {
-		$this->set_format( '/.*/', 'replace' );
-	}
-
-	/**
-	 * Prevent any HTML being output for this field type.
-	 *
-	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} that you want to add.
-	 * @since BuddyPress (2.0.1)
-	 */
-	public function edit_field_html( array $raw_properties = array() ) {
-	}
-
-	/**
-	 * Prevent any HTML being output for this field type.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.1)
-	 */
-	public function admin_field_html( array $raw_properties = array() ) {
-	}
-
-	/**
-	 * Prevent any HTML being output for this field type.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.1)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
-}
-
-/**
- * Represents a type of XProfile field and holds meta information about the type of value that it accepts.
- *
- * @since BuddyPress (2.0.0)
- */
-abstract class BP_XProfile_Field_Type {
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var array Field type validation regexes
-	 */
-	protected $validation_regex = array();
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var array Field type whitelisted values
-	 */
-	protected $validation_whitelist = array();
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var string The name of this field type
-	 */
-	public $name = '';
-
-	/**
-	 * The name of the category that this field type should be grouped with. Used on the [Users > Profile Fields] screen in wp-admin.
-	 *
-	 * @since BuddyPress (2.0.0)
-	 * @var string
-	 */
-	public $category = '';
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var bool If this is set, allow BP to store null/empty values for this field type.
-	 */
-	public $accepts_null_value = false;
-
-	/**
-	 * If this is set, BP will set this field type's validation whitelist from the field's options (e.g checkbox, selectbox).
-	 *
-	 * @since BuddyPress (2.0.0)
-	 * @var bool Does this field support options? e.g. selectbox, radio buttons, etc.
-	 */
-	public $supports_options = false;
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var bool Does this field type support multiple options being set as default values? e.g. multiselectbox, checkbox.
-	 */
-	public $supports_multiple_defaults = false;
-
-	/**
-	 * @since BuddyPress (2.0.0)
-	 * @var BP_XProfile_Field If this object is created by instantiating a {@link BP_XProfile_Field}, this is a reference back to that object.
-	 */
-	public $field_obj = null;
-
-	/**
-	 * Constructor
-	 *
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function __construct() {
-		do_action( 'bp_xprofile_field_type', $this );
-	}
-
-	/**
-	 * Set a regex that profile data will be asserted against.
-	 *
-	 * You can call this method multiple times to set multiple formats. When validation is performed,
-	 * it's successful as long as the new value matches any one of the registered formats.
-	 *
-	 * @param string $format Regex string
-	 * @param string $replace_format Optional; if 'replace', replaces the format instead of adding to it. Defaults to 'add'.
-	 * @return BP_XProfile_Field_Type
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function set_format( $format, $replace_format = 'add' ) {
-
-		$format = apply_filters( 'bp_xprofile_field_type_set_format', $format, $replace_format, $this );
-
-		if ( 'add' === $replace_format ) {
-			$this->validation_regex[] = $format;
-		} elseif ( 'replace' === $replace_format ) {
-			$this->validation_regex = array( $format );
-		}
-
-		return $this;
-	}
-
-	/**
-	 * Add a value to this type's whitelist that that profile data will be asserted against.
-	 *
-	 * You can call this method multiple times to set multiple formats. When validation is performed,
-	 * it's successful as long as the new value matches any one of the registered formats.
-	 *
-	 * @param string|array $values
-	 * @return BP_XProfile_Field_Type
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function set_whitelist_values( $values ) {
-		foreach ( (array) $values as $value ) {
-			$this->validation_whitelist[] = apply_filters( 'bp_xprofile_field_type_set_whitelist_values', $value, $values, $this );
-		}
-
-		return $this;
-	}
-
-	/**
-	 * Check the given string against the registered formats for this field type.
-	 *
-	 * This method doesn't support chaining.
-	 *
-	 * @param string|array $values Value to check against the registered formats
-	 * @return bool True if the value validates
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function is_valid( $values ) {
-		$validated = false;
-
-		// Some types of field (e.g. multi-selectbox) may have multiple values to check
-		foreach ( (array) $values as $value ) {
-
-			// Validate the $value against the type's accepted format(s).
-			foreach ( $this->validation_regex as $format ) {
-				if ( 1 === preg_match( $format, $value ) ) {
-					$validated = true;
-					continue;
-
-				} else {
-					$validated = false;
-				}
-			}
-		}
-
-		// Handle field types with accepts_null_value set if $values is an empty array
-		if ( ( false === $validated ) && is_array( $values ) && empty( $values ) && $this->accepts_null_value ) {
-			$validated = true;
-		}
-
-		// If there's a whitelist set, also check the $value.
-		if ( ( true === $validated ) && ! empty( $values ) && ! empty( $this->validation_whitelist ) ) {
-			foreach ( (array) $values as $value ) {
-				$validated = in_array( $value, $this->validation_whitelist, true );
-			}
-		}
-
-		return (bool) apply_filters( 'bp_xprofile_field_type_is_valid', $validated, $values, $this );
-	}
-
-	/**
-	 * Output the edit field HTML for this field type.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	abstract public function edit_field_html( array $raw_properties = array() );
-
-	/**
-	 * Output the edit field options HTML for this field type.
-	 *
-	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
-	 * These are stored separately in the database, and their templating is handled separately.
-	 * Populate this method in a child class if it's required. Otherwise, you can leave it out.
-	 *
-	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
-	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function edit_field_options_html( array $args = array() ) {}
-
-	/**
-	 * Output HTML for this field type on the wp-admin Profile Fields screen.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
-	 * @since BuddyPress (2.0.0)
-	 */
-	abstract public function admin_field_html( array $raw_properties = array() );
-
-	/**
-	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
-	 *
-	 * You don't need to implement this method for all field types. It's used in core by the
-	 * selectbox, multi selectbox, checkbox, and radio button fields, to allow the admin to
-	 * enter the child option values (e.g. the choices in a select box).
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 *
-	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
-	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
-	 * @since BuddyPress (2.0.0)
-	 */
-	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
-		$type = array_search( get_class( $this ), bp_xprofile_get_field_types() );
-		if ( false === $type ) {
-			return;
-		}
-
-		$class            = $current_field->type != $type ? 'display: none;' : '';
-		$current_type_obj = bp_xprofile_create_field_type( $type );
-		?>
-
-		<div id="<?php echo esc_attr( $type ); ?>" class="postbox bp-options-box" style="<?php echo esc_attr( $class ); ?> margin-top: 15px;">
-			<h3><?php esc_html_e( 'Please enter options for this Field:', 'buddypress' ); ?></h3>
-			<div class="inside">
-				<p>
-					<label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php esc_html_e( 'Sort Order:', 'buddypress' ); ?></label>
-					<select name="sort_order_<?php echo esc_attr( $type ); ?>" id="sort_order_<?php echo esc_attr( $type ); ?>" >
-						<option value="custom" <?php selected( 'custom', $current_field->order_by ); ?>><?php esc_html_e( 'Custom',     'buddypress' ); ?></option>
-						<option value="asc"    <?php selected( 'asc',    $current_field->order_by ); ?>><?php esc_html_e( 'Ascending',  'buddypress' ); ?></option>
-						<option value="desc"   <?php selected( 'desc',   $current_field->order_by ); ?>><?php esc_html_e( 'Descending', 'buddypress' ); ?></option>
-					</select>
-				</p>
-
-				<?php
-
-				// Does option have children?
-				$options = $current_field->get_children( true );
-
-				// If no children options exists for this field, check in $_POST
-				// for a submitted form (e.g. on the "new field" screen).
-				if ( empty( $options ) ) {
-
-					$options = array();
-					$i       = 1;
-
-					while ( isset( $_POST[$type . '_option'][$i] ) ) {
-
-						// Multiselectbox and checkboxes support MULTIPLE default options; all other core types support only ONE.
-						if ( $current_type_obj->supports_options && ! $current_type_obj->supports_multiple_defaults && isset( $_POST["isDefault_{$type}_option"][$i] ) && (int) $_POST["isDefault_{$type}_option"] === $i ) {
-							$is_default_option = true;
-						} elseif ( isset( $_POST["isDefault_{$type}_option"][$i] ) ) {
-							$is_default_option = (bool) $_POST["isDefault_{$type}_option"][$i];
-						} else {
-							$is_default_option = false;
-						}
-
-						// Grab the values from $_POST to use as the form's options
-						$options[] = (object) array(
-							'id'                => -1,
-							'is_default_option' => $is_default_option,
-							'name'              => sanitize_text_field( stripslashes( $_POST[$type . '_option'][$i] ) ),
-						);
-
-						++$i;
-					}
-
-					// If there are still no children options set, this must be the "new field" screen, so add one new/empty option.
-					if ( empty( $options ) ) {
-						$options[] = (object) array(
-							'id'                => -1,
-							'is_default_option' => false,
-							'name'              => '',
-						);
-					}
-				}
-
-				// Render the markup for the children options
-				if ( ! empty( $options ) ) {
-					$default_name = '';
-
-					for ( $i = 0, $count = count( $options ); $i < $count; ++$i ) :
-						$j = $i + 1;
-
-						// Multiselectbox and checkboxes support MULTIPLE default options; all other core types support only ONE.
-						if ( $current_type_obj->supports_options && $current_type_obj->supports_multiple_defaults ) {
-							$default_name = '[' . $j . ']';
-						}
-						?>
-
-						<div id="<?php echo esc_attr( "{$type}_div{$j}" ); ?>" class="bp-option sortable">
-							<span class="bp-option-icon grabber"></span>
-							<input type="text" name="<?php echo esc_attr( "{$type}_option[{$j}]" ); ?>" id="<?php echo esc_attr( "{$type}_option{$j}" ); ?>" value="<?php echo esc_attr( stripslashes( $options[$i]->name ) ); ?>" />
-							<label>
-								<input type="<?php echo esc_attr( $control_type ); ?>" name="<?php echo esc_attr( "isDefault_{$type}_option{$default_name}" ); ?>" <?php checked( $options[$i]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" />
-								<?php _e( 'Default Value', 'buddypress' ); ?>
-							</label>
-
-							<?php if ( 1 !== $j ) : ?>
-								<div class ="delete-button">
-									<a href='javascript:hide("<?php echo esc_attr( "{$type}_div{$j}" ); ?>")' class="delete"><?php esc_html_e( 'Delete', 'buddypress' ); ?></a>
-								</div>
-							<?php endif; ?>
-
-						</div>
-
-					<?php endfor; ?>
-
-					<input type="hidden" name="<?php echo esc_attr( "{$type}_option_number" ); ?>" id="<?php echo esc_attr( "{$type}_option_number" ); ?>" value="<?php echo esc_attr( $j + 1 ); ?>" />
-				<?php } ?>
-
-				<div id="<?php echo esc_attr( "{$type}_more" ); ?>"></div>
-				<p><a href="javascript:add_option('<?php echo esc_js( $type ); ?>')"><?php esc_html_e( 'Add Another Option', 'buddypress' ); ?></a></p>
-			</div>
-		</div>
-
-		<?php
-	}
-
-	/**
-	 * Allow field types to modify submitted values before they are validated.
-	 *
-	 * In some cases, it may be appropriate for a field type to catch
-	 * submitted values and modify them before they are passed to the
-	 * is_valid() method. For example, URL validation requires the
-	 * 'http://' scheme (so that the value saved in the database is always
-	 * a fully-formed URL), but in order to allow users to enter a URL
-	 * without this scheme, BP_XProfile_Field_Type_URL prepends 'http://'
-	 * when it's not present.
-	 *
-	 * By default, this is a pass-through method that does nothing. Only
-	 * override in your own field type if you need this kind of pre-
-	 * validation filtering.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param mixed $submitted_value Submitted value.
-	 * @return mixed
-	 */
-	public static function pre_validate_filter( $field_value ) {
-		return $field_value;
-	}
-
-	/**
-	 * Allow field types to modify the appearance of their values.
-	 *
-	 * By default, this is a pass-through method that does nothing. Only
-	 * override in your own field type if you need to provide custom
-	 * filtering for output values.
-	 *
-	 * @since BuddyPress (2.1.0)
-	 *
-	 * @param mixed $field_value Field value.
-	 * @return mixed
-	 */
-	public static function display_filter( $field_value ) {
-		return $field_value;
-	}
-
-	/** Protected *************************************************************/
-
-	/**
-	 * Get a sanitised and escaped string of the edit field's HTML elements and attributes.
-	 *
-	 * Must be used inside the {@link bp_profile_fields()} template loop.
-	 * This method was intended to be static but couldn't be because php.net/lsb/ requires PHP >= 5.3.
-	 *
-	 * @param array $properties Optional key/value array of attributes for this edit field.
-	 * @return string
-	 * @since BuddyPress (2.0.0)
-	 */
-	protected function get_edit_field_html_elements( array $properties = array() ) {
-
-		$r = bp_parse_args( $properties, array(
-			'id'   => bp_get_the_profile_field_input_name(),
-			'name' => bp_get_the_profile_field_input_name(),
-		) );
-
-		if ( bp_get_the_profile_field_is_required() ) {
-			$r['aria-required'] = 'true';
-		}
-
-		$html = '';
-		$r    = (array) apply_filters( 'bp_xprofile_field_edit_html_elements', $r, get_class( $this ) );
-
-		foreach ( $r as $name => $value ) {
-			$html .= sprintf( '%s="%s" ', sanitize_key( $name ), esc_attr( $value ) );
-		}
-
-		return $html;
-	}
-}
+defined( 'ABSPATH' ) || exit;
+
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-group.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-profiledata.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-datebox.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-checkbox.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-radiobutton.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-multiselectbox.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-selectbox.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-textarea.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-textbox.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-number.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-url.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-field-type-placeholder.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-meta-query.php';
+require dirname( __FILE__ ) . '/classes/class-bp-xprofile-query.php';
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
index b23d3a9ad78a7045cb8c6ce0e573888722afc4b0..1dd30278c190192c3aa4720005206cde8791ce47 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php
@@ -8,12 +8,12 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Enqueue the CSS for XProfile admin styling
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  */
 function xprofile_add_admin_css() {
 	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
@@ -27,12 +27,12 @@ function xprofile_add_admin_css() {
 		}
 	}
 }
-add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' );
+add_action( 'bp_admin_enqueue_scripts', 'xprofile_add_admin_css' );
 
 /**
  * Enqueue the jQuery libraries for handling drag/drop/sort
  *
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  */
 function xprofile_add_admin_js() {
 	if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
@@ -64,4 +64,4 @@ function xprofile_add_admin_js() {
 		wp_localize_script( 'xprofile-admin-js', 'XProfileAdmin', $strings );
 	}
 }
-add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_js', 1 );
+add_action( 'bp_admin_enqueue_scripts', 'xprofile_add_admin_js', 1 );
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
index a11bf124c2c2486903bc907742c5af40156889ac..7918dd7bcc429293ef201b4f40f7412c2f21fd9d 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php
@@ -10,7 +10,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 add_filter( 'bp_get_the_profile_group_name',            'wp_filter_kses',       1 );
 add_filter( 'bp_get_the_profile_group_description',     'wp_filter_kses',       1 );
@@ -55,6 +55,56 @@ add_filter( 'bp_xprofile_set_field_data_pre_validate',  'xprofile_filter_pre_val
 add_filter( 'xprofile_data_value_before_save',          'xprofile_sanitize_data_value_before_save', 1, 4 );
 add_filter( 'xprofile_filtered_data_value_before_save', 'trim', 2 );
 
+// Save field groups
+add_filter( 'xprofile_group_name_before_save',        'wp_filter_kses' );
+add_filter( 'xprofile_group_description_before_save', 'wp_filter_kses' );
+
+// Save fields
+add_filter( 'xprofile_field_name_before_save',         'wp_filter_kses' );
+add_filter( 'xprofile_field_type_before_save',         'wp_filter_kses' );
+add_filter( 'xprofile_field_description_before_save',  'wp_filter_kses' );
+add_filter( 'xprofile_field_order_by_before_save',     'wp_filter_kses' );
+add_filter( 'xprofile_field_is_required_before_save',  'absint' );
+add_filter( 'xprofile_field_field_order_before_save',  'absint' );
+add_filter( 'xprofile_field_option_order_before_save', 'absint' );
+add_filter( 'xprofile_field_can_delete_before_save',   'absint' );
+
+// Save field options
+add_filter( 'xprofile_field_options_before_save', 'bp_xprofile_sanitize_field_options' );
+add_filter( 'xprofile_field_default_before_save', 'bp_xprofile_sanitize_field_default' );
+
+/**
+ * Sanitize each field option name for saving to the database
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  mixed $field_options
+ * @return mixed
+ */
+function bp_xprofile_sanitize_field_options( $field_options = '' ) {
+	if ( is_array( $field_options ) ) {
+		return array_map( 'sanitize_text_field', $field_options );
+	} else {
+		return sanitize_text_field( $field_options );
+	}
+}
+
+/**
+ * Sanitize each field option default for saving to the database
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param  mixed $field_default
+ * @return mixed
+ */
+function bp_xprofile_sanitize_field_default( $field_default = '' ) {
+	if ( is_array( $field_default ) ) {
+		return array_map( 'intval', $field_default );
+	} else {
+		return intval( $field_default );
+	}
+}
+
 /**
  * xprofile_filter_kses ( $content )
  *
@@ -70,6 +120,14 @@ function xprofile_filter_kses( $content, $data_obj = null ) {
 	$xprofile_allowedtags             = $allowedtags;
 	$xprofile_allowedtags['a']['rel'] = array();
 
+	/**
+	 * Filters the allowed tags for use within xprofile_filter_kses().
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array                   $xprofile_allowedtags Array of allowed tags for profile field values.
+	 * @param BP_XProfile_ProfileData $data_obj             The BP_XProfile_ProfileData object.
+	 */
 	$xprofile_allowedtags = apply_filters( 'xprofile_allowed_tags', $xprofile_allowedtags, $data_obj );
 	return wp_kses( $content, $xprofile_allowedtags );
 }
@@ -97,6 +155,16 @@ function xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0,
 	if ( !is_array( $field_value ) ) {
 		$kses_field_value     = xprofile_filter_kses( $field_value, $data_obj );
 		$filtered_field_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
+
+		/**
+		 * Filters the kses-filtered data before saving to database.
+		 *
+		 * @since BuddyPress (1.5.0)
+		 *
+		 * @param string                  $filtered_field_value The filtered value.
+		 * @param string                  $field_value          The original value before filtering.
+		 * @param BP_XProfile_ProfileData $data_obj             The BP_XProfile_ProfileData object.
+		 */
 		$filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value, $data_obj );
 
 	// Filter each array item independently
@@ -105,6 +173,8 @@ function xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0,
 		foreach ( (array) $field_value as $value ) {
 			$kses_field_value       = xprofile_filter_kses( $value, $data_obj );
 			$filtered_value 	= wp_rel_nofollow( force_balance_tags( $kses_field_value ) );
+
+			/** This filter is documented in bp-xprofile/bp-xprofile-filters.php */
 			$filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value, $data_obj );
 
 		}
@@ -200,13 +270,13 @@ function xprofile_filter_pre_validate_value_by_field_type( $value, $field, $fiel
 /**
  * Filter an Extended Profile field value, and attempt to make clickable links
  * to members search results out of them.
- * 
+ *
  * - Not run on datebox field types
  * - Not run on values without commas with less than 5 words
  * - URL's are made clickable
  * - To disable: remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
  *
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @param string $field_value
  * @param string  $field_type
@@ -300,7 +370,7 @@ add_filter( 'comments_array', 'xprofile_filter_comments', 10, 2 );
 /**
  * Filter BP_User_Query::populate_extras to override each queries users fullname
  *
- * @since BuddyPress (1.7)
+ * @since BuddyPress (1.7.0)
  *
  * @param BP_User_Query $user_query
  * @param string $user_ids_sql
@@ -322,6 +392,30 @@ function bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_quer
 }
 add_filter( 'bp_user_query_populate_extras', 'bp_xprofile_filter_user_query_populate_extras', 2, 2 );
 
+/**
+ * Parse 'xprofile_query' argument passed to BP_User_Query.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @param BP_User_Query User query object.
+ */
+function bp_xprofile_add_xprofile_query_to_user_query( BP_User_Query $q ) {
+
+	// Bail if no `xprofile_query` clause
+	if ( empty( $q->query_vars['xprofile_query'] ) ) {
+		return;
+	}
+
+	$xprofile_query = new BP_XProfile_Query( $q->query_vars['xprofile_query'] );
+	$sql            = $xprofile_query->get_sql( 'u', $q->uid_name );
+
+	if ( ! empty( $sql['join'] ) ) {
+		$q->uid_clauses['select'] .= $sql['join'];
+		$q->uid_clauses['where'] .= $sql['where'];
+	}
+}
+add_action( 'bp_pre_user_query', 'bp_xprofile_add_xprofile_query_to_user_query' );
+
 /**
  * Filter meta queries to modify for the xprofile data schema.
  *
@@ -335,18 +429,28 @@ add_filter( 'bp_user_query_populate_extras', 'bp_xprofile_filter_user_query_popu
 function bp_xprofile_filter_meta_query( $q ) {
 	global $wpdb;
 
+	$raw_q = $q;
+
+	/*
+	 * Replace quoted content with __QUOTE__ to avoid false positives.
+	 * This regular expression will match nested quotes.
+	 */
+	$quoted_regex = "/'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'/s";
+	preg_match_all( $quoted_regex, $q, $quoted_matches );
+	$q = preg_replace( $quoted_regex, '__QUOTE__', $q );
+
 	// Get the first word of the command
 	preg_match( '/^(\S+)/', $q, $first_word_matches );
 
 	if ( empty( $first_word_matches[0] ) ) {
-		return $q;
+		return $raw_q;
 	}
 
 	// Get the field type
 	preg_match( '/xprofile_(group|field|data)_id/', $q, $matches );
 
 	if ( empty( $matches[0] ) || empty( $matches[1] ) ) {
-		return $q;
+		return $raw_q;
 	}
 
 	switch ( $first_word_matches[0] ) {
@@ -415,5 +519,13 @@ function bp_xprofile_filter_meta_query( $q ) {
 			break;
 	}
 
+	// Put quoted content back into the string.
+	if ( ! empty( $quoted_matches[0] ) ) {
+		for ( $i = 0; $i < count( $quoted_matches[0] ); $i++ ) {
+			$quote_pos = strpos( $q, '__QUOTE__' );
+			$q = substr_replace( $q, $quoted_matches[0][ $i ], $quote_pos, 9 );
+		}
+	}
+
 	return $q;
 }
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
index f6f2deedbd725707d1afe164301e2833508368ce..d84f029c41c2f684f632fa5718920a61d26628e5 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php
@@ -13,7 +13,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /*** Field Group Management **************************************************/
 
@@ -32,6 +32,14 @@ function bp_xprofile_get_groups( $args = array() ) {
 
 	$groups = BP_XProfile_Group::get( $args );
 
+	/**
+	 * Filters a set of field groups, populated with fields and field data.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $groups Array of field groups and field data.
+	 * @param array $args   Array of arguments used to query for groups.
+	 */
 	return apply_filters( 'bp_xprofile_get_groups', $groups, $args );
 }
 
@@ -146,7 +154,15 @@ function bp_xprofile_get_field_types() {
 		'textbox'        => 'BP_XProfile_Field_Type_Textbox',
 	);
 
-	// If you've added a custom field type in a plugin, register it with this filter.
+	/**
+	 * Filters the list of all xprofile field types.
+	 *
+	 * If you've added a custom field type in a plugin, register it with this filter.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $fields Array of field type/class name pairings.
+	 */
 	return apply_filters( 'bp_xprofile_get_field_types', $fields );
 }
 
@@ -173,48 +189,46 @@ function bp_xprofile_create_field_type( $type ) {
 }
 
 /**
- * Insert an xprofile field.
+ * Insert or update an xprofile field.
  *
  * @param array $args {
  *     Array of arguments.
- *     @type int $field_id Optional. Pass the ID of an existing field to edit
- *           that field.
- *     @type int $field_group_id ID of the associated field group.
- *     @type int $parent_id Optional. ID of the parent field.
- *     @type string $type Field type. Checked against a field_types whitelist.
- *     @type string $name Name of the new field.
- *     @type string $description Optional. Descriptive text for the field.
- *     @type bool $is_required Optional. Whether users must provide a value for
- *           the field. Default: false.
- *     @type bool $can_delete Optional. Whether admins can delete this field in
- *           the Dashboard interface. Generally this is true only for the Name
- *           field, which is required throughout BP. Default: true.
- *     @type string $order_by Optional. For field types that support options
- *           (such as 'radio'), this flag determines whether the sort order of
- *           the options will be 'default' (order created) or 'custom'.
- *     @type bool $is_default_option Optional. For the 'option' field type,
- *           setting this value to true means that it'll be the default value
- *           for the parent field when the user has not yet overridden.
- *     @type int $option_order Optional. For the 'option' field type, this
- *           determines the order in which the options appear.
+ *     @type int    $field_id          Optional. Pass the ID of an existing field to edit that field.
+ *     @type int    $field_group_id    ID of the associated field group.
+ *     @type int    $parent_id         Optional. ID of the parent field.
+ *     @type string $type              Field type. Checked against a field_types whitelist.
+ *     @type string $name              Name of the new field.
+ *     @type string $description       Optional. Descriptive text for the field.
+ *     @type bool   $is_required       Optional. Whether users must provide a value for the field. Default: false.
+ *     @type bool   $can_delete        Optional. Whether admins can delete this field in the Dashboard interface.
+ *                                     Generally this is false only for the Name field, which is required throughout BP.
+ *                                     Default: true.
+ *     @type string $order_by          Optional. For field types that support options (such as 'radio'), this flag
+ *                                     determines whether the sort order of the options will be 'default'
+ *                                     (order created) or 'custom'.
+ *     @type bool   $is_default_option Optional. For the 'option' field type, setting this value to true means that
+ *                                     it'll be the default value for the parent field when the user has not yet
+ *                                     overridden. Default: true.
+ *     @type int    $option_order      Optional. For the 'option' field type, this determines the order in which the
+ *                                     options appear.
  * }
  * @return bool|int False on failure, ID of new field on success.
  */
 function xprofile_insert_field( $args = '' ) {
-	global $bp;
 
 	$r = wp_parse_args( $args, array(
-		'field_id' => null,
-		'field_group_id' => null,
-		'parent_id' => null,
-		'type' => '',
-		'name' => '',
-		'description' => '',
-		'is_required' => false,
-		'can_delete' => true,
-		'order_by' => '',
+		'field_id'          => null,
+		'field_group_id'    => null,
+		'parent_id'         => null,
+		'type'              => '',
+		'name'              => '',
+		'description'       => '',
+		'is_required'       => false,
+		'can_delete'        => true,
+		'order_by'          => '',
 		'is_default_option' => false,
-		'option_order' => null,
+		'option_order'      => null,
+		'field_order'       => null,
 	) );
 
 	// field_group_id is required
@@ -222,8 +236,8 @@ function xprofile_insert_field( $args = '' ) {
 		return false;
 	}
 
-	// Check this is a valid field type
-	if ( ! in_array( $r['type'], (array) $bp->profile->field_types ) ) {
+	// Check this is a non-empty, valid field type.
+	if ( ! in_array( $r['type'], (array) buddypress()->profile->field_types ) ) {
 		return false;
 	}
 
@@ -235,46 +249,21 @@ function xprofile_insert_field( $args = '' ) {
 	}
 
 	$field->group_id = $r['field_group_id'];
+	$field->type     = $r['type'];
 
-	if ( ! empty( $r['parent_id'] ) ) {
-		$field->parent_id = $r['parent_id'];
-	}
-
-	if ( ! empty( $r['type'] ) ) {
-		$field->type = $r['type'];
-	}
-
+	// The 'name' field cannot be empty.
 	if ( ! empty( $r['name'] ) ) {
 		$field->name = $r['name'];
 	}
 
-	if ( ! empty( $r['description'] ) ) {
-		$field->description = $r['description'];
-	}
-
-	if ( ! empty( $r['is_required'] ) ) {
-		$field->is_required = $r['is_required'];
-	}
-
-	if ( ! empty( $r['can_delete'] ) ) {
-		$field->can_delete = $r['can_delete'];
-	}
-
-	if ( ! empty( $r['field_order'] ) ) {
-		$field->field_order = $r['field_order'];
-	}
-
-	if ( ! empty( $r['order_by'] ) ) {
-		$field->order_by = $r['order_by'];
-	}
-
-	if ( ! empty( $r['is_default_option'] ) ) {
-		$field->is_default_option = $r['is_default_option'];
-	}
-
-	if ( ! empty( $r['option_order'] ) ) {
-		$field->option_order = $r['option_order'];
-	}
+	$field->description       = $r['description'];
+	$field->order_by          = $r['order_by'];
+	$field->parent_id         = (int) $r['parent_id'];
+	$field->field_order       = (int) $r['field_order'];
+	$field->option_order      = (int) $r['option_order'];
+	$field->is_required       = (bool) $r['is_required'];
+	$field->can_delete        = (bool) $r['can_delete'];
+	$field->is_default_option = (bool) $r['is_default_option'];
 
 	return $field->save();
 }
@@ -330,6 +319,16 @@ function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array'
 	if ( is_array( $values ) ) {
 		$data = array();
 		foreach( (array) $values as $value ) {
+
+			/**
+			 * Filters the field data value for a specific field for the user.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param string $value    Value saved for the field.
+			 * @param int    $field_id ID of the field being displayed.
+			 * @param int    $user_id  ID of the user being displayed.
+			 */
 			$data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id );
 		}
 
@@ -337,6 +336,7 @@ function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array'
 			$data = implode( ', ', $data );
 		}
 	} else {
+		/** This filter is documented in bp-xprofile/bp-xprofile-functions.php */
 		$data = apply_filters( 'xprofile_get_field_data', $values, $field_id, $user_id );
 	}
 
@@ -563,6 +563,13 @@ function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true )
 		return false;
 	}
 
+	/**
+	 * Filters a random piece of profile data for the user.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param array $field_data Array holding random profile data.
+	 */
 	return apply_filters( 'xprofile_get_random_profile_data', $field_data );
 }
 
@@ -595,7 +602,7 @@ function xprofile_update_field_position( $field_id, $position, $field_group_id )
 }
 
 /**
- * Replace the displayed and logged-in userss fullnames with the xprofile name, if required.
+ * Replace the displayed and logged-in users fullnames with the xprofile name, if required.
  *
  * The Members component uses the logged-in user's display_name to set the
  * value of buddypress()->loggedin_user->fullname. However, in cases where
@@ -647,17 +654,19 @@ function xprofile_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) {
 		$directory = 'avatars';
 	}
 
-	$path    = bp_core_avatar_upload_path() . '/' . $directory. '/' . $user_id;
-	$newbdir = $path;
-
-	if ( ! file_exists( $path ) ) {
-		@wp_mkdir_p( $path );
-	}
-
+	$path      = bp_core_avatar_upload_path() . '/' . $directory. '/' . $user_id;
+	$newbdir   = $path;
 	$newurl    = bp_core_avatar_url() . '/' . $directory. '/' . $user_id;
 	$newburl   = $newurl;
 	$newsubdir = '/' . $directory. '/' . $user_id;
 
+	/**
+	 * Filters the avatar upload directory for a user.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param array $value Array containing the path, URL, and other helpful settings.
+	 */
 	return apply_filters( 'xprofile_avatar_upload_dir', array(
 		'path'    => $path,
 		'url'     => $newurl,
@@ -958,11 +967,19 @@ function bp_xprofile_fullname_field_id() {
  * Return the field name for the Full Name xprofile field
  *
  * @package BuddyPress
- * @since BuddyPress (1.5)
+ * @since BuddyPress (1.5.0)
  *
  * @return string The field name
  */
 function bp_xprofile_fullname_field_name() {
+
+	/**
+	 * Filters the field name for the Full Name xprofile field.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param string BP_XPROFILE_FULLNAME_FIELD_NAME Full name field constant.
+	 */
 	return apply_filters( 'bp_xprofile_fullname_field_name', BP_XPROFILE_FULLNAME_FIELD_NAME );
 }
 
@@ -972,9 +989,15 @@ function bp_xprofile_fullname_field_name() {
  * @return array
  */
 function bp_xprofile_get_visibility_levels() {
-	global $bp;
 
-	return apply_filters( 'bp_xprofile_get_visibility_levels', $bp->profile->visibility_levels );
+	/**
+	 * Filters the visibility levels out of the $bp global.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $visibility_levels Array of visibility levels.
+	 */
+	return apply_filters( 'bp_xprofile_get_visibility_levels', buddypress()->profile->visibility_levels );
 }
 
 /**
@@ -985,7 +1008,7 @@ function bp_xprofile_get_visibility_levels() {
  * profile viewer). Then, based on that relationship, we query for the set of fields that should
  * be excluded from the profile loop.
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  * @see BP_XProfile_Group::get()
  * @uses apply_filters() Filter bp_xprofile_get_hidden_fields_for_user to modify visibility levels,
  *   or if you have added your own custom levels
@@ -1011,6 +1034,15 @@ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren
 	$hidden_levels = bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id, $current_user_id );
 	$hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
 
+	/**
+	 * Filters the ids of fields that are hidden for this displayed/loggedin user pair.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param array $hidden_fields     Array of hidden fields for the displayed/logged in user.
+	 * @param int   $displayed_user_id ID of the displayed user.
+	 * @param int   $current_user_id   ID of the current user.
+	 */
 	return apply_filters( 'bp_xprofile_get_hidden_fields_for_user', $hidden_fields, $displayed_user_id, $current_user_id );
 }
 
@@ -1054,13 +1086,22 @@ function bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id = 0, $c
 		$hidden_levels = array( 'friends', 'loggedin', 'adminsonly', );
 	}
 
+	/**
+	 * Filters the visibility levels that should be hidden for this user pair.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $hidden_fields     Array of hidden fields for the displayed/logged in user.
+	 * @param int   $displayed_user_id ID of the displayed user.
+	 * @param int   $current_user_id   ID of the current user.
+	 */
 	return apply_filters( 'bp_xprofile_get_hidden_field_types_for_user', $hidden_levels, $displayed_user_id, $current_user_id );
 }
 
 /**
  * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels
  *
- * @since BuddyPress (1.6)
+ * @since BuddyPress (1.6.0)
  * @see bp_xprofile_get_hidden_fields_for_user()
  *
  * @param int $user_id The id of the profile owner
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
index 4e9fd6780bdf2f36fd60a342130116e3555a45f2..31474cc7650acb5d4573b9c89c061d65dcc35f53 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php
@@ -11,13 +11,14 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 class BP_XProfile_Component extends BP_Component {
+
 	/**
 	 * Profile field types
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 * @var array
 	 */
 	public $field_types;
@@ -26,14 +27,15 @@ class BP_XProfile_Component extends BP_Component {
 	 * The acceptable visibility levels for xprofile fields.
 	 *
 	 * @see bp_xprofile_get_visibility_levels()
-	 * @since BuddyPress (1.6)
+	 * @since BuddyPress (1.6.0)
+	 * @var array
 	 */
-	var $visibility_levels = array();
+	public $visibility_levels = array();
 
 	/**
 	 * Start the xprofile component creation process
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	public function __construct() {
 		parent::start(
@@ -66,8 +68,9 @@ class BP_XProfile_Component extends BP_Component {
 			'functions',
 		);
 
-		if ( is_admin() )
+		if ( is_admin() ) {
 			$includes[] = 'admin';
+		}
 
 		parent::includes( $includes );
 	}
@@ -78,27 +81,34 @@ class BP_XProfile_Component extends BP_Component {
 	 * The BP_XPROFILE_SLUG constant is deprecated, and only used here for
 	 * backwards compatibility.
 	 *
-	 * @since BuddyPress (1.5)
+	 * @since BuddyPress (1.5.0)
 	 */
 	public function setup_globals( $args = array() ) {
 		$bp = buddypress();
 
 		// Define a slug, if necessary
-		if ( !defined( 'BP_XPROFILE_SLUG' ) )
+		if ( !defined( 'BP_XPROFILE_SLUG' ) ) {
 			define( 'BP_XPROFILE_SLUG', 'profile' );
+		}
 
 		// Assign the base group and fullname field names to constants
 		// to use in SQL statements.
 		// Defined conditionally to accommodate unit tests
 		if ( ! defined( 'BP_XPROFILE_BASE_GROUP_NAME' ) ) {
-			define( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( $bp->site_options['bp-xprofile-base-group-name'] ) );
+			define( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( bp_core_get_root_option( 'avatar_default' ) ) );
 		}
 
 		if ( ! defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) ) {
-			define( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ) );
+			define( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( bp_core_get_root_option( 'bp-xprofile-fullname-field-name' ) ) );
 		}
 
-		// Set the support field type ids
+		/**
+		 * Filters the supported field type IDs.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param array $value Array of IDs for the supported field types.
+		 */
 		$this->field_types = apply_filters( 'xprofile_field_types', array_keys( bp_xprofile_get_field_types() ) );
 
 		// 'option' is a special case. It is not a top-level field, so
@@ -251,7 +261,7 @@ class BP_XProfile_Component extends BP_Component {
 		$settings_slug = bp_get_settings_slug();
 
 		bp_core_new_subnav_item( array(
-			'name'            => _x( 'Profile', 'Profile settings  sub nav', 'buddypress' ),
+			'name'            => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ),
 			'slug'            => 'profile',
 			'parent_url'      => trailingslashit( $user_domain . $settings_slug ),
 			'parent_slug'     => $settings_slug,
@@ -346,6 +356,24 @@ class BP_XProfile_Component extends BP_Component {
 		parent::setup_title();
 	}
 
+	/**
+	 * Setup cache groups
+	 *
+	 * @since BuddyPress (2.2.0)
+	 */
+	public function setup_cache_groups() {
+
+		// Global groups
+		wp_cache_add_global_groups( array(
+			'bp_xprofile',
+			'bp_xprofile_data',
+			'bp_xprofile_groups',
+			'xprofile_meta'
+		) );
+
+		parent::setup_cache_groups();
+	}
+
 	/**
 	 * Adds "Settings > Profile" subnav item under the "Settings" adminbar menu.
 	 *
@@ -373,7 +401,8 @@ class BP_XProfile_Component extends BP_Component {
 function bp_setup_xprofile() {
 	$bp = buddypress();
 
-	if ( !isset( $bp->profile->id ) )
+	if ( ! isset( $bp->profile->id ) ) {
 		$bp->profile = new BP_XProfile_Component();
+	}
 }
-add_action( 'bp_setup_components', 'bp_setup_xprofile', 2 );
\ No newline at end of file
+add_action( 'bp_setup_components', 'bp_setup_xprofile', 2 );
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
index 2b9412e2c134b01982753346cc8c6f578be4ce2e..7fb00b51f202bf25f11f66989b4b73d53359c72f 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php
@@ -12,7 +12,7 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
 /**
  * Handles the display of the profile page by loading the correct template file.
@@ -23,7 +23,22 @@ if ( !defined( 'ABSPATH' ) ) exit;
 function xprofile_screen_display_profile() {
 	$new = isset( $_GET['new'] ) ? $_GET['new'] : '';
 
+	/**
+	 * Fires right before the loading of the XProfile screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $new $_GET parameter holding the "new" parameter.
+	 */
 	do_action( 'xprofile_screen_display_profile', $new );
+
+	/**
+	 * Filters the template to load for the XProfile screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the XProfile template to load.
+	 */
 	bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/home' ) );
 }
 
@@ -131,15 +146,35 @@ function xprofile_screen_edit_profile() {
 				if ( ! $field_updated ) {
 					$errors = true;
 				} else {
+
+					/**
+					 * Fires on each iteration of an XProfile field being saved with no error.
+					 *
+					 * @since BuddyPress (1.1.0)
+					 *
+					 * @param int    $field_id ID of the field that was saved.
+					 * @param string $value    Value that was saved to the field.
+					 */
 					do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
 				}
 			}
 
+			/**
+			 * Fires after all XProfile fields have been saved for the current profile.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param int   $value            Displayed user ID.
+			 * @param array $posted_field_ids Array of field IDs that were edited.
+			 * @param bool  $errors           Whether or not any errors occurred.
+			 * @param array $old_values       Array of original values before updated.
+			 * @param array $new_values       Array of newly saved values after update.
+			 */
 			do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values );
 
 			// Set the feedback messages
 			if ( !empty( $errors ) ) {
-				bp_core_add_message( __( 'There was a problem updating some of your profile information; please try again.', 'buddypress' ), 'error' );
+				bp_core_add_message( __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' ), 'error' );
 			} else {
 				bp_core_add_message( __( 'Changes saved.', 'buddypress' ) );
 			}
@@ -149,7 +184,20 @@ function xprofile_screen_edit_profile() {
 		}
 	}
 
+	/**
+	 * Fires right before the loading of the XProfile edit screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'xprofile_screen_edit_profile' );
+
+	/**
+	 * Filters the template to load for the XProfile edit screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the XProfile edit template to load.
+	 */
 	bp_core_load_template( apply_filters( 'xprofile_template_edit_profile', 'members/single/home' ) );
 }
 
@@ -211,14 +259,32 @@ function xprofile_screen_change_avatar() {
 		if ( ! bp_core_avatar_handle_crop( $args ) ) {
 			bp_core_add_message( __( 'There was a problem cropping your profile photo.', 'buddypress' ), 'error' );
 		} else {
+
+			/**
+			 * Fires right before the redirect, after processing a new avatar.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
 			do_action( 'xprofile_avatar_uploaded' );
 			bp_core_add_message( __( 'Your new profile photo was uploaded successfully.', 'buddypress' ) );
 			bp_core_redirect( bp_displayed_user_domain() );
 		}
 	}
 
+	/**
+	 * Fires right before the loading of the XProfile change avatar screen template file.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
 	do_action( 'xprofile_screen_change_avatar' );
 
+	/**
+	 * Filters the template to load for the XProfile change avatar screen.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @param string $template Path to the XProfile change avatar template to load.
+	 */
 	bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/home' ) );
 }
 
@@ -235,6 +301,12 @@ function bp_xprofile_screen_settings() {
 		return;
 	}
 
-	// Load the template
+	/**
+	 * Filters the template to load for the XProfile settings screen.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param string $template Path to the XProfile change avatar template to load.
+	 */
 	bp_core_load_template( apply_filters( 'bp_settings_screen_xprofile', '/members/single/settings/profile' ) );
 }
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-settings.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-settings.php
index c5ade72e896ffb5b6314635a5d21f4f5b4bc8942..aef3a137742f9edeffb6090dd5aff92bd968d625 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-settings.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-settings.php
@@ -6,8 +6,8 @@
  * @since BuddyPress (2.0.0)
  *
  * @param array $args
- * 
- * 
+ *
+ *
  * @return array
  */
 function bp_xprofile_get_settings_fields( $args = '' ) {
@@ -34,7 +34,7 @@ function bp_xprofile_get_settings_fields( $args = '' ) {
  * @since BuddyPress (2.0.0)
  *
  * @uses bp_core_add_message()
- * @usse bp_is_my_profile()
+ * @uses bp_is_my_profile()
  */
 function bp_xprofile_settings_add_feedback_message() {
 
diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
index 5c9e53fc27671fb0d41bd47efac22da6ecce995f..fbbb1249ce53ea523e0221eb9fcf84a551be99e6 100644
--- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
+++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php
@@ -8,54 +8,190 @@
  */
 
 // Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) exit;
+defined( 'ABSPATH' ) || exit;
 
+/**
+ * The main profile template loop class.
+ *
+ * This is responsible for loading profile field, group, and data and displaying it.
+ *
+ * @since BuddyPress (1.0.0)
+ */
 class BP_XProfile_Data_Template {
-	var $current_group = -1;
-	var $group_count;
-	var $groups;
-	var $group;
-
-	var $current_field = -1;
-	var $field_count;
-	var $field_has_data;
-	var $field;
-
-	var $in_the_loop;
-	var $user_id;
-
-	function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_visibility_level = false, $update_meta_cache = true ) {
-		$this->groups = bp_xprofile_get_groups( array(
-			'profile_group_id'    => $profile_group_id,
-			'user_id'             => $user_id,
-			'hide_empty_groups'   => $hide_empty_groups,
-			'hide_empty_fields'   => $hide_empty_fields,
-			'fetch_fields'        => $fetch_fields,
-			'fetch_field_data'    => $fetch_field_data,
-			'fetch_visibility_level' => $fetch_visibility_level,
-			'exclude_groups'      => $exclude_groups,
-			'exclude_fields'      => $exclude_fields,
-			'update_meta_cache'   => $update_meta_cache,
+
+    /**
+     * The loop iterator.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var int
+     */
+	public $current_group = -1;
+
+    /**
+     * The number of groups returned by the paged query.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var int
+     */
+	public $group_count;
+
+    /**
+     * Array of groups located by the query.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var array
+     */
+	public $groups;
+
+    /**
+     * The group object currently being iterated on.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var object
+     */
+	public $group;
+
+    /**
+     * The current field.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var int
+     */
+	public $current_field = -1;
+
+    /**
+     * The field count.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var int
+     */
+	public $field_count;
+
+    /**
+     * Field has data.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var bool
+     */
+	public $field_has_data;
+
+    /**
+     * The field.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var int
+     */
+	public $field;
+
+    /**
+     * A flag for whether the loop is currently being iterated.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var bool
+     */
+	public $in_the_loop;
+
+    /**
+     * The user ID.
+     *
+     * @since BuddyPress (1.5.0)
+     * @access public
+     * @var int
+     */
+	public $user_id;
+
+	/**
+	 * Get activity items, as specified by parameters
+	 *
+	 * @param array $args {
+	 *     An array of arguments. All items are optional.
+	 *
+	 *     @type int       $user_id                 Fetch field data for this user ID
+	 *     @type int       $profile_group_id        Field group to fetch fields & data for
+	 *     @type int|bool  $hide_empty_groups       Should empty field groups be skipped
+	 *     @type int|bool  $fetch_fields            Fetch fields for field group
+	 *     @type int|bool  $fetch_field_data        Fetch field data for fields in group
+	 *     @type array     $exclude_groups          Exclude these field groups
+	 *     @type array     $exclude_fields          Exclude these fields
+	 *     @type int|bool  $hide_empty_fields       Should empty fields be skipped
+	 *     @type int|bool  $fetch_visibility_level  Fetch visibility levels
+	 *     @type int|bool  $update_meta_cache       Should metadata cache be updated
+	 * }
+	 */
+	public function __construct( $args = '' ) {
+
+		// Backward compatibility with old method of passing arguments
+		if ( ! is_array( $args ) || func_num_args() > 1 ) {
+			_deprecated_argument( __METHOD__, '2.3.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__ ) );
+
+			$old_args_keys = array(
+				0 => 'user_id',
+				1 => 'profile_group_id',
+				2 => 'hide_empty_groups',
+				3 => 'fetch_fields',
+				4 => 'fetch_field_data',
+				5 => 'exclude_groups',
+				6 => 'exclude_fields',
+				7 => 'hide_empty_fields',
+				8 => 'fetch_visibility_level',
+				9 => 'update_meta_cache'
+			);
+
+			$func_args = func_get_args();
+			$args      = bp_core_parse_args_array( $old_args_keys, $func_args );
+		}
+
+		$r = wp_parse_args( $args, array(
+			'profile_group_id'       => false,
+			'user_id'                => false,
+			'hide_empty_groups'      => false,
+			'hide_empty_fields'      => false,
+			'fetch_fields'           => false,
+			'fetch_field_data'       => false,
+			'fetch_visibility_level' => false,
+			'exclude_groups'         => false,
+			'exclude_fields'         => false,
+			'update_meta_cache'      => true
 		) );
 
-		$this->group_count = count($this->groups);
-		$this->user_id = $user_id;
+		$this->groups      = bp_xprofile_get_groups( $r );
+		$this->group_count = count( $this->groups );
+		$this->user_id     = $r['user_id'];
 	}
 
-	function has_groups() {
-		if ( $this->group_count )
+	public function has_groups() {
+		if ( ! empty( $this->group_count ) ) {
 			return true;
+		}
 
 		return false;
 	}
 
-	function next_group() {
+	public function next_group() {
 		$this->current_group++;
 
-		$this->group       = $this->groups[$this->current_group];
+		$this->group       = $this->groups[ $this->current_group ];
 		$this->field_count = 0;
 
-		if( ! empty( $this->group->fields ) ) {
+		if ( ! empty( $this->group->fields ) ) {
+
+			/**
+			 * Filters the group fields for the next_group method.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param array $fields Array of fields for the group.
+			 * @param int   $id     ID of the field group.
+			 */
 			$this->group->fields = apply_filters( 'xprofile_group_fields', $this->group->fields, $this->group->id );
 			$this->field_count   = count( $this->group->fields );
 		}
@@ -63,18 +199,25 @@ class BP_XProfile_Data_Template {
 		return $this->group;
 	}
 
-	function rewind_groups() {
+	public function rewind_groups() {
 		$this->current_group = -1;
 		if ( $this->group_count > 0 ) {
 			$this->group = $this->groups[0];
 		}
 	}
 
-	function profile_groups() {
+	public function profile_groups() {
 		if ( $this->current_group + 1 < $this->group_count ) {
 			return true;
 		} elseif ( $this->current_group + 1 == $this->group_count ) {
-			do_action('xprofile_template_loop_end');
+
+			/**
+			 * Fires right before the rewinding of profile groups.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'xprofile_template_loop_end' );
+
 			// Do some cleaning up after the loop
 			$this->rewind_groups();
 		}
@@ -83,50 +226,56 @@ class BP_XProfile_Data_Template {
 		return false;
 	}
 
-	function the_profile_group() {
+	public function the_profile_group() {
 		global $group;
 
 		$this->in_the_loop = true;
 		$group = $this->next_group();
 
-		if ( 0 == $this->current_group ) // loop has just started
-			do_action('xprofile_template_loop_start');
+		// loop has just started
+		if ( 0 === $this->current_group ) {
+
+			/**
+			 * Fires if the current group is the first in the loop.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 */
+			do_action( 'xprofile_template_loop_start' );
+		}
 	}
 
-	/**** FIELDS ****/
+	/** Fields ****************************************************************/
 
-	function next_field() {
+	public function next_field() {
 		$this->current_field++;
 
-		$this->field = $this->group->fields[$this->current_field];
+		$this->field = $this->group->fields[ $this->current_field ];
+
 		return $this->field;
 	}
 
-	function rewind_fields() {
+	public function rewind_fields() {
 		$this->current_field = -1;
 		if ( $this->field_count > 0 ) {
 			$this->field = $this->group->fields[0];
 		}
 	}
 
-	function has_fields() {
+	public function has_fields() {
 		$has_data = false;
 
 		for ( $i = 0, $count = count( $this->group->fields ); $i < $count; ++$i ) {
-			$field = &$this->group->fields[$i];
+			$field = &$this->group->fields[ $i ];
 
-			if ( !empty( $field->data ) && $field->data->value != null ) {
+			if ( ! empty( $field->data ) && ( $field->data->value != null ) ) {
 				$has_data = true;
 			}
 		}
 
-		if ( $has_data )
-			return true;
-
-		return false;
+		return $has_data;
 	}
 
-	function profile_fields() {
+	public function profile_fields() {
 		if ( $this->current_field + 1 < $this->field_count ) {
 			return true;
 		} elseif ( $this->current_field + 1 == $this->field_count ) {
@@ -137,19 +286,19 @@ class BP_XProfile_Data_Template {
 		return false;
 	}
 
-	function the_profile_field() {
+	public function the_profile_field() {
 		global $field;
 
 		$field = $this->next_field();
 
 		// Valid field values of 0 or '0' get caught by empty(), so we have an extra check for these. See #BP5731
-		if ( ! empty( $field->data ) && ( ! empty( $field->data->value ) || '0' == $field->data->value ) ) {
+		if ( ! empty( $field->data ) && ( ! empty( $field->data->value ) || ( '0' === $field->data->value ) ) ) {
 			$value = maybe_unserialize( $field->data->value );
 		} else {
 			$value = false;
 		}
 
-		if ( ! empty( $value ) || '0' == $value ) {
+		if ( ! empty( $value ) || ( '0' === $value ) ) {
 			$this->field_has_data = true;
 		} else {
 			$this->field_has_data = false;
@@ -157,12 +306,22 @@ class BP_XProfile_Data_Template {
 	}
 }
 
+/**
+ * Query for XProfile groups and fields
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @global object $profile_template
+ * @param  array  $args
+ *
+ * @return bool
+ */
 function bp_has_profile( $args = '' ) {
 	global $profile_template;
 
-	// Only show empty fields if we're on the Dashboard, or we're on a user's profile edit page,
-	// or this is a registration page
-	$hide_empty_fields_default = ( !is_network_admin() && !is_admin() && !bp_is_user_profile_edit() && !bp_is_register_page() );
+	// Only show empty fields if we're on the Dashboard, or we're on a user's
+	// profile edit page, or this is a registration page
+	$hide_empty_fields_default = ( ! is_network_admin() && ! is_admin() && ! bp_is_user_profile_edit() && ! bp_is_register_page() );
 
 	// We only need to fetch visibility levels when viewing your own profile
 	if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) || bp_is_register_page() ) {
@@ -171,23 +330,31 @@ function bp_has_profile( $args = '' ) {
 		$fetch_visibility_level_default = false;
 	}
 
-	$defaults = array(
-		'user_id'             => bp_displayed_user_id(),
-		'profile_group_id'    => false,
-		'hide_empty_groups'   => true,
-		'hide_empty_fields'   => $hide_empty_fields_default,
-		'fetch_fields'        => true,
-		'fetch_field_data'    => true,
+	// Parse arguments
+	$r = bp_parse_args( $args, array(
+		'user_id'                => bp_displayed_user_id(),
+		'profile_group_id'       => false,
+		'hide_empty_groups'      => true,
+		'hide_empty_fields'      => $hide_empty_fields_default,
+		'fetch_fields'           => true,
+		'fetch_field_data'       => true,
 		'fetch_visibility_level' => $fetch_visibility_level_default,
-		'exclude_groups'      => false, // Comma-separated list of profile field group IDs to exclude
-		'exclude_fields'      => false,  // Comma-separated list of profile field IDs to exclude
-		'update_meta_cache'   => true,
-	);
+		'exclude_groups'         => false, // Comma-separated list of profile field group IDs to exclude
+		'exclude_fields'         => false, // Comma-separated list of profile field IDs to exclude
+		'update_meta_cache'      => true,
+	), 'has_profile' );
 
-	$r = bp_parse_args( $args, $defaults, 'has_profile' );
-	extract( $r, EXTR_SKIP );
+	// Populate the template loop global
+	$profile_template = new BP_XProfile_Data_Template( $r );
 
-	$profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_visibility_level, $update_meta_cache );
+	/**
+	 * Filters whether or not a group has a profile to display.
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param bool   $has_groups       Whether or not there are group profiles to display.
+	 * @param string $profile_template Current profile template being used.
+	 */
 	return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
 }
 
@@ -214,8 +381,9 @@ function bp_field_css_class( $class = false ) {
 
 		$css_classes = array();
 
-		if ( $class )
+		if ( ! empty( $class ) ) {
 			$css_classes[] = sanitize_title( esc_attr( $class ) );
+		}
 
 		// Set a class with the field ID
 		$css_classes[] = 'field_' . $profile_template->field->id;
@@ -233,12 +401,28 @@ function bp_field_css_class( $class = false ) {
 		// Add the field visibility level
 		$css_classes[] = 'visibility-' . esc_attr( bp_get_the_profile_field_visibility_level() );
 
-		if ( $profile_template->current_field % 2 == 1 )
+		if ( $profile_template->current_field % 2 == 1 ) {
 			$css_classes[] = 'alt';
+		}
 
 		$css_classes[] = 'field_type_' . sanitize_title( $profile_template->field->type );
+
+		/**
+		 * Filters the field classes to be applied to a field.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param array $css_classes Array of classes to be applied to field. Passed by reference.
+		 */
 		$css_classes = apply_filters_ref_array( 'bp_field_css_classes', array( &$css_classes ) );
 
+		/**
+		 * Filters the class HTML attribute to be used on a field.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value class HTML attribute with imploded classes.
+		 */
 		return apply_filters( 'bp_get_field_css_class', ' class="' . implode( ' ', $css_classes ) . '"' );
 	}
 
@@ -250,8 +434,9 @@ function bp_field_has_data() {
 function bp_field_has_public_data() {
 	global $profile_template;
 
-	if ( $profile_template->field_has_data )
+	if ( ! empty( $profile_template->field_has_data ) ) {
 		return true;
+	}
 
 	return false;
 }
@@ -261,6 +446,14 @@ function bp_the_profile_group_id() {
 }
 	function bp_get_the_profile_group_id() {
 		global $group;
+
+		/**
+		 * Filters the profile group ID.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $id ID for the profile group.
+		 */
 		return apply_filters( 'bp_get_the_profile_group_id', $group->id );
 	}
 
@@ -269,6 +462,14 @@ function bp_the_profile_group_name() {
 }
 	function bp_get_the_profile_group_name() {
 		global $group;
+
+		/**
+		 * Filters the profile group name.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $name Name for the profile group.
+		 */
 		return apply_filters( 'bp_get_the_profile_group_name', $group->name );
 	}
 
@@ -277,6 +478,14 @@ function bp_the_profile_group_slug() {
 }
 	function bp_get_the_profile_group_slug() {
 		global $group;
+
+		/**
+		 * Filters the profile group slug.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Slug for the profile group.
+		 */
 		return apply_filters( 'bp_get_the_profile_group_slug', sanitize_title( $group->name ) );
 	}
 
@@ -285,6 +494,14 @@ function bp_the_profile_group_description() {
 }
 	function bp_get_the_profile_group_description() {
 		global $group;
+
+		/**
+		 * Filters the profile group description.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $description Description for the profile group.
+		 */
 		return apply_filters( 'bp_get_the_profile_group_description', $group->description );
 	}
 
@@ -292,8 +509,18 @@ function bp_the_profile_group_edit_form_action() {
 	echo bp_get_the_profile_group_edit_form_action();
 }
 	function bp_get_the_profile_group_edit_form_action() {
-		global $bp, $group;
+		global $group;
 
+		$bp = buddypress();
+
+		/**
+		 * Filters the action for the profile group edit form.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value URL for the action attribute on the
+		 *                      profile group edit form.
+		 */
 		return apply_filters( 'bp_get_the_profile_group_edit_form_action', trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . $group->id ) );
 	}
 
@@ -341,6 +568,13 @@ function bp_the_profile_field_ids() {
 
 		$field_ids = implode( ',', wp_parse_id_list( $field_ids ) );
 
+		/**
+		 * Filters the comma-separated list of field IDs.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param string $field_ids Comma-separated field IDs.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_ids', $field_ids );
 	}
 
@@ -359,6 +593,14 @@ function bp_the_profile_field_id() {
 }
 	function bp_get_the_profile_field_id() {
 		global $field;
+
+		/**
+		 * Filters the profile field ID.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param int $id ID for the profile field.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_id', $field->id );
 	}
 
@@ -368,6 +610,13 @@ function bp_the_profile_field_name() {
 	function bp_get_the_profile_field_name() {
 		global $field;
 
+		/**
+		 * Filters the profile field name.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $name Name for the profile field.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_name', $field->name );
 	}
 
@@ -379,6 +628,15 @@ function bp_the_profile_field_value() {
 
 		$field->data->value = bp_unserialize_profile_field( $field->data->value );
 
+		/**
+		 * Filters the profile field value.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $value Value for the profile field.
+		 * @param string $type  Type for the profile field.
+		 * @param int    $id    ID for the profile field.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
 	}
 
@@ -392,23 +650,33 @@ function bp_the_profile_field_edit_value() {
 		 * Check to see if the posted value is different, if it is re-display this
 		 * value as long as it's not empty and a required field.
 		 */
-		if ( !isset( $field->data ) ) {
+		if ( ! isset( $field->data ) ) {
 			$field->data = new stdClass;
 		}
 
-		if ( !isset( $field->data->value ) ) {
+		if ( ! isset( $field->data->value ) ) {
 			$field->data->value = '';
 		}
 
 		if ( isset( $_POST['field_' . $field->id] ) && $field->data->value != $_POST['field_' . $field->id] ) {
-			if ( !empty( $_POST['field_' . $field->id] ) )
+			if ( ! empty( $_POST['field_' . $field->id] ) ) {
 				$field->data->value = $_POST['field_' . $field->id];
-			else
+			} else {
 				$field->data->value = '';
+			}
 		}
 
 		$field_value = isset( $field->data->value ) ? bp_unserialize_profile_field( $field->data->value ) : '';
 
+		/**
+		 * Filters the profile field edit value.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $field_value Current field edit value.
+		 * @param string $type        Type for the profile field.
+		 * @param int    $id          ID for the profile field.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_edit_value', $field_value, $field->type, $field->id );
 	}
 
@@ -418,6 +686,13 @@ function bp_the_profile_field_type() {
 	function bp_get_the_profile_field_type() {
 		global $field;
 
+		/**
+		 * Filters the profile field type.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $type Type for the profile field.
+		 */
 		return apply_filters( 'bp_the_profile_field_type', $field->type );
 	}
 
@@ -427,6 +702,13 @@ function bp_the_profile_field_description() {
 	function bp_get_the_profile_field_description() {
 		global $field;
 
+		/**
+		 * Filters the profile field description.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $description Description for the profile field.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_description', $field->description );
 	}
 
@@ -436,6 +718,13 @@ function bp_the_profile_field_input_name() {
 	function bp_get_the_profile_field_input_name() {
 		global $field;
 
+		/**
+		 * Filters the profile field input name.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Value used for the name attribute on an input.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_input_name', 'field_' . $field->id );
 	}
 
@@ -448,7 +737,7 @@ function bp_the_profile_field_input_name() {
  * following fashion:
  *   do_action( bp_get_the_profile_field_errors_action() );
  *
- * @since BuddyPress (1.8)
+ * @since BuddyPress (1.8.0)
  * @return string The _errors action name corresponding to this profile field
  */
 function bp_get_the_profile_field_errors_action() {
@@ -463,7 +752,7 @@ function bp_get_the_profile_field_errors_action() {
  * 'radio', 'checkbox', and 'datebox'.
  *
  * @package BuddyPress Xprofile
- * @since BuddyPress (1.1)
+ * @since BuddyPress (1.1.0)
  *
  * @uses bp_get_the_profile_field_options()
  *
@@ -478,7 +767,7 @@ function bp_the_profile_field_options( $args = array() ) {
 	 * Retrieves field options HTML for field types of 'selectbox', 'multiselectbox', 'radio', 'checkbox', and 'datebox'.
 	 *
 	 * @package BuddyPress Xprofile
-	 * @since BuddyPress (1.1)
+	 * @since BuddyPress (1.1.0)
 	 *
 	 * @uses BP_XProfile_Field::get_children()
 	 * @uses BP_XProfile_ProfileData::get_value_byid()
@@ -507,8 +796,9 @@ function bp_the_profile_field_options( $args = array() ) {
 			$field_obj = new BP_XProfile_Field( $field->id );
 
 			foreach ( $field as $field_prop => $field_prop_value ) {
-				if ( ! isset( $field_obj->{$field_prop} ) )
+				if ( ! isset( $field_obj->{$field_prop} ) ) {
 					$field_obj->{$field_prop} = $field_prop_value;
+				}
 			}
 
 			$field = $field_obj;
@@ -532,13 +822,21 @@ function bp_the_profile_field_is_required() {
 		$retval = false;
 
 		// Super admins can skip required check
-		if ( bp_current_user_can( 'bp_moderate' ) && !is_admin() )
+		if ( bp_current_user_can( 'bp_moderate' ) && !is_admin() ) {
 			$retval = false;
 
 		// All other users will use the field's setting
-		elseif ( isset( $field->is_required ) )
+		} elseif ( isset( $field->is_required ) ) {
 			$retval = $field->is_required;
+		}
 
+		/**
+		 * Filters whether or not a profile field is required.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param bool $retval Whether or not the field is required.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_is_required', (bool) $retval );
 	}
 
@@ -563,6 +861,13 @@ function bp_the_profile_field_visibility_level() {
 			$retval = ! empty( $field->visibility_level ) ? $field->visibility_level : 'public';
 		}
 
+		/**
+		 * Filters the profile field visibility level.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $retval Field visibility level.
+		 */
 		return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval );
 	}
 
@@ -589,7 +894,14 @@ function bp_the_profile_field_visibility_level_label() {
 
 		$fields = bp_xprofile_get_visibility_levels();
 
-		return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] );
+		/**
+		 * Filters the profile field visibility level label.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $retval Field visibility level label.
+		 */
+		return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[ $level ]['label'] );
 	}
 
 
@@ -608,15 +920,19 @@ function bp_profile_field_data( $args = '' ) {
 }
 	function bp_get_profile_field_data( $args = '' ) {
 
-		$defaults = array(
+		$r = wp_parse_args( $args, array(
 			'field'   => false, // Field name or ID.
 			'user_id' => bp_displayed_user_id()
-		);
-
-		$r = wp_parse_args( $args, $defaults );
-		extract( $r, EXTR_SKIP );
+		) );
 
-		return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $field, $user_id ) );
+		/**
+		 * Filters the profile field data.
+		 *
+		 * @since BuddyPress (1.2.0)
+		 *
+		 * @param mixed $value Profile data for a specific field for the user.
+		 */
+		return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $r['field'], $r['user_id'] ) );
 	}
 
 /**
@@ -627,13 +943,20 @@ function bp_profile_field_data( $args = '' ) {
  * @return object $groups
  */
 function bp_profile_get_field_groups() {
-	$groups = wp_cache_get( 'xprofile_groups_inc_empty', 'bp' );
 
-	if ( empty( $groups ) ) {
+	$groups = wp_cache_get( 'all', 'bp_xprofile_groups' );
+	if ( false === $groups ) {
 		$groups = bp_xprofile_get_groups( array( 'fetch_fields' => true ) );
-		wp_cache_set( 'xprofile_groups_inc_empty', $groups, 'bp' );
+		wp_cache_set( 'all', $groups, 'bp_xprofile' );
 	}
 
+	/**
+	 * Filters all profile field groups.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param array $groups Array of available profile field groups.
+	 */
 	return apply_filters( 'bp_profile_get_field_groups', $groups );
 }
 
@@ -646,40 +969,88 @@ function bp_profile_get_field_groups() {
  */
 function bp_profile_has_multiple_groups() {
 	$has_multiple_groups = count( (array) bp_profile_get_field_groups() ) > 1;
+
+	/**
+	 * Filters if there is more than one group of fields for the profile being edited.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param bool $has_multiple_groups Whether or not there are multiple groups.
+	 */
 	return (bool) apply_filters( 'bp_profile_has_multiple_groups', $has_multiple_groups );
 }
 
 /**
  * Output the tabs to switch between profile field groups.
  *
+ * @since BuddyPress (1.0.0)
+ *
  * @return string Field group tabs markup.
  */
 function bp_profile_group_tabs() {
-	global $bp, $group_name;
+	echo bp_get_profile_group_tabs();
 
-	$groups = bp_profile_get_field_groups();
+	/**
+	 * Fires at the end of the tab output for switching between profile field
+	 * groups. This action is in a strange place for legacy reasons.
+	 *
+	 * @since BuddyPress (1.0.0)
+	 */
+	do_action( 'xprofile_profile_group_tabs' );
+}
 
-	if ( empty( $group_name ) )
-		$group_name = bp_profile_group_name(false);
+/**
+ * Return the XProfile group tabs
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @return string
+ */
+function bp_get_profile_group_tabs() {
+
+	// Get field group data
+	$groups     = bp_profile_get_field_groups();
+	$group_name = bp_get_profile_group_name();
+	$tabs       = array();
 
-	$tabs = array();
+	// Loop through field groups and put a tab-lst together
 	for ( $i = 0, $count = count( $groups ); $i < $count; ++$i ) {
-		if ( $group_name == $groups[$i]->name )
+
+		// Setup the selected class
+		$selected = '';
+		if ( $group_name === $groups[ $i ]->name ) {
 			$selected = ' class="current"';
-		else
-			$selected = '';
+		}
 
-		if ( !empty( $groups[$i]->fields ) ) {
-			$link = trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . $groups[$i]->id );
-			$tabs[] = sprintf( '<li %1$s><a href="%2$s">%3$s</a></li>', $selected, $link, esc_html( $groups[$i]->name ) );
+		// Skip if group has no fields
+		if ( empty( $groups[ $i ]->fields ) ) {
+			continue;
 		}
+
+		// Build the profile field group link
+		$link   = trailingslashit( bp_displayed_user_domain() . buddypress()->profile->slug . '/edit/group/' . $groups[ $i ]->id );
+
+		// Add tab to end of tabs array
+		$tabs[] = sprintf(
+			'<li %1$s><a href="%2$s">%3$s</a></li>',
+			$selected,
+			esc_url( $link ),
+			esc_html( apply_filters( 'bp_get_the_profile_group_name', $groups[ $i ]->name ) )
+		);
 	}
 
+	/**
+	 * Filters the tabs to display for profile field groups.
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @param array  $tabs       Array of tabs to display.
+	 * @param array  $groups     Array of profile groups.
+	 * @param string $group_name Name of the current group displayed.
+	 */
 	$tabs = apply_filters( 'xprofile_filter_profile_group_tabs', $tabs, $groups, $group_name );
-	foreach ( (array) $tabs as $tab )
-		echo $tab;
 
-	do_action( 'xprofile_profile_group_tabs' );
+	return join( '', $tabs );
 }
 
 function bp_profile_group_name( $deprecated = true ) {
@@ -690,17 +1061,23 @@ function bp_profile_group_name( $deprecated = true ) {
 	}
 }
 	function bp_get_profile_group_name() {
-		if ( !$group_id = bp_action_variable( 1 ) )
-			$group_id = 1;
 
-		if ( !is_numeric( $group_id ) )
+		// Check action variable
+		$group_id = bp_action_variable( 1 );
+		if ( empty( $group_id ) || ! is_numeric( $group_id ) ) {
 			$group_id = 1;
-
-		if ( !$group = wp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) {
-			$group = new BP_XProfile_Group($group_id);
-			wp_cache_set( 'xprofile_group_' . $group_id, $group, 'bp' );
 		}
 
+		// Check for cached group
+		$group = new BP_XProfile_Group( $group_id );
+
+		/**
+		 * Filters the profile group name.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param string $name Name of the profile group.
+		 */
 		return apply_filters( 'bp_get_profile_group_name', $group->name );
 	}
 
@@ -708,8 +1085,8 @@ function bp_profile_last_updated() {
 
 	$last_updated = bp_get_profile_last_updated();
 
-	if ( !$last_updated ) {
-		_e( 'Profile not recently updated', 'buddypress' ) . '.';
+	if ( empty( $last_updated ) ) {
+		_e( 'Profile not recently updated.', 'buddypress' );
 	} else {
 		echo $last_updated;
 	}
@@ -718,8 +1095,17 @@ function bp_profile_last_updated() {
 
 		$last_updated = bp_get_user_meta( bp_displayed_user_id(), 'profile_last_updated', true );
 
-		if ( $last_updated )
-			return apply_filters( 'bp_get_profile_last_updated', sprintf( __('Profile updated %s', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) );
+		if ( ! empty( $last_updated ) ) {
+
+			/**
+			 * Filters the formatted string used to display when a profile was last updated.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param string $value Formatted last updated indicator string.
+			 */
+			return apply_filters( 'bp_get_profile_last_updated', sprintf( __( 'Profile updated %s', 'buddypress' ), bp_core_time_since( strtotime( $last_updated ) ) ) );
+		}
 
 		return false;
 	}
@@ -728,25 +1114,43 @@ function bp_current_profile_group_id() {
 	echo bp_get_current_profile_group_id();
 }
 	function bp_get_current_profile_group_id() {
-		if ( !$profile_group_id = bp_action_variable( 1 ) )
+		$profile_group_id = bp_action_variable( 1 );
+		if ( empty( $profile_group_id ) ) {
 			$profile_group_id = 1;
+		}
 
-		return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id ); // admin/profile/edit/[group-id]
+		/**
+		 * Filters the current profile group ID.
+		 *
+		 * Possible values are admin/profile/edit/[group-id]
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $profile_group_id Current profile group ID.
+		 */
+		return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id );
 	}
 
 function bp_avatar_delete_link() {
 	echo bp_get_avatar_delete_link();
 }
 	function bp_get_avatar_delete_link() {
-		global $bp;
+		$bp = buddypress();
 
+		/**
+		 * Filters the link used for deleting an avatar.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $value Nonced URL used for deleting an avatar.
+		 */
 		return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . $bp->profile->slug . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) );
 	}
 
 function bp_edit_profile_button() {
-	global $bp;
+	$bp = buddypress();
 
-	bp_button( array (
+	bp_button( array(
 		'id'                => 'edit_profile',
 		'component'         => 'xprofile',
 		'must_be_logged_in' => true,
@@ -817,6 +1221,15 @@ function bp_profile_visibility_radio_buttons( $args = '' ) {
 			$retval = ob_get_clean();
 		endif;
 
+		/**
+		 * Filters the radio buttons for setting visibility.
+		 *
+		 * @since BuddyPress (1.6.0)
+		 *
+		 * @param string $retval HTML output for the visibility radio buttons.
+		 * @param array  $r      Parsed arguments to be used with display.
+		 * @param array  $args   Original passed in arguments to be used with display.
+		 */
 		return apply_filters( 'bp_profile_get_visibility_radio_buttons', $retval, $r, $args );
 	}
 
@@ -880,6 +1293,14 @@ function bp_profile_settings_visibility_select( $args = '' ) {
 			$retval = ob_get_clean();
 		endif;
 
-		// Output the dropdown list
+		/**
+		 * Filters the dropdown list for setting visibility.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string $retval HTML output for the visibility dropdown list.
+		 * @param array  $r      Parsed arguments to be used with display.
+		 * @param array  $args   Original passed in arguments to be used with display.
+		 */
 		return apply_filters( 'bp_profile_settings_visibility_select', $retval, $r, $args );
 	}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php
new file mode 100644
index 0000000000000000000000000000000000000000..88019460db3ac834f8c0b58b2902ffd090c85f9f
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php
@@ -0,0 +1,188 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Checkbox xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the checkbox field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Checkboxes', 'xprofile field type', 'buddypress' );
+
+		$this->supports_multiple_defaults = true;
+		$this->accepts_null_value         = true;
+		$this->supports_options           = true;
+
+		$this->set_format( '/^.+$/', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Checkbox class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Checkbox $this Current instance of
+		 *                                              the field type checkbox.
+		 */
+		do_action( 'bp_xprofile_field_type_checkbox', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.checkbox.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that we pass to
+		// {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			$user_id = (int) $raw_properties['user_id'];
+			unset( $raw_properties['user_id'] );
+		} else {
+			$user_id = bp_displayed_user_id();
+		} ?>
+
+		<div class="checkbox">
+			<label for="<?php bp_the_profile_field_input_name(); ?>">
+				<?php bp_the_profile_field_name(); ?>
+				<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+					<?php esc_html_e( '(required)', 'buddypress' ); ?>
+				<?php endif; ?>
+			</label>
+
+			<?php
+
+			/** This action is documented in bp-xprofile/bp-xprofile-classes */
+			do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+			<?php bp_the_profile_field_options( array(
+				'user_id' => $user_id
+			) ); ?>
+
+		</div>
+
+		<?php
+	}
+
+	/**
+	 * Output the edit field options HTML for this field type.
+	 *
+	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
+	 * These are stored separately in the database, and their templating is handled separately.
+	 *
+	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
+	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_options_html( array $args = array() ) {
+		$options       = $this->field_obj->get_children();
+		$option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ) );
+		$option_values = ( $option_values ) ? (array) $option_values : array();
+
+		$html = '';
+
+		// Check for updated posted values, but errors preventing them from
+		// being saved first time
+		if ( isset( $_POST['field_' . $this->field_obj->id] ) && $option_values != maybe_serialize( $_POST['field_' . $this->field_obj->id] ) ) {
+			if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
+				$option_values = array_map( 'sanitize_text_field', $_POST['field_' . $this->field_obj->id] );
+			}
+		}
+
+		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+			$selected = '';
+
+			// First, check to see whether the user's saved values match the option
+			for ( $j = 0, $count_values = count( $option_values ); $j < $count_values; ++$j ) {
+
+				// Run the allowed option name through the before_save filter,
+				// so we'll be sure to get a match
+				$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
+
+				if ( $option_values[$j] === $allowed_options || in_array( $allowed_options, $option_values ) ) {
+					$selected = ' checked="checked"';
+					break;
+				}
+			}
+
+			// If the user has not yet supplied a value for this field, check to
+			// see whether there is a default value available
+			if ( empty( $option_values ) && empty( $selected ) && ! empty( $options[$k]->is_default_option ) ) {
+				$selected = ' checked="checked"';
+			}
+
+			$new_html = sprintf( '<label><input %1$s type="checkbox" name="%2$s" id="%3$s" value="%4$s">%5$s</label>',
+				$selected,
+				esc_attr( "field_{$this->field_obj->id}[]" ),
+				esc_attr( "field_{$options[$k]->id}_{$k}" ),
+				esc_attr( stripslashes( $options[$k]->name ) ),
+				esc_html( stripslashes( $options[$k]->name ) )
+			);
+
+			/**
+			 * Filters the HTML output for an individual field options checkbox.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param string $new_html Label and checkbox input field.
+			 * @param object $value    Current option being rendered for.
+			 * @param int    $id       ID of the field object being rendered.
+			 * @param string $selected Current selected value.
+			 * @param string $k        Current index in the foreach loop.
+			 */
+			$html .= apply_filters( 'bp_get_the_profile_field_options_checkbox', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
+		}
+
+		echo $html;
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+		bp_the_profile_field_options();
+	}
+
+	/**
+	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
+		parent::admin_new_field_html( $current_field, 'checkbox' );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
new file mode 100644
index 0000000000000000000000000000000000000000..5a39a6f331bcf01c03fc4c1ad56549a88d652e95
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
@@ -0,0 +1,307 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Datebox xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the datebox field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Date Selector', 'xprofile field type', 'buddypress' );
+
+		$this->set_format( '/^\d{4}-\d{1,2}-\d{1,2} 00:00:00$/', 'replace' ); // "Y-m-d 00:00:00"
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Datebox class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Datebox $this Current instance of
+		 *                                             the field type datebox.
+		 */
+		do_action( 'bp_xprofile_field_type_datebox', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that we pass to
+		// {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			$user_id = (int) $raw_properties['user_id'];
+			unset( $raw_properties['user_id'] );
+		} else {
+			$user_id = bp_displayed_user_id();
+		}
+
+		$day_r = bp_parse_args( $raw_properties, array(
+			'id'   => bp_get_the_profile_field_input_name() . '_day',
+			'name' => bp_get_the_profile_field_input_name() . '_day'
+		) );
+
+		$month_r = bp_parse_args( $raw_properties, array(
+			'id'   => bp_get_the_profile_field_input_name() . '_month',
+			'name' => bp_get_the_profile_field_input_name() . '_month'
+		) );
+
+		$year_r = bp_parse_args( $raw_properties, array(
+			'id'   => bp_get_the_profile_field_input_name() . '_year',
+			'name' => bp_get_the_profile_field_input_name() . '_year'
+		) ); ?>
+
+		<div class="datebox">
+
+			<label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+			<?php
+
+			/**
+			 * Fires after field label and displays associated errors for the field.
+			 *
+			 * This is a dynamic hook that is dependent on the associated
+			 * field ID. The hooks will be similar to `bp_field_12_errors`
+			 * where the 12 is the field ID. Simply replace the 12 with
+			 * your needed target ID.
+			 *
+			 * @since BuddyPress (1.8.0)
+			 */
+			do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+			<select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
+				<?php bp_the_profile_field_options( array(
+					'type'    => 'day',
+					'user_id' => $user_id
+				) ); ?>
+			</select>
+
+			<select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
+				<?php bp_the_profile_field_options( array(
+					'type'    => 'month',
+					'user_id' => $user_id
+				) ); ?>
+			</select>
+
+			<select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
+				<?php bp_the_profile_field_options( array(
+					'type'    => 'year',
+					'user_id' => $user_id
+				) ); ?>
+			</select>
+
+		</div>
+	<?php
+	}
+
+	/**
+	 * Output the edit field options HTML for this field type.
+	 *
+	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
+	 * These are stored separately in the database, and their templating is handled separately.
+	 *
+	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
+	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_options_html( array $args = array() ) {
+
+		$date       = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
+		$day        = 0;
+		$month      = 0;
+		$year       = 0;
+		$html       = '';
+		$eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
+
+		// Set day, month, year defaults
+		if ( ! empty( $date ) ) {
+
+			// If Unix timestamp
+			if ( is_numeric( $date ) ) {
+				$day   = date( 'j', $date );
+				$month = date( 'F', $date );
+				$year  = date( 'Y', $date );
+
+			// If MySQL timestamp
+			} else {
+				$day   = mysql2date( 'j', $date );
+				$month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below
+				$year  = mysql2date( 'Y', $date );
+			}
+		}
+
+		// Check for updated posted values, and errors preventing them from
+		// being saved first time.
+		if ( ! empty( $_POST['field_' . $this->field_obj->id . '_day'] ) ) {
+			$new_day = (int) $_POST['field_' . $this->field_obj->id . '_day'];
+			$day     = ( $day != $new_day ) ? $new_day : $day;
+		}
+
+		if ( ! empty( $_POST['field_' . $this->field_obj->id . '_month'] ) ) {
+			if ( in_array( $_POST['field_' . $this->field_obj->id . '_month'], $eng_months ) ) {
+				$new_month = $_POST['field_' . $this->field_obj->id . '_month'];
+			} else {
+				$new_month = $month;
+			}
+
+			$month = ( $month !== $new_month ) ? $new_month : $month;
+		}
+
+		if ( ! empty( $_POST['field_' . $this->field_obj->id . '_year'] ) ) {
+			$new_year = (int) $_POST['field_' . $this->field_obj->id . '_year'];
+			$year     = ( $year != $new_year ) ? $new_year : $year;
+		}
+
+		// $type will be passed by calling function when needed
+		switch ( $args['type'] ) {
+			case 'day':
+				$html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $day, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) );
+
+				for ( $i = 1; $i < 32; ++$i ) {
+					$html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', (int) $i, selected( $day, $i, false ), (int) $i );
+				}
+			break;
+
+			case 'month':
+				$months = array(
+					__( 'January',   'buddypress' ),
+					__( 'February',  'buddypress' ),
+					__( 'March',     'buddypress' ),
+					__( 'April',     'buddypress' ),
+					__( 'May',       'buddypress' ),
+					__( 'June',      'buddypress' ),
+					__( 'July',      'buddypress' ),
+					__( 'August',    'buddypress' ),
+					__( 'September', 'buddypress' ),
+					__( 'October',   'buddypress' ),
+					__( 'November',  'buddypress' ),
+					__( 'December',  'buddypress' )
+				);
+
+				$html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $month, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) );
+
+				for ( $i = 0; $i < 12; ++$i ) {
+					$html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $eng_months[$i] ), selected( $month, $eng_months[$i], false ), $months[$i] );
+				}
+			break;
+
+			case 'year':
+				$html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $year, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) );
+
+				for ( $i = 2037; $i > 1901; $i-- ) {
+					$html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', (int) $i, selected( $year, $i, false ), (int) $i );
+				}
+			break;
+		}
+
+		/**
+		 * Filters the output for the profile field datebox.
+		 *
+		 * @since BuddyPress (1.1.0)
+		 *
+		 * @param string $html  HTML output for the field.
+		 * @param string $value Which date type is being rendered for.
+		 * @param string $day   Date formatted for the current day.
+		 * @param string $month Date formatted for the current month.
+		 * @param string $year  Date formatted for the current year.
+		 * @param int    $id    ID of the field object being rendered.
+		 * @param string $date  Current date.
+		 */
+		echo apply_filters( 'bp_get_the_profile_field_datebox', $html, $args['type'], $day, $month, $year, $this->field_obj->id, $date );
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+
+		$day_r = bp_parse_args( $raw_properties, array(
+			'id'   => bp_get_the_profile_field_input_name() . '_day',
+			'name' => bp_get_the_profile_field_input_name() . '_day'
+		) );
+
+		$month_r = bp_parse_args( $raw_properties, array(
+			'id'   => bp_get_the_profile_field_input_name() . '_month',
+			'name' => bp_get_the_profile_field_input_name() . '_month'
+		) );
+
+		$year_r = bp_parse_args( $raw_properties, array(
+			'id'   => bp_get_the_profile_field_input_name() . '_year',
+			'name' => bp_get_the_profile_field_input_name() . '_year'
+		) ); ?>
+
+		<select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
+			<?php bp_the_profile_field_options( array( 'type' => 'day' ) ); ?>
+		</select>
+
+		<select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
+			<?php bp_the_profile_field_options( array( 'type' => 'month' ) ); ?>
+		</select>
+
+		<select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
+			<?php bp_the_profile_field_options( array( 'type' => 'year' ) ); ?>
+		</select>
+
+	<?php
+	}
+
+	/**
+	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
+	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
+
+	/**
+	 * Format Date values for display.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param string $field_value The date value, as saved in the database.
+	 *        Typically, this is a MySQL-formatted date string (Y-m-d H:i:s).
+	 * @return string Date formatted by bp_format_time().
+	 */
+	public static function display_filter( $field_value ) {
+
+		// If Unix timestamp
+		if ( ! is_numeric( $field_value ) ) {
+			$field_value = strtotime( $field_value );
+		}
+
+		return bp_format_time( $field_value, true, false );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php
new file mode 100644
index 0000000000000000000000000000000000000000..6c26e7ad4725b20292aff8d6076a7c646def3f22
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php
@@ -0,0 +1,196 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Multi-selectbox xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the multi-selectbox field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Multi Select Box', 'xprofile field type', 'buddypress' );
+
+		$this->supports_multiple_defaults = true;
+		$this->accepts_null_value         = true;
+		$this->supports_options           = true;
+
+		$this->set_format( '/^.+$/', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Multiselectbox class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Multiselectbox $this Current instance of
+		 *                                                    the field type multiple select box.
+		 */
+		do_action( 'bp_xprofile_field_type_multiselectbox', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/select.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that we pass to
+		// {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			$user_id = (int) $raw_properties['user_id'];
+			unset( $raw_properties['user_id'] );
+		} else {
+			$user_id = bp_displayed_user_id();
+		}
+
+		$r = bp_parse_args( $raw_properties, array(
+			'multiple' => 'multiple',
+			'id'       => bp_get_the_profile_field_input_name() . '[]',
+			'name'     => bp_get_the_profile_field_input_name() . '[]',
+		) ); ?>
+
+		<label for="<?php bp_the_profile_field_input_name(); ?>[]"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
+
+		<?php
+
+		/** This action is documented in bp-xprofile/bp-xprofile-classes */
+		do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+		<select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+			<?php bp_the_profile_field_options( array(
+				'user_id' => $user_id
+			) ); ?>
+		</select>
+
+		<?php if ( ! bp_get_the_profile_field_is_required() ) : ?>
+
+			<a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>[]' );">
+				<?php esc_html_e( 'Clear', 'buddypress' ); ?>
+			</a>
+
+		<?php endif; ?>
+	<?php
+	}
+
+	/**
+	 * Output the edit field options HTML for this field type.
+	 *
+	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
+	 * These are stored separately in the database, and their templating is handled separately.
+	 *
+	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
+	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_options_html( array $args = array() ) {
+		$original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ) );
+
+		$options = $this->field_obj->get_children();
+		$html    = '';
+
+		if ( empty( $original_option_values ) && ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
+			$original_option_values = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
+		}
+
+		$option_values = ( $original_option_values ) ? (array) $original_option_values : array();
+		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+			$selected = '';
+
+			// Check for updated posted values, but errors preventing them from
+			// being saved first time
+			foreach( $option_values as $i => $option_value ) {
+				if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id][$i] != $option_value ) {
+					if ( ! empty( $_POST['field_' . $this->field_obj->id][$i] ) ) {
+						$option_values[] = sanitize_text_field( $_POST['field_' . $this->field_obj->id][$i] );
+					}
+				}
+			}
+
+			// Run the allowed option name through the before_save filter, so
+			// we'll be sure to get a match
+			$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
+
+			// First, check to see whether the user-entered value matches
+			if ( in_array( $allowed_options, $option_values ) ) {
+				$selected = ' selected="selected"';
+			}
+
+			// Then, if the user has not provided a value, check for defaults
+			if ( ! is_array( $original_option_values ) && empty( $option_values ) && ! empty( $options[$k]->is_default_option ) ) {
+				$selected = ' selected="selected"';
+			}
+
+			/**
+			 * Filters the HTML output for options in a multiselect input.
+			 *
+			 * @since BuddyPress (1.5.0)
+			 *
+			 * @param string $value    Option tag for current value being rendered.
+			 * @param object $value    Current option being rendered for.
+			 * @param int    $id       ID of the field object being rendered.
+			 * @param string $selected Current selected value.
+			 * @param string $k        Current index in the foreach loop.
+			 */
+			$html .= apply_filters( 'bp_get_the_profile_field_options_multiselect', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_html( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $this->field_obj->id, $selected, $k );
+		}
+
+		echo $html;
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+		$r = bp_parse_args( $raw_properties, array(
+			'multiple' => 'multiple'
+		) ); ?>
+
+		<select <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+			<?php bp_the_profile_field_options(); ?>
+		</select>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
+		parent::admin_new_field_html( $current_field, 'checkbox' );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-number.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-number.php
new file mode 100644
index 0000000000000000000000000000000000000000..0e75057767dffe59e232b611c84a1e2e4557d174
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-number.php
@@ -0,0 +1,107 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Number xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the number field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Number', 'xprofile field type', 'buddypress' );
+
+		$this->set_format( '/^\d+|-\d+$/', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Number class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Number $this Current instance of
+		 *                                            the field type number.
+		 */
+		do_action( 'bp_xprofile_field_type_number', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that certain other fields
+		// types pass to {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			unset( $raw_properties['user_id'] );
+		}
+
+		$r = bp_parse_args( $raw_properties, array(
+			'type'  => 'number',
+			'value' =>  bp_get_the_profile_field_edit_value()
+		) ); ?>
+
+		<label for="<?php bp_the_profile_field_input_name(); ?>">
+			<?php bp_the_profile_field_name(); ?>
+			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+				<?php esc_html_e( '(required)', 'buddypress' ); ?>
+			<?php endif; ?>
+		</label>
+
+		<?php
+
+		/** This action is documented in bp-xprofile/bp-xprofile-classes */
+		do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+		$r = bp_parse_args( $raw_properties, array(
+			'type' => 'number'
+		) ); ?>
+
+		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+	<?php
+	}
+
+	/**
+	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
+	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php
new file mode 100644
index 0000000000000000000000000000000000000000..6bc038f9175d96079afa3d2e4cf96795dfe00968
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-placeholder.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * A placeholder xprofile field type. Doesn't do anything.
+ *
+ * Used if an existing field has an unknown type (e.g. one provided by a missing third-party plugin).
+ *
+ * @since BuddyPress (2.0.1)
+ */
+class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the placeholder field type.
+	 *
+	 * @since BuddyPress (2.0.1)
+	 */
+	public function __construct() {
+		$this->set_format( '/.*/', 'replace' );
+	}
+
+	/**
+	 * Prevent any HTML being output for this field type.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.1)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+	}
+
+	/**
+	 * Prevent any HTML being output for this field type.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.1)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+	}
+
+	/**
+	 * Prevent any HTML being output for this field type.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.1)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php
new file mode 100644
index 0000000000000000000000000000000000000000..40f04da5170233805c1673a43459e801503cff83
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php
@@ -0,0 +1,191 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Radio button xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the radio button field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Radio Buttons', 'xprofile field type', 'buddypress' );
+
+		$this->supports_options = true;
+
+		$this->set_format( '/^.+$/', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Radiobutton class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Radiobutton $this Current instance of
+		 *                                                 the field type radio button.
+		 */
+		do_action( 'bp_xprofile_field_type_radiobutton', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.radio.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that we pass to
+		// {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			$user_id = (int) $raw_properties['user_id'];
+			unset( $raw_properties['user_id'] );
+		} else {
+			$user_id = bp_displayed_user_id();
+		} ?>
+
+		<div class="radio">
+
+			<label for="<?php bp_the_profile_field_input_name(); ?>">
+				<?php bp_the_profile_field_name(); ?>
+				<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+					<?php esc_html_e( '(required)', 'buddypress' ); ?>
+				<?php endif; ?>
+			</label>
+
+			<?php
+
+			/** This action is documented in bp-xprofile/bp-xprofile-classes */
+			do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+			<?php bp_the_profile_field_options( array( 'user_id' => $user_id ) );
+
+			if ( ! bp_get_the_profile_field_is_required() ) : ?>
+
+				<a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>' );">
+					<?php esc_html_e( 'Clear', 'buddypress' ); ?>
+				</a>
+
+			<?php endif; ?>
+
+		</div>
+
+		<?php
+	}
+
+	/**
+	 * Output the edit field options HTML for this field type.
+	 *
+	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
+	 * These are stored separately in the database, and their templating is handled separately.
+	 *
+	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
+	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_options_html( array $args = array() ) {
+		$option_value = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
+		$options      = $this->field_obj->get_children();
+
+		$html = sprintf( '<div id="%s">', esc_attr( 'field_' . $this->field_obj->id ) );
+
+		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+
+			// Check for updated posted values, but errors preventing them from
+			// being saved first time
+			if ( isset( $_POST['field_' . $this->field_obj->id] ) && $option_value != $_POST['field_' . $this->field_obj->id] ) {
+				if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
+					$option_value = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
+				}
+			}
+
+			// Run the allowed option name through the before_save filter, so
+			// we'll be sure to get a match
+			$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
+			$selected        = '';
+
+			if ( $option_value === $allowed_options || ( empty( $option_value ) && ! empty( $options[$k]->is_default_option ) ) ) {
+				$selected = ' checked="checked"';
+			}
+
+			$new_html = sprintf( '<label><input %1$s type="radio" name="%2$s" id="%3$s" value="%4$s">%5$s</label>',
+				$selected,
+				esc_attr( "field_{$this->field_obj->id}" ),
+				esc_attr( "option_{$options[$k]->id}" ),
+				esc_attr( stripslashes( $options[$k]->name ) ),
+				esc_html( stripslashes( $options[$k]->name ) )
+			);
+
+			/**
+			 * Filters the HTML output for an individual field options radio button.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param string $new_html Label and radio input field.
+			 * @param object $value    Current option being rendered for.
+			 * @param int    $id       ID of the field object being rendered.
+			 * @param string $selected Current selected value.
+			 * @param string $k        Current index in the foreach loop.
+			 */
+			$html .= apply_filters( 'bp_get_the_profile_field_options_radio', $new_html, $options[$k], $this->field_obj->id, $selected, $k );
+		}
+
+		echo $html . '</div>';
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+		bp_the_profile_field_options();
+
+		if ( bp_get_the_profile_field_is_required() ) {
+			return;
+		} ?>
+
+		<a class="clear-value" href="javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>' );">
+			<?php esc_html_e( 'Clear', 'buddypress' ); ?>
+		</a>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
+		parent::admin_new_field_html( $current_field, 'radio' );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php
new file mode 100644
index 0000000000000000000000000000000000000000..85578fc1b9ed7a68cef9010914ee4938b4ba6ded
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php
@@ -0,0 +1,182 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Selectbox xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the selectbox field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Multi Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Drop Down Select Box', 'xprofile field type', 'buddypress' );
+
+		$this->supports_options = true;
+
+		$this->set_format( '/^.+$/', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Selectbox class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Selectbox $this Current instance of
+		 *                                               the field type select box.
+		 */
+		do_action( 'bp_xprofile_field_type_selectbox', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/select.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that we pass to
+		// {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			$user_id = (int) $raw_properties['user_id'];
+			unset( $raw_properties['user_id'] );
+		} else {
+			$user_id = bp_displayed_user_id();
+		} ?>
+
+		<label for="<?php bp_the_profile_field_input_name(); ?>">
+			<?php bp_the_profile_field_name(); ?>
+			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+				<?php esc_html_e( '(required)', 'buddypress' ); ?>
+			<?php endif; ?>
+		</label>
+
+		<?php
+
+		/** This action is documented in bp-xprofile/bp-xprofile-classes */
+		do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+		<select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
+			<?php bp_the_profile_field_options( array( 'user_id' => $user_id ) ); ?>
+		</select>
+
+		<?php
+	}
+
+	/**
+	 * Output the edit field options HTML for this field type.
+	 *
+	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
+	 * These are stored separately in the database, and their templating is handled separately.
+	 *
+	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
+	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_options_html( array $args = array() ) {
+		$original_option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] ) );
+
+		$options = $this->field_obj->get_children();
+		$html    = '<option value="">' . /* translators: no option picked in select box */ esc_html__( '----', 'buddypress' ) . '</option>';
+
+		if ( empty( $original_option_values ) && !empty( $_POST['field_' . $this->field_obj->id] ) ) {
+			$original_option_values = sanitize_text_field(  $_POST['field_' . $this->field_obj->id] );
+		}
+
+		$option_values = ( $original_option_values ) ? (array) $original_option_values : array();
+		for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) {
+			$selected = '';
+
+			// Check for updated posted values, but errors preventing them from
+			// being saved first time
+			foreach( $option_values as $i => $option_value ) {
+				if ( isset( $_POST['field_' . $this->field_obj->id] ) && $_POST['field_' . $this->field_obj->id] != $option_value ) {
+					if ( ! empty( $_POST['field_' . $this->field_obj->id] ) ) {
+						$option_values[$i] = sanitize_text_field( $_POST['field_' . $this->field_obj->id] );
+					}
+				}
+			}
+
+			// Run the allowed option name through the before_save filter, so
+			// we'll be sure to get a match
+			$allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false );
+
+			// First, check to see whether the user-entered value matches
+			if ( in_array( $allowed_options, $option_values ) ) {
+				$selected = ' selected="selected"';
+			}
+
+			// Then, if the user has not provided a value, check for defaults
+			if ( ! is_array( $original_option_values ) && empty( $option_values ) && $options[$k]->is_default_option ) {
+				$selected = ' selected="selected"';
+			}
+
+			/**
+			 * Filters the HTML output for options in a select input.
+			 *
+			 * @since BuddyPress (1.1.0)
+			 *
+			 * @param string $value    Option tag for current value being rendered.
+			 * @param object $value    Current option being rendered for.
+			 * @param int    $id       ID of the field object being rendered.
+			 * @param string $selected Current selected value.
+			 * @param string $k        Current index in the foreach loop.
+			 */
+			$html .= apply_filters( 'bp_get_the_profile_field_options_select', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_html( stripslashes( $options[$k]->name ) ) . '</option>', $options[$k], $this->field_obj->id, $selected, $k );
+		}
+
+		echo $html;
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+		?>
+
+		<select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>>
+			<?php bp_the_profile_field_options(); ?>
+		</select>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
+		parent::admin_new_field_html( $current_field, 'radio' );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php
new file mode 100644
index 0000000000000000000000000000000000000000..fb985e067c5514b078734888e5de976b8d20a070
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php
@@ -0,0 +1,109 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Textarea xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the textarea field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Multi-line Text Area', 'xprofile field type', 'buddypress' );
+
+		$this->set_format( '/^.*$/m', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Textarea class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Textarea $this Current instance of
+		 *                                              the field type textarea.
+		 */
+		do_action( 'bp_xprofile_field_type_textarea', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that certain other fields
+		// types pass to {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			unset( $raw_properties['user_id'] );
+		}
+
+		$r = bp_parse_args( $raw_properties, array(
+			'cols' => 40,
+			'rows' => 5,
+		) ); ?>
+
+		<label for="<?php bp_the_profile_field_input_name(); ?>">
+			<?php bp_the_profile_field_name(); ?>
+			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+				<?php esc_html_e( '(required)', 'buddypress' ); ?>
+			<?php endif; ?>
+		</label>
+
+		<?php
+
+		/** This action is documented in bp-xprofile/bp-xprofile-classes */
+		do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+		<textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>><?php bp_the_profile_field_edit_value(); ?></textarea>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+		$r = bp_parse_args( $raw_properties, array(
+			'cols' => 40,
+			'rows' => 5,
+		) ); ?>
+
+		<textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>></textarea>
+
+		<?php
+	}
+
+	/**
+	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
+	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php
new file mode 100644
index 0000000000000000000000000000000000000000..80cc45a254d42208fab864ca1f48b0d019beb458
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php
@@ -0,0 +1,109 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Textbox xprofile field type.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the textbox field type
+	 *
+	 * @since BuddyPress (2.0.0)
+ 	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'Text Box', 'xprofile field type', 'buddypress' );
+
+		$this->set_format( '/^.*$/', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_Textbox class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_Textbox $this Current instance of
+		 *                                             the field type text box.
+		 */
+		do_action( 'bp_xprofile_field_type_textbox', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// user_id is a special optional parameter that certain other fields
+		// types pass to {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			unset( $raw_properties['user_id'] );
+		}
+
+		$r = bp_parse_args( $raw_properties, array(
+			'type'  => 'text',
+			'value' => bp_get_the_profile_field_edit_value(),
+		) ); ?>
+
+		<label for="<?php bp_the_profile_field_input_name(); ?>">
+			<?php bp_the_profile_field_name(); ?>
+			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+				<?php esc_html_e( '(required)', 'buddypress' ); ?>
+			<?php endif; ?>
+		</label>
+
+		<?php
+
+		/** This action is documented in bp-xprofile/bp-xprofile-classes */
+		do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+
+		$r = bp_parse_args( $raw_properties, array(
+			'type' => 'text'
+		) ); ?>
+
+		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+
+		<?php
+	}
+
+	/**
+	 * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields
+	 * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-url.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-url.php
new file mode 100644
index 0000000000000000000000000000000000000000..c1a2dc71598f19ce081c396cfbeae5e0951ede16
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-url.php
@@ -0,0 +1,163 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * URL xprofile field type.
+ *
+ * @since BuddyPress (2.1.0)
+ */
+class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type {
+
+	/**
+	 * Constructor for the URL field type
+	 *
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function __construct() {
+		parent::__construct();
+
+		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
+		$this->name     = _x( 'URL', 'xprofile field type', 'buddypress' );
+
+		$this->set_format( '_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS', 'replace' );
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type_URL class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type_URL $this Current instance of
+		 *                                         the field type URL.
+		 */
+		do_action( 'bp_xprofile_field_type_url', $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of
+	 *        {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes}
+	 *        that you want to add.
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function edit_field_html( array $raw_properties = array() ) {
+
+		// `user_id` is a special optional parameter that certain other
+		// fields types pass to {@link bp_the_profile_field_options()}.
+		if ( isset( $raw_properties['user_id'] ) ) {
+			unset( $raw_properties['user_id'] );
+		}
+
+		$r = bp_parse_args( $raw_properties, array(
+			'type'      => 'text',
+			'inputmode' => 'url',
+			'value'     => esc_url( bp_get_the_profile_field_edit_value() ),
+		) ); ?>
+
+		<label for="<?php bp_the_profile_field_input_name(); ?>">
+			<?php bp_the_profile_field_name(); ?>
+			<?php if ( bp_get_the_profile_field_is_required() ) : ?>
+				<?php esc_html_e( '(required)', 'buddypress' ); ?>
+			<?php endif; ?>
+		</label>
+
+		<?php
+
+		/** This action is documented in bp-xprofile/bp-xprofile-classes */
+		do_action( bp_get_the_profile_field_errors_action() ); ?>
+
+		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+
+		<?php
+	}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted
+	 *        attributes that you want to add.
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function admin_field_html( array $raw_properties = array() ) {
+
+		$r = bp_parse_args( $raw_properties, array(
+			'type' => 'url'
+		) ); ?>
+
+		<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
+
+		<?php
+	}
+
+	/**
+	 * This method usually outputs HTML for this field type's children options
+	 * on the wp-admin Profile Fields "Add Field" and "Edit Field" screens, but
+	 * for this field type, we don't want it, so it's stubbed out.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.1.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
+
+	/**
+	 * Modify submitted URL values before validation.
+	 *
+	 * The URL validation regex requires a http(s) protocol, so that all
+	 * values saved in the database are fully-formed URLs. However, we
+	 * still want to allow users to enter URLs without a protocol, for a
+	 * better user experience. So we catch submitted URL values, and if
+	 * the protocol is missing, we prepend 'http://' before passing to
+	 * is_valid().
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param string $submitted_value Raw value submitted by the user.
+	 * @return string
+	 */
+	public static function pre_validate_filter( $submitted_value = '' ) {
+
+		// Allow empty URL values
+		if ( empty( $submitted_value ) ) {
+			return '';
+		}
+
+		// Run some checks on the submitted value
+		if ( false === strpos( $submitted_value, ':'  )
+		     && substr( $submitted_value, 0, 1 ) !== '/'
+		     && substr( $submitted_value, 0, 1 ) !== '#'
+		     && ! preg_match( '/^[a-z0-9-]+?\.php/i', $submitted_value )
+		) {
+			$submitted_value = 'http://' . $submitted_value;
+		}
+
+		return $submitted_value;
+	}
+
+	/**
+	 * Format URL values for display.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param string $field_value The URL value, as saved in the database.
+	 * @return string URL converted to a link.
+	 */
+	public static function display_filter( $field_value ) {
+		$link      = strip_tags( $field_value );
+		$no_scheme = preg_replace( '#^https?://#', '', rtrim( $link, '/' ) );
+		$url_text  = str_replace( $link, $no_scheme, $field_value );
+		return '<a href="' . esc_url( $field_value ) . '" rel="nofollow">' . esc_html( $url_text ) . '</a>';
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type.php
new file mode 100644
index 0000000000000000000000000000000000000000..46d412a4a1f555582adc21ae32646c5c5c71b8de
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type.php
@@ -0,0 +1,447 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Represents a type of XProfile field and holds meta information about the type of value that it accepts.
+ *
+ * @since BuddyPress (2.0.0)
+ */
+abstract class BP_XProfile_Field_Type {
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 * @var array Field type validation regexes
+	 */
+	protected $validation_regex = array();
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 * @var array Field type whitelisted values
+	 */
+	protected $validation_whitelist = array();
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 * @var string The name of this field type
+	 */
+	public $name = '';
+
+	/**
+	 * The name of the category that this field type should be grouped with. Used on the [Users > Profile Fields] screen in wp-admin.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 * @var string
+	 */
+	public $category = '';
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 * @var bool If this is set, allow BP to store null/empty values for this field type.
+	 */
+	public $accepts_null_value = false;
+
+	/**
+	 * If this is set, BP will set this field type's validation whitelist from the field's options (e.g checkbox, selectbox).
+	 *
+	 * @since BuddyPress (2.0.0)
+	 * @var bool Does this field support options? e.g. selectbox, radio buttons, etc.
+	 */
+	public $supports_options = false;
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 * @var bool Does this field type support multiple options being set as default values? e.g. multiselectbox, checkbox.
+	 */
+	public $supports_multiple_defaults = false;
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 * @var BP_XProfile_Field If this object is created by instantiating a {@link BP_XProfile_Field}, this is a reference back to that object.
+	 */
+	public $field_obj = null;
+
+	/**
+	 * Constructor
+	 *
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function __construct() {
+
+		/**
+		 * Fires inside __construct() method for BP_XProfile_Field_Type class.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Field_Type $this Current instance of
+		 *                                     the field type class.
+		 */
+		do_action( 'bp_xprofile_field_type', $this );
+	}
+
+	/**
+	 * Set a regex that profile data will be asserted against.
+	 *
+	 * You can call this method multiple times to set multiple formats. When validation is performed,
+	 * it's successful as long as the new value matches any one of the registered formats.
+	 *
+	 * @param string $format Regex string
+	 * @param string $replace_format Optional; if 'replace', replaces the format instead of adding to it. Defaults to 'add'.
+	 * @return BP_XProfile_Field_Type
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function set_format( $format, $replace_format = 'add' ) {
+
+		/**
+		 * Filters the regex format for the field type.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param string                 $format         Regex string.
+		 * @param string                 $replace_format Optional replace format If "replace", replaces the
+		 *                                               format instead of adding to it. Defaults to "add".
+		 * @param BP_XProfile_Field_Type $this           Current instance of the BP_XProfile_Field_Type class.
+		 */
+		$format = apply_filters( 'bp_xprofile_field_type_set_format', $format, $replace_format, $this );
+
+		if ( 'add' === $replace_format ) {
+			$this->validation_regex[] = $format;
+		} elseif ( 'replace' === $replace_format ) {
+			$this->validation_regex = array( $format );
+		}
+
+		return $this;
+	}
+
+	/**
+	 * Add a value to this type's whitelist that profile data will be asserted against.
+	 *
+	 * You can call this method multiple times to set multiple formats. When validation is performed,
+	 * it's successful as long as the new value matches any one of the registered formats.
+	 *
+	 * @param string|array $values
+	 * @return BP_XProfile_Field_Type
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function set_whitelist_values( $values ) {
+		foreach ( (array) $values as $value ) {
+
+			/**
+			 * Filters values for field type's whitelist that profile data will be asserted against.
+			 *
+			 * @since BuddyPress (2.0.0)
+			 *
+			 * @param string                 $value  Field value.
+			 * @param array                  $values Original array of values.
+			 * @param BP_XProfile_Field_Type $this   Current instance of the BP_XProfile_Field_Type class.
+			 */
+			$this->validation_whitelist[] = apply_filters( 'bp_xprofile_field_type_set_whitelist_values', $value, $values, $this );
+		}
+
+		return $this;
+	}
+
+	/**
+	 * Check the given string against the registered formats for this field type.
+	 *
+	 * This method doesn't support chaining.
+	 *
+	 * @param string|array $values Value to check against the registered formats
+	 * @return bool True if the value validates
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function is_valid( $values ) {
+		$validated = false;
+
+		// Some types of field (e.g. multi-selectbox) may have multiple values to check
+		foreach ( (array) $values as $value ) {
+
+			// Validate the $value against the type's accepted format(s).
+			foreach ( $this->validation_regex as $format ) {
+				if ( 1 === preg_match( $format, $value ) ) {
+					$validated = true;
+					continue;
+
+				} else {
+					$validated = false;
+				}
+			}
+		}
+
+		// Handle field types with accepts_null_value set if $values is an empty array
+		if ( ( false === $validated ) && is_array( $values ) && empty( $values ) && $this->accepts_null_value ) {
+			$validated = true;
+		}
+
+		// If there's a whitelist set, also check the $value.
+		if ( ( true === $validated ) && ! empty( $values ) && ! empty( $this->validation_whitelist ) ) {
+			foreach ( (array) $values as $value ) {
+				$validated = in_array( $value, $this->validation_whitelist, true );
+			}
+		}
+
+		/**
+		 * Filters whether or not field type is a valid format.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param bool                   $validated Whether or not the field type is valid.
+		 * @param string|array           $values    Value to check against the registered formats.
+		 * @param BP_XProfile_Field_Type $this      Current instance of the BP_XProfile_Field_Type class.
+		 */
+		return (bool) apply_filters( 'bp_xprofile_field_type_is_valid', $validated, $values, $this );
+	}
+
+	/**
+	 * Output the edit field HTML for this field type.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	abstract public function edit_field_html( array $raw_properties = array() );
+
+	/**
+	 * Output the edit field options HTML for this field type.
+	 *
+	 * BuddyPress considers a field's "options" to be, for example, the items in a selectbox.
+	 * These are stored separately in the database, and their templating is handled separately.
+	 * Populate this method in a child class if it's required. Otherwise, you can leave it out.
+	 *
+	 * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because
+	 * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function edit_field_options_html( array $args = array() ) {}
+
+	/**
+	 * Output HTML for this field type on the wp-admin Profile Fields screen.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
+	 * @since BuddyPress (2.0.0)
+	 */
+	abstract public function admin_field_html( array $raw_properties = array() );
+
+	/**
+	 * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens.
+	 *
+	 * You don't need to implement this method for all field types. It's used in core by the
+	 * selectbox, multi selectbox, checkbox, and radio button fields, to allow the admin to
+	 * enter the child option values (e.g. the choices in a select box).
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 *
+	 * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
+	 * @param string $control_type Optional. HTML input type used to render the current field's child options.
+	 * @since BuddyPress (2.0.0)
+	 */
+	public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {
+		$type = array_search( get_class( $this ), bp_xprofile_get_field_types() );
+		if ( false === $type ) {
+			return;
+		}
+
+		$class            = $current_field->type != $type ? 'display: none;' : '';
+		$current_type_obj = bp_xprofile_create_field_type( $type );
+		?>
+
+		<div id="<?php echo esc_attr( $type ); ?>" class="postbox bp-options-box" style="<?php echo esc_attr( $class ); ?> margin-top: 15px;">
+			<h3><?php esc_html_e( 'Please enter options for this Field:', 'buddypress' ); ?></h3>
+			<div class="inside">
+				<p>
+					<label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php esc_html_e( 'Sort Order:', 'buddypress' ); ?></label>
+					<select name="sort_order_<?php echo esc_attr( $type ); ?>" id="sort_order_<?php echo esc_attr( $type ); ?>" >
+						<option value="custom" <?php selected( 'custom', $current_field->order_by ); ?>><?php esc_html_e( 'Custom',     'buddypress' ); ?></option>
+						<option value="asc"    <?php selected( 'asc',    $current_field->order_by ); ?>><?php esc_html_e( 'Ascending',  'buddypress' ); ?></option>
+						<option value="desc"   <?php selected( 'desc',   $current_field->order_by ); ?>><?php esc_html_e( 'Descending', 'buddypress' ); ?></option>
+					</select>
+				</p>
+
+				<?php
+
+				// Does option have children?
+				$options = $current_field->get_children( true );
+
+				// If no children options exists for this field, check in $_POST
+				// for a submitted form (e.g. on the "new field" screen).
+				if ( empty( $options ) ) {
+
+					$options = array();
+					$i       = 1;
+
+					while ( isset( $_POST[$type . '_option'][$i] ) ) {
+
+						// Multiselectbox and checkboxes support MULTIPLE default options; all other core types support only ONE.
+						if ( $current_type_obj->supports_options && ! $current_type_obj->supports_multiple_defaults && isset( $_POST["isDefault_{$type}_option"][$i] ) && (int) $_POST["isDefault_{$type}_option"] === $i ) {
+							$is_default_option = true;
+						} elseif ( isset( $_POST["isDefault_{$type}_option"][$i] ) ) {
+							$is_default_option = (bool) $_POST["isDefault_{$type}_option"][$i];
+						} else {
+							$is_default_option = false;
+						}
+
+						// Grab the values from $_POST to use as the form's options
+						$options[] = (object) array(
+							'id'                => -1,
+							'is_default_option' => $is_default_option,
+							'name'              => sanitize_text_field( stripslashes( $_POST[$type . '_option'][$i] ) ),
+						);
+
+						++$i;
+					}
+
+					// If there are still no children options set, this must be the "new field" screen, so add one new/empty option.
+					if ( empty( $options ) ) {
+						$options[] = (object) array(
+							'id'                => -1,
+							'is_default_option' => false,
+							'name'              => '',
+						);
+					}
+				}
+
+				// Render the markup for the children options
+				if ( ! empty( $options ) ) {
+					$default_name = '';
+
+					for ( $i = 0, $count = count( $options ); $i < $count; ++$i ) :
+						$j = $i + 1;
+
+						// Multiselectbox and checkboxes support MULTIPLE default options; all other core types support only ONE.
+						if ( $current_type_obj->supports_options && $current_type_obj->supports_multiple_defaults ) {
+							$default_name = '[' . $j . ']';
+						}
+						?>
+
+						<div id="<?php echo esc_attr( "{$type}_div{$j}" ); ?>" class="bp-option sortable">
+							<span class="bp-option-icon grabber"></span>
+							<input type="text" name="<?php echo esc_attr( "{$type}_option[{$j}]" ); ?>" id="<?php echo esc_attr( "{$type}_option{$j}" ); ?>" value="<?php echo esc_attr( stripslashes( $options[$i]->name ) ); ?>" />
+							<label>
+								<input type="<?php echo esc_attr( $control_type ); ?>" name="<?php echo esc_attr( "isDefault_{$type}_option{$default_name}" ); ?>" <?php checked( $options[$i]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" />
+								<?php _e( 'Default Value', 'buddypress' ); ?>
+							</label>
+
+							<?php if ( 1 !== $j ) : ?>
+								<div class ="delete-button">
+									<a href='javascript:hide("<?php echo esc_attr( "{$type}_div{$j}" ); ?>")' class="delete"><?php esc_html_e( 'Delete', 'buddypress' ); ?></a>
+								</div>
+							<?php endif; ?>
+
+						</div>
+
+					<?php endfor; ?>
+
+					<input type="hidden" name="<?php echo esc_attr( "{$type}_option_number" ); ?>" id="<?php echo esc_attr( "{$type}_option_number" ); ?>" value="<?php echo esc_attr( $j + 1 ); ?>" />
+				<?php } ?>
+
+				<div id="<?php echo esc_attr( "{$type}_more" ); ?>"></div>
+				<p><a href="javascript:add_option('<?php echo esc_js( $type ); ?>')"><?php esc_html_e( 'Add Another Option', 'buddypress' ); ?></a></p>
+
+				<?php
+
+				/**
+				 * Fires at the end of the new field additional settings area.
+				 *
+				 * @since BuddyPress (2.3.0)
+				 *
+				 * @param BP_XProfile_Field $current_field Current field being rendered.
+				 */
+				do_action( 'bp_xprofile_admin_new_field_additional_settings', $current_field ) ?>
+			</div>
+		</div>
+
+		<?php
+	}
+
+	/**
+	 * Allow field types to modify submitted values before they are validated.
+	 *
+	 * In some cases, it may be appropriate for a field type to catch
+	 * submitted values and modify them before they are passed to the
+	 * is_valid() method. For example, URL validation requires the
+	 * 'http://' scheme (so that the value saved in the database is always
+	 * a fully-formed URL), but in order to allow users to enter a URL
+	 * without this scheme, BP_XProfile_Field_Type_URL prepends 'http://'
+	 * when it's not present.
+	 *
+	 * By default, this is a pass-through method that does nothing. Only
+	 * override in your own field type if you need this kind of pre-
+	 * validation filtering.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param mixed $submitted_value Submitted value.
+	 * @return mixed
+	 */
+	public static function pre_validate_filter( $field_value ) {
+		return $field_value;
+	}
+
+	/**
+	 * Allow field types to modify the appearance of their values.
+	 *
+	 * By default, this is a pass-through method that does nothing. Only
+	 * override in your own field type if you need to provide custom
+	 * filtering for output values.
+	 *
+	 * @since BuddyPress (2.1.0)
+	 *
+	 * @param mixed $field_value Field value.
+	 * @return mixed
+	 */
+	public static function display_filter( $field_value ) {
+		return $field_value;
+	}
+
+	/** Protected *************************************************************/
+
+	/**
+	 * Get a sanitised and escaped string of the edit field's HTML elements and attributes.
+	 *
+	 * Must be used inside the {@link bp_profile_fields()} template loop.
+	 * This method was intended to be static but couldn't be because php.net/lsb/ requires PHP >= 5.3.
+	 *
+	 * @param array $properties Optional key/value array of attributes for this edit field.
+	 * @return string
+	 * @since BuddyPress (2.0.0)
+	 */
+	protected function get_edit_field_html_elements( array $properties = array() ) {
+
+		$r = bp_parse_args( $properties, array(
+			'id'   => bp_get_the_profile_field_input_name(),
+			'name' => bp_get_the_profile_field_input_name(),
+		) );
+
+		if ( bp_get_the_profile_field_is_required() ) {
+			$r['aria-required'] = 'true';
+		}
+
+		$html = '';
+
+		/**
+		 * Filters the edit html elements and attributes.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param array  $r     Array of parsed arguments.
+		 * @param string $value Class name for the current class instance.
+		 */
+		$r = (array) apply_filters( 'bp_xprofile_field_edit_html_elements', $r, get_class( $this ) );
+
+		return bp_get_form_field_attributes( sanitize_key( bp_get_the_profile_field_name() ), $r );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field.php
new file mode 100644
index 0000000000000000000000000000000000000000..8913109754606e388963f1ead7692f396255bfe0
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field.php
@@ -0,0 +1,1020 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+class BP_XProfile_Field {
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var int ID of field
+	 */
+	public $id;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var int Field group ID for field
+	 */
+	public $group_id;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var int Parent ID of field
+	 */
+	public $parent_id;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var string Field type
+	 */
+	public $type;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var string Field name
+	 */
+	public $name;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var string Field description
+	 */
+	public $description;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var bool Is field required to be filled out?
+	 */
+	public $is_required;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var int Can field be deleted?
+	 */
+	public $can_delete = '1';
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var int Field position
+	 */
+	public $field_order;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var int Option order
+	 */
+	public $option_order;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var string Order child fields by
+	 */
+	public $order_by;
+
+	/**
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @var bool Is this the default option for this field?
+	 */
+	public $is_default_option;
+
+	/**
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @var string Default field data visibility
+	 */
+	public $default_visibility = 'public';
+
+	/**
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @var string Members are allowed/disallowed to modify data visibility
+	 */
+	public $allow_custom_visibility = 'allowed';
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @var BP_XProfile_Field_Type Field type object used for validation
+	 */
+	public $type_obj = null;
+
+	/**
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @var BP_XProfile_ProfileData Field data for user ID
+	 */
+	public $data;
+
+	/**
+	 * Initialize and/or populate profile field
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param int  $id
+	 * @param int  $user_id
+	 * @param bool $get_data
+	 */
+	public function __construct( $id = null, $user_id = null, $get_data = true ) {
+
+		if ( ! empty( $id ) ) {
+			$this->populate( $id, $user_id, $get_data );
+
+		// Initialise the type obj to prevent fatals when creating new profile fields
+		} else {
+			$this->type_obj            = bp_xprofile_create_field_type( 'textbox' );
+			$this->type_obj->field_obj = $this;
+		}
+	}
+
+	/**
+	 * Populate a profile field object
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @global object $wpdb
+	 * @global object $userdata
+	 *
+	 * @param  int    $id
+	 * @param  int    $user_id
+	 * @param  bool   $get_data
+	 */
+	public function populate( $id, $user_id = null, $get_data = true ) {
+		global $wpdb, $userdata;
+
+		if ( empty( $user_id ) ) {
+			$user_id = isset( $userdata->ID ) ? $userdata->ID : 0;
+		}
+
+		$bp    = buddypress();
+		$field = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE id = %d", $id ) );
+
+		if ( ! empty( $field ) ) {
+			$this->id                = $field->id;
+			$this->group_id          = $field->group_id;
+			$this->parent_id         = $field->parent_id;
+			$this->type              = $field->type;
+			$this->name              = stripslashes( $field->name );
+			$this->description       = stripslashes( $field->description );
+			$this->is_required       = $field->is_required;
+			$this->can_delete        = $field->can_delete;
+			$this->field_order       = $field->field_order;
+			$this->option_order      = $field->option_order;
+			$this->order_by          = $field->order_by;
+			$this->is_default_option = $field->is_default_option;
+
+			// Create the field type and store a reference back to this object.
+			$this->type_obj            = bp_xprofile_create_field_type( $field->type );
+			$this->type_obj->field_obj = $this;
+
+			if ( ! empty( $get_data ) && ! empty( $user_id ) ) {
+				$this->data = $this->get_field_data( $user_id );
+			}
+
+			// Get metadata for field
+			$default_visibility       = bp_xprofile_get_meta( $id, 'field', 'default_visibility'      );
+			$allow_custom_visibility  = bp_xprofile_get_meta( $id, 'field', 'allow_custom_visibility' );
+
+			// Setup default visibility
+			$this->default_visibility = ! empty( $default_visibility )
+				? $default_visibility
+				: 'public';
+
+			// Allow members to customize visibilty
+			$this->allow_custom_visibility = ( 'disabled' === $allow_custom_visibility )
+				? 'disabled'
+				: 'allowed';
+		}
+	}
+
+	/**
+	 * Delete a profile field
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @global object  $wpdb
+	 * @param  boolean $delete_data
+	 * @return boolean
+	 */
+	public function delete( $delete_data = false ) {
+		global $wpdb;
+
+		// Prevent deletion if no ID is present
+		// Prevent deletion by url when can_delete is false.
+		// Prevent deletion of option 1 since this invalidates fields with options.
+		if ( empty( $this->id ) || empty( $this->can_delete ) || ( $this->parent_id && $this->option_order == 1 ) ) {
+			return false;
+		}
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE id = %d OR parent_id = %d", $this->id, $this->id );
+
+		if ( ! $wpdb->query( $sql ) ) {
+			return false;
+		}
+
+		// delete the data in the DB for this field
+		if ( true === $delete_data ) {
+			BP_XProfile_ProfileData::delete_for_field( $this->id );
+		}
+
+		return true;
+	}
+
+	/**
+	 * Save a profile field
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @global object $wpdb
+	 *
+	 * @return boolean
+	 */
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->group_id     = apply_filters( 'xprofile_field_group_id_before_save',     $this->group_id,     $this->id );
+		$this->parent_id    = apply_filters( 'xprofile_field_parent_id_before_save',    $this->parent_id,    $this->id );
+		$this->type         = apply_filters( 'xprofile_field_type_before_save',         $this->type,         $this->id );
+		$this->name         = apply_filters( 'xprofile_field_name_before_save',         $this->name,         $this->id );
+		$this->description  = apply_filters( 'xprofile_field_description_before_save',  $this->description,  $this->id );
+		$this->is_required  = apply_filters( 'xprofile_field_is_required_before_save',  $this->is_required,  $this->id );
+		$this->order_by	    = apply_filters( 'xprofile_field_order_by_before_save',     $this->order_by,     $this->id );
+		$this->field_order  = apply_filters( 'xprofile_field_field_order_before_save',  $this->field_order,  $this->id );
+		$this->option_order = apply_filters( 'xprofile_field_option_order_before_save', $this->option_order, $this->id );
+		$this->can_delete   = apply_filters( 'xprofile_field_can_delete_before_save',   $this->can_delete,   $this->id );
+		$this->type_obj     = bp_xprofile_create_field_type( $this->type );
+
+		/**
+		 * Fires before the current field instance gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_XProfile_Field Current instance of the field being saved.
+		 */
+		do_action_ref_array( 'xprofile_field_before_save', array( $this ) );
+
+		if ( $this->id != null ) {
+			$sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET group_id = %d, parent_id = 0, type = %s, name = %s, description = %s, is_required = %d, order_by = %s, field_order = %d, option_order = %d, can_delete = %d, is_default_option = %d WHERE id = %d", $this->group_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order, $this->option_order, $this->can_delete, $this->is_default_option, $this->id );
+		} else {
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, order_by, field_order, option_order, can_delete, is_default_option ) VALUES ( %d, %d, %s, %s, %s, %d, %s, %d, %d, %d, %d )", $this->group_id, $this->parent_id, $this->type, $this->name, $this->description, $this->is_required, $this->order_by, $this->field_order, $this->option_order, $this->can_delete, $this->is_default_option );
+		}
+
+		/**
+		 * Check for null so field options can be changed without changing any
+		 * other part of the field. The described situation will return 0 here.
+		 */
+		if ( $wpdb->query( $sql ) !== null ) {
+
+			if ( !empty( $this->id ) ) {
+				$field_id = $this->id;
+			} else {
+				$field_id = $wpdb->insert_id;
+			}
+
+			// Only do this if we are editing an existing field
+			if ( $this->id != null ) {
+
+				/**
+				 * Remove any radio or dropdown options for this
+				 * field. They will be re-added if needed.
+				 * This stops orphan options if the user changes a
+				 * field from a radio button field to a text box.
+				 */
+				$this->delete_children();
+			}
+
+			/**
+			 * Check to see if this is a field with child options.
+			 * We need to add the options to the db, if it is.
+			 */
+			if ( $this->type_obj->supports_options ) {
+
+				if ( !empty( $this->id ) ) {
+					$parent_id = $this->id;
+				} else {
+					$parent_id = $wpdb->insert_id;
+				}
+
+				// Allow plugins to filter the field's child options (i.e. the items in a selectbox).
+				$post_option  = ! empty( $_POST["{$this->type}_option"]           ) ? $_POST["{$this->type}_option"]           : '';
+				$post_default = ! empty( $_POST["isDefault_{$this->type}_option"] ) ? $_POST["isDefault_{$this->type}_option"] : '';
+
+				/**
+				 * Filters the submitted field option value before saved.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string            $post_option Submitted option value.
+				 * @param BP_XProfile_Field $type        Current field type being saved for.
+				 */
+				$options      = apply_filters( 'xprofile_field_options_before_save', $post_option,  $this->type );
+
+				/**
+				 * Filters the default field option value before saved.
+				 *
+				 * @since BuddyPress (1.5.0)
+				 *
+				 * @param string            $post_default Default option value.
+				 * @param BP_XProfile_Field $type         Current field type being saved for.
+				 */
+				$defaults     = apply_filters( 'xprofile_field_default_before_save', $post_default, $this->type );
+
+				$counter = 1;
+				if ( !empty( $options ) ) {
+					foreach ( (array) $options as $option_key => $option_value ) {
+						$is_default = 0;
+
+						if ( is_array( $defaults ) ) {
+							if ( isset( $defaults[ $option_key ] ) ) {
+								$is_default = 1;
+							}
+						} else {
+							if ( (int) $defaults == $option_key ) {
+								$is_default = 1;
+							}
+						}
+
+						if ( '' != $option_value ) {
+							$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'option', %s, '', 0, %d, %d)", $this->group_id, $parent_id, $option_value, $counter, $is_default );
+							if ( ! $wpdb->query( $sql ) ) {
+								return false;
+							}
+						}
+
+						$counter++;
+					}
+				}
+			}
+
+			/**
+			 * Fires after the current field instance gets saved.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param BP_XProfile_Field Current instance of the field being saved.
+			 */
+			do_action_ref_array( 'xprofile_field_after_save', array( $this ) );
+
+			// Recreate type_obj in case someone changed $this->type via a filter
+	 		$this->type_obj            = bp_xprofile_create_field_type( $this->type );
+	 		$this->type_obj->field_obj = $this;
+
+			return $field_id;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * Get field data for a user ID
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @param  int $user_id
+	 * @return object
+	 */
+	public function get_field_data( $user_id = 0 ) {
+		return new BP_XProfile_ProfileData( $this->id, $user_id );
+	}
+
+	/**
+	 * Get all child fields for this field ID
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global object $wpdb
+	 *
+	 * @param  bool  $for_editing
+	 * @return array
+	 */
+	public function get_children( $for_editing = false ) {
+		global $wpdb;
+
+		// This is done here so we don't have problems with sql injection
+		if ( empty( $for_editing ) && ( 'asc' === $this->order_by ) ) {
+			$sort_sql = 'ORDER BY name ASC';
+		} elseif ( empty( $for_editing ) && ( 'desc' === $this->order_by ) ) {
+			$sort_sql = 'ORDER BY name DESC';
+		} else {
+			$sort_sql = 'ORDER BY option_order ASC';
+		}
+
+		// This eliminates a problem with getting all fields when there is no
+		// id for the object
+		if ( empty( $this->id ) ) {
+			$parent_id = -1;
+		} else {
+			$parent_id = $this->id;
+		}
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE parent_id = %d AND group_id = %d {$sort_sql}", $parent_id, $this->group_id );
+
+		$children = $wpdb->get_results( $sql );
+
+		/**
+		 * Filters the found children for a field.
+		 *
+		 * @since BuddyPress (1.2.5)
+		 *
+		 * @param object $children    Found children for a field.
+		 * @param bool   $for_editing Whether or not the field is for editing.
+		 */
+		return apply_filters( 'bp_xprofile_field_get_children', $children, $for_editing );
+	}
+
+	/**
+	 * Delete all field children for this field
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global object $wpdb
+	 */
+	public function delete_children() {
+		global $wpdb;
+
+		$bp  = buddypress();
+		$sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE parent_id = %d", $this->id );
+
+		$wpdb->query( $sql );
+	}
+
+	/** Static Methods ********************************************************/
+
+	public static function get_type( $field_id = 0 ) {
+		global $wpdb;
+
+		// Bail if no field ID
+		if ( empty( $field_id ) ) {
+			return false;
+		}
+
+		$bp   = buddypress();
+		$sql  = $wpdb->prepare( "SELECT type FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id );
+		$type = $wpdb->get_var( $sql );
+
+		// Return field type
+		if ( ! empty( $type ) ) {
+			return $type;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Delete all fields in a field group
+	 *
+	 * @since BuddyPress (1.2.0)
+	 *
+	 * @global object $wpdb
+	 *
+	 * @param  int    $group_id
+	 *
+	 * @return boolean
+	 */
+	public static function delete_for_group( $group_id = 0 ) {
+		global $wpdb;
+
+		// Bail if no group ID
+		if ( empty( $group_id ) ) {
+			return false;
+		}
+
+		$bp      = buddypress();
+		$sql     = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $group_id );
+		$deleted = $wpdb->get_var( $sql );
+
+		// Return true if fields were deleted
+		if ( false !== $deleted ) {
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Get field ID from field name
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @global object $wpdb
+	 * @param  string $field_name
+	 *
+	 * @return boolean
+	 */
+	public static function get_id_from_name( $field_name = '' ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		if ( empty( $bp->profile->table_name_fields ) || empty( $field_name ) ) {
+			return false;
+		}
+
+		$sql = $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s AND parent_id = 0", $field_name );
+
+		return $wpdb->get_var( $sql );
+	}
+
+	/**
+	 * Update field position and/or field group when relocating
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @global object $wpdb
+	 *
+	 * @param  int $field_id
+	 * @param  int $position
+	 * @param  int $field_group_id
+	 *
+	 * @return boolean
+	 */
+	public static function update_position( $field_id, $position = null, $field_group_id = null ) {
+		global $wpdb;
+
+		// Bail if invalid position or field group
+		if ( ! is_numeric( $position ) || ! is_numeric( $field_group_id ) ) {
+			return false;
+		}
+
+		// Get table name and field parent
+		$table_name = buddypress()->profile->table_name_fields;
+		$sql        = $wpdb->prepare( "UPDATE {$table_name} SET field_order = %d, group_id = %d WHERE id = %d", $position, $field_group_id, $field_id );
+		$parent     = $wpdb->query( $sql );
+
+		// Update $field_id with new $position and $field_group_id
+		if ( ! empty( $parent ) && ! is_wp_error( $parent ) ) {
+
+			// Update any children of this $field_id
+			$sql = $wpdb->prepare( "UPDATE {$table_name} SET group_id = %d WHERE parent_id = %d", $field_group_id, $field_id );
+			$wpdb->query( $sql );
+
+			return $parent;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Validate form field data on sumbission
+	 *
+	 * @since BuddyPress (2.2.0)
+	 *
+	 * @global type $message
+	 * @return boolean
+	 */
+	public static function admin_validate() {
+		global $message;
+
+		// Check field name
+		if ( ! isset( $_POST['title'] ) || ( '' === $_POST['title'] ) ) {
+			$message = esc_html__( 'Profile fields must have a name.', 'buddypress' );
+			return false;
+		}
+
+		// Check field requirement
+		if ( ! isset( $_POST['required'] ) ) {
+			$message = esc_html__( 'Profile field requirement is missing.', 'buddypress' );
+			return false;
+		}
+
+		// Check field type
+		if ( empty( $_POST['fieldtype'] ) ) {
+			$message = esc_html__( 'Profile field type is missing.', 'buddypress' );
+			return false;
+		}
+
+		// Check that field is of valid type
+		if ( ! in_array( $_POST['fieldtype'], array_keys( bp_xprofile_get_field_types() ), true ) ) {
+			$message = sprintf( esc_html__( 'The profile field type %s is not registered.', 'buddypress' ), '<code>' . esc_attr( $_POST['fieldtype'] ) . '</code>' );
+			return false;
+		}
+
+		// Get field type so we can check for and lavidate any field options
+		$field_type = bp_xprofile_create_field_type( $_POST['fieldtype'] );
+
+		// Field type requires options
+		if ( true === $field_type->supports_options ) {
+
+			// Build the field option key
+			$option_name = sanitize_key( $_POST['fieldtype'] ) . '_option';
+
+			// Check for missing or malformed options
+			if ( empty( $_POST[ $option_name ] ) || ! is_array( $_POST[ $option_name ] ) ) {
+				$message = esc_html__( 'These field options are invalid.', 'buddypress' );
+				return false;
+			}
+
+			// Trim out empty field options
+			$field_values  = array_values( $_POST[ $option_name ] );
+			$field_options = array_map( 'sanitize_text_field', $field_values );
+			$field_count   = count( $field_options );
+
+			// Check for missing or malformed options
+			if ( 0 === $field_count ) {
+				$message = sprintf( esc_html__( '%s require at least one option.', 'buddypress' ), $field_type->name );
+				return false;
+			}
+
+			// If only one option exists, it cannot be an empty string
+			if ( ( 1 === $field_count ) && ( '' === $field_options[0] ) ) {
+				$message = sprintf( esc_html__( '%s require at least one option.', 'buddypress' ), $field_type->name );
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	 * This function populates the items for radio buttons checkboxes and drop
+	 * down boxes.
+	 */
+	public function render_admin_form_children() {
+		foreach ( array_keys( bp_xprofile_get_field_types() ) as $field_type ) {
+			$type_obj = bp_xprofile_create_field_type( $field_type );
+			$type_obj->admin_new_field_html( $this );
+		}
+	}
+
+	/**
+	 * Oupput the admin form for this field
+	 *
+	 * @since BuddyPress (1.9.0)
+	 *
+	 * @param type $message
+	 */
+	public function render_admin_form( $message = '' ) {
+		if ( empty( $this->id ) ) {
+			$title  = __( 'Add New Field', 'buddypress' );
+			$action	= "users.php?page=bp-profile-setup&amp;group_id=" . $this->group_id . "&amp;mode=add_field#tabs-" . $this->group_id;
+			$button	= __( 'Save', 'buddypress' );
+
+			if ( !empty( $_POST['saveField'] ) ) {
+				$this->name        = $_POST['title'];
+				$this->description = $_POST['description'];
+				$this->is_required = $_POST['required'];
+				$this->type        = $_POST['fieldtype'];
+				$this->order_by    = $_POST["sort_order_{$this->type}"];
+				$this->field_order = $_POST['field_order'];
+			}
+		} else {
+			$title  = __( 'Edit Field', 'buddypress' );
+			$action = "users.php?page=bp-profile-setup&amp;mode=edit_field&amp;group_id=" . $this->group_id . "&amp;field_id=" . $this->id . "#tabs-" . $this->group_id;
+			$button	= __( 'Update', 'buddypress' );
+		} ?>
+
+		<div class="wrap">
+
+			<?php screen_icon( 'users' ); ?>
+
+			<h2><?php echo esc_html( $title ); ?></h2>
+
+			<?php if ( !empty( $message ) ) : ?>
+
+				<div id="message" class="error fade">
+					<p><?php echo esc_html( $message ); ?></p>
+				</div>
+
+			<?php endif; ?>
+
+			<form id="bp-xprofile-add-field" action="<?php echo esc_url( $action ); ?>" method="post">
+				<div id="poststuff">
+					<div id="post-body" class="metabox-holder columns-<?php echo ( 1 == get_current_screen()->get_columns() ) ? '1' : '2'; ?>">
+						<div id="post-body-content">
+
+							<?php
+
+							// Output the name & description fields
+							$this->name_and_description(); ?>
+
+						</div><!-- #post-body-content -->
+
+						<div id="postbox-container-1" class="postbox-container">
+
+							<?php
+
+							// Output the sumbit metabox
+							$this->submit_metabox( $button );
+
+							// Output the required metabox
+							$this->required_metabox();
+
+							// Output the field visibility metaboxes
+							$this->visibility_metabox();
+
+							/**
+							 * Fires after XProfile Field sidebar metabox.
+							 *
+							 * @since BuddyPress (2.2.0)
+							 *
+							 * @param BP_XProfile_Field $this Current XProfile field.
+							 */
+							do_action( 'xprofile_field_after_sidebarbox', $this ); ?>
+
+						</div>
+
+						<div id="postbox-container-2" class="postbox-container">
+
+							<?php
+
+							/**
+							 * Fires before XProfile Field content metabox.
+							 *
+							 * @since BuddyPress (2.3.0)
+							 *
+							 * @param BP_XProfile_Field $this Current XProfile field.
+							 */
+							do_action( 'xprofile_field_before_contentbox', $this );
+
+							// Output the field attributes metabox
+							$this->type_metabox();
+
+							// Output hidden inputs for default field
+							$this->default_field_hidden_inputs();
+
+							/**
+							 * Fires after XProfile Field content metabox.
+							 *
+							 * @since BuddyPress (2.2.0)
+							 *
+							 * @param BP_XProfile_Field $this Current XProfile field.
+							 */
+							do_action( 'xprofile_field_after_contentbox', $this ); ?>
+
+						</div>
+					</div><!-- #post-body -->
+				</div><!-- #poststuff -->
+			</form>
+		</div>
+
+	<?php
+	}
+
+	/**
+	 * Private method used to display the submit metabox
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param string $button_text
+	 */
+	private function submit_metabox( $button_text = '' ) {
+
+		/**
+		 * Fires before XProfile Field submit metabox.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param BP_XProfile_Field $this Current XProfile field.
+		 */
+		do_action( 'xprofile_field_before_submitbox', $this ); ?>
+
+		<div id="submitdiv" class="postbox">
+			<h3><?php esc_html_e( 'Submit', 'buddypress' ); ?></h3>
+			<div class="inside">
+				<div id="submitcomment" class="submitbox">
+					<div id="major-publishing-actions">
+
+						<?php
+
+						/**
+						 * Fires at the beginning of the XProfile Field publishing actions section.
+						 *
+						 * @since BuddyPress (2.1.0)
+						 *
+						 * @param BP_XProfile_Field $this Current XProfile field.
+						 */
+						do_action( 'xprofile_field_submitbox_start', $this ); ?>
+
+						<input type="hidden" name="field_order" id="field_order" value="<?php echo esc_attr( $this->field_order ); ?>" />
+
+						<?php if ( ! empty( $button_text ) ) : ?>
+
+							<div id="publishing-action">
+								<input type="submit" name="saveField" value="<?php echo esc_attr( $button_text ); ?>" class="button-primary" />
+							</div>
+
+						<?php endif; ?>
+
+						<div id="delete-action">
+							<a href="users.php?page=bp-profile-setup" class="deletion"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a>
+						</div>
+
+						<?php wp_nonce_field( 'xprofile_delete_option' ); ?>
+
+						<div class="clear"></div>
+					</div>
+				</div>
+			</div>
+		</div>
+
+		<?php
+
+		/**
+		 * Fires after XProfile Field submit metabox.
+		 *
+		 * @since BuddyPress (2.1.0)
+		 *
+		 * @param BP_XProfile_Field $this Current XProfile field.
+		 */
+		do_action( 'xprofile_field_after_submitbox', $this );
+	}
+
+	/**
+	 * Private method used to output field name and description fields
+	 *
+	 * @since BuddyPress (2.3.0)
+	 */
+	private function name_and_description() {
+	?>
+
+		<div id="titlediv">
+			<div class="titlewrap">
+				<label id="title-prompt-text" for="title"><?php echo esc_html_x( 'Name', 'XProfile admin edit field', 'buddypress' ); ?></label>
+				<input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" autocomplete="off" />
+			</div>
+		</div>
+
+		<div class="postbox">
+			<h3><?php echo esc_html_x( 'Description', 'XProfile admin edit field', 'buddypress' ); ?></h3>
+			<div class="inside">
+				<textarea name="description" id="description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea>
+			</div>
+		</div>
+
+	<?php
+	}
+
+	/**
+	 * Private method used to output field visibility metaboxes
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return if default field id 1
+	 */
+	private function visibility_metabox() {
+
+		// Default field cannot have custom visibility
+		if ( true === $this->is_default_field() ) {
+			return;
+		} ?>
+
+		<div class="postbox">
+			<h3><label for="default-visibility"><?php esc_html_e( 'Visibility', 'buddypress' ); ?></label></h3>
+			<div class="inside">
+				<div>
+					<select name="default-visibility" >
+
+						<?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?>
+
+							<option value="<?php echo esc_attr( $level['id'] ); ?>" <?php selected( $this->default_visibility, $level['id'] ); ?>>
+								<?php echo esc_html( $level['label'] ); ?>
+							</option>
+
+						<?php endforeach ?>
+
+					</select>
+				</div>
+
+				<div>
+					<ul>
+						<li>
+							<input type="radio" id="allow-custom-visibility-allowed" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ); ?> />
+							<label for="allow-custom-visibility-allowed"><?php esc_html_e( 'Allow members to override', 'buddypress' ); ?></label>
+						</li>
+						<li>
+							<input type="radio" id="allow-custom-visibility-disabled" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ); ?> />
+							<label for="allow-custom-visibility-disabled"><?php esc_html_e( 'Enforce field visibility', 'buddypress' ); ?></label>
+						</li>
+					</ul>
+				</div>
+			</div>
+		</div>
+
+		<?php
+	}
+
+	/**
+	 * Output the metabox for setting if field is required or not
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return if default field
+	 */
+	private function required_metabox() {
+
+		// Default field is always required
+		if ( true === $this->is_default_field() ) {
+			return;
+		} ?>
+
+		<div class="postbox">
+			<h3><label for="required"><?php esc_html_e( 'Requirement', 'buddypress' ); ?></label></h3>
+			<div class="inside">
+				<select name="required" id="required">
+					<option value="0"<?php selected( $this->is_required, '0' ); ?>><?php esc_html_e( 'Not Required', 'buddypress' ); ?></option>
+					<option value="1"<?php selected( $this->is_required, '1' ); ?>><?php esc_html_e( 'Required',     'buddypress' ); ?></option>
+				</select>
+			</div>
+		</div>
+
+	<?php
+	}
+
+	/**
+	 * Output the metabox for setting what type of field this is
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return if default field
+	 */
+	private function type_metabox() {
+
+		// Default field cannot change type
+		if ( true === $this->is_default_field() ) {
+			return;
+		} ?>
+
+		<div class="postbox">
+			<h3><label for="fieldtype"><?php esc_html_e( 'Type', 'buddypress'); ?></label></h3>
+			<div class="inside">
+				<select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%">
+
+					<?php bp_xprofile_admin_form_field_types( $this->type ); ?>
+
+				</select>
+
+				<?php
+
+				// Deprecated filter, don't use. Go look at {@link BP_XProfile_Field_Type::admin_new_field_html()}.
+				do_action( 'xprofile_field_additional_options', $this );
+
+				$this->render_admin_form_children(); ?>
+
+			</div>
+		</div>
+
+	<?php
+	}
+
+	/**
+	 * Output hidden fields used by default field
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @return if not default field
+	 */
+	private function default_field_hidden_inputs() {
+
+		// Field 1 is the fullname field, which cannot have custom visibility
+		if ( false === $this->is_default_field() ) {
+			return;
+		} ?>
+
+		<input type="hidden" name="required"  id="required"  value="1"       />
+		<input type="hidden" name="fieldtype" id="fieldtype" value="textbox" />
+
+		<?php
+	}
+
+	/**
+	 * Return if a field ID is the default field
+	 *
+	 * @since BuddyPress (2.3.0)
+	 *
+	 * @param  int $field_id ID of field to check
+	 * @return bool
+	 */
+	private function is_default_field( $field_id = 0 ) {
+
+		// Fallback to current field ID if none passed
+		if ( empty( $field_id ) ) {
+			$field_id = $this->id;
+		}
+
+		// Compare & return
+		return (bool) ( 1 === (int) $field_id );
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php
new file mode 100644
index 0000000000000000000000000000000000000000..d2215fbdf4ded7eff786c9838ceb48592f6341ff
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php
@@ -0,0 +1,760 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+class BP_XProfile_Group {
+	
+	/**
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @var int ID of field group
+	 */
+	public $id = null;
+	
+	/**
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @var string Name of field group
+	 */
+	public $name;
+	
+	/**
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @var string Description of field group
+	 */
+	public $description;
+	
+	/**
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @var bool Can this group be deleted?
+	 */
+	public $can_delete;
+	
+	/**
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @var int Group order relative to other groups
+	 */
+	public $group_order;
+	
+	/**
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @var array Fields of group
+	 */
+	public $fields;
+
+	/**
+	 * Initialize and/or populate profile field group
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @param int  $id
+	 * @param int  $user_id
+	 * @param bool $get_data
+	 */
+	public function __construct( $id = null ) {
+		if ( ! empty( $id ) ) {
+			$this->populate( $id );
+		}
+	}
+
+	/**
+	 * Populate a profile field group
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @global $wpdb $wpdb
+	 * @param  int   $id
+	 *
+	 * @return boolean
+	 */
+	public function populate( $id ) {
+
+		// Get this group
+		$group = self::get( array(
+			'profile_group_id' => $id
+		) );
+
+		// Bail if group not found
+		if ( empty( $group ) ) {
+			return false;
+		}
+
+		// Get the first array element
+		$group = reset( $group );
+
+		// Set object properties
+		$this->id          = $group->id;
+		$this->name        = $group->name;
+		$this->description = $group->description;
+		$this->can_delete  = $group->can_delete;
+		$this->group_order = $group->group_order;
+	}
+
+	/**
+	 * Save a profile field group
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @global object $wpdb
+	 *
+	 * @return boolean
+	 */
+	public function save() {
+		global $wpdb;
+
+		// Filter the field group attributes
+		$this->name        = apply_filters( 'xprofile_group_name_before_save',        $this->name,        $this->id );
+		$this->description = apply_filters( 'xprofile_group_description_before_save', $this->description, $this->id );
+
+		/**
+		 * Fires before the current group instance gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_XProfile_Group Current instance of the group being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'xprofile_group_before_save', array( &$this ) );
+
+		$bp = buddypress();
+
+		// Update or insert
+		if ( ! empty( $this->id ) ) {
+			$sql = $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s, description = %s WHERE id = %d", $this->name, $this->description, $this->id );
+		} else {
+			$sql = $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_groups} (name, description, can_delete) VALUES (%s, %s, 1)", $this->name, $this->description );
+		}
+
+		// Attempt to insert or update
+		$query = $wpdb->query( $sql );
+
+		// Bail if query fails
+		if ( empty( $query ) || is_wp_error( $query ) ) {
+			return false;
+		}
+
+		// If not set, update the ID in the group object
+		if ( empty( $this->id ) ) {
+			$this->id = $wpdb->insert_id;
+		}
+
+		/**
+		 * Fires after the current group instance gets saved.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_XProfile_Group Current instance of the group being saved. Passed by reference.
+		 */
+		do_action_ref_array( 'xprofile_group_after_save', array( &$this ) );
+
+		return $this->id;
+	}
+
+	/**
+	 * Delete a profile field group
+	 *
+	 * @since BuddyPress (1.1.0)
+	 *
+	 * @global object  $wpdb
+	 * @return boolean
+	 */
+	public function delete() {
+		global $wpdb;
+
+		// Bail if field group cannot be deleted
+		if ( empty( $this->can_delete ) ) {
+			return false;
+		}
+
+		/**
+		 * Fires before the current group instance gets deleted.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Group Current instance of the group being deleted. Passed by reference.
+		 */
+		do_action_ref_array( 'xprofile_group_before_delete', array( &$this ) );
+
+		$bp      = buddypress();
+		$sql     = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id );
+		$deleted = $wpdb->query( $sql );
+
+		// Delete field group
+		if ( empty( $deleted ) || is_wp_error( $deleted ) ) {
+			return false;
+		}
+
+		// Remove the group's fields.
+		if ( BP_XProfile_Field::delete_for_group( $this->id ) ) {
+
+			// Remove profile data for the groups fields
+			for ( $i = 0, $count = count( $this->fields ); $i < $count; ++$i ) {
+				BP_XProfile_ProfileData::delete_for_field( $this->fields[$i]->id );
+			}
+		}
+
+		/**
+		 * Fires after the current group instance gets deleted.
+		 *
+		 * @since BuddyPress (2.0.0)
+		 *
+		 * @param BP_XProfile_Group Current instance of the group being deleted. Passed by reference.
+		 */
+		do_action_ref_array( 'xprofile_group_after_delete', array( &$this ) );
+
+		return true;
+	}
+
+	/** Static Methods ********************************************************/
+
+	/**
+	 * Populates the BP_XProfile_Group object with profile field groups, fields,
+	 * and field data
+	 *
+	 * @package BuddyPress XProfile
+	 *
+	 * @global $wpdb WordPress DB access object.
+	 *
+	 * @param array $args {
+	 *	Array of optional arguments:
+	 *	@type int $profile_group_id Limit results to a single profile
+	 *	      group.
+	 *      @type int $user_id Required if you want to load a specific
+	 *            user's data. Default: displayed user's ID.
+	 *      @type bool $hide_empty_groups True to hide groups that don't
+	 *            have any fields. Default: false.
+	 *	@type bool $hide_empty_fields True to hide fields where the
+	 *	      user has not provided data. Default: false.
+	 *      @type bool $fetch_fields Whether to fetch each group's fields.
+	 *            Default: false.
+	 *      @type bool $fetch_field_data Whether to fetch data for each
+	 *            field. Requires a $user_id. Default: false.
+	 *      @type array $exclude_groups Comma-separated list or array of
+	 *            group IDs to exclude.
+	 *      @type array $exclude_fields Comma-separated list or array of
+	 *            field IDs to exclude.
+	 *      @type bool $update_meta_cache Whether to pre-fetch xprofilemeta
+	 *            for all retrieved groups, fields, and data. Default: true.
+	 * }
+	 * @return array $groups
+	 */
+	public static function get( $args = array() ) {
+		global $wpdb;
+
+		// Parse arguments
+		$r = wp_parse_args( $args, array(
+			'profile_group_id'       => false,
+			'user_id'                => bp_displayed_user_id(),
+			'hide_empty_groups'      => false,
+			'hide_empty_fields'      => false,
+			'fetch_fields'           => false,
+			'fetch_field_data'       => false,
+			'fetch_visibility_level' => false,
+			'exclude_groups'         => false,
+			'exclude_fields'         => false,
+			'update_meta_cache'      => true,
+		) );
+
+		// Keep track of object IDs for cache-priming
+		$object_ids = array(
+			'group' => array(),
+			'field' => array(),
+			'data'  => array(),
+		);
+
+		// WHERE
+		if ( ! empty( $r['profile_group_id'] ) ) {
+			$where_sql = $wpdb->prepare( 'WHERE g.id = %d', $r['profile_group_id'] );
+		} elseif ( $r['exclude_groups'] ) {
+			$exclude   = join( ',', wp_parse_id_list( $r['exclude_groups'] ) );
+			$where_sql = "WHERE g.id NOT IN ({$exclude})";
+		} else {
+			$where_sql = '';
+		}
+
+		$bp = buddypress();
+
+		// Include or exclude empty groups
+		if ( ! empty( $r['hide_empty_groups'] ) ) {
+			$group_ids = $wpdb->get_col( "SELECT DISTINCT g.id FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" );
+		} else {
+			$group_ids = $wpdb->get_col( "SELECT DISTINCT g.id FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" );
+		}
+
+		// Get all group data
+		$groups = self::get_group_data( $group_ids );
+
+		// Bail if not also getting fields
+		if ( empty( $r['fetch_fields'] ) ) {
+			return $groups;
+		}
+
+		// Get the group ids from the groups we found
+		$group_ids = wp_list_pluck( $groups, 'id' );
+
+		// Store for meta cache priming
+		$object_ids['group'] = $group_ids;
+
+		// Bail if no groups foundS
+		if ( empty( $group_ids ) ) {
+			return $groups;
+		}
+
+		// Setup IN query from group IDs
+		$group_ids_in = implode( ',', (array) $group_ids );
+
+		// Support arrays and comma-separated strings
+		$exclude_fields_cs = wp_parse_id_list( $r['exclude_fields'] );
+
+		// Visibility - Handled here so as not to be overridden by sloppy use of the
+		// exclude_fields parameter. See bp_xprofile_get_hidden_fields_for_user()
+		$hidden_user_fields = bp_xprofile_get_hidden_fields_for_user( $r['user_id'] );
+		$exclude_fields_cs  = array_merge( $exclude_fields_cs, $hidden_user_fields );
+		$exclude_fields_cs  = implode( ',', $exclude_fields_cs );
+
+		// Setup IN query for field IDs
+		if ( ! empty( $exclude_fields_cs ) ) {
+			$exclude_fields_sql = "AND id NOT IN ({$exclude_fields_cs})";
+		} else {
+			$exclude_fields_sql = '';
+		}
+
+		// Fetch the fields
+		$fields    = $wpdb->get_results( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids_in} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" );
+		$field_ids = wp_list_pluck( $fields, 'id' );
+
+		// Store field IDs for meta cache priming
+		$object_ids['field'] = $field_ids;
+
+		// Bail if no fields
+		if ( empty( $fields ) ) {
+			return $groups;
+		}
+
+		// Maybe fetch field data
+		if ( ! empty( $r['fetch_field_data'] ) ) {
+
+			// Get field data for user ID
+			if ( ! empty( $field_ids ) && ! empty( $r['user_id'] ) ) {
+				$field_data = BP_XProfile_ProfileData::get_data_for_user( $r['user_id'], $field_ids );
+			}
+
+			// Remove data-less fields, if necessary
+			if ( ! empty( $r['hide_empty_fields'] ) && ! empty( $field_ids ) && ! empty( $field_data ) ) {
+
+				// Loop through the results and find the fields that have data.
+				foreach( (array) $field_data as $data ) {
+
+					// Empty fields may contain a serialized empty array
+					$maybe_value = maybe_unserialize( $data->value );
+
+					// Valid field values of 0 or '0' get caught by empty(), so we have an extra check for these. See #BP5731
+					if ( ( ! empty( $maybe_value ) || '0' == $maybe_value ) && false !== $key = array_search( $data->field_id, $field_ids ) ) {
+
+						// Fields that have data get removed from the list
+						unset( $field_ids[ $key ] );
+					}
+				}
+
+				// The remaining members of $field_ids are empty. Remove them.
+				foreach( $fields as $field_key => $field ) {
+					if ( in_array( $field->id, $field_ids ) ) {
+						unset( $fields[ $field_key ] );
+					}
+				}
+
+				// Reset indexes
+				$fields = array_values( $fields );
+			}
+
+			// Field data was found
+			if ( ! empty( $fields ) && ! empty( $field_data ) && ! is_wp_error( $field_data ) ) {
+
+				// Loop through fields
+				foreach( (array) $fields as $field_key => $field ) {
+
+					// Loop through the data in each field
+					foreach( (array) $field_data as $data ) {
+
+						// Assign correct data value to the field
+						if ( $field->id == $data->field_id ) {
+							$fields[ $field_key ]->data        = new stdClass;
+							$fields[ $field_key ]->data->value = $data->value;
+							$fields[ $field_key ]->data->id    = $data->id;
+						}
+
+						// Store for meta cache priming
+						$object_ids['data'][] = $data->id;
+					}
+				}
+			}
+		}
+
+		// Prime the meta cache, if necessary
+		if ( ! empty( $r['update_meta_cache'] ) ) {
+			bp_xprofile_update_meta_cache( $object_ids );
+		}
+
+		// Maybe fetch visibility levels
+		if ( ! empty( $r['fetch_visibility_level'] ) ) {
+			$fields = self::fetch_visibility_level( $r['user_id'], $fields );
+		}
+
+		// Merge the field array back in with the group array
+		foreach( (array) $groups as $group ) {
+
+			// Indexes may have been shifted after previous deletions, so we get a
+			// fresh one each time through the loop
+			$index = array_search( $group, $groups );
+
+			foreach( (array) $fields as $field ) {
+				if ( $group->id === $field->group_id ) {
+					$groups[ $index ]->fields[] = $field;
+				}
+			}
+
+			// When we unset fields above, we may have created empty groups.
+			// Remove them, if necessary.
+			if ( empty( $group->fields ) && ! empty( $r['hide_empty_groups'] ) ) {
+				unset( $groups[ $index ] );
+			}
+
+			// Reset indexes
+			$groups = array_values( $groups );
+		}
+
+		return $groups;
+	}
+
+	/**
+	 * Get data about a set of groups, based on IDs.
+	 *
+	 * @since BuddyPress (2.0.0)
+	 *
+	 * @param array $group_ids Array of IDs.
+	 * @return array
+	 */
+	protected static function get_group_data( $group_ids ) {
+		global $wpdb;
+
+		// Bail if no group IDs are passed
+		if ( empty( $group_ids ) ) {
+			return array();
+		}
+
+		// Setup empty arrays
+		$groups        = array();
+		$uncached_gids = array();
+
+		// Loop through groups and look for cached & uncached data
+		foreach ( $group_ids as $group_id ) {
+
+			// If cached data is found, use it
+			$group_data = wp_cache_get( $group_id, 'bp_xprofile_groups' );
+			if ( false !== $group_data ) {
+				$groups[ $group_id ] = $group_data;
+
+			// Otherwise leave a placeholder so we don't lose the order
+			} else {
+				$groups[ $group_id ] = '';
+
+				// Add to the list of items to be queried
+				$uncached_gids[] = $group_id;
+			}
+		}
+
+		// Fetch uncached data from the DB if necessary
+		if ( ! empty( $uncached_gids ) ) {
+
+			// Setup IN query for uncached group data
+			$uncached_gids_sql = implode( ',', wp_parse_id_list( $uncached_gids ) );
+
+			// Get table name to query
+			$table_name = buddypress()->profile->table_name_groups;
+
+			// Fetch data, preserving order
+			$queried_gdata = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE id IN ({$uncached_gids_sql}) ORDER BY FIELD( id, {$uncached_gids_sql} )");
+
+			// Make sure query returned valid data
+			if ( ! empty( $queried_gdata ) && ! is_wp_error( $queried_gdata ) ) {
+
+				// Put queried data into the placeholders created earlier,
+				// and add it to the cache
+				foreach ( (array) $queried_gdata as $gdata ) {
+
+					// Add group to groups array
+					$groups[ $gdata->id ] = $gdata;
+
+					// Cache previously uncached group data
+					wp_cache_set( $gdata->id, $gdata, 'bp_xprofile_groups' );
+				}
+			}
+		}
+
+		// Reset indexes & return
+		return array_values( $groups );
+	}
+
+	/**
+	 * Validate field group when form submitted
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @global string $message
+	 *
+	 * @return boolean
+	 */
+	public static function admin_validate() {
+		global $message;
+
+		// Validate Form
+		if ( empty( $_POST['group_name'] ) ) {
+			$message = __( 'Please make sure you give the group a name.', 'buddypress' );
+			return false;
+		} else {
+			return true;
+		}
+	}
+
+	/**
+	 * Update field group position
+	 *
+	 * @since BuddyPress (1.5.0)
+	 *
+	 * @global $wpdb $wpdb
+	 * @param  int $field_group_id
+	 * @param  int $position
+	 *
+	 * @return boolean
+	 */
+	public static function update_position( $field_group_id, $position ) {
+		global $wpdb;
+
+		if ( ! is_numeric( $position ) ) {
+			return false;
+		}
+
+		// Purge profile field group cache
+		wp_cache_delete( 'all', 'bp_xprofile_groups' );
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
+	}
+
+	/**
+	 * Fetch the field visibility level for the fields returned by the query
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @param int $user_id The profile owner's user_id
+	 * @param array $fields The database results returned by the get() query
+	 * @return array $fields The database results, with field_visibility added
+	 */
+	public static function fetch_visibility_level( $user_id = 0, $fields = array() ) {
+
+		// Get the user's visibility level preferences
+		$visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
+
+		foreach( (array) $fields as $key => $field ) {
+
+			// Does the admin allow this field to be customized?
+			$visibility   = bp_xprofile_get_meta( $field->id, 'field', 'allow_custom_visibility' );
+			$allow_custom = (bool) ( 'disabled' !== $visibility );
+
+			// Look to see if the user has set the visibility for this field
+			if ( ( true === $allow_custom ) && isset( $visibility_levels[ $field->id ] ) ) {
+				$field_visibility = $visibility_levels[ $field->id ];
+
+			// If no admin-set default is saved, fall back on a global default
+			} else {
+				$fallback_visibility = bp_xprofile_get_meta( $field->id, 'field', 'default_visibility' );
+
+				/**
+				 * Filters the XProfile default visibility level for a field.
+				 *
+				 * @since BuddyPress (1.6.0)
+				 *
+				 * @param string $value Default visibility value.
+				 */
+				$field_visibility = ! empty( $fallback_visibility )
+					? $fallback_visibility
+					: apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
+			}
+
+			$fields[ $key ]->visibility_level = $field_visibility;
+		}
+
+		return $fields;
+	}
+
+	/**
+	 * Fetch the admin-set preferences for all fields.
+	 *
+	 * @since BuddyPress (1.6.0)
+	 *
+	 * @return array $default_visibility_levels An array, keyed by
+	 *         field_id, of default visibility level + allow_custom
+	 *         (whether the admin allows this field to be set by user)
+	 */
+	public static function fetch_default_visibility_levels() {
+		global $wpdb;
+
+		$default_visibility_levels = wp_cache_get( 'default_visibility_levels', 'bp_xprofile' );
+
+		if ( false === $default_visibility_levels ) {
+			$bp = buddypress();
+
+			$levels = $wpdb->get_results( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" );
+
+			// Arrange so that the field id is the key and the visibility level the value
+			$default_visibility_levels = array();
+			foreach ( $levels as $level ) {
+				switch ( $level->meta_key ) {
+					case 'default_visibility' :
+						$default_visibility_levels[ $level->object_id ]['default']      = $level->meta_value;
+						break;
+					case 'allow_custom_visibility' :
+						$default_visibility_levels[ $level->object_id ]['allow_custom'] = $level->meta_value;
+						break;
+				}
+			}
+
+			wp_cache_set( 'default_visibility_levels', $default_visibility_levels, 'bp_xprofile' );
+		}
+
+		return $default_visibility_levels;
+	}
+
+	/** Admin Output **********************************************************/
+
+	/**
+	 * Output the admin area field group form
+	 *
+	 * @since BuddyPress (1.0.0)
+	 *
+	 * @global string $message
+	 */
+	public function render_admin_form() {
+		global $message;
+
+		// New field group
+		if ( empty( $this->id ) ) {
+			$title	= __( 'Add New Field Group', 'buddypress' );
+			$action	= add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'add_group' ), 'users.php' );
+			$button	= __( 'Save', 'buddypress' );
+
+		// Existing field group
+		} else {
+			$title  = __( 'Edit Field Group', 'buddypress' );
+			$action	= add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'edit_group', 'group_id' => $this->id ), 'users.php' );
+			$button	= __( 'Update', 'buddypress' );
+		} ?>
+
+		<div class="wrap">
+
+			<?php screen_icon( 'users' ); ?>
+
+			<h2><?php echo esc_html( $title ); ?></h2>
+
+			<?php if ( ! empty( $message ) ) : ?>
+
+				<div id="message" class="error fade">
+					<p><?php echo esc_html( $message ); ?></p>
+				</div>
+
+			<?php endif; ?>
+
+			<form id="bp-xprofile-add-field-group" action="<?php echo esc_url( $action ); ?>" method="post">
+				<div id="poststuff">
+					<div id="post-body" class="metabox-holder columns-<?php echo ( 1 == get_current_screen()->get_columns() ) ? '1' : '2'; ?>">
+						<div id="post-body-content">
+							<div id="titlediv">
+								<div class="titlewrap">
+									<label id="title-prompt-text" for="title"><?php esc_html_e( 'Field Group Name', 'buddypress') ?></label>
+									<input type="text" name="group_name" id="title" value="<?php echo esc_attr( $this->name ); ?>" autocomplete="off" />
+								</div>
+							</div>
+							<div class="postbox">
+								<h3><?php _e( 'Field Group Description', 'buddypress' ); ?></h3>
+								<div class="inside">
+									<textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea>
+								</div>
+							</div>
+						</div><!-- #post-body-content -->
+
+						<div id="postbox-container-1" class="postbox-container">
+
+							<?php
+
+							/**
+							 * Fires before XProfile Group submit metabox.
+							 *
+							 * @since BuddyPress (2.1.0)
+							 *
+							 * @param BP_XProfile_Group $this Current XProfile group.
+							 */
+							do_action( 'xprofile_group_before_submitbox', $this ); ?>
+
+							<div id="submitdiv" class="postbox">
+								<h3><?php _e( 'Submit', 'buddypress' ); ?></h3>
+								<div class="inside">
+									<div id="submitcomment" class="submitbox">
+										<div id="major-publishing-actions">
+
+											<?php
+
+											/**
+											 * Fires at the beginning of the XProfile Group publishing actions section.
+											 *
+											 * @since BuddyPress (2.1.0)
+											 *
+											 * @param BP_XProfile_Group $this Current XProfile group.
+											 */
+											do_action( 'xprofile_group_submitbox_start', $this ); ?>
+
+											<input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" />
+											<div id="publishing-action">
+												<input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/>
+											</div>
+											<div id="delete-action">
+												<a href="users.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
+											</div>
+											<div class="clear"></div>
+										</div>
+									</div>
+								</div>
+							</div>
+
+							<?php
+
+							/**
+							 * Fires after XProfile Group submit metabox.
+							 *
+							 * @since BuddyPress (2.1.0)
+							 *
+							 * @param BP_XProfile_Group $this Current XProfile group.
+							 */
+							do_action( 'xprofile_group_after_submitbox', $this ); ?>
+
+						</div>
+					</div>
+				</div>
+			</form>
+		</div>
+
+	<?php
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-meta-query.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-meta-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..0bfa17e760a349c4282d51ae85614b42d64f55cf
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-meta-query.php
@@ -0,0 +1,368 @@
+<?php
+
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Class for generating SQL clauses that filter a primary query according to
+ * XProfile metadata keys and values.
+ *
+ * `BP_XProfile_Meta_Query` is a helper that allows primary query classes, such
+ * as {@see WP_Query} and {@see WP_User_Query}, to filter their results by object
+ * metadata, by generating `JOIN` and `WHERE` subclauses to be attached
+ * to the primary SQL query string.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+class BP_XProfile_Meta_Query extends WP_Meta_Query {
+
+	/**
+	 * Determine whether a query clause is first-order.
+	 *
+	 * A first-order meta query clause is one that has either a 'key', 'value',
+	 * or 'object' array key.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 * @access protected
+	 *
+	 * @param array $query Meta query arguments.
+	 * @return bool Whether the query clause is a first-order clause.
+	 */
+	protected function is_first_order_clause( $query ) {
+		return isset( $query['key'] ) || isset( $query['value'] ) || isset( $query['object'] );
+	}
+
+	/**
+	 * Constructs a meta query based on 'meta_*' query vars
+	 *
+	 * @since BuddyPress (2.3.0)
+	 * @access public
+	 *
+	 * @param array $qv The query variables
+	 */
+	public function parse_query_vars( $qv ) {
+		$meta_query = array();
+
+		/*
+		 * For orderby=meta_value to work correctly, simple query needs to be
+		 * first (so that its table join is against an unaliased meta table) and
+		 * needs to be its own clause (so it doesn't interfere with the logic of
+		 * the rest of the meta_query).
+		 */
+		$primary_meta_query = array();
+		foreach ( array( 'key', 'compare', 'type' ) as $key ) {
+			if ( ! empty( $qv[ "meta_$key" ] ) ) {
+				$primary_meta_query[ $key ] = $qv[ "meta_$key" ];
+			}
+		}
+
+		// WP_Query sets 'meta_value' = '' by default.
+		if ( isset( $qv['meta_value'] ) && ( '' !== $qv['meta_value'] ) && ( ! is_array( $qv['meta_value'] ) || $qv['meta_value'] ) ) {
+			$primary_meta_query['value'] = $qv['meta_value'];
+		}
+
+		// BP_XProfile_Query sets 'object_type' = '' by default
+		if ( isset( $qv[ 'object_type' ] ) && ( '' !== $qv[ 'object_type' ] ) && ( ! is_array( $qv[ 'object_type' ] ) || $qv[ 'object_type' ] ) ) {
+			$meta_query[0]['object'] = $qv[ 'object_type' ];
+		}
+
+		$existing_meta_query = isset( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ? $qv['meta_query'] : array();
+
+		if ( ! empty( $primary_meta_query ) && ! empty( $existing_meta_query ) ) {
+			$meta_query = array(
+				'relation' => 'AND',
+				$primary_meta_query,
+				$existing_meta_query,
+			);
+		} elseif ( ! empty( $primary_meta_query ) ) {
+			$meta_query = array(
+				$primary_meta_query,
+			);
+		} elseif ( ! empty( $existing_meta_query ) ) {
+			$meta_query = $existing_meta_query;
+		}
+
+		$this->__construct( $meta_query );
+	}
+
+	/**
+	 * Generates SQL clauses to be appended to a main query.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 * @access public
+	 *
+	 * @param string $type              Type of meta, eg 'user', 'post'.
+	 * @param string $primary_table     Database table where the object being filtered is stored (eg wp_users).
+	 * @param string $primary_id_column ID column for the filtered object in $primary_table.
+	 * @param object $context           Optional. The main query object.
+	 * @return array {
+	 *     Array containing JOIN and WHERE SQL clauses to append to the main query.
+	 *
+	 *     @type string $join  SQL fragment to append to the main JOIN clause.
+	 *     @type string $where SQL fragment to append to the main WHERE clause.
+	 * }
+	 */
+	public function get_sql( $type, $primary_table, $primary_id_column, $context = null ) {
+		if ( ! $meta_table = _get_meta_table( $type ) ) {
+			return false;
+		}
+
+		$this->meta_table     = $meta_table;
+		$this->meta_id_column = 'object_id';
+
+		$this->primary_table     = $primary_table;
+		$this->primary_id_column = $primary_id_column;
+
+		$sql = $this->get_sql_clauses();
+
+		/*
+		 * If any JOINs are LEFT JOINs (as in the case of NOT EXISTS), then all JOINs should
+		 * be LEFT. Otherwise posts with no metadata will be excluded from results.
+		 */
+		if ( false !== strpos( $sql['join'], 'LEFT JOIN' ) ) {
+			$sql['join'] = str_replace( 'INNER JOIN', 'LEFT JOIN', $sql['join'] );
+		}
+
+		/**
+		 * Filter the meta query's generated SQL.
+		 *
+		 * @since BuddyPress (2.3.0)
+		 *
+		 * @param array $args {
+		 *     An array of meta query SQL arguments.
+		 *
+		 *     @type array  $clauses           Array containing the query's JOIN and WHERE clauses.
+		 *     @type array  $queries           Array of meta queries.
+		 *     @type string $type              Type of meta.
+		 *     @type string $primary_table     Primary table.
+		 *     @type string $primary_id_column Primary column ID.
+		 *     @type object $context           The main query object.
+		 * }
+		 */
+		return apply_filters_ref_array( 'bp_xprofile_get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) );
+	}
+
+	/**
+	 * Generate SQL JOIN and WHERE clauses for a first-order query clause.
+	 *
+	 * "First-order" means that it's an array with a 'key' or 'value'.
+	 *
+	 * @since BuddyPress (2.3.0)
+	 * @access public
+	 *
+	 * @param array  $clause       Query clause, passed by reference.
+	 * @param array  $parent_query Parent query array.
+	 * @param string $clause_key   Optional. The array key used to name the clause in the original `$meta_query`
+	 *                             parameters. If not provided, a key will be generated automatically.
+	 * @return array {
+	 *     Array containing JOIN and WHERE SQL clauses to append to a first-order query.
+	 *
+	 *     @type string $join  SQL fragment to append to the main JOIN clause.
+	 *     @type string $where SQL fragment to append to the main WHERE clause.
+	 * }
+	 */
+	public function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) {
+		global $wpdb;
+
+		$sql_chunks = array(
+			'where' => array(),
+			'join'  => array(),
+		);
+
+		if ( isset( $clause['compare'] ) ) {
+			$clause['compare'] = strtoupper( $clause['compare'] );
+		} else {
+			$clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';
+		}
+
+		if ( ! in_array( $clause['compare'], array(
+			'=', '!=', '>', '>=', '<', '<=',
+			'LIKE', 'NOT LIKE',
+			'IN', 'NOT IN',
+			'BETWEEN', 'NOT BETWEEN',
+			'EXISTS', 'NOT EXISTS',
+			'REGEXP', 'NOT REGEXP', 'RLIKE'
+		) ) ) {
+			$clause['compare'] = '=';
+		}
+
+		$meta_compare = $clause['compare'];
+
+		// First build the JOIN clause, if one is required.
+		$join = '';
+
+		// We prefer to avoid joins if possible. Look for an existing join compatible with this clause.
+		$alias = $this->find_compatible_table_alias( $clause, $parent_query );
+		if ( false === $alias ) {
+			$i = count( $this->table_aliases );
+			$alias = $i ? 'mt' . $i : $this->meta_table;
+
+			// JOIN clauses for NOT EXISTS have their own syntax.
+			if ( 'NOT EXISTS' === $meta_compare ) {
+				$join .= " LEFT JOIN $this->meta_table";
+				$join .= $i ? " AS $alias" : '';
+				$join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] );
+
+			// All other JOIN clauses.
+			} else {
+				$join .= " INNER JOIN $this->meta_table";
+				$join .= $i ? " AS $alias" : '';
+				$join .= " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column )";
+			}
+
+			$this->table_aliases[] = $alias;
+			$sql_chunks['join'][]  = $join;
+		}
+
+		// Save the alias to this clause, for future siblings to find.
+		$clause['alias'] = $alias;
+
+		// Determine the data type.
+		$_meta_type     = isset( $clause['type'] ) ? $clause['type'] : '';
+		$meta_type      = $this->get_cast_for_type( $_meta_type );
+		$clause['cast'] = $meta_type;
+
+		// Fallback for clause keys is the table alias.
+		if ( ! $clause_key ) {
+			$clause_key = $clause['alias'];
+		}
+
+		// Ensure unique clause keys, so none are overwritten.
+		$iterator = 1;
+		$clause_key_base = $clause_key;
+		while ( isset( $this->clauses[ $clause_key ] ) ) {
+			$clause_key = $clause_key_base . '-' . $iterator;
+			$iterator++;
+		}
+
+		// Store the clause in our flat array.
+		$this->clauses[ $clause_key ] =& $clause;
+
+		// Next, build the WHERE clause.
+
+		// meta_key.
+		if ( array_key_exists( 'key', $clause ) ) {
+			if ( 'NOT EXISTS' === $meta_compare ) {
+				$sql_chunks['where'][] = $alias . '.' . $this->meta_id_column . ' IS NULL';
+			} else {
+				$sql_chunks['where'][] = $wpdb->prepare( "$alias.meta_key = %s", trim( $clause['key'] ) );
+			}
+		}
+
+		// meta_value.
+		if ( array_key_exists( 'value', $clause ) ) {
+			$meta_value = $clause['value'];
+
+			if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+				if ( ! is_array( $meta_value ) ) {
+					$meta_value = preg_split( '/[,\s]+/', $meta_value );
+				}
+			} else {
+				$meta_value = trim( $meta_value );
+			}
+
+			switch ( $meta_compare ) {
+				case 'IN' :
+				case 'NOT IN' :
+					$meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')';
+					$where = $wpdb->prepare( $meta_compare_string, $meta_value );
+					break;
+
+				case 'BETWEEN' :
+				case 'NOT BETWEEN' :
+					$meta_value = array_slice( $meta_value, 0, 2 );
+					$where = $wpdb->prepare( '%s AND %s', $meta_value );
+					break;
+
+				case 'LIKE' :
+				case 'NOT LIKE' :
+					$meta_value = '%' . $wpdb->esc_like( $meta_value ) . '%';
+					$where = $wpdb->prepare( '%s', $meta_value );
+					break;
+
+				// EXISTS with a value is interpreted as '='.
+				case 'EXISTS' :
+					$meta_compare = '=';
+					$where = $wpdb->prepare( '%s', $meta_value );
+					break;
+
+				// 'value' is ignored for NOT EXISTS.
+				case 'NOT EXISTS' :
+					$where = '';
+					break;
+
+				default :
+					$where = $wpdb->prepare( '%s', $meta_value );
+					break;
+
+			}
+
+			if ( $where ) {
+				$sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}";
+			}
+		}
+
+		// object_type.
+		if ( array_key_exists( 'object', $clause ) ) {
+			$object_type = $clause['object'];
+
+			if ( in_array( $meta_compare, array( 'IN', 'NOT IN' ) ) ) {
+				if ( ! is_array( $object_type ) ) {
+					$object_type = preg_split( '/[,\s]+/', $object_type );
+				}
+			} else {
+				$object_type = trim( $object_type );
+			}
+
+			switch ( $meta_compare ) {
+				case 'IN' :
+				case 'NOT IN' :
+					$meta_compare_string = '(' . substr( str_repeat( ',%s', count( $object_type ) ), 1 ) . ')';
+					$object_where        = $wpdb->prepare( $meta_compare_string, $object_type );
+					break;
+
+				case 'LIKE' :
+				case 'NOT LIKE' :
+					$object_type  = '%' . $wpdb->esc_like( $object_type ) . '%';
+					$object_where = $wpdb->prepare( '%s', $object_type );
+					break;
+
+				// EXISTS with a value is interpreted as '='.
+				case 'EXISTS' :
+					$meta_compare = '=';
+					$object_where = $wpdb->prepare( '%s', $object_type );
+					break;
+
+				// 'value' is ignored for NOT EXISTS.
+				case 'NOT EXISTS' :
+					$object_where = '';
+					break;
+
+				default :
+					$object_where = $wpdb->prepare( '%s', $object_type );
+					break;
+			}
+
+			if ( ! empty( $object_where ) ) {
+				$sql_chunks['where'][] = "{$alias}.object_type {$meta_compare} {$object_where}";
+			}
+		}
+
+		/*
+		 * Multiple WHERE clauses (for meta_key and meta_value) should
+		 * be joined in parentheses.
+		 */
+		if ( 1 < count( $sql_chunks['where'] ) ) {
+			$sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );
+		}
+
+		return $sql_chunks;
+	}
+}
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php
new file mode 100644
index 0000000000000000000000000000000000000000..7f335ab2dbfe65af1d3d58b249f7ac2aa53c23af
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php
@@ -0,0 +1,528 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+class BP_XProfile_ProfileData {
+	public $id;
+	public $user_id;
+	public $field_id;
+	public $value;
+	public $last_updated;
+
+	public function __construct( $field_id = null, $user_id = null ) {
+		if ( !empty( $field_id ) ) {
+			$this->populate( $field_id, $user_id );
+		}
+	}
+
+	public function populate( $field_id, $user_id )  {
+		global $wpdb;
+
+		$cache_key   = "{$user_id}:{$field_id}";
+		$profiledata = wp_cache_get( $cache_key, 'bp_xprofile_data' );
+
+		if ( false === $profiledata ) {
+			$bp = buddypress();
+
+			$sql         = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
+			$profiledata = $wpdb->get_row( $sql );
+
+			if ( $profiledata ) {
+				wp_cache_set( $cache_key, $profiledata, 'bp_xprofile_data' );
+			}
+		}
+
+		if ( $profiledata ) {
+			$this->id           = $profiledata->id;
+			$this->user_id      = $profiledata->user_id;
+			$this->field_id     = $profiledata->field_id;
+			$this->value        = stripslashes( $profiledata->value );
+			$this->last_updated = $profiledata->last_updated;
+
+		} else {
+			// When no row is found, we'll need to set these properties manually
+			$this->field_id	    = $field_id;
+			$this->user_id	    = $user_id;
+		}
+	}
+
+	/**
+	 * Check if there is data already for the user.
+	 *
+	 * @global object $wpdb
+	 * @global array $bp
+	 * @return bool
+	 */
+	public function exists() {
+		global $wpdb;
+
+		// Check cache first
+		$cache_key = "{$this->user_id}:{$this->field_id}";
+		$cached    = wp_cache_get( $cache_key, 'bp_xprofile_data' );
+
+		if ( $cached && ! empty( $cached->id ) ) {
+			$retval = true;
+		} else {
+			$bp = buddypress();
+			$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $this->user_id, $this->field_id ) );
+		}
+
+		/**
+		 * Filters whether or not data already exists for the user.
+		 *
+		 * @since BuddyPress (1.2.7)
+		 *
+		 * @param bool                    $retval Whether or not data already exists.
+		 * @param BP_XProfile_ProfileData $this   Instance of the current BP_XProfile_ProfileData class.
+		 */
+		return apply_filters_ref_array( 'xprofile_data_exists', array( (bool)$retval, $this ) );
+	}
+
+	/**
+	 * Check if this data is for a valid field.
+	 *
+	 * @global object $wpdb
+	 * @return bool
+	 */
+	public function is_valid_field() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$retval = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = %d", $this->field_id ) );
+
+		/**
+		 * Filters whether or not data is for a valid field
+		 *
+		 * @since BuddyPress (1.2.7)
+		 *
+		 * @param bool                    $retval Whether or not data is valid.
+		 * @param BP_XProfile_ProfileData $this   Instance of the current BP_XProfile_ProfileData class.
+		 */
+		return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) );
+	}
+
+	public function save() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$this->user_id      = apply_filters( 'xprofile_data_user_id_before_save',      $this->user_id,         $this->id );
+		$this->field_id     = apply_filters( 'xprofile_data_field_id_before_save',     $this->field_id,        $this->id );
+		$this->value        = apply_filters( 'xprofile_data_value_before_save',        $this->value,           $this->id, true, $this );
+		$this->last_updated = apply_filters( 'xprofile_data_last_updated_before_save', bp_core_current_time(), $this->id );
+
+		/**
+		 * Fires before the current profile data instance gets saved.
+		 *
+		 * Please use this hook to filter the properties above. Each part will be passed in.
+		 *
+		 * @since BuddyPress (1.0.0)
+		 *
+		 * @param BP_XProfile_ProfileData $this Current instance of the profile data being saved.
+		 */
+		do_action_ref_array( 'xprofile_data_before_save', array( $this ) );
+
+		if ( $this->is_valid_field() ) {
+			if ( $this->exists() && strlen( trim( $this->value ) ) ) {
+				$result   = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
+
+			} elseif ( $this->exists() && empty( $this->value ) ) {
+				// Data removed, delete the entry.
+				$result   = $this->delete();
+
+			} else {
+				$result   = $wpdb->query( $wpdb->prepare("INSERT INTO {$bp->profile->table_name_data} (user_id, field_id, value, last_updated) VALUES (%d, %d, %s, %s)", $this->user_id, $this->field_id, $this->value, $this->last_updated ) );
+				$this->id = $wpdb->insert_id;
+			}
+
+			if ( false === $result ) {
+				return false;
+			}
+
+			/**
+			 * Fires after the current profile data instance gets saved.
+			 *
+			 * @since BuddyPress (1.0.0)
+			 *
+			 * @param BP_XProfile_ProfileData $this Current instance of the profile data being saved.
+			 */
+			do_action_ref_array( 'xprofile_data_after_save', array( $this ) );
+
+			return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Delete specific XProfile field data
+	 *
+	 * @global object $wpdb
+	 * @return boolean
+	 */
+	public function delete() {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		/**
+		 * Fires before the current profile data instance gets deleted.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted.
+		 */
+		do_action_ref_array( 'xprofile_data_before_delete', array( $this ) );
+
+		$deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $this->field_id, $this->user_id ) );
+		if ( empty( $deleted ) ) {
+			return false;
+		}
+
+		/**
+		 * Fires after the current profile data instance gets deleted.
+		 *
+		 * @since BuddyPress (1.9.0)
+		 *
+		 * @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted.
+		 */
+		do_action_ref_array( 'xprofile_data_after_delete', array( $this ) );
+
+		return true;
+	}
+
+	/** Static Methods ********************************************************/
+
+	/**
+	 * Get a user's profile data for a set of fields.
+	 *
+	 * @param int $user_id
+	 * @param array $field_ids
+	 * @return array
+	 */
+	public static function get_data_for_user( $user_id, $field_ids ) {
+		global $wpdb;
+
+		$data = array();
+
+		$uncached_field_ids = bp_xprofile_get_non_cached_field_ids( $user_id, $field_ids );
+
+		// Prime the cache
+		if ( ! empty( $uncached_field_ids ) ) {
+			$bp = buddypress();
+			$uncached_field_ids_sql = implode( ',', wp_parse_id_list( $uncached_field_ids ) );
+			$uncached_data = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, field_id, value, last_updated FROM {$bp->profile->table_name_data} WHERE field_id IN ({$uncached_field_ids_sql}) AND user_id = %d", $user_id ) );
+
+			// Rekey
+			$queried_data = array();
+			foreach ( $uncached_data as $ud ) {
+				$d               = new stdClass;
+				$d->id           = $ud->id;
+				$d->user_id      = $ud->user_id;
+				$d->field_id     = $ud->field_id;
+				$d->value        = $ud->value;
+				$d->last_updated = $ud->last_updated;
+
+				$queried_data[ $ud->field_id ] = $d;
+			}
+
+			// Set caches
+			foreach ( $uncached_field_ids as $field_id ) {
+
+				$cache_key = "{$user_id}:{$field_id}";
+
+				// If a value was found, cache it
+				if ( isset( $queried_data[ $field_id ] ) ) {
+					wp_cache_set( $cache_key, $queried_data[ $field_id ], 'bp_xprofile_data' );
+
+				// If no value was found, cache an empty item
+				// to avoid future cache misses
+				} else {
+					$d               = new stdClass;
+					$d->id           = '';
+					$d->user_id      = '';
+					$d->field_id     = $field_id;
+					$d->value        = '';
+					$d->last_updated = '';
+
+					wp_cache_set( $cache_key, $d, 'bp_xprofile_data' );
+				}
+			}
+		}
+
+		// Now that all items are cached, fetch them
+		foreach ( $field_ids as $field_id ) {
+			$cache_key = "{$user_id}:{$field_id}";
+			$data[]    = wp_cache_get( $cache_key, 'bp_xprofile_data' );
+		}
+
+		return $data;
+	}
+
+	/**
+	 * Get all of the profile information for a specific user.
+	 *
+	 * @param int $user_id ID of the user.
+	 * @return array
+	 */
+	public static function get_all_for_user( $user_id ) {
+
+		$groups = bp_xprofile_get_groups( array(
+			'user_id'                => $user_id,
+			'hide_empty_groups'      => true,
+			'hide_empty_fields'      => true,
+			'fetch_fields'           => true,
+			'fetch_field_data'       => true,
+		) );
+
+		$profile_data = array();
+
+		if ( ! empty( $groups ) ) {
+			$user = new WP_User( $user_id );
+
+			$profile_data['user_login']    = $user->user_login;
+			$profile_data['user_nicename'] = $user->user_nicename;
+			$profile_data['user_email']    = $user->user_email;
+
+			foreach ( (array) $groups as $group ) {
+				if ( empty( $group->fields ) ) {
+					continue;
+				}
+
+				foreach ( (array) $group->fields as $field ) {
+					$profile_data[ $field->name ] = array(
+						'field_group_id'   => $group->id,
+						'field_group_name' => $group->name,
+						'field_id'         => $field->id,
+						'field_type'       => $field->type,
+						'field_data'       => $field->data->value,
+					);
+				}
+			}
+		}
+
+		return $profile_data;
+	}
+
+	/**
+	 * Get the user's field data id by the id of the xprofile field.
+	 *
+	 * @param int $field_id
+	 * @param int $user_id
+	 * @return int $fielddata_id
+	 */
+	public static function get_fielddataid_byid( $field_id, $user_id ) {
+		global $wpdb;
+
+		if ( empty( $field_id ) || empty( $user_id ) ) {
+			$fielddata_id = 0;
+		} else {
+			$bp = buddypress();
+
+			// Check cache first
+			$cache_key = "{$user_id}:{$field_id}";
+			$fielddata = wp_cache_get( $cache_key, 'bp_xprofile_data' );
+			if ( false === $fielddata || empty( $fielddata->id ) ) {
+				$fielddata_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ) );
+			} else {
+				$fielddata_id = $fielddata->id;
+			}
+		}
+
+		return $fielddata_id;
+	}
+
+	/**
+	 * Get profile field values by field ID and user IDs.
+	 *
+	 * Supports multiple user IDs.
+	 *
+	 * @param int $field_id ID of the field.
+	 * @param int|array $user_ids ID or IDs of user(s).
+	 * @return string|array Single value if a single user is queried,
+	 *         otherwise an array of results.
+	 */
+	public static function get_value_byid( $field_id, $user_ids = null ) {
+		global $wpdb;
+
+		if ( empty( $user_ids ) ) {
+			$user_ids = bp_displayed_user_id();
+		}
+
+		$is_single = false;
+		if ( ! is_array( $user_ids ) ) {
+			$user_ids  = array( $user_ids );
+			$is_single = true;
+		}
+
+		// Assemble uncached IDs
+		$uncached_ids = array();
+		foreach ( $user_ids as $user_id ) {
+			$cache_key = "{$user_id}:{$field_id}";
+			if ( false === wp_cache_get( $cache_key, 'bp_xprofile_data' ) ) {
+				$uncached_ids[] = $user_id;
+			}
+		}
+
+		// Prime caches
+		if ( ! empty( $uncached_ids ) ) {
+			$bp = buddypress();
+			$uncached_ids_sql = implode( ',', $uncached_ids );
+			$queried_data = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, field_id, value, last_updated FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id IN ({$uncached_ids_sql})", $field_id ) );
+
+			// Rekey
+			$qd = array();
+			foreach ( $queried_data as $data ) {
+				$qd[ $data->user_id ] = $data;
+			}
+
+			foreach ( $uncached_ids as $id ) {
+				// The value was successfully fetched
+				if ( isset( $qd[ $id ] ) ) {
+					$d = $qd[ $id ];
+
+				// No data found for the user, so we fake it to
+				// avoid cache misses and PHP notices
+				} else {
+					$d = new stdClass;
+					$d->id           = '';
+					$d->user_id      = $id;
+					$d->field_id     = '';
+					$d->value        = '';
+					$d->last_updated = '';
+				}
+
+				$cache_key = "{$d->user_id}:{$field_id}";
+				wp_cache_set( $cache_key, $d, 'bp_xprofile_data' );
+			}
+		}
+
+		// Now that the cache is primed with all data, fetch it
+		$data = array();
+		foreach ( $user_ids as $user_id ) {
+			$cache_key = "{$user_id}:{$field_id}";
+			$data[]    = wp_cache_get( $cache_key, 'bp_xprofile_data' );
+		}
+
+		// If a single ID was passed, just return the value
+		if ( $is_single ) {
+			return $data[0]->value;
+
+		// Otherwise return the whole array
+		} else {
+			return $data;
+		}
+	}
+
+	public static function get_value_byfieldname( $fields, $user_id = null ) {
+		global $wpdb;
+
+		if ( empty( $fields ) ) {
+			return false;
+		}
+
+		$bp = buddypress();
+
+		if ( empty( $user_id ) ) {
+			$user_id = bp_displayed_user_id();
+		}
+
+		$field_sql = '';
+
+		if ( is_array( $fields ) ) {
+			for ( $i = 0, $count = count( $fields ); $i < $count; ++$i ) {
+				if ( $i == 0 ) {
+					$field_sql .= $wpdb->prepare( "AND ( f.name = %s ", $fields[$i] );
+				} else {
+					$field_sql .= $wpdb->prepare( "OR f.name = %s ", $fields[$i] );
+				}
+			}
+
+			$field_sql .= ')';
+		} else {
+			$field_sql .= $wpdb->prepare( "AND f.name = %s", $fields );
+		}
+
+		$sql    = $wpdb->prepare( "SELECT d.value, f.name FROM {$bp->profile->table_name_data} d, {$bp->profile->table_name_fields} f WHERE d.field_id = f.id AND d.user_id = %d AND f.parent_id = 0 $field_sql", $user_id );
+		$values = $wpdb->get_results( $sql );
+
+		if ( empty( $values ) || is_wp_error( $values ) ) {
+			return false;
+		}
+
+		$new_values = array();
+
+		if ( is_array( $fields ) ) {
+			for ( $i = 0, $count = count( $values ); $i < $count; ++$i ) {
+				for ( $j = 0; $j < count( $fields ); $j++ ) {
+					if ( $values[$i]->name == $fields[$j] ) {
+						$new_values[$fields[$j]] = $values[$i]->value;
+					} elseif ( !array_key_exists( $fields[$j], $new_values ) ) {
+						$new_values[$fields[$j]] = NULL;
+					}
+				}
+			}
+		} else {
+			$new_values = $values[0]->value;
+		}
+
+		return $new_values;
+	}
+
+	public static function delete_for_field( $field_id ) {
+		global $wpdb;
+
+		$bp      = buddypress();
+		$deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE field_id = %d", $field_id ) );
+		if ( empty( $deleted ) || is_wp_error( $deleted ) ) {
+			return false;
+		}
+
+		return true;
+	}
+
+	public static function get_last_updated( $user_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		$last_updated = $wpdb->get_var( $wpdb->prepare( "SELECT last_updated FROM {$bp->profile->table_name_data} WHERE user_id = %d ORDER BY last_updated LIMIT 1", $user_id ) );
+
+		return $last_updated;
+	}
+
+	public static function delete_data_for_user( $user_id ) {
+		global $wpdb;
+
+		$bp = buddypress();
+
+		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d", $user_id ) );
+	}
+
+	public static function get_random( $user_id, $exclude_fullname ) {
+		global $wpdb;
+
+		$exclude_sql = ! empty( $exclude_fullname ) ? ' AND pf.id != 1' : '';
+
+		$bp = buddypress();
+
+		return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) );
+	}
+
+	public static function get_fullname( $user_id = 0 ) {
+
+		if ( empty( $user_id ) ) {
+			$user_id = bp_displayed_user_id();
+		}
+
+		return xprofile_get_field_data( bp_xprofile_fullname_field_id(), $user_id );
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-query.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-query.php
new file mode 100644
index 0000000000000000000000000000000000000000..0e72668e95beb0d11d0fbaf5e09e16fdbffe3aed
--- /dev/null
+++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-query.php
@@ -0,0 +1,543 @@
+<?php
+/**
+ * BuddyPress XProfile Classes
+ *
+ * @package BuddyPress
+ * @subpackage XProfileClasses
+ */
+
+// Exit if accessed directly
+defined( 'ABSPATH' ) || exit;
+
+/**
+ * Class for generating SQL clauses to filter a user query by xprofile data.
+ *
+ * @since BuddyPress (2.2.0)
+ */
+class BP_XProfile_Query {
+	/**
+	 * Array of xprofile queries.
+	 *
+	 * See {@see WP_XProfile_Query::__construct()} for information on parameters.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 * @var    array
+	 */
+	public $queries = array();
+
+	/**
+	 * Database table that where the metadata's objects are stored (eg $wpdb->users).
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 * @var    string
+	 */
+	public $primary_table;
+
+	/**
+	 * Column in primary_table that represents the ID of the object.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 * @var    string
+	 */
+	public $primary_id_column;
+
+	/**
+	 * A flat list of table aliases used in JOIN clauses.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access protected
+	 * @var    array
+	 */
+	protected $table_aliases = array();
+
+	/**
+	 * Constructor.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param array $xprofile_query {
+	 *     Array of xprofile query clauses.
+	 *
+	 *     @type string $relation Optional. The MySQL keyword used to join the clauses of the query.
+	 *                            Accepts 'AND', or 'OR'. Default 'AND'.
+	 *     @type array {
+	 *         Optional. An array of first-order clause parameters, or another fully-formed xprofile query.
+	 *
+	 *         @type string|int $field   XProfile field to filter by. Accepts a field name or ID.
+	 *         @type string     $value   XProfile value to filter by.
+	 *         @type string     $compare MySQL operator used for comparing the $value. Accepts '=', '!=', '>',
+	 *                                   '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN',
+	 *                                   'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', or 'RLIKE'. Default is 'IN'
+	 *                                   when `$value` is an array, '=' otherwise.
+	 *         @type string     $type    MySQL data type that the `value` column will be CAST to for comparisons.
+	 *                                   Accepts 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL',
+	 *                                   'SIGNED', 'TIME', or 'UNSIGNED'. Default is 'CHAR'.
+	 *     }
+	 * }
+	 */
+	public function __construct( $xprofile_query ) {
+		if ( empty( $xprofile_query ) ) {
+			return;
+		}
+
+		$this->queries = $this->sanitize_query( $xprofile_query );
+	}
+
+	/**
+	 * Ensure the `xprofile_query` argument passed to the class constructor is well-formed.
+	 *
+	 * Eliminates empty items and ensures that a 'relation' is set.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param  array $queries Array of query clauses.
+	 * @return array Sanitized array of query clauses.
+	 */
+	public function sanitize_query( $queries ) {
+		$clean_queries = array();
+
+		if ( ! is_array( $queries ) ) {
+			return $clean_queries;
+		}
+
+		foreach ( $queries as $key => $query ) {
+			if ( 'relation' === $key ) {
+				$relation = $query;
+
+			} elseif ( ! is_array( $query ) ) {
+				continue;
+
+			// First-order clause.
+			} elseif ( $this->is_first_order_clause( $query ) ) {
+				if ( isset( $query['value'] ) && array() === $query['value'] ) {
+					unset( $query['value'] );
+				}
+
+				$clean_queries[] = $query;
+
+			// Otherwise, it's a nested query, so we recurse.
+			} else {
+				$cleaned_query = $this->sanitize_query( $query );
+
+				if ( ! empty( $cleaned_query ) ) {
+					$clean_queries[] = $cleaned_query;
+				}
+			}
+		}
+
+		if ( empty( $clean_queries ) ) {
+			return $clean_queries;
+		}
+
+		// Sanitize the 'relation' key provided in the query.
+		if ( isset( $relation ) && 'OR' === strtoupper( $relation ) ) {
+			$clean_queries['relation'] = 'OR';
+
+		/*
+		 * If there is only a single clause, call the relation 'OR'.
+		 * This value will not actually be used to join clauses, but it
+		 * simplifies the logic around combining key-only queries.
+		 */
+		} elseif ( 1 === count( $clean_queries ) ) {
+			$clean_queries['relation'] = 'OR';
+
+		// Default to AND.
+		} else {
+			$clean_queries['relation'] = 'AND';
+		}
+
+		return $clean_queries;
+	}
+
+	/**
+	 * Determine whether a query clause is first-order.
+	 *
+	 * A first-order query clause is one that has either a 'key' or a 'value' array key.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array $query XProfile query arguments.
+	 * @return bool  Whether the query clause is a first-order clause.
+	 */
+	protected function is_first_order_clause( $query ) {
+		return isset( $query['field'] ) || isset( $query['value'] );
+	}
+
+	/**
+	 * Return the appropriate alias for the given field type if applicable.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param  string $type MySQL type to cast `value`.
+	 * @return string MySQL type.
+	 */
+	public function get_cast_for_type( $type = '' ) {
+		if ( empty( $type ) ) {
+			return 'CHAR';
+		}
+
+		$meta_type = strtoupper( $type );
+
+		if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) {
+			return 'CHAR';
+		}
+
+		if ( 'NUMERIC' === $meta_type ) {
+			$meta_type = 'SIGNED';
+		}
+
+		return $meta_type;
+	}
+
+	/**
+	 * Generate SQL clauses to be appended to a main query.
+	 *
+	 * Called by the public {@see BP_XProfile_Query::get_sql()}, this method is abstracted out to maintain parity
+	 * with WP's Query classes.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @return array {
+	 *     Array containing JOIN and WHERE SQL clauses to append to the main query.
+	 *
+	 *     @type string $join  SQL fragment to append to the main JOIN clause.
+	 *     @type string $where SQL fragment to append to the main WHERE clause.
+	 * }
+	 */
+	protected function get_sql_clauses() {
+		/*
+		 * $queries are passed by reference to get_sql_for_query() for recursion.
+		 * To keep $this->queries unaltered, pass a copy.
+		 */
+		$queries = $this->queries;
+		$sql = $this->get_sql_for_query( $queries );
+
+		if ( ! empty( $sql['where'] ) ) {
+			$sql['where'] = ' AND ' . $sql['where'];
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Generate SQL clauses for a single query array.
+	 *
+	 * If nested subqueries are found, this method recurses the tree to produce the properly nested SQL.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array $query Query to parse.
+	 * @param  int   $depth Optional. Number of tree levels deep we currently are. Used to calculate indentation.
+	 * @return array {
+	 *     Array containing JOIN and WHERE SQL clauses to append to a single query array.
+	 *
+	 *     @type string $join  SQL fragment to append to the main JOIN clause.
+	 *     @type string $where SQL fragment to append to the main WHERE clause.
+	 * }
+	 */
+	protected function get_sql_for_query( &$query, $depth = 0 ) {
+		$sql_chunks = array(
+			'join'  => array(),
+			'where' => array(),
+		);
+
+		$sql = array(
+			'join'  => '',
+			'where' => '',
+		);
+
+		$indent = '';
+		for ( $i = 0; $i < $depth; $i++ ) {
+			$indent .= "  ";
+		}
+
+		foreach ( $query as $key => &$clause ) {
+			if ( 'relation' === $key ) {
+				$relation = $query['relation'];
+			} elseif ( is_array( $clause ) ) {
+
+				// This is a first-order clause.
+				if ( $this->is_first_order_clause( $clause ) ) {
+					$clause_sql = $this->get_sql_for_clause( $clause, $query );
+
+					$where_count = count( $clause_sql['where'] );
+					if ( ! $where_count ) {
+						$sql_chunks['where'][] = '';
+					} elseif ( 1 === $where_count ) {
+						$sql_chunks['where'][] = $clause_sql['where'][0];
+					} else {
+						$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
+					}
+
+					$sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] );
+				// This is a subquery, so we recurse.
+				} else {
+					$clause_sql = $this->get_sql_for_query( $clause, $depth + 1 );
+
+					$sql_chunks['where'][] = $clause_sql['where'];
+					$sql_chunks['join'][]  = $clause_sql['join'];
+				}
+			}
+		}
+
+		// Filter to remove empties.
+		$sql_chunks['join']  = array_filter( $sql_chunks['join'] );
+		$sql_chunks['where'] = array_filter( $sql_chunks['where'] );
+
+		if ( empty( $relation ) ) {
+			$relation = 'AND';
+		}
+
+		// Filter duplicate JOIN clauses and combine into a single string.
+		if ( ! empty( $sql_chunks['join'] ) ) {
+			$sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) );
+		}
+
+		// Generate a single WHERE clause with proper brackets and indentation.
+		if ( ! empty( $sql_chunks['where'] ) ) {
+			$sql['where'] = '( ' . "\n  " . $indent . implode( ' ' . "\n  " . $indent . $relation . ' ' . "\n  " . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')';
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Generates SQL clauses to be appended to a main query.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param string $primary_table     Database table where the object being filtered is stored (eg wp_users).
+	 * @param string $primary_id_column ID column for the filtered object in $primary_table.
+	 * @return array {
+	 *     Array containing JOIN and WHERE SQL clauses to append to the main query.
+	 *
+	 *     @type string $join  SQL fragment to append to the main JOIN clause.
+	 *     @type string $where SQL fragment to append to the main WHERE clause.
+	 * }
+	 */
+	public function get_sql( $primary_table, $primary_id_column ) {
+
+		$this->primary_table     = $primary_table;
+		$this->primary_id_column = $primary_id_column;
+
+		$sql = $this->get_sql_clauses();
+
+		/*
+		 * If any JOINs are LEFT JOINs (as in the case of NOT EXISTS), then all JOINs should
+		 * be LEFT. Otherwise posts with no metadata will be excluded from results.
+		 */
+		if ( false !== strpos( $sql['join'], 'LEFT JOIN' ) ) {
+			$sql['join'] = str_replace( 'INNER JOIN', 'LEFT JOIN', $sql['join'] );
+		}
+
+		return $sql;
+	}
+
+	/**
+	 * Generate SQL JOIN and WHERE clauses for a first-order query clause.
+	 *
+	 * "First-order" means that it's an array with a 'field' or 'value'.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access public
+	 *
+	 * @param array $clause       Query clause.
+	 * @param array $parent_query Parent query array.
+	 * @return array {
+	 *     Array containing JOIN and WHERE SQL clauses to append to a first-order query.
+	 *
+	 *     @type string $join  SQL fragment to append to the main JOIN clause.
+	 *     @type string $where SQL fragment to append to the main WHERE clause.
+	 * }
+	 */
+	public function get_sql_for_clause( &$clause, $parent_query ) {
+		global $wpdb;
+
+		$sql_chunks = array(
+			'where' => array(),
+			'join' => array(),
+		);
+
+		if ( isset( $clause['compare'] ) ) {
+			$clause['compare'] = strtoupper( $clause['compare'] );
+		} else {
+			$clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '=';
+		}
+
+		if ( ! in_array( $clause['compare'], array(
+			'=', '!=', '>', '>=', '<', '<=',
+			'LIKE', 'NOT LIKE',
+			'IN', 'NOT IN',
+			'BETWEEN', 'NOT BETWEEN',
+			'EXISTS', 'NOT EXISTS',
+			'REGEXP', 'NOT REGEXP', 'RLIKE'
+		) ) ) {
+			$clause['compare'] = '=';
+		}
+
+		$field_compare = $clause['compare'];
+
+		// First build the JOIN clause, if one is required.
+		$join = '';
+
+		$data_table = buddypress()->profile->table_name_data;
+
+		// We prefer to avoid joins if possible. Look for an existing join compatible with this clause.
+		$alias = $this->find_compatible_table_alias( $clause, $parent_query );
+		if ( false === $alias ) {
+			$i = count( $this->table_aliases );
+			$alias = $i ? 'xpq' . $i : $data_table;
+
+			// JOIN clauses for NOT EXISTS have their own syntax.
+			if ( 'NOT EXISTS' === $field_compare ) {
+				$join .= " LEFT JOIN $data_table";
+				$join .= $i ? " AS $alias" : '';
+				$join .= $wpdb->prepare( " ON ($this->primary_table.$this->primary_id_column = $alias.user_id AND $alias.field_id = %d )", $clause['field'] );
+
+			// All other JOIN clauses.
+			} else {
+				$join .= " INNER JOIN $data_table";
+				$join .= $i ? " AS $alias" : '';
+				$join .= " ON ( $this->primary_table.$this->primary_id_column = $alias.user_id )";
+			}
+
+			$this->table_aliases[] = $alias;
+			$sql_chunks['join'][] = $join;
+		}
+
+		// Save the alias to this clause, for future siblings to find.
+		$clause['alias'] = $alias;
+
+		// Next, build the WHERE clause.
+		$where = '';
+
+		// field_id.
+		if ( array_key_exists( 'field', $clause ) ) {
+			// Convert field name to ID if necessary.
+			if ( ! is_numeric( $clause['field'] ) ) {
+				$clause['field'] = xprofile_get_field_id_from_name( $clause['field'] );
+			}
+
+			// NOT EXISTS has its own syntax.
+			if ( 'NOT EXISTS' === $field_compare ) {
+				$sql_chunks['where'][] = $alias . '.user_id IS NULL';
+			} else {
+				$sql_chunks['where'][] = $wpdb->prepare( "$alias.field_id = %d", $clause['field'] );
+			}
+		}
+
+		// value.
+		if ( array_key_exists( 'value', $clause ) ) {
+			$field_value = $clause['value'];
+			$field_type = $this->get_cast_for_type( isset( $clause['type'] ) ? $clause['type'] : '' );
+
+			if ( in_array( $field_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+				if ( ! is_array( $field_value ) ) {
+					$field_value = preg_split( '/[,\s]+/', $field_value );
+				}
+			} else {
+				$field_value = trim( $field_value );
+			}
+
+			switch ( $field_compare ) {
+				case 'IN' :
+				case 'NOT IN' :
+					$field_compare_string = '(' . substr( str_repeat( ',%s', count( $field_value ) ), 1 ) . ')';
+					$where = $wpdb->prepare( $field_compare_string, $field_value );
+					break;
+
+				case 'BETWEEN' :
+				case 'NOT BETWEEN' :
+					$field_value = array_slice( $field_value, 0, 2 );
+					$where = $wpdb->prepare( '%s AND %s', $field_value );
+					break;
+
+				case 'LIKE' :
+				case 'NOT LIKE' :
+					$field_value = '%' . bp_esc_like( $field_value ) . '%';
+					$where = $wpdb->prepare( '%s', $field_value );
+					break;
+
+				default :
+					$where = $wpdb->prepare( '%s', $field_value );
+					break;
+
+			}
+
+			if ( $where ) {
+				$sql_chunks['where'][] = "CAST($alias.value AS {$field_type}) {$field_compare} {$where}";
+			}
+		}
+
+		/*
+		 * Multiple WHERE clauses (`field` and `value` pairs) should be joined in parentheses.
+		 */
+		if ( 1 < count( $sql_chunks['where'] ) ) {
+			$sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' );
+		}
+
+		return $sql_chunks;
+	}
+
+	/**
+	 * Identify an existing table alias that is compatible with the current query clause.
+	 *
+	 * We avoid unnecessary table joins by allowing each clause to look for an existing table alias that is
+	 * compatible with the query that it needs to perform. An existing alias is compatible if (a) it is a
+	 * sibling of $clause (ie, it's under the scope of the same relation), and (b) the combination of
+	 * operator and relation between the clauses allows for a shared table join. In the case of BP_XProfile_Query,
+	 * this * only applies to IN clauses that are connected by the relation OR.
+	 *
+	 * @since  BuddyPress (2.2.0)
+	 * @access protected
+	 *
+	 * @param  array       $clause       Query clause.
+	 * @param  array       $parent_query Parent query of $clause.
+	 * @return string|bool Table alias if found, otherwise false.
+	 */
+	protected function find_compatible_table_alias( $clause, $parent_query ) {
+		$alias = false;
+
+		foreach ( $parent_query as $sibling ) {
+			// If the sibling has no alias yet, there's nothing to check.
+			if ( empty( $sibling['alias'] ) ) {
+				continue;
+			}
+
+			// We're only interested in siblings that are first-order clauses.
+			if ( ! is_array( $sibling ) || ! $this->is_first_order_clause( $sibling ) ) {
+				continue;
+			}
+
+			$compatible_compares = array();
+
+			// Clauses connected by OR can share joins as long as they have "positive" operators.
+			if ( 'OR' === $parent_query['relation'] ) {
+				$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );
+
+			// Clauses joined by AND with "negative" operators share a join only if they also share a key.
+			} elseif ( isset( $sibling['field_id'] ) && isset( $clause['field_id'] ) && $sibling['field_id'] === $clause['field_id'] ) {
+				$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );
+			}
+
+			$clause_compare  = strtoupper( $clause['compare'] );
+			$sibling_compare = strtoupper( $sibling['compare'] );
+			if ( in_array( $clause_compare, $compatible_compares ) && in_array( $sibling_compare, $compatible_compares ) ) {
+				$alias = $sibling['alias'];
+				break;
+			}
+		}
+
+		return $alias;
+	}
+}
diff --git a/wp-content/plugins/buddypress/buddypress.pot b/wp-content/plugins/buddypress/buddypress.pot
index 248956828570e45eea9c00e300280e64f828c353..a5f905afc379a0fed49a54341a1bde27f08fd9ab 100644
--- a/wp-content/plugins/buddypress/buddypress.pot
+++ b/wp-content/plugins/buddypress/buddypress.pot
@@ -1,85 +1,83 @@
-# Copyright (C) 2014 The BuddyPress Community
+# Copyright (C) 2015 The BuddyPress Community
 # This file is distributed under the GPLv2 or later (license.txt).
 msgid ""
 msgstr ""
-"Project-Id-Version: BuddyPress 2.1.1\n"
+"Project-Id-Version: BuddyPress 2.3.0\n"
 "Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org\n"
-"POT-Creation-Date: 2014-10-06 21:39:12+00:00\n"
+"POT-Creation-Date: 2015-06-05 13:48:17+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
 "Last-Translator: JOHN JAMES JACOBY <jjj@buddypress.org>\n"
 "Language-Team: ENGLISH <jjj@buddypress.org>\n"
-"X-Generator: grunt-wp-i18n 0.4.8\n"
+"X-Generator: grunt-wp-i18n 0.5.2\n"
 
-#: bp-activity/bp-activity-actions.php:157
+#: bp-activity/bp-activity-actions.php:175
 msgid "Activity deleted successfully"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:159
+#: bp-activity/bp-activity-actions.php:177
 msgid "There was an error when deleting that activity"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:214
+#: bp-activity/bp-activity-actions.php:247
 msgid "The activity item has been marked as spam and is no longer visible."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:269
-#: bp-templates/bp-legacy/buddypress-functions.php:711
+#: bp-activity/bp-activity-actions.php:332
+#: bp-templates/bp-legacy/buddypress-functions.php:925
 msgid "Please enter some content to post."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:290
+#: bp-activity/bp-activity-actions.php:362
 msgid "Update Posted!"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:292
-msgid "There was an error when posting your update, please try again."
+#: bp-activity/bp-activity-actions.php:364
+msgid "There was an error when posting your update. Please try again."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:329
-#: bp-templates/bp-legacy/buddypress-functions.php:772
+#: bp-activity/bp-activity-actions.php:416
+#: bp-templates/bp-legacy/buddypress-functions.php:994
 msgid "Please do not leave the comment area blank."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:340
+#: bp-activity/bp-activity-actions.php:427
 msgid "Reply Posted!"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:342
-#: bp-templates/bp-legacy/buddypress-functions.php:775
-#: bp-templates/bp-legacy/buddypress-functions.php:784
-msgid "There was an error posting that reply, please try again."
+#: bp-activity/bp-activity-actions.php:429
+msgid "There was an error posting that reply. Please try again."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:374
+#: bp-activity/bp-activity-actions.php:461
 msgid "Activity marked as favorite."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:376
-msgid "There was an error marking that activity as a favorite, please try again."
+#: bp-activity/bp-activity-actions.php:463
+msgid "There was an error marking that activity as a favorite. Please try again."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:408
+#: bp-activity/bp-activity-actions.php:495
 msgid "Activity removed as favorite."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:410
-msgid "There was an error removing that activity as a favorite, please try again."
+#: bp-activity/bp-activity-actions.php:497
+msgid "There was an error removing that activity as a favorite. Please try again."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:440
+#: bp-activity/bp-activity-actions.php:526
 #. translators: Sitewide activity RSS title - "[Site Name] | Site Wide
 #. Activity"
 msgid "%s | Site-Wide Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:443
+#: bp-activity/bp-activity-actions.php:529
 msgid "Activity feed for the entire site."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:470 bp-groups/bp-groups-actions.php:473
+#: bp-activity/bp-activity-actions.php:556 bp-groups/bp-groups-actions.php:531
 #. translators: Personal activity RSS title - "[Site Name] | [User Display
 #. Name] | Activity"
 #. translators: Group activity RSS title - "[Site Name] | [Group Name] |
@@ -87,78 +85,78 @@ msgstr ""
 msgid "%1$s | %2$s | Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:473
+#: bp-activity/bp-activity-actions.php:559
 msgid "Activity feed for %s."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:503
+#: bp-activity/bp-activity-actions.php:589
 #. translators: Friends activity RSS title - "[Site Name] | [User Display Name]
 #. | Friends Activity"
 msgid "%1$s | %2$s | Friends Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:506
+#: bp-activity/bp-activity-actions.php:592
 msgid "Activity feed for %s's friends."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:540
+#: bp-activity/bp-activity-actions.php:626
 #. translators: Member groups activity RSS title - "[Site Name] | [User Display
 #. Name] | Groups Activity"
 msgid "%1$s | %2$s | Group Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:543
+#: bp-activity/bp-activity-actions.php:629
 msgid "Public group activity feed of which %s is a member."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:579
+#: bp-activity/bp-activity-actions.php:665
 #. translators: User mentions activity RSS title - "[Site Name] | [User Display
 #. Name] | Mentions"
 msgid "%1$s | %2$s | Mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:582
+#: bp-activity/bp-activity-actions.php:668
 msgid "Activity feed mentioning %s."
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:616
+#: bp-activity/bp-activity-actions.php:702
 #. translators: User activity favorites RSS title - "[Site Name] | [User
 #. Display Name] | Favorites"
 msgid "%1$s | %2$s | Favorites"
 msgstr ""
 
-#: bp-activity/bp-activity-actions.php:619
+#: bp-activity/bp-activity-actions.php:705
 msgid "Activity feed of %s's favorites."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:88
+#: bp-activity/bp-activity-admin.php:89
 msgid "ERROR: Please type a reply."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:93
+#: bp-activity/bp-activity-admin.php:94
 msgid ""
 "ERROR: The item you are trying to reply to cannot be found, or it has been "
 "deleted."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:211 bp-activity/bp-activity-admin.php:258
-#: bp-core/admin/bp-core-functions.php:445
-#: bp-core/admin/bp-core-functions.php:463
-#: bp-core/admin/bp-core-functions.php:482
-#: bp-core/admin/bp-core-functions.php:501 bp-groups/bp-groups-admin.php:111
-#: bp-groups/bp-groups-admin.php:146 bp-members/bp-members-admin.php:671
-#: bp-members/bp-members-admin.php:1255
+#: bp-activity/bp-activity-admin.php:228 bp-activity/bp-activity-admin.php:275
+#: bp-core/admin/bp-core-admin-functions.php:472
+#: bp-core/admin/bp-core-admin-functions.php:490
+#: bp-core/admin/bp-core-admin-functions.php:509
+#: bp-core/admin/bp-core-admin-functions.php:528
+#: bp-groups/bp-groups-admin.php:118 bp-groups/bp-groups-admin.php:158
+#: bp-members/bp-members-admin.php:715 bp-members/bp-members-admin.php:1432
 msgid "Overview"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:213
+#: bp-activity/bp-activity-admin.php:230
 msgid ""
 "You edit activities made on your site similar to the way you edit a "
 "comment. This is useful if you need to change which page the activity links "
 "to, or when you notice that the author has made a typographical error."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:214
+#: bp-activity/bp-activity-admin.php:231
 msgid ""
 "The two big editing areas for the activity title and content are fixed in "
 "place, but you can reposition all the other boxes using drag and drop, and "
@@ -167,17 +165,17 @@ msgid ""
 "Type, Author ID) or to choose a 1- or 2-column layout for this screen."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:215
+#: bp-activity/bp-activity-admin.php:232
 msgid ""
 "You can also moderate the activity from this screen using the Status box, "
 "where you can also change the timestamp of the activity."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:220
+#: bp-activity/bp-activity-admin.php:237
 msgid "Item, Link, Type"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:222
+#: bp-activity/bp-activity-admin.php:239
 msgid ""
 "<strong>Primary Item/Secondary Item</strong> - These identify the object "
 "that created the activity. For example, the fields could reference a "
@@ -185,53 +183,54 @@ msgid ""
 "or none, of these fields."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:223
+#: bp-activity/bp-activity-admin.php:240
 msgid ""
 "<strong>Link</strong> - Used by some types of activity (e.g blog posts and "
 "comments, and forum topics and replies) to store a link back to the "
 "original content."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:224
+#: bp-activity/bp-activity-admin.php:241
 msgid ""
 "<strong>Type</strong> - Each distinct kind of activity has its own type. "
 "For example, <code>created_group</code> is used when a group is created and "
 "<code>joined_group</code> is used when a user joins a group."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:225
+#: bp-activity/bp-activity-admin.php:242
 msgid ""
 "For information about when and how BuddyPress uses all of these settings, "
 "see the Managing Activity link in the panel to the side."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:230 bp-activity/bp-activity-admin.php:275
-#: bp-core/admin/bp-core-functions.php:451
-#: bp-core/admin/bp-core-functions.php:469
-#: bp-core/admin/bp-core-functions.php:488
-#: bp-core/admin/bp-core-functions.php:507 bp-groups/bp-groups-admin.php:119
-#: bp-groups/bp-groups-admin.php:162 bp-members/bp-members-admin.php:680
-#: bp-members/bp-members-admin.php:1276
+#: bp-activity/bp-activity-admin.php:247 bp-activity/bp-activity-admin.php:292
+#: bp-core/admin/bp-core-admin-functions.php:478
+#: bp-core/admin/bp-core-admin-functions.php:496
+#: bp-core/admin/bp-core-admin-functions.php:515
+#: bp-core/admin/bp-core-admin-functions.php:534
+#: bp-groups/bp-groups-admin.php:126 bp-groups/bp-groups-admin.php:174
+#: bp-members/bp-members-admin.php:724 bp-members/bp-members-admin.php:1453
 msgid "For more information:"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:231
+#: bp-activity/bp-activity-admin.php:248
 msgid ""
 "<a "
-"href=\"http://codex.buddypress.org/buddypress-site-administration/managing-"
-"activity/\">Managing Activity</a>"
+"href=\"https://codex.buddypress.org/administrator-guide/activity-stream-"
+"management-panels/\">Managing Activity</a>"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:232 bp-activity/bp-activity-admin.php:276
-#: bp-core/admin/bp-core-functions.php:453
-#: bp-core/admin/bp-core-functions.php:471
-#: bp-core/admin/bp-core-functions.php:490
-#: bp-core/admin/bp-core-functions.php:509 bp-groups/bp-groups-admin.php:163
-#: bp-members/bp-members-admin.php:682 bp-members/bp-members-admin.php:1277
-msgid "<a href=\"http://buddypress.org/support/\">Support Forums</a>"
+#: bp-activity/bp-activity-admin.php:249 bp-activity/bp-activity-admin.php:293
+#: bp-core/admin/bp-core-admin-functions.php:480
+#: bp-core/admin/bp-core-admin-functions.php:498
+#: bp-core/admin/bp-core-admin-functions.php:517
+#: bp-core/admin/bp-core-admin-functions.php:536
+#: bp-groups/bp-groups-admin.php:175 bp-members/bp-members-admin.php:726
+#: bp-members/bp-members-admin.php:1454
+msgid "<a href=\"https://buddypress.org/support/\">Support Forums</a>"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:260
+#: bp-activity/bp-activity-admin.php:277
 msgid ""
 "You can manage activities made on your site similar to the way you manage "
 "comments and other content. This screen is customizable in the same ways as "
@@ -239,7 +238,7 @@ msgid ""
 "action links or the Bulk Actions."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:261
+#: bp-activity/bp-activity-admin.php:278
 msgid ""
 "There are many different types of activities. Some are generated "
 "automatically by BuddyPress and other plugins, and some are entered "
@@ -248,11 +247,11 @@ msgid ""
 "them."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:267
+#: bp-activity/bp-activity-admin.php:284
 msgid "Moderating Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:269
+#: bp-activity/bp-activity-admin.php:286
 msgid ""
 "In the <strong>Activity</strong> column, above each activity it says "
 "&#8220;Submitted on,&#8221; followed by the date and time the activity item "
@@ -261,7 +260,7 @@ msgid ""
 "options to reply, edit, spam mark, or delete that activity."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:270
+#: bp-activity/bp-activity-admin.php:287
 msgid ""
 "In the <strong>In Response To</strong> column, if the activity was in reply "
 "to another activity, it shows that activity's author's picture and name, "
@@ -271,362 +270,356 @@ msgid ""
 "screen to show only related activity items."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:594
+#: bp-activity/bp-activity-admin.php:651
 msgid "Editing Activity (ID #%s)"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:605
+#: bp-activity/bp-activity-admin.php:662
 msgid "Action"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:612
+#: bp-activity/bp-activity-admin.php:669
 msgid "Content"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:637
+#: bp-activity/bp-activity-admin.php:694
 msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:660
+#: bp-activity/bp-activity-admin.php:717
 msgid "View Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:668
+#: bp-activity/bp-activity-admin.php:725
 msgid "Approved"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:669 bp-activity/bp-activity-admin.php:1424
-#: bp-activity/bp-activity-akismet.php:197
-#: bp-activity/bp-activity-akismet.php:226
-#: bp-core/admin/bp-core-functions.php:823
+#: bp-activity/bp-activity-admin.php:726 bp-activity/bp-activity-admin.php:1512
+#: bp-activity/bp-activity-akismet.php:206
+#: bp-activity/bp-activity-akismet.php:235
+#: bp-core/admin/bp-core-admin-functions.php:863
 msgid "Spam"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:675 bp-members/bp-members-admin.php:923
-#: bp-members/bp-members-admin.php:985
+#: bp-activity/bp-activity-admin.php:732 bp-members/bp-members-admin.php:1001
+#: bp-members/bp-members-admin.php:1063
 #. translators: Publish box date format, see http:php.net/date
 msgid "M j, Y @ G:i"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:678
+#: bp-activity/bp-activity-admin.php:735
 msgid "Submitted on: <strong>%1$s</strong>"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:678 bp-activity/bp-activity-admin.php:1417
-#: bp-forums/bp-forums-template.php:2112 bp-groups/bp-groups-admin.php:1398
-#: bp-xprofile/bp-xprofile-admin.php:402
+#: bp-activity/bp-activity-admin.php:735 bp-activity/bp-activity-admin.php:1505
+#: bp-forums/bp-forums-template.php:2554 bp-groups/bp-groups-admin.php:1547
+#: bp-xprofile/bp-xprofile-admin.php:544
 msgid "Edit"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:691
+#: bp-activity/bp-activity-admin.php:748
+#: bp-xprofile/classes/class-bp-xprofile-field.php:686
+#: bp-xprofile/classes/class-bp-xprofile-group.php:663
 msgid "Update"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:711
+#: bp-activity/bp-activity-admin.php:768
 msgid "Link"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:713
+#: bp-activity/bp-activity-admin.php:770
 msgid ""
 "Activity generated by posts and comments, forum topics and replies, and "
 "some plugins, uses the link field for a permalink back to the content item."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:728
+#: bp-activity/bp-activity-admin.php:785
 msgid "Author ID"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:797
+#: bp-activity/bp-activity-admin.php:852
 msgid ""
 "This activity item has a type (%s) that is not registered using "
 "bp_activity_set_action(), so no label is available."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:822
+#: bp-activity/bp-activity-admin.php:877
 msgid "Primary Item ID"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:826
+#: bp-activity/bp-activity-admin.php:881
 msgid "Secondary Item ID"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:829
+#: bp-activity/bp-activity-admin.php:884
 msgid ""
 "These identify the object that created this activity. For example, the "
 "fields could reference a pair of site and comment IDs."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:869
+#: bp-activity/bp-activity-admin.php:923
 msgid "%s activity item has been permanently deleted."
 msgid_plural "%s activity items have been permanently deleted."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-activity/bp-activity-admin.php:873
+#: bp-activity/bp-activity-admin.php:927
 msgid "An error occurred when trying to update activity ID #%s."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:876
+#: bp-activity/bp-activity-admin.php:930
 msgid "Errors occurred when trying to update these activity items:"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:882
+#: bp-activity/bp-activity-admin.php:936
 #. Translators: This is a bulleted list of item IDs
 msgid "#%s"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:891
+#: bp-activity/bp-activity-admin.php:945
 msgid "%s activity item has been successfully spammed."
 msgid_plural "%s activity items have been successfully spammed."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-activity/bp-activity-admin.php:894
+#: bp-activity/bp-activity-admin.php:948
 msgid "%s activity item has been successfully unspammed."
 msgid_plural "%s activity items have been successfully unspammed."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-activity/bp-activity-admin.php:897
-msgid "The activity item has been updated succesfully."
+#: bp-activity/bp-activity-admin.php:951
+msgid "The activity item has been updated successfully."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:910
+#: bp-activity/bp-activity-admin.php:970
 msgid "Activity related to ID #%s"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:916 bp-groups/bp-groups-admin.php:651
-#: bp-members/bp-members-admin.php:1671
+#: bp-activity/bp-activity-admin.php:976 bp-groups/bp-groups-admin.php:732
+#: bp-members/bp-members-admin.php:1857
 msgid "Search results for &#8220;%s&#8221;"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:929
+#: bp-activity/bp-activity-admin.php:989
 msgid "Search all Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:940
+#: bp-activity/bp-activity-admin.php:1000
 msgid "Reply to Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:944 bp-groups/bp-groups-admin.php:605
-#: bp-members/bp-members-admin.php:1802
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:102
-#: bp-templates/bp-legacy/buddypress/forums/index.php:116
-#: bp-xprofile/bp-xprofile-classes.php:548
-#: bp-xprofile/bp-xprofile-classes.php:968
+#: bp-activity/bp-activity-admin.php:1004 bp-groups/bp-groups-admin.php:678
+#: bp-members/bp-members-admin.php:2002
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:130
+#: bp-templates/bp-legacy/buddypress/forums/index.php:196
+#: bp-xprofile/classes/class-bp-xprofile-field.php:822
+#: bp-xprofile/classes/class-bp-xprofile-group.php:733
 msgid "Cancel"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:945 bp-activity/bp-activity-admin.php:1411
-#: bp-templates/bp-legacy/buddypress/activity/comment.php:37
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:10
+#: bp-activity/bp-activity-admin.php:1005
+#: bp-activity/bp-activity-admin.php:1499
+#: bp-templates/bp-legacy/buddypress/activity/comment.php:44
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:17
 msgid "Reply"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1140
+#: bp-activity/bp-activity-admin.php:1211
 msgid "No activities found."
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1211 bp-groups/bp-groups-admin.php:1271
+#: bp-activity/bp-activity-admin.php:1282 bp-groups/bp-groups-admin.php:1385
 msgid "All"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1212
+#: bp-activity/bp-activity-admin.php:1283
 msgid "Spam <span class=\"count\">(%s)</span>"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1228
+#: bp-activity/bp-activity-admin.php:1309
 msgid "Mark as Spam"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1229
-#: bp-activity/bp-activity-admin.php:1422
-#: bp-core/admin/bp-core-functions.php:817
+#: bp-activity/bp-activity-admin.php:1310
+#: bp-activity/bp-activity-admin.php:1510
+#: bp-core/admin/bp-core-admin-functions.php:857
 msgid "Not Spam"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1230
-#: bp-activity/bp-activity-admin.php:1427 bp-groups/bp-groups-admin.php:604
+#: bp-activity/bp-activity-admin.php:1311
+#: bp-activity/bp-activity-admin.php:1515 bp-groups/bp-groups-admin.php:677
 msgid "Delete Permanently"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1295
+#: bp-activity/bp-activity-admin.php:1383
 msgid "View all actions"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1320
+#: bp-activity/bp-activity-admin.php:1408
 msgid "Filter"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1336
+#: bp-activity/bp-activity-admin.php:1424
 msgid "Select activity item %1$d"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1367
+#: bp-activity/bp-activity-admin.php:1455
 msgid "Unregistered action - %s"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1413
+#: bp-activity/bp-activity-admin.php:1501
 msgid "Replies are disabled for this activity item"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1413
+#: bp-activity/bp-activity-admin.php:1501
 msgid "Replies disabled"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1427 bp-core/bp-core-cssjs.php:81
+#: bp-activity/bp-activity-admin.php:1515 bp-core/bp-core-cssjs.php:115
 msgid "Are you sure?"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1436
+#: bp-activity/bp-activity-admin.php:1531
 #. translators: 2: activity admin ui date/time
 msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1468
+#: bp-activity/bp-activity-admin.php:1587
 msgid "%s related activity"
 msgid_plural "%s related activities"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-activity/bp-activity-admin.php:1479
+#: bp-activity/bp-activity-admin.php:1598
 msgid "<a href=\"%1$s\">View Activity</a>"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:86
+#: bp-activity/bp-activity-akismet.php:88
 msgid "Flagged as spam by Akismet"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:89
+#: bp-activity/bp-activity-akismet.php:91
 msgid "Cleared by Akismet"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:95
+#: bp-activity/bp-activity-akismet.php:97
 msgid "Flagged as spam by %s"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:97
+#: bp-activity/bp-activity-akismet.php:99
 msgid "Un-spammed by %s"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:106
+#: bp-activity/bp-activity-akismet.php:108
 msgid "History"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:373
+#: bp-activity/bp-activity-akismet.php:434
 msgid "%s reported this activity as spam"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:390
+#: bp-activity/bp-activity-akismet.php:451
 msgid "%s reported this activity as not spam"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:414
+#: bp-activity/bp-activity-akismet.php:475
 msgid "Akismet caught this item as spam"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:419
+#: bp-activity/bp-activity-akismet.php:480
 msgid "Akismet cleared this item"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:424
+#: bp-activity/bp-activity-akismet.php:485
 msgid ""
 "Akismet was unable to check this item (response: %s), will automatically "
 "retry again later."
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:538
+#: bp-activity/bp-activity-akismet.php:592
 msgid "Activity History"
 msgstr ""
 
-#: bp-activity/bp-activity-classes.php:286
-#: bp-activity/bp-activity-template.php:147 bp-groups/bp-groups-classes.php:654
-#: bp-groups/bp-groups-functions.php:491 bp-groups/bp-groups-template.php:187
-#: bp-groups/bp-groups-template.php:2629 bp-groups/bp-groups-template.php:3670
-#: bp-groups/bp-groups-template.php:3938
-msgid ""
-"Arguments passed to %1$s should be in an associative array. See the inline "
-"documentation at %2$s for more details."
-msgstr ""
-
-#: bp-activity/bp-activity-classes.php:1506
-msgid "RSS feed 'id' must be defined"
-msgstr ""
-
-#: bp-activity/bp-activity-classes.php:1619
-msgid "In reply to"
-msgstr ""
-
-#: bp-activity/bp-activity-filters.php:383
+#: bp-activity/bp-activity-filters.php:435
 msgid "[Read more]"
 msgstr ""
 
-#: bp-activity/bp-activity-filters.php:388
+#: bp-activity/bp-activity-filters.php:448
 msgid "&hellip;"
 msgstr ""
 
-#: bp-activity/bp-activity-filters.php:574
+#: bp-activity/bp-activity-filters.php:658
 msgid "Load Newest"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:902
+#: bp-activity/bp-activity-functions.php:1247
 msgid "Posted a status update"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:904
+#: bp-activity/bp-activity-functions.php:1249
 msgid "Updates"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:911
+#: bp-activity/bp-activity-functions.php:1256
 msgid "Replied to a status update"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:913
+#: bp-activity/bp-activity-functions.php:1258
 msgid "Activity Comments"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:964
+#: bp-activity/bp-activity-functions.php:1326
 msgid "%s posted an update"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:978
+#: bp-activity/bp-activity-functions.php:1350
 msgid "%s posted a new activity comment"
 msgstr ""
 
-#: bp-activity/bp-activity-functions.php:1780
+#: bp-activity/bp-activity-functions.php:2096
+#: bp-templates/bp-legacy/buddypress-functions.php:991
+msgid "There was an error posting your reply. Please try again."
+msgstr ""
+
+#: bp-activity/bp-activity-functions.php:2130
+msgid "Sorry, the item you are replying to no longer exists."
+msgstr ""
+
+#: bp-activity/bp-activity-functions.php:2668
 msgid "Thumbnail"
 msgstr ""
 
 #: bp-activity/bp-activity-loader.php:30
-#: bp-core/admin/bp-core-components.php:380
+#: bp-core/admin/bp-core-admin-components.php:390
 msgid "Activity Streams"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:112
+#: bp-activity/bp-activity-loader.php:114
 msgid "Search Activity..."
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:343
-#: bp-activity/bp-activity-template.php:1282
-#: bp-activity/bp-activity-template.php:1432
-#: bp-activity/bp-activity-template.php:1443 bp-blogs/bp-blogs-loader.php:241
-#: bp-core/deprecated/2.1.php:501 bp-forums/bp-forums-loader.php:245
-#: bp-forums/bp-forums-template.php:730 bp-forums/bp-forums-template.php:960
-#: bp-forums/bp-forums-template.php:1990 bp-friends/bp-friends-loader.php:234
-#: bp-groups/bp-groups-loader.php:604 bp-groups/bp-groups-template.php:1344
-#: bp-groups/bp-groups-template.php:1387 bp-groups/bp-groups-template.php:1829
-#: bp-groups/bp-groups-template.php:1845 bp-groups/bp-groups-template.php:1894
-#: bp-groups/bp-groups-template.php:1910 bp-groups/bp-groups-template.php:2848
-#: bp-groups/bp-groups-template.php:2879 bp-groups/bp-groups-template.php:2909
-#: bp-groups/bp-groups-template.php:3829 bp-members/bp-members-loader.php:258
-#: bp-members/bp-members-template.php:724
-#: bp-members/bp-members-template.php:1168
-#: bp-members/bp-members-template.php:1210
-#: bp-messages/bp-messages-loader.php:282
-#: bp-messages/bp-messages-template.php:687
-#: bp-notifications/bp-notifications-loader.php:232
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:185
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:212
+#: bp-activity/bp-activity-loader.php:348
+#: bp-activity/bp-activity-template.php:1474
+#: bp-activity/bp-activity-template.php:1654
+#: bp-activity/bp-activity-template.php:1665 bp-blogs/bp-blogs-loader.php:270
+#: bp-core/deprecated/2.1.php:508 bp-forums/bp-forums-loader.php:246
+#: bp-forums/bp-forums-template.php:854 bp-forums/bp-forums-template.php:1153
+#: bp-forums/bp-forums-template.php:2404 bp-friends/bp-friends-loader.php:234
+#: bp-groups/bp-groups-loader.php:705 bp-groups/bp-groups-template.php:1572
+#: bp-groups/bp-groups-template.php:1615 bp-groups/bp-groups-template.php:2312
+#: bp-groups/bp-groups-template.php:2328 bp-groups/bp-groups-template.php:2387
+#: bp-groups/bp-groups-template.php:2403 bp-groups/bp-groups-template.php:3908
+#: bp-groups/bp-groups-template.php:3949 bp-groups/bp-groups-template.php:3991
+#: bp-groups/bp-groups-template.php:5217 bp-members/bp-members-loader.php:275
+#: bp-members/bp-members-template.php:926
+#: bp-members/bp-members-template.php:1467
+#: bp-members/bp-members-template.php:1516
+#: bp-messages/bp-messages-loader.php:317
+#: bp-messages/bp-messages-template.php:1002
+#: bp-notifications/bp-notifications-loader.php:235
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:242
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:269
 msgid "Profile picture of %s"
 msgstr ""
 
@@ -657,23 +650,23 @@ msgid ""
 msgstr ""
 
 #: bp-activity/bp-activity-notifications.php:99
-#: bp-activity/bp-activity-notifications.php:177
-#: bp-activity/bp-activity-notifications.php:226 bp-core/deprecated/1.5.php:364
+#: bp-activity/bp-activity-notifications.php:217
+#: bp-activity/bp-activity-notifications.php:305 bp-core/deprecated/1.5.php:364
 #: bp-friends/bp-friends-notifications.php:56
-#: bp-friends/bp-friends-notifications.php:105
-#: bp-groups/bp-groups-notifications.php:55
-#: bp-groups/bp-groups-notifications.php:133
-#: bp-groups/bp-groups-notifications.php:211
-#: bp-groups/bp-groups-notifications.php:280
-#: bp-groups/bp-groups-notifications.php:358
+#: bp-friends/bp-friends-notifications.php:143
+#: bp-groups/bp-groups-notifications.php:91
+#: bp-groups/bp-groups-notifications.php:230
+#: bp-groups/bp-groups-notifications.php:349
+#: bp-groups/bp-groups-notifications.php:455
+#: bp-groups/bp-groups-notifications.php:571
 msgid "To disable these notifications please log in and go to: %s"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:164
+#: bp-activity/bp-activity-notifications.php:204
 msgid "%s replied to one of your updates"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:165
+#: bp-activity/bp-activity-notifications.php:205
 msgid ""
 "%1$s replied to one of your updates:\n"
 "\n"
@@ -684,11 +677,11 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:209
+#: bp-activity/bp-activity-notifications.php:288
 msgid "%s replied to one of your comments"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:214
+#: bp-activity/bp-activity-notifications.php:293
 msgid ""
 "%1$s replied to one of your comments:\n"
 "\n"
@@ -700,148 +693,169 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:280
+#: bp-activity/bp-activity-notifications.php:400
 msgid "@%s Mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:283
+#: bp-activity/bp-activity-notifications.php:404
 msgid "You have %1$d new mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-notifications.php:287
+#: bp-activity/bp-activity-notifications.php:408
 msgid "%1$s mentioned you"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:231
+#: bp-activity/bp-activity-screens.php:325
 msgid "You do not have access to this activity."
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:270
-#: bp-activity/bp-activity-screens.php:437
+#: bp-activity/bp-activity-screens.php:379
+#: bp-activity/bp-activity-screens.php:570
 msgid "Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:271 bp-blogs/bp-blogs-template.php:1052
-#: bp-friends/bp-friends-screens.php:86 bp-groups/bp-groups-screens.php:973
-#: bp-messages/bp-messages-screens.php:199
-#: bp-templates/bp-legacy/buddypress/members/register.php:149
+#: bp-activity/bp-activity-screens.php:380 bp-blogs/bp-blogs-template.php:1272
+#: bp-friends/bp-friends-screens.php:110 bp-groups/bp-groups-screens.php:1332
+#: bp-messages/bp-messages-screens.php:269
+#: bp-templates/bp-legacy/buddypress/members/register.php:286
 msgid "Yes"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:272 bp-blogs/bp-blogs-template.php:1056
-#: bp-friends/bp-friends-screens.php:87 bp-groups/bp-groups-screens.php:974
-#: bp-messages/bp-messages-screens.php:200
-#: bp-templates/bp-legacy/buddypress/members/register.php:150
+#: bp-activity/bp-activity-screens.php:381 bp-blogs/bp-blogs-template.php:1276
+#: bp-friends/bp-friends-screens.php:111 bp-groups/bp-groups-screens.php:1333
+#: bp-messages/bp-messages-screens.php:270
+#: bp-templates/bp-legacy/buddypress/members/register.php:287
 msgid "No"
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:280
+#: bp-activity/bp-activity-screens.php:389
 msgid "A member mentions you in an update using \"@%s\""
 msgstr ""
 
-#: bp-activity/bp-activity-screens.php:288
+#: bp-activity/bp-activity-screens.php:397
 msgid "A member replies to an update or comment you've posted"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:775
+#: bp-activity/bp-activity-template.php:247
+#: bp-activity/classes/class-bp-activity-activity.php:301
+#: bp-groups/bp-groups-functions.php:585 bp-groups/bp-groups-template.php:211
+#: bp-groups/bp-groups-template.php:3654 bp-groups/bp-groups-template.php:5024
+#: bp-groups/bp-groups-template.php:5383
+#: bp-groups/classes/class-bp-groups-group.php:705
+#: bp-messages/bp-messages-template.php:125
+#: bp-messages/classes/class-bp_messages-thread.php:409
+#: bp-xprofile/bp-xprofile-template.php:134
+msgid ""
+"Arguments passed to %1$s should be in an associative array. See the inline "
+"documentation at %2$s for more details."
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:851
 msgid "Viewing 1 item"
+msgstr ""
+
+#: bp-activity/bp-activity-template.php:853
+msgid "Viewing %1$s - %2$s of %3$s item"
 msgid_plural "Viewing %1$s - %2$s of %3$s items"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-activity/bp-activity-template.php:1282
+#: bp-activity/bp-activity-template.php:1474
 msgid "Profile picture"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:1408
+#: bp-activity/bp-activity-template.php:1630
 msgid "Group logo"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:1411 bp-groups/bp-groups-admin.php:1418
-#: bp-groups/bp-groups-template.php:787
+#: bp-activity/bp-activity-template.php:1633 bp-groups/bp-groups-admin.php:1574
+#: bp-groups/bp-groups-template.php:897
 msgid "Group logo of %s"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:1422
+#: bp-activity/bp-activity-template.php:1644
 msgid "Profile picture of the author of the site %s"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:1652
+#: bp-activity/bp-activity-template.php:1959
 msgid "View Discussion"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2201
+#: bp-activity/bp-activity-template.php:2672
 msgid ""
 "%1$s no longer accepts arguments. See the inline documentation at %2$s for "
 "more details."
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2582
-#: bp-forums/bp-forums-template.php:2113 bp-groups/bp-groups-admin.php:1290
-#: bp-groups/bp-groups-admin.php:1401 bp-groups/bp-groups-template.php:2094
-#: bp-members/admin/bp-members-classes.php:146
-#: bp-members/admin/bp-members-classes.php:277
-#: bp-members/admin/bp-members-classes.php:474
-#: bp-members/admin/bp-members-classes.php:600
-#: bp-notifications/bp-notifications-template.php:876
-#: bp-templates/bp-legacy/buddypress/activity/comment.php:43
-#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51
-#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24
-#: bp-xprofile/bp-xprofile-admin.php:407
-#: bp-xprofile/bp-xprofile-classes.php:3167
+#: bp-activity/bp-activity-template.php:3148
+#: bp-core/bp-core-attachments.php:221 bp-forums/bp-forums-template.php:2555
+#: bp-groups/bp-groups-admin.php:1422 bp-groups/bp-groups-admin.php:1550
+#: bp-groups/bp-groups-loader.php:598
+#: bp-members/admin/bp-members-admin-classes.php:156
+#: bp-members/admin/bp-members-admin-classes.php:296
+#: bp-members/admin/bp-members-admin-classes.php:524
+#: bp-members/admin/bp-members-admin-classes.php:655
+#: bp-messages/bp-messages-template.php:1294
+#: bp-notifications/bp-notifications-template.php:1050
+#: bp-notifications/bp-notifications-template.php:1283
+#: bp-templates/bp-legacy/buddypress/activity/comment.php:50
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:127
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:35
+#: bp-xprofile/bp-xprofile-admin.php:549
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:340
 msgid "Delete"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2674
-#: bp-core/admin/bp-core-functions.php:829 bp-core/admin/bp-core-slugs.php:109
-#: bp-core/admin/bp-core-slugs.php:172 bp-groups/bp-groups-admin.php:1404
-#: bp-members/bp-members-template.php:892
-#: bp-templates/bp-legacy/buddypress-functions.php:250
+#: bp-activity/bp-activity-template.php:3270
+#: bp-core/admin/bp-core-admin-functions.php:869
+#: bp-core/admin/bp-core-admin-slugs.php:113
+#: bp-core/admin/bp-core-admin-slugs.php:189 bp-groups/bp-groups-admin.php:1553
+#: bp-members/bp-members-template.php:1141
+#: bp-templates/bp-legacy/buddypress-functions.php:311
 msgid "View"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:2772
+#: bp-activity/bp-activity-template.php:3385
 msgid "Clear Filter"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:3050
+#: bp-activity/bp-activity-template.php:3734
 msgid "a user"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:3106
+#: bp-activity/bp-activity-template.php:3798
 msgid "Send a public message on your activity stream."
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:3107
+#: bp-activity/bp-activity-template.php:3799
 msgid "Public Message"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:3629
+#: bp-activity/bp-activity-template.php:4428
 msgid "Site Wide Activity RSS Feed"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:34
-msgid "New site created"
+#: bp-activity/classes/class-bp-activity-feed.php:139
+msgid "RSS feed 'id' must be defined"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:36
-msgid "New Sites"
+#: bp-activity/classes/class-bp-activity-feed.php:281
+msgid "In reply to"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:43
-msgid "New post published"
+#: bp-blogs/bp-blogs-activity.php:32
+msgid "New site created"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:45
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:40
-msgid "Posts"
+#: bp-blogs/bp-blogs-activity.php:34
+msgid "New Sites"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:52
+#: bp-blogs/bp-blogs-activity.php:45
 msgid "New post comment posted"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:54
+#: bp-blogs/bp-blogs-activity.php:47
 msgid "Comments"
 msgstr ""
 
@@ -849,19 +863,23 @@ msgstr ""
 msgid "%s created the site %s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:133 bp-blogs/bp-blogs-functions.php:505
+#: bp-blogs/bp-blogs-activity.php:155
+msgid "(no title)"
+msgstr ""
+
+#: bp-blogs/bp-blogs-activity.php:182
 msgid "%1$s wrote a new post, %2$s, on the site %3$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:135 bp-blogs/bp-blogs-functions.php:507
+#: bp-blogs/bp-blogs-activity.php:184
 msgid "%1$s wrote a new post, %2$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:200
+#: bp-blogs/bp-blogs-activity.php:257
 msgid "%1$s commented on the post, %2$s, on the site %3$s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-activity.php:202
+#: bp-blogs/bp-blogs-activity.php:259
 msgid "%1$s commented on the post, %2$s"
 msgstr ""
 
@@ -869,455 +887,468 @@ msgstr ""
 msgid "Site Directory"
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:70
+#: bp-blogs/bp-blogs-loader.php:71
 msgid "Search sites..."
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:133
-msgid "Sites <span>%d</span>"
+#: bp-blogs/bp-blogs-loader.php:160
+msgid "Sites <span class=\"%s\">%s</span>"
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:153 bp-blogs/bp-blogs-loader.php:204
-#: bp-blogs/bp-blogs-loader.php:232 bp-core/deprecated/2.1.php:118
+#: bp-blogs/bp-blogs-loader.php:182 bp-blogs/bp-blogs-loader.php:233
+#: bp-blogs/bp-blogs-loader.php:261 bp-core/deprecated/2.1.php:111
 msgid "My Sites"
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:196 bp-blogs/bp-blogs-screens.php:144
-#: bp-blogs/bp-blogs-screens.php:204 bp-blogs/bp-blogs-screens.php:206
+#: bp-blogs/bp-blogs-loader.php:225 bp-blogs/bp-blogs-screens.php:174
+#: bp-blogs/bp-blogs-screens.php:239
 msgid "Sites"
 msgstr ""
 
-#: bp-blogs/bp-blogs-loader.php:213 bp-blogs/bp-blogs-screens.php:204
-#: bp-blogs/bp-blogs-template.php:1148 bp-blogs/bp-blogs-template.php:1216
-#: bp-blogs/bp-blogs-template.php:1217 bp-core/bp-core-filters.php:499
+#: bp-blogs/bp-blogs-loader.php:242 bp-blogs/bp-blogs-screens.php:237
+#: bp-blogs/bp-blogs-template.php:1408 bp-blogs/bp-blogs-template.php:1488
+#: bp-blogs/bp-blogs-template.php:1489 bp-core/bp-core-filters.php:761
 msgid "Create a Site"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:429
+#: bp-blogs/bp-blogs-loader.php:324
+msgid "New post published"
+msgstr ""
+
+#: bp-blogs/bp-blogs-loader.php:326
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:54
+msgid "Posts"
+msgstr ""
+
+#: bp-blogs/bp-blogs-template.php:476
 msgid "Viewing 1 site"
+msgstr ""
+
+#: bp-blogs/bp-blogs-template.php:478
+msgid "Viewing %1$s - %2$s of %3$s site"
 msgid_plural "Viewing %1$s - %2$s of %3$s sites"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-blogs/bp-blogs-template.php:501
+#: bp-blogs/bp-blogs-template.php:560
 msgid "Profile picture of site author %s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:670 bp-core/bp-core-classes.php:838
-#: bp-groups/bp-groups-template.php:4046 bp-groups/bp-groups-widgets.php:94
-#: bp-groups/bp-groups-widgets.php:206 bp-members/bp-members-template.php:834
-#: bp-members/bp-members-template.php:1263
-#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:47
-#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:42
+#: bp-blogs/bp-blogs-template.php:786
+#: bp-core/classes/class-bp-core-user.php:188
+#: bp-groups/bp-groups-template.php:5508 bp-groups/bp-groups-widgets.php:112
+#: bp-groups/bp-groups-widgets.php:224 bp-members/bp-members-template.php:1067
+#: bp-members/bp-members-template.php:1589
+#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:63
+#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:65
 msgid "active %s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:683 bp-members/bp-members-template.php:847
+#: bp-blogs/bp-blogs-template.php:799 bp-members/bp-members-template.php:1080
 msgid "Never active"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:719
+#: bp-blogs/bp-blogs-template.php:851
 msgid "Latest Post: %s"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:970
+#: bp-blogs/bp-blogs-template.php:1183
 msgid "There was a problem; please correct the form below and try again."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:973
+#: bp-blogs/bp-blogs-template.php:1186
 msgid ""
 "By filling out the form below, you can <strong>add a site to your "
 "account</strong>. There is no limit to the number of sites that you can "
 "have, so create to your heart's content, but blog responsibly!"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:975
+#: bp-blogs/bp-blogs-template.php:1188
 msgid ""
 "If you&#8217;re not going to use a great domain, leave it for a new user. "
 "Now have at it!"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:984
+#: bp-blogs/bp-blogs-template.php:1204
 msgid "Create Site"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1006
+#: bp-blogs/bp-blogs-template.php:1226
 msgid "Site Name:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1008
+#: bp-blogs/bp-blogs-template.php:1228
 msgid "Site Domain:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1022
+#: bp-blogs/bp-blogs-template.php:1242
 msgid "Your address will be "
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1025
+#: bp-blogs/bp-blogs-template.php:1245
 msgid "blogname"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1027
+#: bp-blogs/bp-blogs-template.php:1247
 msgid "domain."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1030
+#: bp-blogs/bp-blogs-template.php:1250
 msgid ""
 "Must be at least 4 characters, letters and numbers only. It cannot be "
 "changed so choose carefully!)"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1036
+#: bp-blogs/bp-blogs-template.php:1256
 msgid "Site Title:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1047
+#: bp-blogs/bp-blogs-template.php:1267
 msgid "Privacy:"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1048
-#: bp-templates/bp-legacy/buddypress/members/register.php:146
+#: bp-blogs/bp-blogs-template.php:1268
+#: bp-templates/bp-legacy/buddypress/members/register.php:276
 msgid ""
 "I would like my site to appear in search engines, and in public listings "
 "around this network."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1134
+#: bp-blogs/bp-blogs-template.php:1373
 msgid "Congratulations! You have successfully registered a new site."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1136
+#: bp-blogs/bp-blogs-template.php:1375
 msgid ""
 "<a href=\"%1$s\">%2$s</a> is your new site.  <a href=\"%3$s\">Login</a> as "
 "\"%4$s\" using your existing password."
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1165
+#: bp-blogs/bp-blogs-template.php:1424
 msgid "%s's Sites"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1166
+#: bp-blogs/bp-blogs-template.php:1425
 msgid "%s's Recent Posts"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1167
+#: bp-blogs/bp-blogs-template.php:1426
 msgid "%s's Recent Comments"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1183 bp-core/deprecated/1.5.php:417
-#: bp-forums/bp-forums-template.php:2196 bp-groups/bp-groups-template.php:3450
-#: bp-members/bp-members-template.php:1031
-#: bp-messages/bp-messages-template.php:768
+#: bp-blogs/bp-blogs-template.php:1448 bp-core/deprecated/1.5.php:417
+#: bp-forums/bp-forums-template.php:2684 bp-groups/bp-groups-template.php:4776
+#: bp-members/bp-members-template.php:1301
+#: bp-messages/bp-messages-template.php:1122
 msgid "Search"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1266 bp-blogs/bp-blogs-template.php:1267
+#: bp-blogs/bp-blogs-template.php:1600 bp-blogs/bp-blogs-template.php:1601
 msgid "Visit Site"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:1322
+#: bp-blogs/bp-blogs-template.php:1662
 msgid "%s site"
 msgid_plural "%s sites"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-blogs/bp-blogs-widgets.php:34
+#: bp-blogs/bp-blogs-widgets.php:35
 msgid "A list of recently published posts from across your network."
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:50 bp-blogs/bp-blogs-widgets.php:122
+#: bp-blogs/bp-blogs-widgets.php:53 bp-blogs/bp-blogs-widgets.php:147
 msgid "Recent Networkwide Posts"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:91
+#: bp-blogs/bp-blogs-widgets.php:115
 msgid "Sorry, there were no posts found. Why not write one?"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:134
+#: bp-blogs/bp-blogs-widgets.php:159
 msgid "Link widget title to Blogs directory"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:135
+#: bp-blogs/bp-blogs-widgets.php:160
 msgid "Max posts to show:"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:26
-#: bp-core/admin/bp-core-functions.php:383
+#: bp-core/admin/bp-core-admin-components.php:26
+#: bp-core/admin/bp-core-admin-functions.php:417
 msgid "Components"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:32
-#: bp-core/admin/bp-core-settings.php:252 bp-core/admin/bp-core-slugs.php:32
-#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:42
+#: bp-core/admin/bp-core-admin-components.php:32
+#: bp-core/admin/bp-core-admin-settings.php:264
+#: bp-core/admin/bp-core-admin-slugs.php:32
+#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:56
 msgid "Save Settings"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:59
-#: bp-core/admin/bp-core-components.php:364
+#: bp-core/admin/bp-core-admin-components.php:67
+#: bp-core/admin/bp-core-admin-components.php:374
 msgid "Extended Profiles"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:60
-#: bp-core/admin/bp-core-components.php:365
+#: bp-core/admin/bp-core-admin-components.php:68
+#: bp-core/admin/bp-core-admin-components.php:375
 msgid ""
 "Customize your community with fully editable profile fields that allow your "
 "users to describe themselves."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:63
-#: bp-core/admin/bp-core-components.php:368
+#: bp-core/admin/bp-core-admin-components.php:71
+#: bp-core/admin/bp-core-admin-components.php:378
 msgid "Account Settings"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:64
-#: bp-core/admin/bp-core-components.php:369
+#: bp-core/admin/bp-core-admin-components.php:72
+#: bp-core/admin/bp-core-admin-components.php:379
 msgid ""
 "Allow your users to modify their account and notification settings directly "
 "from within their profiles."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:67
-#: bp-core/admin/bp-core-components.php:384 bp-core/deprecated/2.1.php:570
-#: bp-notifications/bp-notifications-loader.php:227
+#: bp-core/admin/bp-core-admin-components.php:75
+#: bp-core/admin/bp-core-admin-components.php:394
+#: bp-core/deprecated/2.1.php:579
+#: bp-notifications/bp-notifications-loader.php:230
 msgid "Notifications"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:68
-#: bp-core/admin/bp-core-components.php:385
+#: bp-core/admin/bp-core-admin-components.php:76
+#: bp-core/admin/bp-core-admin-components.php:395
 msgid ""
 "Notify members of relevant activity with a toolbar bubble and/or via email, "
 "and allow them to customize their notification settings."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:145
+#: bp-core/admin/bp-core-admin-components.php:153
 msgid "Active <span class=\"count\">(%s)</span>"
 msgid_plural "Active <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/admin/bp-core-components.php:146
+#: bp-core/admin/bp-core-admin-components.php:154
 msgid "Inactive <span class=\"count\">(%s)</span>"
 msgid_plural "Inactive <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/admin/bp-core-components.php:147
+#: bp-core/admin/bp-core-admin-components.php:155
 msgid "Must-Use <span class=\"count\">(%s)</span>"
 msgid_plural "Must-Use <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/admin/bp-core-components.php:148
+#: bp-core/admin/bp-core-admin-components.php:156
 msgid "Retired <span class=\"count\">(%s)</span>"
 msgid_plural "Retired <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/admin/bp-core-components.php:155
-#: bp-core/admin/bp-core-components.php:163
+#: bp-core/admin/bp-core-admin-components.php:163
+#: bp-core/admin/bp-core-admin-components.php:171
 msgid "Component"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:156
-#: bp-core/admin/bp-core-components.php:164
+#: bp-core/admin/bp-core-admin-components.php:164
+#: bp-core/admin/bp-core-admin-components.php:172
 msgid "Description"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:189
-#: bp-members/admin/bp-members-classes.php:224
-#: bp-members/admin/bp-members-classes.php:547
-msgid "Select %s"
-msgstr ""
-
-#: bp-core/admin/bp-core-components.php:214
+#: bp-core/admin/bp-core-admin-components.php:224
 msgid "No components found."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:344 bp-core/bp-core-loader.php:27
+#: bp-core/admin/bp-core-admin-components.php:354 bp-core/bp-core-loader.php:27
 msgid "BuddyPress Core"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:345
+#: bp-core/admin/bp-core-admin-components.php:355
 msgid "It&#8216;s what makes <del>time travel</del> BuddyPress possible!"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:348
+#: bp-core/admin/bp-core-admin-components.php:358
 msgid "Community Members"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:349
+#: bp-core/admin/bp-core-admin-components.php:359
 msgid "Everything in a BuddyPress community revolves around its members."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:356
-#: bp-templates/bp-legacy/buddypress/groups/create.php:108
+#: bp-core/admin/bp-core-admin-components.php:366
+#: bp-templates/bp-legacy/buddypress/groups/create.php:152
 msgid "Group Forums"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:357
+#: bp-core/admin/bp-core-admin-components.php:367
 msgid "BuddyPress Forums are retired. Use %s."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:372
+#: bp-core/admin/bp-core-admin-components.php:382
 msgid "Friend Connections"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:373
+#: bp-core/admin/bp-core-admin-components.php:383
 msgid ""
 "Let your users make connections so they can track the activity of others "
 "and focus on the people they care about the most."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:376
+#: bp-core/admin/bp-core-admin-components.php:386
 msgid "Private Messaging"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:377
+#: bp-core/admin/bp-core-admin-components.php:387
 msgid ""
 "Allow your users to talk to each other directly and in private. Not just "
 "limited to one-on-one discussions, messages can be sent between any number "
 "of members."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:381
+#: bp-core/admin/bp-core-admin-components.php:391
 msgid ""
 "Global, personal, and group activity streams with threaded commenting, "
 "direct posting, favoriting, and @mentions, all with full RSS feed and email "
 "notification support."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:388
+#: bp-core/admin/bp-core-admin-components.php:398
 msgid "User Groups"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:389
+#: bp-core/admin/bp-core-admin-components.php:399
 msgid ""
 "Groups allow your users to organize themselves into specific public, "
 "private or hidden sections with separate activity streams and member "
 "listings."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:392
+#: bp-core/admin/bp-core-admin-components.php:402
 msgid "Group Forums (Legacy)"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:393
+#: bp-core/admin/bp-core-admin-components.php:403
 msgid "Group forums allow for focused, bulletin-board style conversations."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:396
+#: bp-core/admin/bp-core-admin-components.php:406
 msgid "Site Tracking"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:397
+#: bp-core/admin/bp-core-admin-components.php:407
 msgid "Record activity for new posts and comments from your site."
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:404
+#: bp-core/admin/bp-core-admin-components.php:414
 msgid "Record activity for new sites, posts, and comments across your network."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:104
+#: bp-core/admin/bp-core-admin-functions.php:105
 msgid "Why have all my BuddyPress menus disappeared?"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:106
+#: bp-core/admin/bp-core-admin-functions.php:107
 msgid ""
 "Don't worry! We've moved the BuddyPress options into more convenient and "
 "easier to find locations. You're seeing this page because you are running a "
 "legacy BuddyPress plugin which has not been updated."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:107
+#: bp-core/admin/bp-core-admin-functions.php:108
 msgid ""
 "Components, Pages, Settings, and Forums, have been moved to <a "
 "href=\"%s\">Settings &gt; BuddyPress</a>. Profile Fields has been moved "
 "into the <a href=\"%s\">Users</a> menu."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:241
+#: bp-core/admin/bp-core-admin-functions.php:243
 msgid ""
 "<strong>BuddyPress is almost ready</strong>. You must <a href=\"%s\">update "
 "your permalink structure</a> to something other than the default for it to "
 "work."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:268 bp-core/admin/bp-core-slugs.php:135
-#: bp-members/admin/bp-members-classes.php:269
-#: bp-members/admin/bp-members-classes.php:273
-#: bp-members/admin/bp-members-classes.php:592
-#: bp-members/admin/bp-members-classes.php:596
-#: bp-messages/bp-messages-template.php:1046
-#: bp-templates/bp-legacy/buddypress/members/activate.php:29
+#: bp-core/admin/bp-core-admin-functions.php:270
+#: bp-core/admin/bp-core-admin-slugs.php:148
+#: bp-members/admin/bp-members-admin-classes.php:288
+#: bp-members/admin/bp-members-admin-classes.php:292
+#: bp-members/admin/bp-members-admin-classes.php:647
+#: bp-members/admin/bp-members-admin-classes.php:651
+#: bp-messages/bp-messages-template.php:1529
+#: bp-templates/bp-legacy/buddypress/members/activate.php:46
 msgid "Activate"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:273 bp-core/admin/bp-core-slugs.php:134
-#: bp-members/bp-members-adminbar.php:61
+#: bp-core/admin/bp-core-admin-functions.php:275
+#: bp-core/admin/bp-core-admin-slugs.php:147
+#: bp-members/bp-members-adminbar.php:63
 msgid "Register"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:299
+#: bp-core/admin/bp-core-admin-functions.php:301
 msgid ""
 "The following active BuddyPress Components do not have associated WordPress "
 "Pages: %2$s. <a href=\"%1$s\">Repair</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:321
+#: bp-core/admin/bp-core-admin-functions.php:323
 msgid ""
 "Each BuddyPress Component needs its own WordPress page. The following "
 "WordPress Pages have more than one component associated with them: %2$s. <a "
 "href=\"%1$s\">Repair</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:387 bp-core/admin/bp-core-slugs.php:26
+#: bp-core/admin/bp-core-admin-functions.php:421
+#: bp-core/admin/bp-core-admin-slugs.php:26
 msgid "Pages"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:391
-#: bp-core/admin/bp-core-settings.php:243 bp-core/bp-core-admin.php:439
-#: bp-groups/bp-groups-template.php:2076 bp-settings/bp-settings-loader.php:23
+#: bp-core/admin/bp-core-admin-functions.php:425
+#: bp-core/admin/bp-core-admin-settings.php:255 bp-core/bp-core-admin.php:436
+#: bp-groups/bp-groups-loader.php:570 bp-settings/bp-settings-loader.php:23
 #: bp-settings/bp-settings-loader.php:73 bp-settings/bp-settings-loader.php:163
 msgid "Settings"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:404 bp-forums/bp-forums-loader.php:132
-#: bp-forums/bp-forums-loader.php:199 bp-forums/bp-forums-loader.php:240
-#: bp-forums/bp-forums-screens.php:208 bp-forums/bp-forums-screens.php:210
-#: bp-forums/deprecated/1.6.php:42 bp-forums/deprecated/1.7.php:25
-#: bp-forums/deprecated/1.7.php:102
+#: bp-core/admin/bp-core-admin-functions.php:438
+#: bp-forums/bp-forums-loader.php:133 bp-forums/bp-forums-loader.php:200
+#: bp-forums/bp-forums-loader.php:241 bp-forums/bp-forums-screens.php:288
+#: bp-forums/bp-forums-screens.php:290 bp-forums/deprecated/1.6.php:42
+#: bp-forums/deprecated/1.7.php:25 bp-forums/deprecated/1.7.php:102
 msgid "Forums"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:452
+#: bp-core/admin/bp-core-admin-functions.php:479
 msgid ""
 "<a "
-"href=\"http://codex.buddypress.org/getting-started/configure-buddypress-"
-"components/#settings-buddypress-components\">Managing Components</a>"
+"href=\"https://codex.buddypress.org/getting-started/configure-components/\">"
+"Managing Components</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:470
+#: bp-core/admin/bp-core-admin-functions.php:497
 msgid ""
 "<a "
-"href=\"http://codex.buddypress.org/getting-started/configure-buddypress-"
-"components/#settings-buddypress-pages\">Managing Pages</a>"
+"href=\"https://codex.buddypress.org/getting-started/configure-components/#"
+"settings-buddypress-pages\">Managing Pages</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:489
+#: bp-core/admin/bp-core-admin-functions.php:516
 msgid ""
 "<a "
-"href=\"http://codex.buddypress.org/getting-started/configure-buddypress-"
-"components/#settings-buddypress-settings\">Managing Settings</a>"
+"href=\"https://codex.buddypress.org/getting-started/configure-components/#"
+"settings-buddypress-settings\">Managing Settings</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:508
+#: bp-core/admin/bp-core-admin-functions.php:535
 msgid ""
 "<a "
-"href=\"http://codex.buddypress.org/getting-started/configure-buddypress-"
-"components/#users-profile-fields\">Managing Profile Fields</a>"
+"href=\"https://codex.buddypress.org/administrator-guide/extended-profiles/\""
+">Managing Profile Fields</a>"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:526
+#: bp-core/admin/bp-core-admin-functions.php:553
 msgid ""
 "By default, all but four of the BuddyPress components are enabled. You can "
 "selectively enable or disable any of the components by using the form "
@@ -1326,279 +1357,282 @@ msgid ""
 "using the site."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:530
+#: bp-core/admin/bp-core-admin-functions.php:557
 msgid ""
 "BuddyPress Components use WordPress Pages for their root directory/archive "
 "pages. You can change the page associations for each active component by "
 "using the form below."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:534
+#: bp-core/admin/bp-core-admin-functions.php:561
 msgid ""
 "Extra configuration settings are provided and activated. You can "
 "selectively enable or disable any setting by using the form on this screen."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:538
+#: bp-core/admin/bp-core-admin-functions.php:565
 msgid ""
 "Your users will distinguish themselves through their profile page. Create "
-"relevant profile fields that will show on each users "
-"profile.</br></br>Note: Any fields in the first group will appear on the "
-"signup page."
+"relevant profile fields that will show on each users profile.<br /><br "
+"/>Note: Any fields in the first group will appear on the signup page."
 msgstr ""
 
 #. Plugin Name of the plugin/theme
 msgid "BuddyPress"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:720
-#: bp-core/admin/bp-core-functions.php:729
+#: bp-core/admin/bp-core-admin-functions.php:760
+#: bp-core/admin/bp-core-admin-functions.php:769
 msgid "Logged-In"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:723
-#: bp-core/admin/bp-core-functions.php:738
+#: bp-core/admin/bp-core-admin-functions.php:763
+#: bp-core/admin/bp-core-admin-functions.php:778
 msgid "Logged-Out"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:730
+#: bp-core/admin/bp-core-admin-functions.php:770
 msgid ""
 "<em>Logged-In</em> links are relative to the current user, and are not "
 "visible to visitors who are not logged in."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:739
+#: bp-core/admin/bp-core-admin-functions.php:779
 msgid "<em>Logged-Out</em> links are not visible to users who are logged in."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:749
+#: bp-core/admin/bp-core-admin-functions.php:789
 msgid "Add to Menu"
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:881 bp-members/bp-members-actions.php:54
-#: bp-members/bp-members-admin.php:293
+#: bp-core/admin/bp-core-admin-functions.php:921
+#: bp-members/bp-members-actions.php:53 bp-members/bp-members-admin.php:298
 msgid "User marked as spammer. Spam users are visible only to site admins."
 msgstr ""
 
-#: bp-core/admin/bp-core-functions.php:883
+#: bp-core/admin/bp-core-admin-functions.php:923
 msgid "User removed from spam."
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:31
+#: bp-core/admin/bp-core-admin-settings.php:31
 msgid "Show the Toolbar for logged out users"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:47
+#: bp-core/admin/bp-core-admin-settings.php:47
 msgid "Allow registered members to delete their own accounts"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:72
+#: bp-core/admin/bp-core-admin-settings.php:72
 msgid "Allow Akismet to scan for activity stream spam"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:86
+#: bp-core/admin/bp-core-admin-settings.php:86
 msgid "Allow activity stream commenting on blog and forum posts"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:100
+#: bp-core/admin/bp-core-admin-settings.php:100
 msgid "Automatically check for new items while viewing the activity stream"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:138
+#: bp-core/admin/bp-core-admin-settings.php:138
 msgid "Enable BuddyPress to WordPress profile syncing"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:154
+#: bp-core/admin/bp-core-admin-settings.php:154
 msgid "Allow registered members to upload avatars"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:179
+#: bp-core/admin/bp-core-admin-settings.php:179
 msgid "Enable group creation for all users"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:180
+#: bp-core/admin/bp-core-admin-settings.php:180
 msgid "Administrators can always create groups, regardless of this setting."
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:211
+#: bp-core/admin/bp-core-admin-settings.php:193
+msgid "Allow customizable avatars for groups"
+msgstr ""
+
+#: bp-core/admin/bp-core-admin-settings.php:223
 msgid "Attempt to save a new config file."
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:211 bp-core/admin/bp-core-tools.php:34
+#: bp-core/admin/bp-core-admin-settings.php:223
+#: bp-core/admin/bp-core-admin-tools.php:34
 msgid "Repair"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:212
+#: bp-core/admin/bp-core-admin-settings.php:224
 msgid "File does not exist"
 msgstr ""
 
-#: bp-core/admin/bp-core-settings.php:216
+#: bp-core/admin/bp-core-admin-settings.php:228
 msgid "Absolute path to your bbPress configuration file."
 msgstr ""
 
-#: bp-core/admin/bp-core-slugs.php:79
+#: bp-core/admin/bp-core-admin-slugs.php:86
 msgid "Directories"
 msgstr ""
 
-#: bp-core/admin/bp-core-slugs.php:81
+#: bp-core/admin/bp-core-admin-slugs.php:88
 msgid "Associate a WordPress Page with each BuddyPress component directory."
 msgstr ""
 
-#: bp-core/admin/bp-core-slugs.php:100 bp-core/admin/bp-core-slugs.php:163
+#: bp-core/admin/bp-core-admin-slugs.php:107
+#: bp-core/admin/bp-core-admin-slugs.php:183
 msgid "- None -"
 msgstr ""
 
-#: bp-core/admin/bp-core-slugs.php:104 bp-core/admin/bp-core-slugs.php:167
-msgid "New Page"
-msgstr ""
-
-#: bp-core/admin/bp-core-slugs.php:105 bp-core/admin/bp-core-slugs.php:168
-#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:13
-#: bp-xprofile/bp-xprofile-classes.php:531
-#: bp-xprofile/bp-xprofile-classes.php:965
-msgid "Save"
-msgstr ""
-
-#: bp-core/admin/bp-core-slugs.php:142
+#: bp-core/admin/bp-core-admin-slugs.php:162
 msgid "Registration"
 msgstr ""
 
-#: bp-core/admin/bp-core-slugs.php:144
+#: bp-core/admin/bp-core-admin-slugs.php:164
 msgid "Associate WordPress Pages with the following BuddyPress Registration pages."
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:19 bp-core/admin/bp-core-tools.php:383
-#: bp-core/admin/bp-core-tools.php:386 bp-core/bp-core-admin.php:289
+#: bp-core/admin/bp-core-admin-tools.php:19
+#: bp-core/admin/bp-core-admin-tools.php:401
+#: bp-core/admin/bp-core-admin-tools.php:404 bp-core/bp-core-admin.php:291
 msgid "BuddyPress Tools"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:22 bp-core/admin/bp-core-tools.php:385
+#: bp-core/admin/bp-core-admin-tools.php:22
+#: bp-core/admin/bp-core-admin-tools.php:403
 msgid ""
 "BuddyPress keeps track of various relationships between users, groups, and "
 "activity items. Occasionally these relationships become out of sync, most "
 "often after an import, update, or migration."
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:23
+#: bp-core/admin/bp-core-admin-tools.php:23
 msgid "Use the tools below to manually recalculate these relationships."
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:25
+#: bp-core/admin/bp-core-admin-tools.php:25
 msgid ""
 "Some of these tools create substantial database overhead. Avoid running "
 "more than one repair job at a time."
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:31
+#: bp-core/admin/bp-core-admin-tools.php:31
 msgid "Data to Repair:"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:49
+#: bp-core/admin/bp-core-admin-tools.php:49
 msgid "Repair Items"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:105
+#: bp-core/admin/bp-core-admin-tools.php:105
 msgid "Count total members"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:111
+#: bp-core/admin/bp-core-admin-tools.php:111
 msgid "Repair user \"last activity\" data"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:120
+#: bp-core/admin/bp-core-admin-tools.php:120
 msgid "Count friends for each user"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:130
+#: bp-core/admin/bp-core-admin-tools.php:130
 msgid "Count groups for each user"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:140
+#: bp-core/admin/bp-core-admin-tools.php:140
 msgid "Repopulate blogs records"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:164
+#: bp-core/admin/bp-core-admin-tools.php:171
 msgid "Counting the number of friends for each user&hellip; %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:165 bp-core/admin/bp-core-tools.php:221
-#: bp-core/admin/bp-core-tools.php:264
+#: bp-core/admin/bp-core-admin-tools.php:172
+#: bp-core/admin/bp-core-admin-tools.php:230
+#: bp-core/admin/bp-core-admin-tools.php:275
 msgid "Failed!"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:203 bp-core/admin/bp-core-tools.php:248
-#: bp-core/admin/bp-core-tools.php:276 bp-core/admin/bp-core-tools.php:292
-#: bp-core/admin/bp-core-tools.php:305
+#: bp-core/admin/bp-core-admin-tools.php:212
+#: bp-core/admin/bp-core-admin-tools.php:259
+#: bp-core/admin/bp-core-admin-tools.php:287
+#: bp-core/admin/bp-core-admin-tools.php:303
+#: bp-core/admin/bp-core-admin-tools.php:316
 msgid "Complete!"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:220
+#: bp-core/admin/bp-core-admin-tools.php:229
 msgid "Counting the number of groups for each user&hellip; %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:261
+#: bp-core/admin/bp-core-admin-tools.php:272
 msgid "Repopulating Blogs records&hellip; %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:289
+#: bp-core/admin/bp-core-admin-tools.php:300
 msgid "Counting the number of active members on the site&hellip; %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:303
+#: bp-core/admin/bp-core-admin-tools.php:314
 msgid "Determining last activity dates for each user&hellip; %s"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:361 bp-core/bp-core-admin.php:266
-#: bp-core/bp-core-admin.php:267
+#: bp-core/admin/bp-core-admin-tools.php:372 bp-core/bp-core-admin.php:268
+#: bp-core/bp-core-admin.php:269
 msgid "Tools"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:195 bp-core/bp-core-admin.php:196
-#: bp-core/bp-core-admin.php:204 bp-core/bp-core-admin.php:205
+#: bp-core/bp-core-admin.php:197 bp-core/bp-core-admin.php:198
+#: bp-core/bp-core-admin.php:206 bp-core/bp-core-admin.php:207
 msgid "Welcome to BuddyPress"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:225
+#: bp-core/bp-core-admin.php:227
 msgid "BuddyPress Help"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:226
+#: bp-core/bp-core-admin.php:228
 msgid "Help"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:235
+#: bp-core/bp-core-admin.php:237
 msgid "BuddyPress Components"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:244 bp-core/bp-core-admin.php:245
+#: bp-core/bp-core-admin.php:246 bp-core/bp-core-admin.php:247
 msgid "BuddyPress Pages"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:253 bp-core/bp-core-admin.php:254
+#: bp-core/bp-core-admin.php:255 bp-core/bp-core-admin.php:256
 msgid "BuddyPress Settings"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:277 bp-core/bp-core-admin.php:278
+#: bp-core/bp-core-admin.php:279 bp-core/bp-core-admin.php:280
 msgid "Available Tools"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:316
+#: bp-core/bp-core-admin.php:318
 msgid "Main Settings"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:319 bp-core/bp-core-admin.php:324
+#: bp-core/bp-core-admin.php:321 bp-core/bp-core-admin.php:326
 msgid "Toolbar"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:329
+#: bp-core/bp-core-admin.php:331
 msgid "Account Deletion"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:342
+#: bp-core/bp-core-admin.php:341
+msgid "Profile Photo Uploads"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:345
 msgid "Profile Syncing"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:351
+#: bp-core/bp-core-admin.php:354
 msgid "Groups Settings"
 msgstr ""
 
@@ -1606,339 +1640,318 @@ msgstr ""
 msgid "Group Creation"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:366
+#: bp-core/bp-core-admin.php:361
+msgid "Group Photo Uploads"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:370
 msgid "Legacy Group Forums"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:369
+#: bp-core/bp-core-admin.php:373
 msgid "bbPress Configuration"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:378
+#: bp-core/bp-core-admin.php:382
 msgid "Activity Settings"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:381
+#: bp-core/bp-core-admin.php:385
 msgid "Blog &amp; Forum Comments"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:385
+#: bp-core/bp-core-admin.php:389
 msgid "Activity auto-refresh"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:390
+#: bp-core/bp-core-admin.php:394
 msgid "Akismet"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:399
-msgid "Profile Photo Uploads"
-msgstr ""
-
-#: bp-core/bp-core-admin.php:416
+#: bp-core/bp-core-admin.php:412
 msgid "About BuddyPress"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:440
+#: bp-core/bp-core-admin.php:437
 msgid "About"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:496 bp-core/bp-core-admin.php:677
-msgid "Welcome to BuddyPress %s"
-msgstr ""
-
-#: bp-core/bp-core-admin.php:499 bp-core/bp-core-admin.php:680
-msgid ""
-"Thank you for installing BuddyPress! BuddyPress %s is our most streamlined "
-"and easy-to-use release to date, and we think you&#8217;re going to love it."
-msgstr ""
-
-#: bp-core/bp-core-admin.php:501 bp-core/bp-core-admin.php:682
-msgid ""
-"Howdy. BuddyPress %s is our most streamlined and easy-to-use release to "
-"date, and we think you&#8217;re going to love it."
-msgstr ""
-
-#: bp-core/bp-core-admin.php:509 bp-core/bp-core-admin.php:690
-msgid "What&#8217;s New"
-msgstr ""
-
-#: bp-core/bp-core-admin.php:511 bp-core/bp-core-admin.php:692
-msgid "Credits"
-msgstr ""
-
-#: bp-core/bp-core-admin.php:519
+#: bp-core/bp-core-admin.php:506
 msgid "Getting Started with BuddyPress"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:522
-msgid "Configure Buddypress"
+#: bp-core/bp-core-admin.php:509
+msgid "Configure BuddyPress"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:525
+#: bp-core/bp-core-admin.php:512
 msgid "Set Up Components"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:528
+#: bp-core/bp-core-admin.php:515
 msgid "Assign Components to Pages"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:531
+#: bp-core/bp-core-admin.php:518
 msgid "Customize Settings"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:534
+#: bp-core/bp-core-admin.php:521
 msgid "Get Started"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:537
+#: bp-core/bp-core-admin.php:524
 msgid "Administration Tools"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:540
+#: bp-core/bp-core-admin.php:527
 msgid "Add User Profile Fields"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:542
+#: bp-core/bp-core-admin.php:529
 msgid "Manage User Signups"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:544
+#: bp-core/bp-core-admin.php:531
 msgid "Moderate Activity Streams"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:547
+#: bp-core/bp-core-admin.php:534
 msgid "Manage Groups"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:549
+#: bp-core/bp-core-admin.php:536
 msgid "Repair Data"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:554
+#: bp-core/bp-core-admin.php:541
 msgid "Community and Support"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:555
+#: bp-core/bp-core-admin.php:542
 msgid ""
-"Looking for help? The <a href=\"http://codex.buddypress.org/\">BuddyPress "
+"Looking for help? The <a href=\"https://codex.buddypress.org/\">BuddyPress "
 "Codex</a> has you covered."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:556
+#: bp-core/bp-core-admin.php:543
 msgid ""
 "Can&#8217;t find what you need? Stop by <a "
-"href=\"http://buddypress.org/support/\">our support forums</a>, where "
+"href=\"https://buddypress.org/support/\">our support forums</a>, where "
 "active BuddyPress users and developers are waiting to share tips and more."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:567
-msgid "Revamped @mentions Interface"
+#: bp-core/bp-core-admin.php:552
+msgid "Upload Profile Pictures with Drag and Drop"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:568
-msgid ""
-"Forget the old days of trying to remember someone&#8217;s username when you "
-"want to @mention them in a conversation! With BuddyPress 2.1, type a "
-"<code>@</code> when leaving a status update or commenting on an activity "
-"item or blog post, and the new suggestions panel will open."
+#: bp-core/bp-core-admin.php:555
+msgid "Revamped Profile Picture Upload UI"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:569
-msgid "Demo of at-mentions feature"
+#: bp-core/bp-core-admin.php:559
+msgid ""
+"Built with the Attachments API, the new foundation for BuddyPress media "
+"management."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:575
-msgid "Continuous Improvement"
+#: bp-core/bp-core-admin.php:560
+msgid ""
+"You can drag and drop any image you choose to upload as your profile photo. "
+"The interface is mobile-ready and now includes integration with phone and "
+"laptop cameras. This is an example of what can be developed using the new "
+"Attachments API, the long-awaited foundation for media-related BuddyPress "
+"components and features."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:579
-msgid "New Profile Field Type: URL"
+#: bp-core/bp-core-admin.php:560
+msgid "Learn more &rarr;"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:580
-msgid ""
-"Built to hold the address of another website, this new field type "
-"automatically creates a link to that site."
+#: bp-core/bp-core-admin.php:567
+msgid "The Finer Points"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:584
-msgid "Awesome Translations"
+#: bp-core/bp-core-admin.php:572
+msgid "Member Type Directories"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:585
-msgid ""
-"BuddyPress supports high-quality translations that are automatically "
-"fetched by WordPress. Many thanks to our translation volunteers for making "
-"this possible."
+#: bp-core/bp-core-admin.php:573
+msgid "Create directories of member types in your site using the Member Type API."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:589
-msgid "Performance Improvements"
+#: bp-core/bp-core-admin.php:578
+msgid "Companion Stylesheets For Themes"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:590
+#: bp-core/bp-core-admin.php:579
 msgid ""
-"Like we do with every release, we&#8217ve made further optimizations to "
-"increase BuddyPress&#8217 performance and reduce its query overhead."
+"Improved styling and integration of BuddyPress components with bundled "
+"WordPress themes, Twenty Fifteen and Twenty Fourteen."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:598
-msgid "Enhancements for Plugin &amp; Theme Developers"
+#: bp-core/bp-core-admin.php:584
+msgid "Blog Post Activity"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:601
+#: bp-core/bp-core-admin.php:585
 msgid ""
-"If you&#8217re a plugin developer, or make custom themes, or want to "
-"contribute back to the BuddyPress project, here&#8217s what you should know "
-"about this release:"
+"BuddyPress now generates better excerpts in the activity streams for posts "
+"containing images or other embedded media content."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:602
-msgid ""
-"If you&#8217ve used BuddyPress for a very long time, you might remember the "
-"<em>BuddyBar</em>; it was our toolbar before WordPress had its own toolbar. "
-"We started to deprecate it in BuddyPress 1.6. It is now formally "
-"deprecated, which means you should not use it for new sites."
+#: bp-core/bp-core-admin.php:590
+msgid "Star Private Messages "
 msgstr ""
 
-#: bp-core/bp-core-admin.php:605
-msgid ""
-"The classic <a href=\"%s\">BP Default theme has moved to Github</a>. We "
-"moved it because BuddyPress development is now focused on our <a "
-"href=\"%s\">theme compatibility</a> templates, which were introduced in "
-"BuddyPress 1.7. Don&#8217t worry, BP-Default is still bundled with "
-"BuddyPress releases."
+#: bp-core/bp-core-admin.php:591
+msgid "Mark important messages in your inbox from your friends with a star."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:613
-#. translators: don't translate the insides of the <code> block
-msgid ""
-"In BuddyPress 2.0, we added a new <code>BP_XProfile_Field_Type</code> API "
-"for managing profile field types. In this release, we&#8217ve added a new "
-"<code>bp_core_get_suggestions</code> API which powers our new @mentions "
-"interface. Both are cool, and are worth checking out."
+#: bp-core/bp-core-admin.php:597
+msgid "Under the Hood"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:619
-msgid "Other interesting changes:"
+#: bp-core/bp-core-admin.php:601
+msgid "Components can register new features"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:625
-#. translators: don't translate the insides of the <code> block
+#: bp-core/bp-core-admin.php:602
 msgid ""
-"In <code>BP_Group_Extension</code>, the <code>visibility</code> and "
-"<code>enable_nav_item</code> properties have been phased out in favor of "
-"new <code>access</code> and <code>show_tab</code> parameters."
+"Plugin developers can register new features or check if a component feature "
+"is registered using the <code>BP_Component</code> class."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:631
-#. translators: don't translate the insides of the <code> block
-msgid ""
-"A new <code>group_activity</code> sort order has been added for Groups "
-"queries, to let you query for recently active members."
+#: bp-core/bp-core-admin.php:604
+msgid "Cache Improvements"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:637
-#. translators: don't translate the insides of the <code> block
+#: bp-core/bp-core-admin.php:605
 msgid ""
-"Extra CSS classes have been added to Profile Field visibility field "
-"elements, allowing greater CSS customization."
+"Improved caching for the following components: Messages, Profiles, Members "
+"&amp; Member Types, and Friends."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:643
-#. translators: don't translate the insides of the <code> block
-msgid ""
-"A <code>no_access_url</code> parameter has been added to "
-"<code>bp_core_new_subnav_item()</code>. This allows you to set the URL that "
-"users are redirected to when they do not have permission to access a "
-"sub-navigation item."
+#: bp-core/bp-core-admin.php:608
+msgid "Developer Reference"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:649
-#. translators: don't translate the insides of the <code> block
+#: bp-core/bp-core-admin.php:609
 msgid ""
-"When making searches with <code>BP_User_Query</code>, a new "
-"<code>search_wildcard</code> parameter gives you finer control over how the "
-"search SQL is constructed."
+"Continued improvements to inline code documentation make it easier for "
+"developers to understand how BuddyPress works."
+msgstr ""
+
+#: bp-core/bp-core-admin.php:611
+msgid "User Documentation"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:654
-msgid "<a href=\"%s\">&hellip;and lots more!</a>"
+#: bp-core/bp-core-admin.php:612
+msgid ""
+"The BuddyPress Codex is maintained and updated regularly with new articles "
+"and tutorials."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:696
-msgid "BuddyPress is created by a worldwide network of friendly folks."
+#: bp-core/bp-core-admin.php:640
+msgid "BuddyPress is created by a worldwide network of friendly folks like these."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:698
+#: bp-core/bp-core-admin.php:642
 msgid "Project Leaders"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:703
+#: bp-core/bp-core-admin.php:647
 msgid "Project Lead"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:708 bp-core/bp-core-admin.php:713
+#: bp-core/bp-core-admin.php:652 bp-core/bp-core-admin.php:657
 msgid "Lead Developer"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:717
+#: bp-core/bp-core-admin.php:661
 msgid "Core Team"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:722 bp-core/bp-core-admin.php:727
+#: bp-core/bp-core-admin.php:666 bp-core/bp-core-admin.php:671
+#: bp-core/bp-core-admin.php:681 bp-core/bp-core-admin.php:686
+#: bp-core/bp-core-admin.php:691
 msgid "Core Developer"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:732
+#: bp-core/bp-core-admin.php:676
 msgid "Navigator"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:736
+#: bp-core/bp-core-admin.php:695
 msgid "Recent Rockstars"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:760
+#: bp-core/bp-core-admin.php:720
 msgid "Contributors to BuddyPress %s"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:807
+#: bp-core/bp-core-admin.php:764
 msgid "External Libraries"
 msgstr ""
 
-#: bp-core/bp-core-admin.php:835
+#: bp-core/bp-core-admin.php:785
+msgid ""
+"Thank you for installing BuddyPress! BuddyPress %s gives you the components "
+"you need to turn your WordPress powered site into a thriving membership "
+"community."
+msgstr ""
+
+#: bp-core/bp-core-admin.php:786
+msgid ""
+"BuddyPress %s comes with a bunch of great improvements we think "
+"you&#8217;re really going to like."
+msgstr ""
+
+#: bp-core/bp-core-admin.php:790
+msgid "Welcome to BuddyPress %s"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:811
+msgid "What&#8217;s New"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:813
+msgid "Credits"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:880
 msgid "Maintenance Release"
 msgid_plural "Maintenance Releases"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:836
+#: bp-core/bp-core-admin.php:881
 msgid "Security Release"
 msgid_plural "Security Releases"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:837
+#: bp-core/bp-core-admin.php:882
 msgid "Maintenance and Security Release"
 msgid_plural "Maintenance and Security Releases"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:840
+#: bp-core/bp-core-admin.php:885
 #. translators: 1: WordPress version number.
 msgid "<strong>Version %1$s</strong> addressed a security issue."
 msgid_plural "<strong>Version %1$s</strong> addressed some security issues."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:845
+#: bp-core/bp-core-admin.php:890
 #. translators: 1: WordPress version number, 2: plural number of bugs.
 msgid "<strong>Version %1$s</strong> addressed %2$s bug."
 msgid_plural "<strong>Version %1$s</strong> addressed %2$s bugs."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:850
+#: bp-core/bp-core-admin.php:895
 #. translators: 1: WordPress version number, 2: plural number of bugs. Singular
 #. security issue.
 msgid "<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug."
@@ -1948,7 +1961,7 @@ msgid_plural ""
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:855
+#: bp-core/bp-core-admin.php:900
 #. translators: 1: WordPress version number, 2: plural number of bugs. More
 #. than one security issue.
 msgid ""
@@ -1960,11 +1973,11 @@ msgid_plural ""
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-admin.php:859
+#: bp-core/bp-core-admin.php:904
 msgid "For more information, see <a href=\"%s\">the release notes</a>."
 msgstr ""
 
-#: bp-core/bp-core-adminbar.php:36 bp-core/deprecated/2.1.php:264
+#: bp-core/bp-core-adminbar.php:36 bp-core/deprecated/2.1.php:262
 msgid "My Account"
 msgstr ""
 
@@ -1974,99 +1987,200 @@ msgid ""
 "toolbar as soon as possible."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:303
-msgid "Profile Photo"
+#: bp-core/bp-core-attachments.php:95
+msgid "You have attempted to queue too many files."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:578
-msgid "The image was uploaded successfully"
+#: bp-core/bp-core-attachments.php:96
+msgid "%s exceeds the maximum upload size for this site."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:579 bp-core/bp-core-avatars.php:580
-msgid "The image exceeds the maximum allowed file size of: "
+#: bp-core/bp-core-attachments.php:97
+msgid "This file is empty. Please try another."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:581
-msgid "The uploaded file was only partially uploaded."
+#: bp-core/bp-core-attachments.php:98
+msgid "This file type is not allowed. Please try another."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:582
-msgid "The image was not uploaded."
+#: bp-core/bp-core-attachments.php:99
+msgid "This file is not an image. Please try another."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:583
-msgid "Missing a temporary folder."
+#: bp-core/bp-core-attachments.php:100
+msgid "Memory exceeded. Please try another smaller file."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:101
+msgid "This is larger than the maximum size. Please try another."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:102
+msgid "An error occurred. Please try again later."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:103
+msgid "There was a configuration error. Please contact the server administrator."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:104
+msgid "You may only upload 1 file."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:105
+msgid "HTTP error."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:106 bp-core/bp-core-avatars.php:965
+msgid "Upload failed."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:107
+msgid "Please try uploading this file with the %1$sbrowser uploader%2$s."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:108
+msgid ""
+"%s exceeds the maximum upload size for the multi-file uploader when used in "
+"your browser."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:109
+msgid "IO error."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:110
+msgid "Security error."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:111
+msgid "File canceled."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:112
+msgid "Upload stopped."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:113
+msgid "Dismiss"
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:114
+msgid "Crunching&hellip;"
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:115
+msgid "Make sure to upload a unique file"
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:116
+msgid "&#8220;%s&#8221; has failed to upload."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:117
+msgid ""
+"If you&#39;d like to delete the existing profile photo but not upload a new "
+"one, please use the delete tab."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:218
+msgid "Upload"
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:226
+msgid "Take Photo"
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:230
+msgid "Please allow us to access to your camera."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:231
+msgid "Please wait as we access your camera."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:587
-msgid "Your upload failed, please try again. Error was: %s"
+#: bp-core/bp-core-attachments.php:232
+msgid "Camera loaded. Click on the \"Capture\" button to take your photo."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:592
-msgid "The file you uploaded is too big. Please upload a file under %s"
+#: bp-core/bp-core-attachments.php:233
+msgid ""
+"It looks like you do not have a webcam or we were unable to get permission "
+"to use your webcam. Please upload a photo instead."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:234
+msgid "Your browser is not supported. Please upload a photo instead."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:235
+msgid "Video error. Please upload a photo instead."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:236
+msgid "Your profile photo is ready. Click on the \"Save\" button to use this photo."
+msgstr ""
+
+#: bp-core/bp-core-attachments.php:237
+msgid "No photo was captured. Click on the \"Capture\" button to take your photo."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:597
-msgid "Please upload only JPG, GIF or PNG photos."
+#: bp-core/bp-core-avatars.php:329
+msgid "Profile Photo"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:614 bp-core/bp-core-avatars.php:651
+#: bp-core/bp-core-avatars.php:821
 msgid "Upload Failed! Error was: %s"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:669
+#: bp-core/bp-core-avatars.php:841
 msgid "Upload failed! Error was: %s"
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:679
+#: bp-core/bp-core-avatars.php:847
 msgid ""
 "You have selected an image that is smaller than recommended. For best "
 "results, upload a picture larger than %d x %d pixels."
 msgstr ""
 
-#: bp-core/bp-core-avatars.php:856 bp-core/bp-core-classes.php:835
-#: bp-core/bp-core-classes.php:836 bp-core/bp-core-classes.php:837
-#: bp-core/bp-core-template.php:151 bp-core/bp-core-template.php:170
-#: bp-groups/bp-groups-template.php:4040 bp-groups/bp-groups-template.php:4041
-#: bp-groups/bp-groups-template.php:4042
+#: bp-core/bp-core-avatars.php:1281 bp-core/bp-core-template.php:177
+#: bp-core/bp-core-template.php:196 bp-core/classes/class-bp-core-user.php:185
+#: bp-core/classes/class-bp-core-user.php:186
+#: bp-core/classes/class-bp-core-user.php:187
+#: bp-groups/bp-groups-template.php:5502 bp-groups/bp-groups-template.php:5503
+#: bp-groups/bp-groups-template.php:5504
 msgid "Profile photo of %s"
 msgstr ""
 
-#: bp-core/bp-core-buddybar.php:383 bp-core/bp-core-buddybar.php:394
-#: bp-core/bp-core-buddybar.php:414
+#: bp-core/bp-core-buddybar.php:400 bp-core/bp-core-buddybar.php:411
+#: bp-core/bp-core-buddybar.php:431
 msgid "You do not have access to this page."
 msgstr ""
 
-#: bp-core/bp-core-caps.php:283 bp-core/bp-core-caps.php:295
-#: bp-core/bp-core-caps.php:309 bp-core/bp-core-caps.php:319
+#: bp-core/bp-core-caps.php:345 bp-core/bp-core-caps.php:357
+#: bp-core/bp-core-caps.php:371 bp-core/bp-core-caps.php:381
 msgid "Special community roles no longer exist. Use mapped capabilities instead"
 msgstr ""
 
-#: bp-core/bp-core-catchuri.php:276
+#: bp-core/bp-core-catchuri.php:300
 msgid ""
 "This user has been marked as a spammer. Only site admins can view this "
 "profile."
 msgstr ""
 
-#: bp-core/bp-core-catchuri.php:490 bp-core/bp-core-catchuri.php:550
+#: bp-core/bp-core-catchuri.php:544 bp-core/bp-core-catchuri.php:621
 msgid "You must log in to access the page you requested."
 msgstr ""
 
-#: bp-core/bp-core-classes.php:852 bp-groups/bp-groups-template.php:4050
-msgid "%d group"
-msgid_plural "%d groups"
-msgstr[0] ""
-msgstr[1] ""
-
-#: bp-core/bp-core-dependency.php:88
+#: bp-core/bp-core-dependency.php:189
 msgid "The current user is being initialized without using $wp->init()."
 msgstr ""
 
-#: bp-core/bp-core-filters.php:267 bp-core/bp-core-filters.php:298
+#: bp-core/bp-core-filters.php:388 bp-core/bp-core-filters.php:419
 msgid "[User Set]"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:327
+#: bp-core/bp-core-filters.php:448
 msgid ""
 "%1$s,\n"
 "\n"
@@ -2084,11 +2198,11 @@ msgid ""
 "%3$s"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:328
+#: bp-core/bp-core-filters.php:449
 msgid "Activate %s"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:392 bp-members/bp-members-functions.php:1949
+#: bp-core/bp-core-filters.php:572 bp-members/bp-members-functions.php:2236
 msgid ""
 "Thanks for registering! To complete the activation of your account please "
 "click the following link:\n"
@@ -2097,275 +2211,298 @@ msgid ""
 "\n"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:393 bp-members/bp-members-functions.php:1950
+#: bp-core/bp-core-filters.php:573 bp-members/bp-members-functions.php:2237
 msgid "Activate Your Account"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:466
-#. translators: "group name | group nav section name"
-msgid "%1$s | %2$s"
-msgstr ""
-
-#: bp-core/bp-core-filters.php:471
-#. translators: "component item name | component nav section name | root
-#. component name"
-msgid "%1$s | %2$s | %3$s"
-msgstr ""
-
-#: bp-core/bp-core-filters.php:487 bp-members/bp-members-screens.php:517
+#: bp-core/bp-core-filters.php:749 bp-members/bp-members-screens.php:670
 msgid "Create an Account"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:491 bp-members/bp-members-screens.php:525
+#: bp-core/bp-core-filters.php:753 bp-members/bp-members-screens.php:678
 msgid "Activate your Account"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:495 bp-groups/bp-groups-template.php:2513
-#: bp-groups/bp-groups-template.php:2514
+#: bp-core/bp-core-filters.php:757 bp-groups/bp-groups-template.php:3390
+#: bp-groups/bp-groups-template.php:3391
 msgid "Create a Group"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:849
+#: bp-core/bp-core-filters.php:788
+msgid "Page %s"
+msgstr ""
+
+#: bp-core/bp-core-functions.php:1074
 msgid "sometime"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:850
+#: bp-core/bp-core-functions.php:1083
 msgid "right now"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:851
+#: bp-core/bp-core-functions.php:1092
 msgid "%s ago"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:912
+#: bp-core/bp-core-functions.php:1153
 msgid "%s year"
 msgid_plural "%s years"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:915 bp-core/bp-core-functions.php:949
+#: bp-core/bp-core-functions.php:1156 bp-core/bp-core-functions.php:1190
 msgid "%s month"
 msgid_plural "%s months"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:918 bp-core/bp-core-functions.php:952
+#: bp-core/bp-core-functions.php:1159 bp-core/bp-core-functions.php:1193
 msgid "%s week"
 msgid_plural "%s weeks"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:921 bp-core/bp-core-functions.php:955
+#: bp-core/bp-core-functions.php:1162 bp-core/bp-core-functions.php:1196
 msgid "%s day"
 msgid_plural "%s days"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:924 bp-core/bp-core-functions.php:958
+#: bp-core/bp-core-functions.php:1165 bp-core/bp-core-functions.php:1199
 msgid "%s hour"
 msgid_plural "%s hours"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:927 bp-core/bp-core-functions.php:961
+#: bp-core/bp-core-functions.php:1168 bp-core/bp-core-functions.php:1202
 msgid "%s minute"
 msgid_plural "%s minutes"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:930 bp-core/bp-core-functions.php:964
+#: bp-core/bp-core-functions.php:1171 bp-core/bp-core-functions.php:1205
 msgid "%s second"
 msgid_plural "%s seconds"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/bp-core-functions.php:1152
+#: bp-core/bp-core-functions.php:1427
 msgid "Not recently active"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:1850 bp-core/bp-core-widgets.php:72
-#: bp-core/deprecated/1.5.php:307 bp-core/deprecated/2.1.php:306
-#: bp-members/bp-members-template.php:1103
+#: bp-core/bp-core-functions.php:2292 bp-core/bp-core-widgets.php:89
+#: bp-core/deprecated/1.5.php:307 bp-core/deprecated/2.1.php:307
+#: bp-members/bp-members-template.php:1388
 msgid "Log Out"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:1917 bp-core/bp-core-widgets.php:90
-#: bp-core/deprecated/2.1.php:243
+#: bp-core/bp-core-functions.php:2358 bp-core/bp-core-widgets.php:121
+#: bp-core/deprecated/2.1.php:239
 msgid "Log In"
 msgstr ""
 
-#: bp-core/bp-core-template.php:81
+#: bp-core/bp-core-template.php:99
 msgid "Options"
 msgstr ""
 
-#: bp-core/bp-core-template.php:106
+#: bp-core/bp-core-template.php:124
 msgid "%s Directory"
 msgstr ""
 
-#: bp-core/bp-core-template.php:302
+#: bp-core/bp-core-template.php:389
 msgid "%1$s at %2$s"
 msgstr ""
 
-#: bp-core/bp-core-template.php:443
+#: bp-core/bp-core-template.php:574
 msgid "Search anything..."
 msgstr ""
 
-#: bp-core/bp-core-template.php:547
+#: bp-core/bp-core-template.php:770
 msgid " [&hellip;]"
 msgstr ""
 
-#: bp-core/bp-core-template.php:771
+#: bp-core/bp-core-template.php:1034
 msgid "Community"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:38
+#: bp-core/bp-core-widgets.php:37
 msgid ""
 "Show a Log In form to logged-out visitors, and a Log Out link to those who "
 "are logged in."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:82 bp-members/admin/bp-members-classes.php:125
-#: bp-members/admin/bp-members-classes.php:453
-#: bp-templates/bp-legacy/buddypress/members/register.php:32
+#: bp-core/bp-core-widgets.php:113
+#: bp-members/admin/bp-members-admin-classes.php:135
+#: bp-members/admin/bp-members-admin-classes.php:503
+#: bp-templates/bp-legacy/buddypress/members/register.php:66
 msgid "Username"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:85
+#: bp-core/bp-core-widgets.php:116
 msgid "Password"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:88
+#: bp-core/bp-core-widgets.php:119
 msgid "Remember Me"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:94
+#: bp-core/bp-core-widgets.php:125
 msgid "<a href=\"%s\" title=\"Register for a new account\">Register</a>"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:133 bp-core/bp-core-widgets.php:288
-#: bp-core/bp-core-widgets.php:404 bp-core/bp-core-widgets.php:507
-#: bp-groups/bp-groups-widgets.php:146 bp-messages/bp-messages-widgets.php:110
-#: bp-templates/bp-legacy/buddypress/forums/index.php:86
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:47
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:75
+#: bp-core/bp-core-widgets.php:171 bp-groups/bp-groups-widgets.php:164
+#: bp-members/bp-members-widgets.php:189 bp-members/bp-members-widgets.php:358
+#: bp-members/bp-members-widgets.php:508
+#: bp-messages/bp-messages-widgets.php:124
+#: bp-templates/bp-legacy/buddypress/forums/index.php:159
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:68
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:100
 msgid "Title:"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:151
-msgid "A dynamic list of recently active, popular, and newest members"
+#: bp-core/classes/class-bp-attachment-avatar.php:41
+msgid "That photo is too big. Please upload one smaller than %s"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:199 bp-core/bp-core-widgets.php:297
-#: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:152
-#: bp-friends/bp-friends-widgets.php:98 bp-friends/bp-friends-widgets.php:186
-#: bp-groups/bp-groups-template.php:3091 bp-groups/bp-groups-widgets.php:74
-#: bp-groups/bp-groups-widgets.php:155
-#: bp-templates/bp-legacy/buddypress/blogs/index.php:39
-#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:22
-msgid "Newest"
+#: bp-core/classes/class-bp-attachment-avatar.php:42
+msgid "Please upload only this file type: %s."
+msgid_plural "Please upload only these file types: %s."
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-core/classes/class-bp-attachment-avatar.php:353
+#: bp-xprofile/bp-xprofile-screens.php:260
+msgid "There was a problem cropping your profile photo."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:200 bp-core/bp-core-widgets.php:298
-#: bp-friends/bp-friends-widgets.php:99 bp-friends/bp-friends-widgets.php:187
-#: bp-groups/bp-groups-widgets.php:75 bp-groups/bp-groups-widgets.php:156
-#: bp-members/bp-members-admin.php:913
-msgid "Active"
+#: bp-core/classes/class-bp-attachment-avatar.php:354
+#: bp-xprofile/bp-xprofile-screens.php:269
+msgid "Your new profile photo was uploaded successfully."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:204 bp-core/bp-core-widgets.php:299
-#: bp-friends/bp-friends-widgets.php:100 bp-friends/bp-friends-widgets.php:188
-#: bp-groups/bp-groups-widgets.php:76 bp-groups/bp-groups-widgets.php:157
-msgid "Popular"
+#: bp-core/classes/class-bp-attachment-avatar.php:355
+#: bp-xprofile/bp-xprofile-actions.php:41
+msgid "There was a problem deleting your profile photo. Please try again."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:241
-msgid "No one has signed up yet!"
+#: bp-core/classes/class-bp-attachment-avatar.php:356
+#: bp-xprofile/bp-xprofile-actions.php:39
+msgid "Your profile photo was deleted successfully!"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:275 bp-groups/bp-groups-admin.php:784
-#: bp-groups/bp-groups-template.php:2084 bp-members/bp-members-loader.php:23
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:231
-msgid "Members"
+#: bp-core/classes/class-bp-attachment-avatar.php:371
+#: bp-groups/bp-groups-screens.php:966
+msgid "There was a problem cropping the group profile photo."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:290 bp-friends/bp-friends-widgets.php:179
-msgid "Link widget title to Members directory"
+#: bp-core/classes/class-bp-attachment-avatar.php:372
+msgid "The group profile photo was uploaded successfully."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:292
-msgid "Max members to show:"
+#: bp-core/classes/class-bp-attachment-avatar.php:373
+#: bp-groups/bp-groups-screens.php:923
+msgid "There was a problem deleting the group profile photo. Please try again."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:295
-msgid "Default members to show:"
+#: bp-core/classes/class-bp-attachment-avatar.php:374
+#: bp-groups/bp-groups-screens.php:921
+msgid "The group profile photo was deleted successfully!"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:317
-msgid "Profile photos of online users"
+#: bp-core/classes/class-bp-attachment.php:157
+msgid "The file was uploaded successfully"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:364
-msgid "There are no users currently online"
+#: bp-core/classes/class-bp-attachment.php:158
+msgid "The uploaded file exceeds the maximum allowed file size for this site"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:395
-msgid "Who's Online"
+#: bp-core/classes/class-bp-attachment.php:159
+msgid "The uploaded file exceeds the maximum allowed file size of: %s"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:406 bp-core/bp-core-widgets.php:509
-msgid "Max Members to show:"
+#: bp-core/classes/class-bp-attachment.php:160
+msgid "The uploaded file was only partially uploaded."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:420
-msgid "Profile photos of recently active members"
+#: bp-core/classes/class-bp-attachment.php:161
+msgid "No file was uploaded."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:467
-msgid "There are no recently active members"
+#: bp-core/classes/class-bp-attachment.php:163
+msgid "Missing a temporary folder."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:498
-msgid "Recently Active Members"
+#: bp-core/classes/class-bp-attachment.php:164
+msgid "Failed to write file to disk."
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:571 bp-friends/bp-friends-widgets.php:252
-msgid "There were no members found, please try another filter."
+#: bp-core/classes/class-bp-attachment.php:165
+msgid "File upload stopped by extension."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:142
-#: bp-templates/bp-legacy/buddypress/activity/post-form.php:45
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
-msgid "My Profile"
+#: bp-core/classes/class-bp-attachment.php:432
+msgid "Cropping the file failed: missing source file."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:149 bp-members/admin/bp-members-classes.php:126
-#: bp-members/admin/bp-members-classes.php:454
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:15
-msgid "Name"
+#: bp-core/classes/class-bp-attachment.php:437
+msgid "Cropping the file failed: the file path is not allowed."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:158
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:24
-msgid "About Me"
+#: bp-core/classes/class-bp-attachment.php:478
+msgid "Cropping the file failed: %s is not a supported image file."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:167
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:33
-msgid "Website"
+#: bp-core/classes/class-bp-attachment.php:511
+msgid "Sorry, uploading the file failed."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:176
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:42
-msgid "Jabber"
+#: bp-core/classes/class-bp-attachment.php:512
+msgid "File successfully uploaded."
 msgstr ""
 
-#: bp-core/deprecated/1.5.php:185
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:51
+#: bp-core/classes/class-bp-core-user.php:202
+#: bp-groups/bp-groups-template.php:5512
+msgid "%d group"
+msgid_plural "%d groups"
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-core/deprecated/1.5.php:142
+#: bp-templates/bp-legacy/buddypress/activity/post-form.php:54
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:22
+msgid "My Profile"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:149
+#: bp-members/admin/bp-members-admin-classes.php:136
+#: bp-members/admin/bp-members-admin-classes.php:504
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:29
+msgid "Name"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:158
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:38
+msgid "About Me"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:167
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:47
+msgid "Website"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:176
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:56
+msgid "Jabber"
+msgstr ""
+
+#: bp-core/deprecated/1.5.php:185
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:65
 msgid "AOL Messenger"
 msgstr ""
 
 #: bp-core/deprecated/1.5.php:194
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:60
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:74
 msgid "Yahoo Messenger"
 msgstr ""
 
@@ -2374,115 +2511,124 @@ msgid "%1$s mentioned you in the group \"%2$s\""
 msgstr ""
 
 #: bp-core/deprecated/1.6.php:128 bp-core/deprecated/1.6.php:149
-#: bp-groups/bp-groups-template.php:3465 bp-groups/bp-groups-template.php:3486
+#: bp-groups/bp-groups-template.php:4798 bp-groups/bp-groups-template.php:4819
 msgid "Recently Active"
 msgstr ""
 
+#: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:152
+#: bp-friends/bp-friends-widgets.php:108 bp-friends/bp-friends-widgets.php:196
+#: bp-groups/bp-groups-template.php:4291 bp-groups/bp-groups-widgets.php:92
+#: bp-groups/bp-groups-widgets.php:173 bp-members/bp-members-widgets.php:98
+#: bp-members/bp-members-widgets.php:211
+#: bp-templates/bp-legacy/buddypress/blogs/index.php:84
+#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:22
+msgid "Newest"
+msgstr ""
+
 #: bp-core/deprecated/1.6.php:130 bp-core/deprecated/1.6.php:155
-#: bp-groups/bp-groups-template.php:3470 bp-groups/bp-groups-template.php:3501
+#: bp-groups/bp-groups-template.php:4803 bp-groups/bp-groups-template.php:4834
 msgid "Alphabetically"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:130 bp-core/deprecated/2.1.php:314
+#: bp-core/deprecated/2.1.php:123 bp-core/deprecated/2.1.php:315
 msgid "Dashboard"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:131 bp-core/deprecated/2.1.php:318
+#: bp-core/deprecated/2.1.php:124 bp-core/deprecated/2.1.php:319
 msgid "New Post"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:132 bp-core/deprecated/2.1.php:319
+#: bp-core/deprecated/2.1.php:125 bp-core/deprecated/2.1.php:320
 msgid "Manage Posts"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:133 bp-core/deprecated/2.1.php:320
+#: bp-core/deprecated/2.1.php:126 bp-core/deprecated/2.1.php:321
 msgid "Manage Comments"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:146
+#: bp-core/deprecated/2.1.php:139
 msgid "Create a Site!"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:166
+#: bp-core/deprecated/2.1.php:159
 msgid "Switch to WordPress Toolbar"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:247
+#: bp-core/deprecated/2.1.php:243
 msgid "Sign Up"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:340
+#: bp-core/deprecated/2.1.php:341
 msgid "Visit"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:342
+#: bp-core/deprecated/2.1.php:343
 msgid "Random Member"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:346
+#: bp-core/deprecated/2.1.php:347
 msgid "Random Group"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:352
+#: bp-core/deprecated/2.1.php:353
 msgid "Random Site"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:410 bp-core/deprecated/2.1.php:533
+#: bp-core/deprecated/2.1.php:413 bp-core/deprecated/2.1.php:542
 msgid "Admin Options"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:413 bp-groups/bp-groups-adminbar.php:50
+#: bp-core/deprecated/2.1.php:416
 msgid "Edit Details"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:415
+#: bp-core/deprecated/2.1.php:418
 msgid "Group Settings"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:419 bp-groups/bp-groups-loader.php:617
+#: bp-core/deprecated/2.1.php:422 bp-groups/bp-groups-loader.php:718
 msgid "Group Profile Photo"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:425 bp-groups/bp-groups-adminbar.php:77
+#: bp-core/deprecated/2.1.php:428
 msgid "Manage Invitations"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:429 bp-groups/bp-groups-adminbar.php:86
+#: bp-core/deprecated/2.1.php:432
 msgid "Manage Members"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:433 bp-groups/bp-groups-adminbar.php:95
+#: bp-core/deprecated/2.1.php:436
 msgid "Membership Requests"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:437 bp-groups/bp-groups-admin.php:893
-#: bp-groups/bp-groups-adminbar.php:104
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:332
-#: bp-xprofile/bp-xprofile-admin.php:118
+#: bp-core/deprecated/2.1.php:440 bp-groups/bp-groups-admin.php:983
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:440
+#: bp-xprofile/bp-xprofile-admin.php:145
 msgid "Delete Group"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:486
+#: bp-core/deprecated/2.1.php:491
 msgid "Blog Authors"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:538
+#: bp-core/deprecated/2.1.php:547
 msgid "Edit %s's Profile"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:542
+#: bp-core/deprecated/2.1.php:551
 msgid "Edit %s's Profile Photo"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:544 bp-members/bp-members-adminbar.php:121
+#: bp-core/deprecated/2.1.php:553 bp-members/bp-members-adminbar.php:125
 msgid "User Capabilities"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:546
+#: bp-core/deprecated/2.1.php:555
 msgid "Delete %s's Account"
 msgstr ""
 
-#: bp-core/deprecated/2.1.php:591
+#: bp-core/deprecated/2.1.php:603
 msgid "No new notifications."
 msgstr ""
 
@@ -2490,112 +2636,120 @@ msgstr ""
 msgid "Discussion Forums"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:70
+#: bp-forums/bp-forums-loader.php:71
 msgid "Search Forums..."
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:154 bp-forums/bp-forums-loader.php:207
+#: bp-forums/bp-forums-loader.php:155 bp-forums/bp-forums-loader.php:208
 msgid "Topics Started"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:165
+#: bp-forums/bp-forums-loader.php:166
 msgid "Replied To"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:215
+#: bp-forums/bp-forums-loader.php:216
 msgid "Replies"
 msgstr ""
 
-#: bp-forums/bp-forums-loader.php:223
+#: bp-forums/bp-forums-loader.php:224
 msgid "Favorite Topics"
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:25 bp-forums/bp-forums-screens.php:182
+#: bp-forums/bp-forums-screens.php:25 bp-forums/bp-forums-screens.php:262
 msgid "The forums component has not been set up yet."
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:48 bp-groups/bp-groups-screens.php:381
+#: bp-forums/bp-forums-screens.php:53 bp-groups/bp-groups-screens.php:516
 msgid "Please provide a title for your forum topic."
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:50 bp-groups/bp-groups-screens.php:383
+#: bp-forums/bp-forums-screens.php:55 bp-groups/bp-groups-screens.php:518
 msgid "Forum posts cannot be empty. Please enter some text."
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:57 bp-groups/bp-groups-screens.php:395
+#: bp-forums/bp-forums-screens.php:62 bp-groups/bp-groups-screens.php:530
 msgid "There was an error when creating the topic"
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:60 bp-groups/bp-groups-screens.php:398
+#: bp-forums/bp-forums-screens.php:65 bp-groups/bp-groups-screens.php:533
 msgid "The topic was created successfully"
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:68 bp-forums/bp-forums-screens.php:73
+#: bp-forums/bp-forums-screens.php:73 bp-forums/bp-forums-screens.php:78
 msgid "Please pick the group forum where you would like to post this topic."
 msgstr ""
 
-#: bp-forums/bp-forums-screens.php:208 bp-groups/bp-groups-template.php:2358
-#: bp-groups/bp-groups-template.php:2359
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:19
+#: bp-forums/bp-forums-screens.php:288 bp-groups/bp-groups-template.php:3201
+#: bp-groups/bp-groups-template.php:3202
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:24
 msgid "New Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:756 bp-forums/bp-forums-template.php:870
-#: bp-forums/bp-forums-template.php:2014
-#: bp-messages/bp-messages-classes.php:484
-#: bp-messages/bp-messages-template.php:1525
-#: bp-messages/bp-messages-template.php:1717
+#: bp-forums/bp-forums-template.php:887 bp-forums/bp-forums-template.php:1048
+#: bp-forums/bp-forums-template.php:2435
+#: bp-messages/bp-messages-template.php:2139
+#: bp-messages/bp-messages-template.php:2380
+#: bp-messages/classes/class-bp_messages-thread.php:774
 msgid "Deleted User"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:916
+#: bp-forums/bp-forums-template.php:1102
 msgid "Group logo for %s"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1103 bp-groups/bp-groups-template.php:1648
+#: bp-forums/bp-forums-template.php:1360 bp-groups/bp-groups-template.php:2070
 msgid "%d post"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1105 bp-groups/bp-groups-template.php:1650
+#: bp-forums/bp-forums-template.php:1364 bp-groups/bp-groups-template.php:2072
 msgid "%d posts"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1291
+#: bp-forums/bp-forums-template.php:1594
 msgid "Edit Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1295
+#: bp-forums/bp-forums-template.php:1598
 msgid "Sticky Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1297
+#: bp-forums/bp-forums-template.php:1600
 msgid "Un-stick Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1300
+#: bp-forums/bp-forums-template.php:1603
 msgid "Open Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1302
+#: bp-forums/bp-forums-template.php:1605
 msgid "Close Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1304
+#: bp-forums/bp-forums-template.php:1607
 msgid "Delete Topic"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1525
+#: bp-forums/bp-forums-template.php:1879
 msgid " matching tag \"%s\""
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1527
+#: bp-forums/bp-forums-template.php:1882
 msgid "Viewing 1 topic"
+msgstr ""
+
+#: bp-forums/bp-forums-template.php:1884
+msgid "Viewing %1$s - %2$s of %3$s topic"
 msgid_plural "Viewing %1$s - %2$s of %3$s topics"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-forums/bp-forums-template.php:2166
+#: bp-forums/bp-forums-template.php:2632
 msgid "Viewing 1 post"
+msgstr ""
+
+#: bp-forums/bp-forums-template.php:2634
+msgid "Viewing %1$s - %2$s of %3$s post"
 msgid_plural "Viewing %1$s - %2$s of %3$s posts"
 msgstr[0] ""
 msgstr[1] ""
@@ -2707,7 +2861,7 @@ msgid ""
 msgstr ""
 
 #: bp-forums/deprecated/1.6.php:143
-msgid "The bb-config.php file was not found at that location, please try again."
+msgid "The bb-config.php file was not found at that location. Please try again."
 msgstr ""
 
 #: bp-forums/deprecated/1.6.php:146
@@ -2792,7 +2946,7 @@ msgid "You already have a pending friendship request with this user"
 msgstr ""
 
 #: bp-friends/bp-friends-actions.php:76
-#: bp-templates/bp-legacy/buddypress-functions.php:1099
+#: bp-templates/bp-legacy/buddypress-functions.php:1343
 msgid "Friendship could not be canceled."
 msgstr ""
 
@@ -2825,8 +2979,8 @@ msgstr ""
 msgid "New friendship created"
 msgstr ""
 
-#: bp-friends/bp-friends-activity.php:132
-#: bp-friends/bp-friends-activity.php:158
+#: bp-friends/bp-friends-activity.php:137
+#: bp-friends/bp-friends-activity.php:171
 msgid "%1$s and %2$s are now friends"
 msgstr ""
 
@@ -2853,12 +3007,12 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:94
-#: bp-friends/bp-friends-notifications.php:144
+#: bp-friends/bp-friends-notifications.php:132
+#: bp-friends/bp-friends-notifications.php:222
 msgid "%s accepted your friendship request"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:95
+#: bp-friends/bp-friends-notifications.php:133
 msgid ""
 "%1$s accepted your friend request.\n"
 "\n"
@@ -2867,105 +3021,105 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:141
+#: bp-friends/bp-friends-notifications.php:219
 msgid "%d friends accepted your friendship requests"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:155
+#: bp-friends/bp-friends-notifications.php:235
 msgid "You have %d pending friendship requests"
 msgstr ""
 
-#: bp-friends/bp-friends-notifications.php:158
+#: bp-friends/bp-friends-notifications.php:238
 msgid "You have a friendship request from %s"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:36
+#: bp-friends/bp-friends-screens.php:48
 msgid "Friendship accepted"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:38
+#: bp-friends/bp-friends-screens.php:50
 msgid "Friendship could not be accepted"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:47
+#: bp-friends/bp-friends-screens.php:59
 msgid "Friendship rejected"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:49
+#: bp-friends/bp-friends-screens.php:61
 msgid "Friendship could not be rejected"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:58
+#: bp-friends/bp-friends-screens.php:70
 msgid "Friendship request withdrawn"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:60
+#: bp-friends/bp-friends-screens.php:72
 msgid "Friendship request could not be withdrawn"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:66
+#: bp-friends/bp-friends-template.php:82
 msgid "My Friends"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:66
+#: bp-friends/bp-friends-template.php:82
 msgid "%s's Friends"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:66
+#: bp-friends/bp-friends-template.php:82
 msgid "See All"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:86
+#: bp-friends/bp-friends-template.php:102
 msgid "You haven't added any friend connections yet."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:86
+#: bp-friends/bp-friends-template.php:102
 msgid "%s hasn't created any friend connections yet."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:156
+#: bp-friends/bp-friends-template.php:172
 msgid "There aren't enough site members to show a random sample just yet."
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:173
+#: bp-friends/bp-friends-template.php:189
 msgid "Filter Friends"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:216
+#: bp-friends/bp-friends-template.php:241
 msgid "%d friend"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:218
+#: bp-friends/bp-friends-template.php:245
 msgid "%d friends"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:313
-#: bp-templates/bp-legacy/buddypress-functions.php:1111
+#: bp-friends/bp-friends-template.php:355
+#: bp-templates/bp-legacy/buddypress-functions.php:1355
 msgid "Cancel Friendship Request"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:314
+#: bp-friends/bp-friends-template.php:356
 msgid "Cancel Friendship Requested"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:330
-#: bp-friends/bp-friends-template.php:331
+#: bp-friends/bp-friends-template.php:372
+#: bp-friends/bp-friends-template.php:373
 msgid "Friendship Requested"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:347
-#: bp-friends/bp-friends-template.php:348
+#: bp-friends/bp-friends-template.php:389
+#: bp-friends/bp-friends-template.php:390
 msgid "Cancel Friendship"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:364
-#: bp-friends/bp-friends-template.php:365
-#: bp-templates/bp-legacy/buddypress-functions.php:1101
-#: bp-templates/bp-legacy/buddypress-functions.php:1119
+#: bp-friends/bp-friends-template.php:406
+#: bp-friends/bp-friends-template.php:407
+#: bp-templates/bp-legacy/buddypress-functions.php:1345
+#: bp-templates/bp-legacy/buddypress-functions.php:1363
 msgid "Add Friend"
 msgstr ""
 
-#: bp-friends/bp-friends-template.php:583
+#: bp-friends/bp-friends-template.php:674
 msgid "%s friend"
 msgid_plural "%s friends"
 msgstr[0] ""
@@ -2981,19 +3135,40 @@ msgstr ""
 msgid "%s&#8217;s Friends"
 msgstr ""
 
-#: bp-friends/bp-friends-widgets.php:135
-#: bp-templates/bp-legacy/buddypress/members/members-loop.php:108
+#: bp-friends/bp-friends-widgets.php:109 bp-friends/bp-friends-widgets.php:197
+#: bp-groups/bp-groups-widgets.php:93 bp-groups/bp-groups-widgets.php:174
+#: bp-members/bp-members-admin.php:991 bp-members/bp-members-widgets.php:99
+#: bp-members/bp-members-widgets.php:212
+msgid "Active"
+msgstr ""
+
+#: bp-friends/bp-friends-widgets.php:110 bp-friends/bp-friends-widgets.php:198
+#: bp-groups/bp-groups-widgets.php:94 bp-groups/bp-groups-widgets.php:175
+#: bp-members/bp-members-widgets.php:103 bp-members/bp-members-widgets.php:213
+msgid "Popular"
+msgstr ""
+
+#: bp-friends/bp-friends-widgets.php:145
+#: bp-templates/bp-legacy/buddypress/members/members-loop.php:147
 msgid "Sorry, no members were found."
 msgstr ""
 
-#: bp-friends/bp-friends-widgets.php:181
+#: bp-friends/bp-friends-widgets.php:189 bp-members/bp-members-widgets.php:197
+msgid "Link widget title to Members directory"
+msgstr ""
+
+#: bp-friends/bp-friends-widgets.php:191
 msgid "Max friends to show:"
 msgstr ""
 
-#: bp-friends/bp-friends-widgets.php:184
+#: bp-friends/bp-friends-widgets.php:194
 msgid "Default friends to show:"
 msgstr ""
 
+#: bp-friends/bp-friends-widgets.php:262 bp-members/bp-members-widgets.php:616
+msgid "There were no members found, please try another filter."
+msgstr ""
+
 #: bp-groups/bp-groups-actions.php:39
 msgid "You do not have access to this group."
 msgstr ""
@@ -3002,65 +3177,62 @@ msgstr ""
 msgid "You are not an admin of this group."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:108
+#: bp-groups/bp-groups-actions.php:107
 msgid "Sorry, you are not allowed to create groups."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:131
+#: bp-groups/bp-groups-actions.php:132 bp-groups/bp-groups-actions.php:167
+#: bp-groups/bp-groups-actions.php:191
 msgid "There was an error saving group details. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:146
+#: bp-groups/bp-groups-actions.php:147
 msgid "Only the group creator may continue editing this group."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:159
+#: bp-groups/bp-groups-actions.php:160
 msgid "Please fill in all of the required fields"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:166 bp-groups/bp-groups-actions.php:190
-msgid "There was an error saving group details, please try again."
-msgstr ""
-
-#: bp-groups/bp-groups-actions.php:274 bp-groups/bp-groups-screens.php:488
+#: bp-groups/bp-groups-actions.php:308 bp-groups/bp-groups-screens.php:668
 msgid "Invite successfully removed"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:278 bp-groups/bp-groups-screens.php:499
+#: bp-groups/bp-groups-actions.php:312 bp-groups/bp-groups-screens.php:679
 msgid "There was an error removing the invite"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:309
+#: bp-groups/bp-groups-actions.php:343
 msgid ""
 "There was an error saving the group profile photo, please try uploading "
 "again."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:311
+#: bp-groups/bp-groups-actions.php:345
 msgid "The group profile photo was uploaded successfully!"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:338 bp-groups/bp-groups-actions.php:345
+#: bp-groups/bp-groups-actions.php:380 bp-groups/bp-groups-actions.php:387
 msgid "There was an error joining the group."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:347
+#: bp-groups/bp-groups-actions.php:389
 msgid "You joined the group!"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:385 bp-groups/bp-groups-screens.php:785
+#: bp-groups/bp-groups-actions.php:434 bp-groups/bp-groups-screens.php:1045
 msgid "This group must have at least one admin"
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:387
+#: bp-groups/bp-groups-actions.php:436
 msgid "There was an error leaving the group."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:389 bp-groups/bp-groups-functions.php:370
+#: bp-groups/bp-groups-actions.php:438 bp-groups/bp-groups-functions.php:447
 msgid "You successfully left the group."
 msgstr ""
 
-#: bp-groups/bp-groups-actions.php:476
+#: bp-groups/bp-groups-actions.php:534
 msgid "Activity feed for the group, %s."
 msgstr ""
 
@@ -3080,37 +3252,61 @@ msgstr ""
 msgid "Group Memberships"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:53
+#: bp-groups/bp-groups-activity.php:49
+msgid "Group details edited"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:51
+msgid "Group Updates"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:62
 msgid "New group forum topic"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:55
+#: bp-groups/bp-groups-activity.php:64
 msgid "Forum Topics"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:62
+#: bp-groups/bp-groups-activity.php:71
 msgid "New group forum post"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:64
+#: bp-groups/bp-groups-activity.php:73
 msgid "Forum Replies"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:91
+#: bp-groups/bp-groups-activity.php:106
 msgid "%1$s created the group %2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-activity.php:114 bp-groups/bp-groups-activity.php:284
+#: bp-groups/bp-groups-activity.php:138 bp-groups/bp-groups-activity.php:444
 msgid "%1$s joined the group %2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:113
+#: bp-groups/bp-groups-activity.php:189
+msgid "%1$s updated details for the group %2$s"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:193
+msgid "%1$s changed the name and description of the group %2$s"
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:197
+msgid "%1$s changed the name of the group %2$s from \"%3$s\" to \"%4$s\""
+msgstr ""
+
+#: bp-groups/bp-groups-activity.php:201
+msgid "%1$s changed the description of the group %2$s from \"%3$s\" to \"%4$s\""
+msgstr ""
+
+#: bp-groups/bp-groups-admin.php:120
 msgid ""
 "This page is a convenient way to edit the details associated with one of "
 "your groups."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:114
+#: bp-groups/bp-groups-admin.php:121
 msgid ""
 "The Name and Description box is fixed in place, but you can reposition all "
 "the other boxes using drag and drop, and can minimize or expand them by "
@@ -3118,11 +3314,11 @@ msgid ""
 "unhide, or to choose a 1- or 2-column layout for this screen."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:120
+#: bp-groups/bp-groups-admin.php:127
 msgid "Support Forums"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:148
+#: bp-groups/bp-groups-admin.php:160
 msgid ""
 "You can manage groups much like you can manage comments and other content. "
 "This screen is customizable in the same ways as other management screens, "
@@ -3130,24 +3326,24 @@ msgid ""
 "Actions."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:153
+#: bp-groups/bp-groups-admin.php:165
 msgid "Group Actions"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:155
+#: bp-groups/bp-groups-admin.php:167
 msgid ""
 "Clicking \"Visit\" will take you to the group&#8217;s public page. Use this "
 "link to see what the group looks like on the front end of your site."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:156
+#: bp-groups/bp-groups-admin.php:168
 msgid ""
 "Clicking \"Edit\" will take you to a Dashboard panel where you can manage "
 "various details about the group, such as its name and description, its "
 "members, and other settings."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:157
+#: bp-groups/bp-groups-admin.php:169
 msgid ""
 "If you click \"Delete\" under a specific group, or select a number of "
 "groups and then choose Delete from the Bulk Actions menu, you will be led "
@@ -3155,328 +3351,366 @@ msgid ""
 "the group(s)."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:172
+#: bp-groups/bp-groups-admin.php:184
 msgid "Start typing a username to add a new member."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:173
+#: bp-groups/bp-groups-admin.php:185
 msgid ""
 "If you leave this page, you will lose any unsaved changes you have made to "
 "the group."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:454
+#: bp-groups/bp-groups-admin.php:500
 msgid "You cannot remove all administrators from a group."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:458
+#: bp-groups/bp-groups-admin.php:506
+msgid "Group name cannot be empty."
+msgstr ""
+
+#: bp-groups/bp-groups-admin.php:510
+msgid "Group description cannot be empty."
+msgstr ""
+
+#: bp-groups/bp-groups-admin.php:514
+msgid "Group name and description cannot be empty."
+msgstr ""
+
+#: bp-groups/bp-groups-admin.php:518
 msgid "An error occurred when trying to update your group details."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:460
+#: bp-groups/bp-groups-admin.php:523
 msgid "The group has been updated successfully."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:464
+#: bp-groups/bp-groups-admin.php:527
 msgid "The following users could not be added to the group: <em>%s</em>"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:468
+#: bp-groups/bp-groups-admin.php:531
 msgid "The following users were successfully added to the group: <em>%s</em>"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:473
+#: bp-groups/bp-groups-admin.php:536
 msgid "An error occurred when trying to modify the following members: <em>%s</em>"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:478
+#: bp-groups/bp-groups-admin.php:541
 msgid "The following members were successfully modified: <em>%s</em>"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:497 bp-groups/bp-groups-adminbar.php:42
-#: bp-xprofile/bp-xprofile-admin.php:114
+#: bp-groups/bp-groups-admin.php:570 bp-groups/bp-groups-adminbar.php:45
+#: bp-xprofile/bp-xprofile-admin.php:140
 msgid "Edit Group"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:500 bp-groups/bp-groups-admin.php:647
+#: bp-groups/bp-groups-admin.php:573 bp-groups/bp-groups-admin.php:728
 msgid "Add New"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:519
+#: bp-groups/bp-groups-admin.php:592
 msgid "Name and Description"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:523
+#: bp-groups/bp-groups-admin.php:596
 msgid "Permalink:"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:523
+#: bp-groups/bp-groups-admin.php:596
 msgid "Visit Group"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:550
+#: bp-groups/bp-groups-admin.php:623
 msgid "No group found with this ID. <a href=\"%s\">Go back and try again</a>."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:593
+#: bp-groups/bp-groups-admin.php:666
 msgid "Delete Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:594
+#: bp-groups/bp-groups-admin.php:667
 msgid "You are about to delete the following groups:"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:602 bp-members/bp-members-admin.php:1797
+#: bp-groups/bp-groups-admin.php:675 bp-members/bp-members-admin.php:1997
 msgid "This action cannot be undone."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:631
+#: bp-groups/bp-groups-admin.php:704
 msgid "%s group has been permanently deleted."
 msgid_plural "%s groups have been permanently deleted."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-admin.php:644 bp-groups/bp-groups-notifications.php:443
-#: bp-groups/bp-groups-notifications.php:479
-#: bp-groups/bp-groups-notifications.php:515
-#: bp-groups/bp-groups-notifications.php:551 bp-groups/bp-groups-widgets.php:53
-#: bp-groups/bp-groups-widgets.php:133
+#: bp-groups/bp-groups-admin.php:725 bp-groups/bp-groups-notifications.php:774
+#: bp-groups/bp-groups-notifications.php:863
+#: bp-groups/bp-groups-notifications.php:949
+#: bp-groups/bp-groups-notifications.php:1031
+#: bp-groups/bp-groups-widgets.php:61 bp-groups/bp-groups-widgets.php:151
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:664
+#: bp-groups/bp-groups-admin.php:745
 msgid "Search all Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:687
-#: bp-templates/bp-legacy/buddypress/groups/create.php:115
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:47
+#: bp-groups/bp-groups-admin.php:768
+#: bp-templates/bp-legacy/buddypress/groups/create.php:159
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:82
 msgid "Enable discussion forum"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:693
+#: bp-groups/bp-groups-admin.php:774
 msgid "Privacy"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:696 bp-groups/bp-groups-admin.php:1456
-#: bp-groups/bp-groups-template.php:1083
+#: bp-groups/bp-groups-admin.php:777 bp-groups/bp-groups-admin.php:1621
+#: bp-groups/bp-groups-template.php:1270
 msgid "Public"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:697 bp-groups/bp-groups-admin.php:1459
-#: bp-groups/bp-groups-template.php:1085
+#: bp-groups/bp-groups-admin.php:778 bp-groups/bp-groups-admin.php:1624
+#: bp-groups/bp-groups-template.php:1272
 msgid "Private"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:698 bp-groups/bp-groups-admin.php:1462
+#: bp-groups/bp-groups-admin.php:779 bp-groups/bp-groups-admin.php:1627
 msgid "Hidden"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:705
+#: bp-groups/bp-groups-admin.php:786
 msgid "Who can invite others to this group?"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:708
-#: bp-templates/bp-legacy/buddypress/groups/create.php:92
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:99
+#: bp-groups/bp-groups-admin.php:789
+#: bp-templates/bp-legacy/buddypress/groups/create.php:136
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:134
 msgid "All group members"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:709
-#: bp-templates/bp-legacy/buddypress/groups/create.php:97
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:104
+#: bp-groups/bp-groups-admin.php:790
+#: bp-templates/bp-legacy/buddypress/groups/create.php:141
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:139
 msgid "Group admins and mods only"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:710
-#: bp-templates/bp-legacy/buddypress/groups/create.php:102
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:109
+#: bp-groups/bp-groups-admin.php:791
+#: bp-templates/bp-legacy/buddypress/groups/create.php:146
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:144
 msgid "Group admins only"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:726
+#: bp-groups/bp-groups-admin.php:807
 msgid "Enter a comma-separated list of user logins."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:782
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:177
+#: bp-groups/bp-groups-admin.php:862
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:234
 msgid "Administrators"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:783
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:205
+#: bp-groups/bp-groups-admin.php:863
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:262
 msgid "Moderators"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:785
+#: bp-groups/bp-groups-admin.php:864 bp-groups/bp-groups-loader.php:584
+#: bp-members/bp-members-loader.php:34 bp-members/bp-members-widgets.php:234
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:288
+msgid "Members"
+msgstr ""
+
+#: bp-groups/bp-groups-admin.php:865
 msgid "Banned Members"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:821
+#: bp-groups/bp-groups-admin.php:901
 msgid "Roles"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:822
+#: bp-groups/bp-groups-admin.php:902
 msgid "Administrator"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:823
+#: bp-groups/bp-groups-admin.php:903
 msgid "Moderator"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:824 bp-members/bp-members-admin.php:709
+#: bp-groups/bp-groups-admin.php:904 bp-members/bp-members-admin.php:760
 msgid "Member"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:826
+#: bp-groups/bp-groups-admin.php:906
 msgid "Banned"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:829 bp-members/bp-members-admin.php:1265
-#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:7
+#: bp-groups/bp-groups-admin.php:909 bp-members/bp-members-admin.php:1442
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:68
+#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:9
 msgid "Actions"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:830
+#: bp-groups/bp-groups-admin.php:910
 msgid "Remove"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:832
+#: bp-groups/bp-groups-admin.php:912
 msgid "Ban"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:868
+#: bp-groups/bp-groups-admin.php:958
 msgid "No members of this type"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:897 bp-groups/bp-groups-classes.php:3268
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:32
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:117
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:58
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:74
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:63
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:23
-#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:11
-#: bp-xprofile/bp-xprofile-classes.php:478
+#: bp-groups/bp-groups-admin.php:987
+#: bp-groups/classes/class-bp-group-extension.php:538
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:60
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:159
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:86
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:116
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:88
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:33
+#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:28
 msgid "Save Changes"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:946
+#: bp-groups/bp-groups-admin.php:1037
 msgid "&laquo;"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:947
+#: bp-groups/bp-groups-admin.php:1038
 msgid "&raquo;"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:953 bp-groups/bp-groups-template.php:3037
-#: bp-members/bp-members-template.php:543
+#: bp-groups/bp-groups-admin.php:1044 bp-groups/bp-groups-template.php:4213
+#: bp-members/bp-members-template.php:654
 msgid "Viewing 1 member"
+msgstr ""
+
+#: bp-groups/bp-groups-admin.php:1047 bp-groups/bp-groups-template.php:4215
+#: bp-members/bp-members-template.php:656
+msgid "Viewing %1$s - %2$s of %3$s member"
 msgid_plural "Viewing %1$s - %2$s of %3$s members"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-admin.php:1018
+#: bp-groups/bp-groups-admin.php:1114
 #. translators: 1: user_login, 2: user_email
 msgid "%1$s (%2$s)"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1201
+#: bp-groups/bp-groups-admin.php:1307
 msgid "No groups found."
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1272
+#: bp-groups/bp-groups-admin.php:1386
 msgid "Public <span class=\"count\">(%s)</span>"
 msgid_plural "Public <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-admin.php:1273
+#: bp-groups/bp-groups-admin.php:1387
 msgid "Private <span class=\"count\">(%s)</span>"
 msgid_plural "Private <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-admin.php:1274
+#: bp-groups/bp-groups-admin.php:1388
 msgid "Hidden <span class=\"count\">(%s)</span>"
 msgid_plural "Hidden <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-admin.php:1349
+#: bp-groups/bp-groups-admin.php:1489
 msgid "Select group %1$d"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:58
-msgid "Edit Settings"
+#: bp-groups/bp-groups-forums.php:150 bp-groups/bp-groups-forums.php:449
+msgid "%1$s replied to the forum topic %2$s in the group %3$s"
 msgstr ""
 
-#: bp-groups/bp-groups-adminbar.php:67 bp-members/bp-members-adminbar.php:109
-msgid "Edit Profile Photo"
+#: bp-groups/bp-groups-forums.php:278
+msgid "%1$s started the forum topic %2$s in the group %3$s"
 msgstr ""
 
-#: bp-groups/bp-groups-classes.php:2071
-msgid "Group Mod"
+#: bp-groups/bp-groups-forums.php:377
+msgid "%1$s edited the forum topic %2$s in the group %3$s"
 msgstr ""
 
-#: bp-groups/bp-groups-classes.php:2077 bp-groups/bp-groups-functions.php:153
+#: bp-groups/bp-groups-functions.php:166
+#: bp-groups/classes/class-bp-groups-member.php:285
 msgid "Group Admin"
 msgstr ""
 
-#: bp-groups/bp-groups-classes.php:3561
-msgid "You do not have access to this content."
-msgstr ""
-
-#: bp-groups/bp-groups-forums.php:117 bp-groups/bp-groups-forums.php:284
-msgid "%1$s replied to the forum topic %2$s in the group %3$s"
+#: bp-groups/bp-groups-functions.php:438
+msgid "As the only admin, you cannot leave the group."
 msgstr ""
 
-#: bp-groups/bp-groups-forums.php:173
-msgid "%1$s started the forum topic %2$s in the group %3$s"
+#: bp-groups/bp-groups-functions.php:951
+msgid "%1$s posted an update in the group %2$s"
 msgstr ""
 
-#: bp-groups/bp-groups-forums.php:230
-msgid "%1$s edited the forum topic %2$s in the group %3$s"
+#: bp-groups/bp-groups-loader.php:427 bp-groups/bp-groups-loader.php:457
+msgid "Memberships"
 msgstr ""
 
-#: bp-groups/bp-groups-functions.php:360
-msgid "As the only admin, you cannot leave the group."
+#: bp-groups/bp-groups-loader.php:438
+msgid "Invitations"
 msgstr ""
 
-#: bp-groups/bp-groups-functions.php:817
-msgid "%1$s posted an update in the group %2$s"
+#: bp-groups/bp-groups-loader.php:564
+msgid "Details"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:386 bp-groups/bp-groups-loader.php:416
-msgid "Memberships"
+#: bp-groups/bp-groups-loader.php:577
+msgid "Photo"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:397
-msgid "Invitations"
+#: bp-groups/bp-groups-loader.php:591
+msgid "Requests"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:621
+#: bp-groups/bp-groups-loader.php:722
 msgid "No Group Profile Photo"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:28
+#: bp-groups/bp-groups-notifications.php:64
 msgid "Group Details Updated"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:47
+#: bp-groups/bp-groups-notifications.php:83
 msgid ""
-"Group details for the group \"%1$s\" were updated:\n"
+"Group details for the group \"%1$s\" were updated: %2$s\n"
 "\n"
-"To view the group: %2$s\n"
+"To view the group: %3$s\n"
 "\n"
 "---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:116
+#: bp-groups/bp-groups-notifications.php:194
 msgid "Membership request for group: %s"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:118
+#: bp-groups/bp-groups-notifications.php:197
+msgid ""
+"%1$s wants to join the group \"%2$s\".\n"
+"\n"
+"Message from %1$s: \"%3$s\"\n"
+"\n"
+"Because you are the administrator of this group, you must either accept or "
+"reject the membership request.\n"
+"\n"
+"To view all pending membership requests for this group, please visit:\n"
+"%4$s\n"
+"\n"
+"To view %5$s's profile: %6$s\n"
+"\n"
+"---------------------\n"
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:214
 msgid ""
 "%1$s wants to join the group \"%2$s\".\n"
 "\n"
@@ -3491,11 +3725,11 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:189
+#: bp-groups/bp-groups-notifications.php:327
 msgid "Membership request for group \"%s\" accepted"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:190
+#: bp-groups/bp-groups-notifications.php:328
 msgid ""
 "Your membership request for the group \"%1$s\" has been accepted.\n"
 "\n"
@@ -3504,11 +3738,11 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:199
+#: bp-groups/bp-groups-notifications.php:337
 msgid "Membership request for group \"%s\" rejected"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:200
+#: bp-groups/bp-groups-notifications.php:338
 msgid ""
 "Your membership request for the group \"%1$s\" has been rejected.\n"
 "\n"
@@ -3517,19 +3751,19 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:239
+#: bp-groups/bp-groups-notifications.php:414
 msgid "an administrator"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:242
+#: bp-groups/bp-groups-notifications.php:417
 msgid "a moderator"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:269
+#: bp-groups/bp-groups-notifications.php:444
 msgid "You have been promoted in the group: \"%s\""
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:270
+#: bp-groups/bp-groups-notifications.php:445
 msgid ""
 "You have been promoted to %1$s for the group: \"%2$s\".\n"
 "\n"
@@ -3538,11 +3772,11 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:343
+#: bp-groups/bp-groups-notifications.php:556
 msgid "You have an invitation to the group: \"%s\""
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:344
+#: bp-groups/bp-groups-notifications.php:557
 msgid ""
 "One of your friends %1$s has invited you to the group: \"%2$s\".\n"
 "\n"
@@ -3555,439 +3789,427 @@ msgid ""
 "---------------------\n"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:401
+#: bp-groups/bp-groups-notifications.php:655
 msgid "%1$d new membership requests for the group \"%2$s\""
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:406
+#: bp-groups/bp-groups-notifications.php:676
 msgid "Group Membership Requests"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:415
-#: bp-groups/bp-groups-notifications.php:420
+#: bp-groups/bp-groups-notifications.php:701
+#: bp-groups/bp-groups-notifications.php:721
 msgid "%s requests group membership"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:438
+#: bp-groups/bp-groups-notifications.php:756
 msgid "%d accepted group membership requests"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:451
+#: bp-groups/bp-groups-notifications.php:795
 msgid "Membership for group \"%s\" accepted"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:474
+#: bp-groups/bp-groups-notifications.php:845
 msgid "%d rejected group membership requests"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:487
+#: bp-groups/bp-groups-notifications.php:884
 msgid "Membership for group \"%s\" rejected"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:510
+#: bp-groups/bp-groups-notifications.php:933
 msgid "You were promoted to an admin in %d groups"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:523
+#: bp-groups/bp-groups-notifications.php:968
 msgid "You were promoted to an admin in the group \"%s\""
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:546
+#: bp-groups/bp-groups-notifications.php:1015
 msgid "You were promoted to a mod in %d groups"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:559
+#: bp-groups/bp-groups-notifications.php:1050
 msgid "You were promoted to a mod in the group \"%s\""
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:583
+#: bp-groups/bp-groups-notifications.php:1098
 msgid "You have %d new group invitations"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:587
+#: bp-groups/bp-groups-notifications.php:1113
 msgid "Group Invites"
 msgstr ""
 
-#: bp-groups/bp-groups-notifications.php:595
+#: bp-groups/bp-groups-notifications.php:1132
 msgid "You have an invitation to the group: %s"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:53
+#: bp-groups/bp-groups-screens.php:77
 msgid "Group invite could not be accepted"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:55 bp-groups/bp-groups-screens.php:525
+#: bp-groups/bp-groups-screens.php:79 bp-groups/bp-groups-screens.php:704
 msgid "Group invite accepted"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:80
+#: bp-groups/bp-groups-screens.php:104
 msgid "Group invite could not be rejected"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:82
+#: bp-groups/bp-groups-screens.php:106
 msgid "Group invite rejected"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:161
+#: bp-groups/bp-groups-screens.php:211
 msgid "It looks like you've already said that!"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:164
+#: bp-groups/bp-groups-screens.php:214
 msgid "There was an error when replying to that topic"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:166
+#: bp-groups/bp-groups-screens.php:216
 msgid "Your reply was posted successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:187
+#: bp-groups/bp-groups-screens.php:237
 msgid "There was an error when making that topic a sticky"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:189
+#: bp-groups/bp-groups-screens.php:239
 msgid "The topic was made sticky successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:202
+#: bp-groups/bp-groups-screens.php:259
 msgid "There was an error when unsticking that topic"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:204
+#: bp-groups/bp-groups-screens.php:261
 msgid "The topic was unstuck successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:217
+#: bp-groups/bp-groups-screens.php:281
 msgid "There was an error when closing that topic"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:219
+#: bp-groups/bp-groups-screens.php:283
 msgid "The topic was closed successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:232
+#: bp-groups/bp-groups-screens.php:303
 msgid "There was an error when opening that topic"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:234
+#: bp-groups/bp-groups-screens.php:305
 msgid "The topic was opened successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:257
+#: bp-groups/bp-groups-screens.php:342
 msgid "There was an error deleting the topic"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:259
+#: bp-groups/bp-groups-screens.php:344
 msgid "The topic was deleted successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:283
+#: bp-groups/bp-groups-screens.php:375
 msgid "There was an error when editing that topic"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:285
+#: bp-groups/bp-groups-screens.php:377
 msgid "The topic was edited successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:310
+#: bp-groups/bp-groups-screens.php:423
 msgid "There was an error deleting that post"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:312
+#: bp-groups/bp-groups-screens.php:425
 msgid "The post was deleted successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:336
+#: bp-groups/bp-groups-screens.php:456
 msgid "There was an error when editing that post"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:338
+#: bp-groups/bp-groups-screens.php:458
 msgid "The post was edited successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:354 bp-groups/bp-groups-screens.php:373
+#: bp-groups/bp-groups-screens.php:482 bp-groups/bp-groups-screens.php:508
 msgid "You have been banned from this group."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:387
+#: bp-groups/bp-groups-screens.php:522
 msgid "This group does not have a forum setup yet."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:452
+#: bp-groups/bp-groups-screens.php:617
 msgid "Group invites sent."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:493
+#: bp-groups/bp-groups-screens.php:673
 msgid "You are not allowed to send or remove invites"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:496
+#: bp-groups/bp-groups-screens.php:676
 msgid "The member requested to join the group"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:527
-msgid "There was an error accepting the group invitation; please try again."
+#: bp-groups/bp-groups-screens.php:706
+msgid "There was an error accepting the group invitation. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:539
-msgid "There was an error sending your group membership request; please try again."
+#: bp-groups/bp-groups-screens.php:718
+msgid "There was an error sending your group membership request. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:541
+#: bp-groups/bp-groups-screens.php:720
 msgid ""
 "Your membership request was sent to the group administrator successfully. "
 "You will be notified when the group administrator responds to your request."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:599
-msgid "There was an error updating group details; please try again."
+#: bp-groups/bp-groups-screens.php:793
+msgid "There was an error updating group details. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:601
+#: bp-groups/bp-groups-screens.php:795
 msgid "Group details were successfully updated."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:646
-msgid "There was an error updating group settings; please try again."
+#: bp-groups/bp-groups-screens.php:863
+msgid "There was an error updating group settings. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:648
+#: bp-groups/bp-groups-screens.php:865
 msgid "Group settings were successfully updated."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:683
-msgid "The group profile photo was deleted successfully!"
-msgstr ""
-
-#: bp-groups/bp-groups-screens.php:685
-msgid "There was a problem deleting the group profile photo; please try again."
-msgstr ""
-
-#: bp-groups/bp-groups-screens.php:728
-msgid "There was a problem cropping the group profile photo."
-msgstr ""
-
-#: bp-groups/bp-groups-screens.php:730
+#: bp-groups/bp-groups-screens.php:968
 msgid "The new group profile photo was uploaded successfully."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:764
-msgid "There was an error when promoting that user, please try again"
+#: bp-groups/bp-groups-screens.php:1016
+msgid "There was an error when promoting that user. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:766
+#: bp-groups/bp-groups-screens.php:1018
 msgid "User promoted successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:789
-msgid "There was an error when demoting that user; please try again"
+#: bp-groups/bp-groups-screens.php:1049
+msgid "There was an error when demoting that user. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:791
+#: bp-groups/bp-groups-screens.php:1051
 msgid "User demoted successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:807
-msgid "There was an error when banning that user; please try again"
+#: bp-groups/bp-groups-screens.php:1075
+msgid "There was an error when banning that user. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:809
+#: bp-groups/bp-groups-screens.php:1077
 msgid "User banned successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:825
-msgid "There was an error when unbanning that user, please try again"
+#: bp-groups/bp-groups-screens.php:1101
+msgid "There was an error when unbanning that user. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:827
+#: bp-groups/bp-groups-screens.php:1103
 msgid "User ban removed successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:843
-msgid "There was an error removing that user from the group; please try again"
+#: bp-groups/bp-groups-screens.php:1127
+msgid "There was an error removing that user from the group. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:845
+#: bp-groups/bp-groups-screens.php:1129
 msgid "User removed successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:885
-msgid "There was an error accepting the membership request; please try again."
+#: bp-groups/bp-groups-screens.php:1191
+msgid "There was an error accepting the membership request. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:887
+#: bp-groups/bp-groups-screens.php:1193
 msgid "Group membership request accepted"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:896
-msgid "There was an error rejecting the membership request; please try again."
+#: bp-groups/bp-groups-screens.php:1202
+msgid "There was an error rejecting the membership request. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:898
+#: bp-groups/bp-groups-screens.php:1204
 msgid "Group membership request rejected"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:933
-msgid "There was an error deleting the group; please try again."
+#: bp-groups/bp-groups-screens.php:1271 bp-xprofile/bp-xprofile-admin.php:295
+msgid "There was an error deleting the group. Please try again."
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:935
+#: bp-groups/bp-groups-screens.php:1273
 msgid "The group was deleted successfully"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:708
+#: bp-groups/bp-groups-template.php:804
 msgid "Public Group"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:710
+#: bp-groups/bp-groups-template.php:806
 msgid "Hidden Group"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:712
+#: bp-groups/bp-groups-template.php:808
 msgid "Private Group"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:714
+#: bp-groups/bp-groups-template.php:810
 msgid "Group"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:895
+#: bp-groups/bp-groups-template.php:1017
 msgid "not yet active"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1281
+#: bp-groups/bp-groups-template.php:1502
 msgid "Group creator profile photo of %s"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1349
+#: bp-groups/bp-groups-template.php:1577
 msgid "No Admins"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1396
+#: bp-groups/bp-groups-template.php:1624
 msgid "No Mods"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1497
+#: bp-groups/bp-groups-template.php:1750
 msgid "Filter Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1545
-msgid "Viewing 1"
+#: bp-groups/bp-groups-template.php:1840
+msgid "Viewing 1 group"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:1842
+msgid "Viewing %1$s - %2$s of %3$s group"
 msgid_plural "Viewing %1$s - %2$s of %3$s groups"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-template.php:1573
+#: bp-groups/bp-groups-template.php:1930
 msgid "%s member"
-msgstr ""
-
-#: bp-groups/bp-groups-template.php:1575
-msgid "%s members"
-msgstr ""
+msgid_plural "%s members"
+msgstr[0] ""
+msgstr[1] ""
 
-#: bp-groups/bp-groups-template.php:1614
+#: bp-groups/bp-groups-template.php:2012
 msgid "%d topic"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1616
+#: bp-groups/bp-groups-template.php:2014
 msgid "%d topics"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1836 bp-groups/bp-groups-template.php:1901
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:190
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:217
+#: bp-groups/bp-groups-template.php:2319 bp-groups/bp-groups-template.php:2394
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:247
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:274
 msgid "Demote to Member"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1849 bp-groups/bp-groups-template.php:1914
-#: bp-groups/bp-groups-template.php:2989
+#: bp-groups/bp-groups-template.php:2332 bp-groups/bp-groups-template.php:2407
+#: bp-groups/bp-groups-template.php:4140
 msgid "joined %s"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1872
+#: bp-groups/bp-groups-template.php:2355
 msgid "This group has no administrators"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1900
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:216
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:272
+#: bp-groups/bp-groups-template.php:2393
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:273
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:329
 msgid "Promote to Admin"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:1934
+#: bp-groups/bp-groups-template.php:2427
 msgid "This group has no moderators"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2069
-msgid "Details"
-msgstr ""
-
-#: bp-groups/bp-groups-template.php:2080
-msgid "Photo"
-msgstr ""
-
-#: bp-groups/bp-groups-template.php:2088
-msgid "Requests"
+#: bp-groups/bp-groups-template.php:2747
+msgid ""
+"This action should not be used directly. Please use the BuddyPress Group "
+"Extension API to generate Manage tabs."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2398 bp-groups/bp-groups-template.php:2399
-#: bp-templates/bp-legacy/buddypress-functions.php:1197
-#: bp-templates/bp-legacy/buddypress-functions.php:1210
+#: bp-groups/bp-groups-template.php:3270 bp-groups/bp-groups-template.php:3271
+#: bp-templates/bp-legacy/buddypress-functions.php:1441
+#: bp-templates/bp-legacy/buddypress-functions.php:1454
 msgid "Leave Group"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2421 bp-groups/bp-groups-template.php:2422
-#: bp-templates/bp-legacy/buddypress-functions.php:1231
+#: bp-groups/bp-groups-template.php:3292 bp-groups/bp-groups-template.php:3293
+#: bp-templates/bp-legacy/buddypress-functions.php:1475
 msgid "Join Group"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2440 bp-groups/bp-groups-template.php:2441
+#: bp-groups/bp-groups-template.php:3311 bp-groups/bp-groups-template.php:3312
 msgid "Accept Invitation"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2456 bp-groups/bp-groups-template.php:2457
+#: bp-groups/bp-groups-template.php:3327 bp-groups/bp-groups-template.php:3328
 msgid "Request Sent"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2472 bp-groups/bp-groups-template.php:2473
-#: bp-templates/bp-legacy/buddypress-functions.php:1233
+#: bp-groups/bp-groups-template.php:3343 bp-groups/bp-groups-template.php:3344
+#: bp-templates/bp-legacy/buddypress-functions.php:1477
 msgid "Request Membership"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2540
+#: bp-groups/bp-groups-template.php:3488
+msgid "This group is not currently accessible."
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:3499
 msgid ""
 "You must accept your pending invitation before you can access this private "
 "group."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2542
+#: bp-groups/bp-groups-template.php:3501
 msgid ""
 "This is a private group and you must request group membership in order to "
 "join."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2544
+#: bp-groups/bp-groups-template.php:3504
 msgid ""
 "This is a private group. To join you must be a registered site member and "
 "request group membership."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2548
+#: bp-groups/bp-groups-template.php:3507
 msgid ""
 "This is a private group. Your membership request is awaiting approval from "
 "the group administrator."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:2552
+#: bp-groups/bp-groups-template.php:3515
 msgid "This is a hidden group and only invited members can join."
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3089
-#: bp-notifications/bp-notifications-template.php:1038
-#: bp-templates/bp-legacy/buddypress/blogs/index.php:36
-#: bp-templates/bp-legacy/buddypress/forums/index.php:42
-#: bp-templates/bp-legacy/buddypress/groups/index.php:36
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:36
-#: bp-templates/bp-legacy/buddypress/members/index.php:35
+#: bp-groups/bp-groups-template.php:4289
+#: bp-notifications/bp-notifications-template.php:1252
+#: bp-templates/bp-legacy/buddypress/blogs/index.php:81
+#: bp-templates/bp-legacy/buddypress/forums/index.php:77
+#: bp-templates/bp-legacy/buddypress/groups/index.php:74
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:44
+#: bp-templates/bp-legacy/buddypress/members/index.php:77
 #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:19
 #: bp-templates/bp-legacy/buddypress/members/single/forums.php:18
 #: bp-templates/bp-legacy/buddypress/members/single/friends.php:20
@@ -3995,65 +4217,73 @@ msgstr ""
 msgid "Order By:"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3092
+#: bp-groups/bp-groups-template.php:4292
 msgid "Oldest"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3095
+#: bp-groups/bp-groups-template.php:4295
 msgid "Group Activity"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3098
-#: bp-templates/bp-legacy/buddypress/blogs/index.php:40
-#: bp-templates/bp-legacy/buddypress/groups/index.php:42
-#: bp-templates/bp-legacy/buddypress/members/index.php:41
+#: bp-groups/bp-groups-template.php:4298
+#: bp-templates/bp-legacy/buddypress/blogs/index.php:85
+#: bp-templates/bp-legacy/buddypress/groups/index.php:80
+#: bp-templates/bp-legacy/buddypress/members/index.php:83
 #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:23
 #: bp-templates/bp-legacy/buddypress/members/single/friends.php:24
 #: bp-templates/bp-legacy/buddypress/members/single/groups.php:25
 msgid "Alphabetical"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3324 bp-groups/bp-groups-template.php:3574
+#: bp-groups/bp-groups-template.php:4612 bp-groups/bp-groups-template.php:4914
 msgid "Group avatar"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3466 bp-groups/bp-groups-template.php:3489
+#: bp-groups/bp-groups-template.php:4799 bp-groups/bp-groups-template.php:4822
 msgid "Recently Joined"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3467 bp-groups/bp-groups-template.php:3492
+#: bp-groups/bp-groups-template.php:4800 bp-groups/bp-groups-template.php:4825
 msgid "Most Popular"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3468 bp-groups/bp-groups-template.php:3495
+#: bp-groups/bp-groups-template.php:4801 bp-groups/bp-groups-template.php:4828
 msgid "Administrator Of"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3469 bp-groups/bp-groups-template.php:3498
+#: bp-groups/bp-groups-template.php:4802 bp-groups/bp-groups-template.php:4831
 msgid "Moderator Of"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3862
+#: bp-groups/bp-groups-template.php:5278
 msgid "requested %s"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:3914
+#: bp-groups/bp-groups-template.php:5346
 msgid "Viewing 1 request"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:5348
+msgid "Viewing %1$s - %2$s of %3$s request"
 msgid_plural "Viewing %1$s - %2$s of %3$s requests"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-template.php:4209
+#: bp-groups/bp-groups-template.php:5725
 msgid "Viewing 1 invitation"
+msgstr ""
+
+#: bp-groups/bp-groups-template.php:5727
+msgid "Viewing %1$s - %2$s of %3$s invitation"
 msgid_plural "Viewing %1$s - %2$s of %3$s invitations"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-groups/bp-groups-template.php:4225
+#: bp-groups/bp-groups-template.php:5748
 msgid "Group Activity RSS Feed"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:4436
+#: bp-groups/bp-groups-template.php:6039
 msgid "%s group"
 msgid_plural "%s groups"
 msgstr[0] ""
@@ -4063,611 +4293,744 @@ msgstr[1] ""
 msgid "A dynamic list of recently active, popular, and newest groups"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:92 bp-groups/bp-groups-widgets.php:204
+#: bp-groups/bp-groups-widgets.php:110 bp-groups/bp-groups-widgets.php:222
 msgid "created %s"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:111
+#: bp-groups/bp-groups-widgets.php:129
 msgid "There are no groups to display."
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:148
+#: bp-groups/bp-groups-widgets.php:166
 msgid "Link widget title to Groups directory"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:150
+#: bp-groups/bp-groups-widgets.php:168
 msgid "Max groups to show:"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:153
+#: bp-groups/bp-groups-widgets.php:171
 msgid "Default groups to show:"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:222
+#: bp-groups/bp-groups-widgets.php:240
 msgid "No groups matched the current filter."
 msgstr ""
 
-#: bp-loader.php:164 bp-loader.php:171
+#: bp-groups/classes/class-bp-group-extension.php:851
+msgid "You do not have access to this content."
+msgstr ""
+
+#: bp-groups/classes/class-bp-groups-member.php:279
+msgid "Group Mod"
+msgstr ""
+
+#: bp-loader.php:171 bp-loader.php:178
 msgid "Cheatin&#8217; huh?"
 msgstr ""
 
-#: bp-loader.php:568
+#: bp-loader.php:611
 msgid "BuddyPress Default"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:127
-#: bp-members/admin/bp-members-classes.php:274
-#: bp-members/admin/bp-members-classes.php:455
-#: bp-members/admin/bp-members-classes.php:597
+#: bp-members/admin/bp-members-admin-classes.php:137
+#: bp-members/admin/bp-members-admin-classes.php:293
+#: bp-members/admin/bp-members-admin-classes.php:505
+#: bp-members/admin/bp-members-admin-classes.php:652
 #: bp-settings/bp-settings-loader.php:106
-#: bp-settings/bp-settings-loader.php:179
+#: bp-settings/bp-settings-loader.php:180
 msgid "Email"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:128
-#: bp-members/admin/bp-members-classes.php:456
+#: bp-members/admin/bp-members-admin-classes.php:138
+#: bp-members/admin/bp-members-admin-classes.php:506
 msgid "Registered"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:129
-#: bp-members/admin/bp-members-classes.php:457
+#: bp-members/admin/bp-members-admin-classes.php:139
+#: bp-members/admin/bp-members-admin-classes.php:507
 msgid "Last Sent"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:130
-#: bp-members/admin/bp-members-classes.php:458
+#: bp-members/admin/bp-members-admin-classes.php:140
+#: bp-members/admin/bp-members-admin-classes.php:508
 msgid "Emails Sent"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:162
-#: bp-members/admin/bp-members-classes.php:489
+#: bp-members/admin/bp-members-admin-classes.php:172
+#: bp-members/admin/bp-members-admin-classes.php:539
 msgid "No pending accounts found."
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:168
-#: bp-members/admin/bp-members-classes.php:170
-#: bp-members/admin/bp-members-classes.php:494
+#: bp-members/admin/bp-members-admin-classes.php:178
+#: bp-members/admin/bp-members-admin-classes.php:180
+#: bp-members/admin/bp-members-admin-classes.php:544
 msgid "Edit settings"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:173
-#: bp-members/admin/bp-members-classes.php:497
+#: bp-members/admin/bp-members-admin-classes.php:183
+#: bp-members/admin/bp-members-admin-classes.php:547
 msgid "Registration is disabled. %s"
 msgstr ""
 
-#: bp-members/bp-members-actions.php:56 bp-members/bp-members-admin.php:287
+#: bp-members/admin/bp-members-admin-classes.php:243
+#: bp-members/admin/bp-members-admin-classes.php:602
+msgid "Select user: %s"
+msgstr ""
+
+#: bp-members/bp-members-actions.php:55 bp-members/bp-members-admin.php:292
 msgid "User removed as spammer."
 msgstr ""
 
-#: bp-members/bp-members-actions.php:89
+#: bp-members/bp-members-actions.php:88
 msgid "%s has been deleted from the system."
 msgstr ""
 
-#: bp-members/bp-members-actions.php:91
+#: bp-members/bp-members-actions.php:90
 msgid "There was an error deleting %s from the system. Please try again."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:281
+#: bp-members/bp-members-activity.php:26
+msgid "New member registered"
+msgstr ""
+
+#: bp-members/bp-members-activity.php:28
+msgid "New Members"
+msgstr ""
+
+#: bp-members/bp-members-activity.php:53
+msgid "%s became a registered member"
+msgstr ""
+
+#: bp-members/bp-members-admin.php:286
 msgid "Profile photo was deleted."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:299
+#: bp-members/bp-members-admin.php:304
 msgid "Profile updated."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:311
-msgid "There was a problem deleting that avatar, please try again."
+#: bp-members/bp-members-admin.php:316
+msgid "There was a problem deleting that profile photo. Please try again."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:317
+#: bp-members/bp-members-admin.php:322
 msgid "User could not be removed as spammer."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:323
+#: bp-members/bp-members-admin.php:328
 msgid "User could not be marked as spammer."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:329
-msgid "An error occured while trying to update the profile."
+#: bp-members/bp-members-admin.php:334
+msgid "An error occurred while trying to update the profile."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:335 bp-xprofile/bp-xprofile-screens.php:96
+#: bp-members/bp-members-admin.php:340 bp-xprofile/bp-xprofile-screens.php:111
 msgid ""
 "Please make sure you fill in all required fields in this profile field "
 "group before saving."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:341
+#: bp-members/bp-members-admin.php:346 bp-xprofile/bp-xprofile-screens.php:177
 msgid ""
-"There was a problem updating some of your profile information, please try "
+"There was a problem updating some of your profile information. Please try "
 "again."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:366 bp-members/bp-members-admin.php:367
-#: bp-members/bp-members-admin.php:405 bp-members/bp-members-admin.php:406
-#: bp-members/bp-members-adminbar.php:100
-#: bp-xprofile/bp-xprofile-template.php:756
-#: bp-xprofile/bp-xprofile-template.php:757
+#: bp-members/bp-members-admin.php:371 bp-members/bp-members-admin.php:372
+#: bp-members/bp-members-admin.php:410 bp-members/bp-members-admin.php:411
+#: bp-members/bp-members-adminbar.php:104
+#: bp-xprofile/bp-xprofile-template.php:1160
+#: bp-xprofile/bp-xprofile-template.php:1161
 msgid "Edit Profile"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:417 bp-members/bp-members-admin.php:418
+#: bp-members/bp-members-admin.php:422 bp-members/bp-members-admin.php:423
 msgid "Manage Signups"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:617 bp-members/bp-members-admin.php:776
+#: bp-members/bp-members-admin.php:648 bp-members/bp-members-admin.php:856
 msgid "Profile"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:621
+#: bp-members/bp-members-admin.php:652
 msgid "Extended Profile"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:644
+#: bp-members/bp-members-admin.php:675
 msgid "You cannot edit the requested user."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:673
+#: bp-members/bp-members-admin.php:717
 msgid "This is the admin view of a user&#39;s profile."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:674
+#: bp-members/bp-members-admin.php:718
 msgid ""
 "In the main column, you can edit the fields of the user&#39;s extended "
 "profile."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:675
+#: bp-members/bp-members-admin.php:719
 msgid ""
 "In the right-hand column, you can update the user&#39;s status, delete the "
 "user&#39;s avatar, and view recent statistics."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:681
+#: bp-members/bp-members-admin.php:725
 msgid ""
 "<a "
-"href=\"http://codex.buddypress.org/buddypress-site-administration/managing-"
-"user-profiles/\">Managing Profiles</a>"
+"href=\"https://codex.buddypress.org/administrator-guide/extended-profiles/\""
+">Managing Profiles</a>"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:778
+#: bp-members/bp-members-admin.php:858
 msgid "Edit User"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:800
+#: bp-members/bp-members-admin.php:880
 msgid "&larr; Back to Users"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:858
+#: bp-members/bp-members-admin.php:936
 msgid "No user found with this ID. <a href=\"%s\">Go back and try again</a>."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:888
+#: bp-members/bp-members-admin.php:966
 msgid "User account has not yet been activated"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:914
+#: bp-members/bp-members-admin.php:992
 msgid "Spammer"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:926
+#: bp-members/bp-members-admin.php:1004
 msgid "Registered on: <strong>%1$s</strong>"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:936
+#: bp-members/bp-members-admin.php:1014
 msgid "View Profile"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:937
+#: bp-members/bp-members-admin.php:1015
 msgid "Update Profile"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:957 bp-xprofile/bp-xprofile-admin.php:810
+#: bp-members/bp-members-admin.php:1035 bp-xprofile/bp-xprofile-admin.php:1031
 msgid ""
 "%s has been marked as a spammer. All BuddyPress data associated with the "
 "user has been removed"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:989
+#: bp-members/bp-members-admin.php:1067
 msgid "Last active: %1$s"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1035
+#: bp-members/bp-members-admin.php:1109
+#: bp-templates/bp-legacy/buddypress/forums/index.php:171
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:184
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:207
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:215
+#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:101
+#. translators: no option picked in select box
+msgid "----"
+msgstr ""
+
+#: bp-members/bp-members-admin.php:1189
 msgid "Extended"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1257
-msgid "This is the admininistration screen for pending accounts on your site."
+#: bp-members/bp-members-admin.php:1434
+msgid "This is the administration screen for pending accounts on your site."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1258
+#: bp-members/bp-members-admin.php:1435
 msgid ""
 "From the screen options, you can customize the displayed columns and the "
 "pagination of this screen."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1259
+#: bp-members/bp-members-admin.php:1436
 msgid ""
 "You can reorder the list of your pending accounts by clicking on the "
 "Username, Email or Registered column headers."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1260
+#: bp-members/bp-members-admin.php:1437
 msgid ""
 "Using the search form, you can find pending accounts more easily. The "
 "Username and Email fields will be included in the search."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1267
+#: bp-members/bp-members-admin.php:1444
 msgid ""
 "Hovering over a row in the pending accounts list will display action links "
 "that allow you to manage pending accounts. You can perform the following "
 "actions:"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1268
+#: bp-members/bp-members-admin.php:1445
 msgid ""
 "\"Email\" takes you to the confirmation screen before being able to send "
 "the activation link to the desired pending account. You can only send the "
 "activation email once per day."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1269
+#: bp-members/bp-members-admin.php:1446
 msgid ""
 "\"Delete\" allows you to delete a pending account from your site. You will "
 "be asked to confirm this deletion."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1270
+#: bp-members/bp-members-admin.php:1447
 msgid ""
 "By clicking on a Username you will be able to activate a pending account "
 "from the confirmation screen."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1271
+#: bp-members/bp-members-admin.php:1448
 msgid "Bulk actions allow you to perform these 3 actions for the selected rows."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1527
-msgid "There was a problem sending the activation emails, please try again."
+#: bp-members/bp-members-admin.php:1713
+msgid "There was a problem sending the activation emails. Please try again."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1534
-msgid "There was a problem activating accounts, please try again."
+#: bp-members/bp-members-admin.php:1720
+msgid "There was a problem activating accounts. Please try again."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1541
-msgid "There was a problem deleting sign-ups, please try again."
+#: bp-members/bp-members-admin.php:1727
+msgid "There was a problem deleting sign-ups. Please try again."
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1658
+#: bp-members/bp-members-admin.php:1844
 msgid "Users"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1682
+#: bp-members/bp-members-admin.php:1868
 msgid "Search Pending Users"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1728
+#: bp-members/bp-members-admin.php:1916
 msgid "Delete Pending Accounts"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1729
+#: bp-members/bp-members-admin.php:1918
 msgid "You are about to delete the following account:"
-msgid_plural "You are about to delete the following accounts:"
-msgstr[0] ""
-msgstr[1] ""
+msgstr ""
 
-#: bp-members/bp-members-admin.php:1733
+#: bp-members/bp-members-admin.php:1920
+msgid "You are about to delete the following accounts:"
+msgstr ""
+
+#: bp-members/bp-members-admin.php:1925
 msgid "Activate Pending Accounts"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1734
+#: bp-members/bp-members-admin.php:1927
 msgid "You are about to activate the following account:"
-msgid_plural "You are about to activate the following accounts:"
-msgstr[0] ""
-msgstr[1] ""
+msgstr ""
+
+#: bp-members/bp-members-admin.php:1929
+msgid "You are about to activate the following accounts:"
+msgstr ""
 
-#: bp-members/bp-members-admin.php:1738
+#: bp-members/bp-members-admin.php:1934
 msgid "Resend Activation Emails"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1739
+#: bp-members/bp-members-admin.php:1936
 msgid "You are about to resend an activation email to the following account:"
-msgid_plural "You are about to resend activation emails to the following accounts:"
-msgstr[0] ""
-msgstr[1] ""
+msgstr ""
+
+#: bp-members/bp-members-admin.php:1938
+msgid "You are about to resend an activation email to the following accounts:"
+msgstr ""
 
-#: bp-members/bp-members-admin.php:1779
+#: bp-members/bp-members-admin.php:1979
 msgid "Last notified: %s"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1783
+#: bp-members/bp-members-admin.php:1983
 msgid "(less than 24 hours ago)"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1801
+#: bp-members/bp-members-admin.php:2001
 msgid "Confirm"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:39
+#: bp-members/bp-members-adminbar.php:41
 msgid "Edit My Profile"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:53
+#: bp-members/bp-members-adminbar.php:55
 msgid "Log in"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:91
+#: bp-members/bp-members-adminbar.php:95
 msgid "Edit Member"
 msgstr ""
 
-#: bp-members/bp-members-adminbar.php:129
-#: bp-settings/bp-settings-loader.php:131
-#: bp-settings/bp-settings-loader.php:188
-#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:27
-msgid "Delete Account"
-msgstr ""
-
-#: bp-members/bp-members-classes.php:307
-msgid ""
-"<strong>ERROR</strong>: Couldn&#8217;t register you. Please contact the <a "
-"href=\"mailto:%s\">webmaster</a>."
+#: bp-members/bp-members-adminbar.php:113
+#: bp-xprofile/bp-xprofile-admin.php:1078
+msgid "Edit Profile Photo"
 msgstr ""
 
-#: bp-members/bp-members-classes.php:511 bp-members/bp-members-classes.php:576
-#: bp-members/bp-members-classes.php:631
-msgid "the sign-up has already been activated."
+#: bp-members/bp-members-adminbar.php:133
+#: bp-settings/bp-settings-loader.php:131
+#: bp-settings/bp-settings-loader.php:190
+#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:37
+msgid "Delete Account"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1005
+#: bp-members/bp-members-functions.php:1193
 msgid ""
 "User last_activity data is no longer stored in usermeta. Use "
 "bp_get_user_last_activity() instead."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1035
+#: bp-members/bp-members-functions.php:1223
 msgid ""
 "User last_activity data is no longer stored in usermeta. Use "
 "bp_update_user_last_activity() instead."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1219
-#: bp-members/bp-members-functions.php:2145
+#: bp-members/bp-members-functions.php:1435
+#: bp-members/bp-members-functions.php:2476
 msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1414
+#: bp-members/bp-members-functions.php:1645
 msgid "Please check your email address."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1418
-#: bp-members/bp-members-functions.php:1422
+#: bp-members/bp-members-functions.php:1649
+#: bp-members/bp-members-functions.php:1653
 msgid "Sorry, that email address is not allowed!"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1426
+#: bp-members/bp-members-functions.php:1657
 msgid "Sorry, that email address is already used!"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1458
+#: bp-members/bp-members-functions.php:1696
 msgid "Please enter a username"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1464
+#: bp-members/bp-members-functions.php:1702
 msgid "That username is not allowed"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1469
+#: bp-members/bp-members-functions.php:1707
 msgid "Usernames can contain only letters, numbers, ., -, and @"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1474
+#: bp-members/bp-members-functions.php:1712
 msgid "Username must be at least 4 characters"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1479
+#: bp-members/bp-members-functions.php:1717
 msgid "Sorry, usernames may not contain the character \"_\"!"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1486
+#: bp-members/bp-members-functions.php:1724
 msgid "Sorry, usernames must have letters too!"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1498
+#: bp-members/bp-members-functions.php:1736
 msgid "Sorry, that username already exists!"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1656
+#: bp-members/bp-members-functions.php:1947
 msgid "Invalid activation key."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1663
+#: bp-members/bp-members-functions.php:1954
 msgid "The user is already active."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1665
+#: bp-members/bp-members-functions.php:1956
 msgid "The site is already active."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1683
+#: bp-members/bp-members-functions.php:1974
 msgid "Invalid activation key"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1698
+#: bp-members/bp-members-functions.php:1989
 msgid "Could not create user"
 msgstr ""
 
-#: bp-members/bp-members-functions.php:1712
+#: bp-members/bp-members-functions.php:2003
 msgid "That username is already activated."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:2016
+#: bp-members/bp-members-functions.php:2341
 msgid ""
 "If you have not received an email yet, <a href=\"%s\">click here to resend "
 "it</a>."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:2018
+#: bp-members/bp-members-functions.php:2343
 msgid ""
 "<strong>ERROR</strong>: Your account has not been activated. Check your "
 "email for the activation link."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:2049
+#: bp-members/bp-members-functions.php:2374
 msgid "<strong>ERROR</strong>: Your account has already been activated."
 msgstr ""
 
-#: bp-members/bp-members-functions.php:2051
+#: bp-members/bp-members-functions.php:2376
 msgid "Activation email resent! Please check your inbox or spam folder."
 msgstr ""
 
-#: bp-members/bp-members-loader.php:87
+#: bp-members/bp-members-functions.php:2511
+msgid "Member type already exists."
+msgstr ""
+
+#: bp-members/bp-members-loader.php:104
 msgid "Search Members..."
 msgstr ""
 
-#: bp-members/bp-members-loader.php:252
+#: bp-members/bp-members-loader.php:269
 msgid "You"
 msgstr ""
 
-#: bp-members/bp-members-screens.php:83
+#: bp-members/bp-members-screens.php:121
 msgid "Please make sure you enter your password twice"
 msgstr ""
 
-#: bp-members/bp-members-screens.php:87
+#: bp-members/bp-members-screens.php:125
 msgid "The passwords you entered do not match."
 msgstr ""
 
-#: bp-members/bp-members-screens.php:110
+#: bp-members/bp-members-screens.php:148
 msgid "This is a required field"
 msgstr ""
 
-#: bp-members/bp-members-screens.php:255
+#: bp-members/bp-members-screens.php:365
 msgid "Your account is now active!"
 msgstr ""
 
-#: bp-members/bp-members-screens.php:520
+#: bp-members/bp-members-screens.php:673
 msgid "Check Your Email To Activate Your Account!"
 msgstr ""
 
-#: bp-members/bp-members-screens.php:528
+#: bp-members/bp-members-screens.php:681
 msgid "Account Activated"
 msgstr ""
 
-#: bp-members/bp-members-template.php:537
+#: bp-members/bp-members-template.php:636
 msgid "Viewing 1 active member"
+msgstr ""
+
+#: bp-members/bp-members-template.php:638
+msgid "Viewing %1$s - %2$s of %3$s active member"
 msgid_plural "Viewing %1$s - %2$s of %3$s active members"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-template.php:539
+#: bp-members/bp-members-template.php:642
 msgid "Viewing 1 member with friends"
+msgstr ""
+
+#: bp-members/bp-members-template.php:644
+msgid "Viewing %1$s - %2$s of %3$s member with friends"
 msgid_plural "Viewing %1$s - %2$s of %3$s members with friends"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-template.php:541
+#: bp-members/bp-members-template.php:648
 msgid "Viewing 1 online member"
+msgstr ""
+
+#: bp-members/bp-members-template.php:650
+msgid "Viewing %1$s - %2$s of %3$s online member"
 msgid_plural "Viewing %1$s - %2$s of %3$s online members"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-template.php:1751
+#: bp-members/bp-members-template.php:1865
+msgid "Viewing members of the type: %s"
+msgstr ""
+
+#: bp-members/bp-members-template.php:2245
 msgid "Your Profile Photo"
 msgstr ""
 
-#: bp-members/bp-members-template.php:1831
+#: bp-members/bp-members-template.php:2348
 msgid "Activity RSS Feed"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:48
-msgid "Your reply was sent successfully"
+#: bp-members/bp-members-widgets.php:39
+msgid "A dynamic list of recently active, popular, and newest members"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:50
-msgid "There was a problem sending your reply, please try again"
+#: bp-members/bp-members-widgets.php:144
+msgid "No one has signed up yet!"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:85
-msgid "There was an error deleting that message."
+#: bp-members/bp-members-widgets.php:203
+msgid "Max members to show:"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:87
-msgid "Message deleted."
+#: bp-members/bp-members-widgets.php:209
+msgid "Default members to show:"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:115
-msgid "There was an error deleting messages."
+#: bp-members/bp-members-widgets.php:254
+msgid "Profile photos of online users"
 msgstr ""
 
-#: bp-messages/bp-messages-actions.php:117
-#: bp-templates/bp-legacy/buddypress-functions.php:1389
-msgid "Messages deleted."
+#: bp-members/bp-members-widgets.php:318
+msgid "There are no users currently online"
 msgstr ""
 
-#: bp-messages/bp-messages-classes.php:476
-msgid "%s Recipients"
+#: bp-members/bp-members-widgets.php:365 bp-members/bp-members-widgets.php:515
+msgid "Max Members to show:"
 msgstr ""
 
-#: bp-messages/bp-messages-functions.php:79
-msgid "Re: %s"
+#: bp-members/bp-members-widgets.php:386
+msgid "Who's Online"
 msgstr ""
 
-#: bp-messages/bp-messages-functions.php:92
-msgid "No Subject"
+#: bp-members/bp-members-widgets.php:404
+msgid "Profile photos of recently active members"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:38
-msgid "Private Messages"
+#: bp-members/bp-members-widgets.php:468
+msgid "There are no recently active members"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:102
-msgid "Search Messages..."
+#: bp-members/bp-members-widgets.php:536
+msgid "Recently Active Members"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:123
-msgid "Messages <span class=\"%s\">%s</span>"
+#: bp-members/classes/class-bp-signup.php:585
+#: bp-members/classes/class-bp-signup.php:673
+#: bp-members/classes/class-bp-signup.php:751
+msgid "the sign-up has already been activated."
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:125
-#: bp-messages/bp-messages-loader.php:219
-#: bp-messages/bp-messages-screens.php:198
-msgid "Messages"
+#: bp-messages/bp-messages-actions.php:48
+msgid "Your reply was sent successfully"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:153
-#: bp-messages/bp-messages-loader.php:220
-#: bp-messages/bp-messages-notifications.php:127
-msgid "Inbox"
+#: bp-messages/bp-messages-actions.php:50
+msgid "There was a problem sending your reply. Please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:163
-#: bp-messages/bp-messages-loader.php:243
-msgid "Sent"
+#: bp-messages/bp-messages-actions.php:90
+msgid "There was an error deleting that message."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:92
+msgid "Message deleted."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:130
+msgid "Message marked as read."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:132
+#: bp-messages/bp-messages-actions.php:173
+msgid "There was a problem marking that message."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:171
+msgid "Message marked unread."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:214
+msgid "There was a problem managing your messages."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:225
+#: bp-messages/bp-messages-actions.php:271
+#: bp-templates/bp-legacy/buddypress-functions.php:1673
+msgid "Messages deleted."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:232
+msgid "Messages marked as read"
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:239
+msgid "Messages marked as unread."
+msgstr ""
+
+#: bp-messages/bp-messages-actions.php:269
+msgid "There was an error deleting messages."
+msgstr ""
+
+#: bp-messages/bp-messages-functions.php:78
+msgid "Re: %s"
+msgstr ""
+
+#: bp-messages/bp-messages-functions.php:91
+msgid "No Subject"
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:39
+msgid "Private Messages"
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:118
+msgid "Search Messages..."
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:136
+msgid "Messages <span class=\"%s\">%s</span>"
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:138
+#: bp-messages/bp-messages-loader.php:244
+#: bp-messages/bp-messages-screens.php:268
+msgid "Messages"
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:166
+#: bp-messages/bp-messages-loader.php:245
+#: bp-messages/bp-messages-notifications.php:169
+msgid "Inbox"
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:177
+#: bp-messages/bp-messages-loader.php:269 bp-messages/bp-messages-star.php:98
+#: bp-templates/bp-legacy/buddypress-functions.php:340
+msgid "Starred"
+msgstr ""
+
+#: bp-messages/bp-messages-loader.php:188
+#: bp-messages/bp-messages-loader.php:278
+msgid "Sent"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:173
-#: bp-messages/bp-messages-loader.php:251
+#: bp-messages/bp-messages-loader.php:198
+#: bp-messages/bp-messages-loader.php:286
 msgid "Compose"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:184
+#: bp-messages/bp-messages-loader.php:209
 msgid "Notices"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:216
+#: bp-messages/bp-messages-loader.php:241
 msgid "Messages <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:217
+#: bp-messages/bp-messages-loader.php:242
 msgid "Inbox <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:260
+#: bp-messages/bp-messages-loader.php:295
 msgid "All Member Notices"
 msgstr ""
 
-#: bp-messages/bp-messages-loader.php:277
+#: bp-messages/bp-messages-loader.php:312
 msgid "My Messages"
 msgstr ""
 
@@ -4692,113 +5055,202 @@ msgstr ""
 msgid "To disable these notifications, please log in and go to: %s"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:131
+#: bp-messages/bp-messages-notifications.php:175
 msgid "You have %d new messages"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:142
+#: bp-messages/bp-messages-notifications.php:187
 msgid "%s sent you a new private message"
 msgstr ""
 
-#: bp-messages/bp-messages-notifications.php:144
+#: bp-messages/bp-messages-notifications.php:189
 msgid "You have %s new private message"
 msgid_plural "You have %s new private messages"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-messages/bp-messages-screens.php:64
-#: bp-messages/bp-messages-screens.php:91
-msgid "There was an error sending that message, please try again"
+#: bp-messages/bp-messages-screens.php:90
+#: bp-messages/bp-messages-screens.php:125
+msgid "There was an error sending that message. Please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:69
+#: bp-messages/bp-messages-screens.php:95
 msgid "Notice sent successfully!"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:72
-msgid "There was an error sending that notice, please try again"
+#: bp-messages/bp-messages-screens.php:98
+msgid "There was an error sending that notice. Please try again."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:88
+#: bp-messages/bp-messages-screens.php:122
 msgid "Message sent successfully!"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:124
+#: bp-messages/bp-messages-screens.php:170
 msgid "Messages <span>%s</span>"
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:151
+#: bp-messages/bp-messages-screens.php:209
 msgid "There was a problem deactivating that notice."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:153
+#: bp-messages/bp-messages-screens.php:211
 msgid "Notice deactivated."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:157
+#: bp-messages/bp-messages-screens.php:215
 msgid "There was a problem activating that notice."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:159
+#: bp-messages/bp-messages-screens.php:217
 msgid "Notice activated."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:163
+#: bp-messages/bp-messages-screens.php:221
 msgid "There was a problem deleting that notice."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:165
+#: bp-messages/bp-messages-screens.php:223
 msgid "Notice deleted."
 msgstr ""
 
-#: bp-messages/bp-messages-screens.php:207
+#: bp-messages/bp-messages-screens.php:277
 msgid "A member sends you a new message"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:753
+#: bp-messages/bp-messages-star.php:96
+#: bp-templates/bp-legacy/buddypress-functions.php:338
+msgid "Unstar"
+msgstr ""
+
+#: bp-messages/bp-messages-star.php:97
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:65
+#: bp-templates/bp-legacy/buddypress-functions.php:339
+msgid "Star"
+msgstr ""
+
+#: bp-messages/bp-messages-star.php:99
+#: bp-templates/bp-legacy/buddypress-functions.php:341
+msgid "Not starred"
+msgstr ""
+
+#: bp-messages/bp-messages-star.php:100
+#: bp-templates/bp-legacy/buddypress-functions.php:342
+msgid "Remove all starred messages in this thread"
+msgstr ""
+
+#: bp-messages/bp-messages-star.php:101
+#: bp-templates/bp-legacy/buddypress-functions.php:343
+msgid "Star the first message in this thread"
+msgstr ""
+
+#: bp-messages/bp-messages-star.php:423
+msgid "%s message was successfully starred"
+msgid_plural "%s messages were successfully starred"
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-messages/bp-messages-star.php:437
+msgid "%s message was successfully unstarred"
+msgid_plural "%s messages were successfully unstarred"
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-messages/bp-messages-star.php:473
+msgid "Add star"
+msgstr ""
+
+#: bp-messages/bp-messages-star.php:474
+msgid "Remove star"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:918
+msgid "%d unread"
+msgid_plural "%d unread"
+msgstr[0] ""
+msgstr[1] ""
+
+#: bp-messages/bp-messages-template.php:1092
 msgid "Viewing 1 message"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1094
+msgid "Viewing %1$s - %2$s of %3$s message"
 msgid_plural "Viewing %1$s - %2$s of %3$s messages"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-messages/bp-messages-template.php:859
+#: bp-messages/bp-messages-template.php:1120
+msgid "Search Messages"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1260
 msgid "Select:"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:875
+#: bp-messages/bp-messages-template.php:1264
+msgid "Select"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1277
 msgid "Delete Selected"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:920
+#: bp-messages/bp-messages-template.php:1289
+#: bp-notifications/bp-notifications-template.php:1274
+msgid "Select Bulk Action"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1291
+#: bp-notifications/bp-notifications-template.php:1276
+msgid "Bulk Actions"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1292
+#: bp-notifications/bp-notifications-template.php:1279
+msgid "Mark read"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1293
+#: bp-notifications/bp-notifications-template.php:1281
+msgid "Mark unread"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1304
+#: bp-notifications/bp-notifications-template.php:1285
+msgid "Apply"
+msgstr ""
+
+#: bp-messages/bp-messages-template.php:1355
 msgid "Currently Active"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:1044
+#: bp-messages/bp-messages-template.php:1527
 msgid "Deactivate"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:1095
-#: bp-templates/bp-legacy/buddypress/members/register.php:90
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:45
-#: bp-templates/bp-legacy/buddypress-functions.php:239
-#: bp-xprofile/bp-xprofile-admin.php:786
+#: bp-messages/bp-messages-template.php:1594
+#: bp-templates/bp-legacy/buddypress/members/register.php:178
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:60
+#: bp-templates/bp-legacy/buddypress-functions.php:300
+#: bp-xprofile/bp-xprofile-admin.php:1000
 msgid "Close"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:1158
+#: bp-messages/bp-messages-template.php:1672
 msgid "Send a private message to this user."
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:1159
+#: bp-messages/bp-messages-template.php:1673
 msgid "Private Message"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:1517
-msgid "%d Recipients"
+#: bp-messages/bp-messages-template.php:2076
+msgid "%s recipients"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:1750
-#: bp-templates/bp-legacy/buddypress-functions.php:1298
+#: bp-messages/bp-messages-template.php:2437
+#: bp-templates/bp-legacy/buddypress-functions.php:1558
 msgid "Sent %s"
 msgstr ""
 
@@ -4810,6 +5262,10 @@ msgstr ""
 msgid "Display Sitewide Notices posted by the site administrator"
 msgstr ""
 
+#: bp-messages/classes/class-bp_messages-thread.php:766
+msgid "%s Recipients"
+msgstr ""
+
 #: bp-notifications/bp-notifications-actions.php:43
 msgid "Notification successfully marked read."
 msgstr ""
@@ -4831,38 +5287,58 @@ msgstr ""
 msgid "There was a problem deleting that notification."
 msgstr ""
 
+#: bp-notifications/bp-notifications-actions.php:151
+msgid "There was a problem managing your notifications."
+msgstr ""
+
+#: bp-notifications/bp-notifications-actions.php:163
+msgid "Notifications deleted."
+msgstr ""
+
+#: bp-notifications/bp-notifications-actions.php:170
+msgid "Notifications marked as read"
+msgstr ""
+
+#: bp-notifications/bp-notifications-actions.php:177
+msgid "Notifications marked as unread."
+msgstr ""
+
 #: bp-notifications/bp-notifications-adminbar.php:54
 msgid "No new notifications"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:82
+#: bp-notifications/bp-notifications-loader.php:85
 msgid "Search Notifications..."
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:208
-#: bp-notifications/bp-notifications-template.php:720
-msgid "Read"
+#: bp-notifications/bp-notifications-template.php:781
+msgid "Date not found"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:654
-msgid "Date not found"
+#: bp-notifications/bp-notifications-template.php:861
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:122
+msgid "Read"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:993
+#: bp-notifications/bp-notifications-template.php:1189
 msgid "Viewing 1 notification"
+msgstr ""
+
+#: bp-notifications/bp-notifications-template.php:1191
+msgid "Viewing %1$s - %2$s of %3$s notification"
 msgid_plural "Viewing %1$s - %2$s of %3$s notifications"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-notifications/bp-notifications-template.php:1041
+#: bp-notifications/bp-notifications-template.php:1255
 msgid "Newest First"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:1042
+#: bp-notifications/bp-notifications-template.php:1256
 msgid "Oldest First"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:1046
+#: bp-notifications/bp-notifications-template.php:1260
 msgid "Go"
 msgstr ""
 
@@ -4890,67 +5366,71 @@ msgstr ""
 msgid "[%s] Verify your new email address"
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:211
+#: bp-settings/bp-settings-actions.php:218
 msgid "That email address is invalid. Check the formatting and try again."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:214
+#: bp-settings/bp-settings-actions.php:221
 msgid "That email address is currently unavailable for use."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:217
+#: bp-settings/bp-settings-actions.php:224
 msgid "That email address is already taken."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:220
+#: bp-settings/bp-settings-actions.php:227
 msgid "Email address cannot be empty."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:230
+#: bp-settings/bp-settings-actions.php:237
 msgid "Your current password is invalid."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:233
+#: bp-settings/bp-settings-actions.php:240
 msgid "The new password fields did not match."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:236
+#: bp-settings/bp-settings-actions.php:243
 msgid "One of the password fields was empty."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:245
+#: bp-settings/bp-settings-actions.php:246
+msgid "The new password must be different from the current password."
+msgstr ""
+
+#: bp-settings/bp-settings-actions.php:255
 msgid "Your settings have been saved."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:251
+#: bp-settings/bp-settings-actions.php:261
 msgid "No changes were made to your account."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:253
+#: bp-settings/bp-settings-actions.php:263
 msgid "No changes were made to this account."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:301
+#: bp-settings/bp-settings-actions.php:315
 msgid "Your notification settings have been saved."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:303
+#: bp-settings/bp-settings-actions.php:317
 msgid "This user's notification settings have been saved."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:403
+#: bp-settings/bp-settings-actions.php:441
 msgid "%s was successfully deleted."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:449
+#: bp-settings/bp-settings-actions.php:487
 msgid "You have successfully verified your new email address."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:452
+#: bp-settings/bp-settings-actions.php:490
 msgid "There was a problem verifying your new email address. Please try again."
 msgstr ""
 
-#: bp-settings/bp-settings-actions.php:461
+#: bp-settings/bp-settings-actions.php:499
 msgid "You have successfully dismissed your pending email change."
 msgstr ""
 
@@ -4962,22 +5442,22 @@ msgstr ""
 msgid "Capabilities"
 msgstr ""
 
-#: bp-settings/bp-settings-template.php:78
+#: bp-settings/bp-settings-template.php:94
 msgid ""
 "There is a pending change of your email address to <code>%1$s</code>.<br "
 "/>Check your email (<code>%2$s</code>) for the verification link. <a "
 "href=\"%3$s\">Cancel</a>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:20
+#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:27
 msgid "Load More"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:34
+#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:41
 msgid "Sorry, there was no activity found. Please try a different filter."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/comment.php:27
+#: bp-templates/bp-legacy/buddypress/activity/comment.php:34
 #. translators: 1: user profile link, 2: user name, 3: activity permalink, 4:
 #. activity timestamp
 msgid ""
@@ -4985,138 +5465,206 @@ msgid ""
 "class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:50
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:64
 msgid "View Conversation"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:58
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:72
 msgid "Comment <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:66
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:80
 msgid "Mark as Favorite"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:66
-#: bp-templates/bp-legacy/buddypress-functions.php:242
-#: bp-templates/bp-legacy/buddypress-functions.php:944
-#: bp-templates/bp-legacy/buddypress-functions.php:961
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:80
+#: bp-templates/bp-legacy/buddypress-functions.php:303
+#: bp-templates/bp-legacy/buddypress-functions.php:1177
+#: bp-templates/bp-legacy/buddypress-functions.php:1194
 msgid "Favorite"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:70
-#: bp-templates/bp-legacy/buddypress-functions.php:245
-#: bp-templates/bp-legacy/buddypress-functions.php:942
-#: bp-templates/bp-legacy/buddypress-functions.php:963
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:84
+#: bp-templates/bp-legacy/buddypress-functions.php:306
+#: bp-templates/bp-legacy/buddypress-functions.php:1175
+#: bp-templates/bp-legacy/buddypress-functions.php:1196
 msgid "Remove Favorite"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/entry.php:102
+#: bp-templates/bp-legacy/buddypress/activity/entry.php:130
 msgid "Post"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:19
+#: bp-templates/bp-legacy/buddypress/activity/index.php:47
 msgid "The public activity for everyone on this site."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:19
-#: bp-templates/bp-legacy/buddypress/members/index.php:19
+#: bp-templates/bp-legacy/buddypress/activity/index.php:47
+#: bp-templates/bp-legacy/buddypress/members/index.php:47
 msgid "All Members <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:29
+#: bp-templates/bp-legacy/buddypress/activity/index.php:64
 msgid "The activity of my friends only."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:29
-#: bp-templates/bp-legacy/buddypress/members/index.php:22
+#: bp-templates/bp-legacy/buddypress/activity/index.php:64
+#: bp-templates/bp-legacy/buddypress/members/index.php:50
 msgid "My Friends <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:41
+#: bp-templates/bp-legacy/buddypress/activity/index.php:83
 msgid "The activity of groups I am a member of."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:41
-#: bp-templates/bp-legacy/buddypress/groups/index.php:22
+#: bp-templates/bp-legacy/buddypress/activity/index.php:83
+#: bp-templates/bp-legacy/buddypress/groups/index.php:46
 msgid "My Groups <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:51
+#: bp-templates/bp-legacy/buddypress/activity/index.php:100
 msgid "The activity I've marked as a favorite."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:51
+#: bp-templates/bp-legacy/buddypress/activity/index.php:100
 msgid "My Favorites <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:59
+#: bp-templates/bp-legacy/buddypress/activity/index.php:115
 msgid "Activity that I have been mentioned in."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:59
+#: bp-templates/bp-legacy/buddypress/activity/index.php:115
 msgid "Mentions"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:71
+#: bp-templates/bp-legacy/buddypress/activity/index.php:134
 #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3
 msgid "RSS Feed"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:71
+#: bp-templates/bp-legacy/buddypress/activity/index.php:134
 #: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3
 msgid "RSS"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:76
-#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:8
+#: bp-templates/bp-legacy/buddypress/activity/index.php:146
+#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:15
 #: bp-templates/bp-legacy/buddypress/members/single/activity.php:18
 msgid "Show:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:78
-#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:10
+#: bp-templates/bp-legacy/buddypress/activity/index.php:148
+#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:17
 #: bp-templates/bp-legacy/buddypress/members/single/activity.php:20
 msgid "&mdash; Everything &mdash;"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/post-form.php:23
+#: bp-templates/bp-legacy/buddypress/activity/post-form.php:30
 msgid "What's new in %s, %s?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/post-form.php:25
+#: bp-templates/bp-legacy/buddypress/activity/post-form.php:32
 msgid "What's new, %s?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/post-form.php:35
+#: bp-templates/bp-legacy/buddypress/activity/post-form.php:44
 msgid "Post Update"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/post-form.php:42
+#: bp-templates/bp-legacy/buddypress/activity/post-form.php:51
 msgid "Post in"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:90
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:16
+msgid "Your browser does not support this feature."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:23
+msgid "Capture"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:24
+#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:23
+#: bp-xprofile/classes/class-bp-xprofile-field.php:673
+#: bp-xprofile/classes/class-bp-xprofile-group.php:657
+msgid "Save"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php:22
+#: bp-templates/bp-legacy/buddypress/groups/create.php:234
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:207
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:46
+msgid "Crop Image"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php:37
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:30
+msgid ""
+"If you'd like to delete your current profile photo but not upload a new "
+"one, please use the delete profile photo button."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php:38
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:31
+#: bp-xprofile/bp-xprofile-admin.php:1072
+msgid "Delete Profile Photo"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php:38
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:31
+msgid "Delete My Profile Photo"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php:40
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:179
+msgid ""
+"If you'd like to remove the existing group profile photo but not upload a "
+"new one, please use the delete group profile photo button."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/index.php:41
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:181
+msgid "Delete Group Profile Photo"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:15
+msgid "The web browser on your device cannot be used to upload files."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:17
+msgid "Upload Limit Exceeded"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:22
+msgid "Drop your file here"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:24
+msgid "Select your File"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:125
 msgid "Sorry, there were no sites found."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/blogs/create.php:14
+#: bp-templates/bp-legacy/buddypress/blogs/create.php:31
 msgid "Site registration is currently disabled"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/blogs/index.php:16
+#: bp-templates/bp-legacy/buddypress/blogs/index.php:47
 msgid "All Sites <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/blogs/index.php:20
+#: bp-templates/bp-legacy/buddypress/blogs/index.php:51
 msgid "My Sites <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/blogs/index.php:38
-#: bp-templates/bp-legacy/buddypress/forums/index.php:44
-#: bp-templates/bp-legacy/buddypress/groups/index.php:39
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:38
-#: bp-templates/bp-legacy/buddypress/members/index.php:37
+#: bp-templates/bp-legacy/buddypress/blogs/index.php:83
+#: bp-templates/bp-legacy/buddypress/forums/index.php:79
+#: bp-templates/bp-legacy/buddypress/groups/index.php:77
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:46
+#: bp-templates/bp-legacy/buddypress/members/index.php:79
 #: bp-templates/bp-legacy/buddypress/members/single/blogs.php:21
 #: bp-templates/bp-legacy/buddypress/members/single/forums.php:20
 #: bp-templates/bp-legacy/buddypress/members/single/friends.php:22
@@ -5124,88 +5672,79 @@ msgstr ""
 msgid "Last Active"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:39
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:53
 msgid "Topic"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:41
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:55
 msgid "Freshness"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:54
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:95
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:75
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:123
 msgid "Permanent link to this post"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:61
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:82
 #. translators: "started by [poster] in [forum]"
 msgid "Started by %1$s"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:72
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:93
 #. translators: "started by [poster] in [forum]"
 msgid "in %1$s"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:122
+#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:164
 msgid "Sorry, there were no forum topics found."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:22
+#: bp-templates/bp-legacy/buddypress/forums/index.php:43
 msgid "All Topics <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:26
+#: bp-templates/bp-legacy/buddypress/forums/index.php:47
 msgid "My Topics <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:45
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:39
+#: bp-templates/bp-legacy/buddypress/forums/index.php:80
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:47
 #: bp-templates/bp-legacy/buddypress/members/single/forums.php:21
 msgid "Most Posts"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:46
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:40
+#: bp-templates/bp-legacy/buddypress/forums/index.php:81
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:48
 #: bp-templates/bp-legacy/buddypress/members/single/forums.php:22
 msgid "Unreplied"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:82
+#: bp-templates/bp-legacy/buddypress/forums/index.php:152
 msgid "Create New Topic:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:89
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:50
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:78
+#: bp-templates/bp-legacy/buddypress/forums/index.php:162
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:71
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:103
 msgid "Content:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:92
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:53
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:81
+#: bp-templates/bp-legacy/buddypress/forums/index.php:165
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:74
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:106
 msgid "Tags (comma separated):"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:95
+#: bp-templates/bp-legacy/buddypress/forums/index.php:168
 msgid "Post In Group Forum:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:98
-#: bp-xprofile/bp-xprofile-classes.php:1695
-#: bp-xprofile/bp-xprofile-classes.php:1718
-#: bp-xprofile/bp-xprofile-classes.php:1726
-#: bp-xprofile/bp-xprofile-classes.php:2358
-#. translators: no option picked in select box
-msgid "----"
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/forums/index.php:115
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:87
+#: bp-templates/bp-legacy/buddypress/forums/index.php:195
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:119
 msgid "Post Topic"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/forums/index.php:127
+#: bp-templates/bp-legacy/buddypress/forums/index.php:207
 msgid ""
 "You are not a member of any groups so you don't have any group forums you "
 "can post in. To start posting, first find a group that matches the topic "
@@ -5214,536 +5753,560 @@ msgid ""
 "you can post your topic in that group's forum."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:29
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:16
+#: bp-templates/bp-legacy/buddypress/groups/create.php:60
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:30
 msgid "Group Name (required)"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:34
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:19
+#: bp-templates/bp-legacy/buddypress/groups/create.php:65
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:33
 msgid "Group Description (required)"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:51
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:56
+#: bp-templates/bp-legacy/buddypress/groups/create.php:95
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:91
 msgid "Privacy Options"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:54
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:61
+#: bp-templates/bp-legacy/buddypress/groups/create.php:98
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:96
 msgid "This is a public group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:56
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:63
+#: bp-templates/bp-legacy/buddypress/groups/create.php:100
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:98
 msgid "Any site member can join this group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:57
-#: bp-templates/bp-legacy/buddypress/groups/create.php:68
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:64
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:74
+#: bp-templates/bp-legacy/buddypress/groups/create.php:101
+#: bp-templates/bp-legacy/buddypress/groups/create.php:112
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:99
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:109
 msgid "This group will be listed in the groups directory and in search results."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:58
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:65
+#: bp-templates/bp-legacy/buddypress/groups/create.php:102
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:100
 msgid "Group content and activity will be visible to any site member."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:64
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:71
+#: bp-templates/bp-legacy/buddypress/groups/create.php:108
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:106
 msgid "This is a private group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:67
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:73
+#: bp-templates/bp-legacy/buddypress/groups/create.php:111
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:108
 msgid "Only users who request membership and are accepted can join the group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:69
-#: bp-templates/bp-legacy/buddypress/groups/create.php:80
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:75
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:85
+#: bp-templates/bp-legacy/buddypress/groups/create.php:113
+#: bp-templates/bp-legacy/buddypress/groups/create.php:124
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:110
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:120
 msgid "Group content and activity will only be visible to members of the group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:75
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:81
+#: bp-templates/bp-legacy/buddypress/groups/create.php:119
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:116
 msgid "This is a hidden group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:78
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:83
+#: bp-templates/bp-legacy/buddypress/groups/create.php:122
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:118
 msgid "Only users who are invited can join the group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:79
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:84
+#: bp-templates/bp-legacy/buddypress/groups/create.php:123
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:119
 msgid "This group will not be listed in the groups directory or search results."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:85
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:92
+#: bp-templates/bp-legacy/buddypress/groups/create.php:129
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:127
 msgid "Group Invitations"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:87
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:94
+#: bp-templates/bp-legacy/buddypress/groups/create.php:131
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:129
 msgid "Which members of this group are allowed to invite others?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:112
+#: bp-templates/bp-legacy/buddypress/groups/create.php:156
 msgid "Should this group have a forum?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:119
+#: bp-templates/bp-legacy/buddypress/groups/create.php:163
 msgid ""
 "<strong>Attention Site Admin:</strong> Group forums require the <a "
 "href=\"%s\">correct setup and configuration</a> of a bbPress installation."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:145
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:127
+#: bp-templates/bp-legacy/buddypress/groups/create.php:203
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:169
 msgid ""
 "Upload an image to use as a profile photo for this group. The image will be "
 "shown on the main group page, and in search results."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:149
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:131
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:18
+#: bp-templates/bp-legacy/buddypress/groups/create.php:207
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:173
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:25
 msgid "Upload Image"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:153
+#: bp-templates/bp-legacy/buddypress/groups/create.php:211
 msgid ""
 "To skip the group profile photo upload process, hit the \"Next Step\" "
 "button."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:160
+#: bp-templates/bp-legacy/buddypress/groups/create.php:226
 msgid "Crop Group Profile Photo"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:162
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:151
+#: bp-templates/bp-legacy/buddypress/groups/create.php:228
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:201
 msgid "Profile photo to crop"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:165
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:154
+#: bp-templates/bp-legacy/buddypress/groups/create.php:231
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:204
 msgid "Profile photo preview"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:168
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:157
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:39
-msgid "Crop Image"
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/groups/create.php:207
-#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:79
+#: bp-templates/bp-legacy/buddypress/groups/create.php:287
 msgid "Select people to invite from your friends list."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:225
-#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:51
-#: bp-templates/bp-legacy/buddypress-functions.php:1050
+#: bp-templates/bp-legacy/buddypress/groups/create.php:305
+#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:66
+#: bp-templates/bp-legacy/buddypress-functions.php:1294
 msgid "Remove Invite"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:242
+#: bp-templates/bp-legacy/buddypress/groups/create.php:322
 msgid ""
 "Once you have built up friend connections you will be able to invite others "
 "to your group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:264
+#: bp-templates/bp-legacy/buddypress/groups/create.php:367
 msgid "Back to Previous Step"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:271
+#: bp-templates/bp-legacy/buddypress/groups/create.php:374
 msgid "Next Step"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:278
+#: bp-templates/bp-legacy/buddypress/groups/create.php:381
 msgid "Create Group and Continue"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/create.php:285
+#: bp-templates/bp-legacy/buddypress/groups/create.php:388
 msgid "Finish"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:95
+#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:132
 msgid "There were no groups found."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/index.php:19
+#: bp-templates/bp-legacy/buddypress/groups/index.php:43
 msgid "All Groups <span>%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/index.php:40
+#: bp-templates/bp-legacy/buddypress/groups/index.php:78
 #: bp-templates/bp-legacy/buddypress/members/single/groups.php:23
 msgid "Most Members"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/index.php:41
+#: bp-templates/bp-legacy/buddypress/groups/index.php:79
 #: bp-templates/bp-legacy/buddypress/members/single/groups.php:24
 msgid "Newly Created"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:26
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:47
 msgid "Notify group members of these changes via email"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:137
-msgid ""
-"If you'd like to remove the existing group profile photo but not upload a "
-"new one, please use the delete group profile photo button."
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:139
-msgid "Delete Group Profile Photo"
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:149
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:199
 msgid "Crop Profile Photo"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:260
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:317
 msgid "(banned)"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:323
 msgid "Unban this member"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:323
 msgid "Remove Ban"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:327
 msgid "Kick and ban this member"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:327
 msgid "Kick &amp; Ban"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:271
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:328
 msgid "Promote to Mod"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:276
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:333
 msgid "Remove this member"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:276
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:333
 msgid "Remove from group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:290
-#: bp-templates/bp-legacy/buddypress/groups/single/members.php:79
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:354
 msgid "This group has no members."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:324
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:425
 msgid ""
 "WARNING: Deleting this group will completely remove ALL content associated "
 "with it. There is no way back, please be careful with this option."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:327
+#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:428
 msgid "I understand the consequences of deleting this group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:16
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:17
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:27
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:23
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:24
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:32
 msgid "Forum Directory"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:25
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:32
 msgid "Edit:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:87
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:129
 msgid "This topic does not exist."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:9
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:16
 msgid "New Reply"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:32
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:39
 msgid "Topic tags:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:81
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:102
 msgid "%1$s said %2$s:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:119
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:154
 msgid "There are no posts for this topic."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:134
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:169
 msgid "You will auto join this group when you reply to this topic."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:139
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:181
 msgid "Add a reply:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:144
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:186
 msgid "Post Reply"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:155
+#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:204
 msgid "This topic is closed, replies are no longer accepted."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:69
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:94
 msgid "You will auto join this group when you start a new topic."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:73
+#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:98
 msgid "Post a New Topic:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:11
+#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:16
 msgid "Group Admins"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:20
+#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:36
 msgid "Group Mods"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:90
-msgid "Send Invites"
+#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:102
+msgid "Select friends to invite."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/groups/single/members.php:121
+msgid "No members were found."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:4
+#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:11
 msgid "You are requesting to become a member of the group '%s'."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:7
+#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:14
 msgid "Comments (optional)"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:12
+#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:26
 msgid "Send Request"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:31
-#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:37
-#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:23
+#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:38
+#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:51
+#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:39
 msgid "Accept"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:33
-#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:38
-#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:24
+#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:40
+#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:52
+#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:40
 msgid "Reject"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:62
+#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:76
 msgid "There are no pending membership requests."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/activate.php:14
+#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:22
+msgid "Send Invites"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:37
+msgid "Group invitations can only be extended to friends."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:38
+msgid ""
+"Once you've made some friendships, you'll be able to invite those members "
+"to this group."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:46
+msgid "All of your friends already belong to this group."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/activate.php:31
 msgid ""
 "Your account was activated successfully! Your account details have been "
 "sent to you in a separate email."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/activate.php:16
+#: bp-templates/bp-legacy/buddypress/members/activate.php:33
 msgid ""
 "Your account was activated successfully! You can now <a href=\"%s\">log "
 "in</a> with the username and password you provided when you signed up."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/activate.php:21
+#: bp-templates/bp-legacy/buddypress/members/activate.php:38
 msgid "Please provide a valid activation key."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/activate.php:25
+#: bp-templates/bp-legacy/buddypress/members/activate.php:42
 msgid "Activation Key:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/index.php:38
+#: bp-templates/bp-legacy/buddypress/members/index.php:80
 #: bp-templates/bp-legacy/buddypress/members/single/friends.php:23
 msgid "Newest Registered"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:13
+#: bp-templates/bp-legacy/buddypress/members/register.php:30
 msgid "User registration is currently not allowed."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:22
+#: bp-templates/bp-legacy/buddypress/members/register.php:49
 msgid ""
 "Registering for this site is easy. Just fill in the fields below, and we'll "
 "get a new account set up for you in no time."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:30
+#: bp-templates/bp-legacy/buddypress/members/register.php:64
 msgid "Account Details"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:32
-#: bp-templates/bp-legacy/buddypress/members/register.php:36
-#: bp-templates/bp-legacy/buddypress/members/register.php:40
-#: bp-templates/bp-legacy/buddypress/members/register.php:45
-#: bp-templates/bp-legacy/buddypress/members/register.php:133
-#: bp-templates/bp-legacy/buddypress/members/register.php:142
-#: bp-xprofile/bp-xprofile-classes.php:1602
-#: bp-xprofile/bp-xprofile-classes.php:1856
-#: bp-xprofile/bp-xprofile-classes.php:2009
-#: bp-xprofile/bp-xprofile-classes.php:2169
-#: bp-xprofile/bp-xprofile-classes.php:2327
-#: bp-xprofile/bp-xprofile-classes.php:2476
-#: bp-xprofile/bp-xprofile-classes.php:2563
-#: bp-xprofile/bp-xprofile-classes.php:2650
-#: bp-xprofile/bp-xprofile-classes.php:2739
+#: bp-templates/bp-legacy/buddypress/members/register.php:66
+#: bp-templates/bp-legacy/buddypress/members/register.php:77
+#: bp-templates/bp-legacy/buddypress/members/register.php:88
+#: bp-templates/bp-legacy/buddypress/members/register.php:100
+#: bp-templates/bp-legacy/buddypress/members/register.php:249
+#: bp-templates/bp-legacy/buddypress/members/register.php:265
+#: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php:70
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:79
+#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:72
+#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:67
+#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:69
+#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:67
+#: bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php:67
+#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:67
+#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:70
 msgid "(required)"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:36
+#: bp-templates/bp-legacy/buddypress/members/register.php:77
 msgid "Email Address"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:40
+#: bp-templates/bp-legacy/buddypress/members/register.php:88
 msgid "Choose a Password"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:45
+#: bp-templates/bp-legacy/buddypress/members/register.php:100
 msgid "Confirm Password"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:63
+#: bp-templates/bp-legacy/buddypress/members/register.php:146
 msgid "Profile Details"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:80
-#: bp-templates/bp-legacy/buddypress/members/register.php:95
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:35
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:49
+#: bp-templates/bp-legacy/buddypress/members/register.php:168
+#: bp-templates/bp-legacy/buddypress/members/register.php:183
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:50
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:64
 msgid ""
 "This field can be seen by: <span "
 "class=\"current-visibility-level\">%s</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:85
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:40
-#: bp-xprofile/bp-xprofile-admin.php:781
+#: bp-templates/bp-legacy/buddypress/members/register.php:173
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:55
+#: bp-xprofile/bp-xprofile-admin.php:995
 msgid "Who can see this field?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:127
+#: bp-templates/bp-legacy/buddypress/members/register.php:243
 msgid "Blog Details"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:129
+#: bp-templates/bp-legacy/buddypress/members/register.php:245
 msgid "Yes, I'd like to create a new site"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:133
+#: bp-templates/bp-legacy/buddypress/members/register.php:249
 msgid "Blog URL"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:142
+#: bp-templates/bp-legacy/buddypress/members/register.php:265
 msgid "Site Title"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:165
+#: bp-templates/bp-legacy/buddypress/members/register.php:323
 msgid "Complete Sign Up"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:180
+#: bp-templates/bp-legacy/buddypress/members/register.php:355
 msgid ""
 "You have successfully created your account! To begin using this site you "
 "will need to activate your account via the email we have just sent to your "
 "address."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:182
+#: bp-templates/bp-legacy/buddypress/members/register.php:357
 msgid ""
 "You have successfully created your account! Please log in using the "
 "username and password you have just created."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:68
+#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:96
 msgid "You have no pending friendship requests."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:37
+#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:60
 msgid "You have no outstanding group invites."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:5
+#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:12
 msgid "Send To (Username or Friend's Name)"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:14
+#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:21
 msgid "This is a notice to all users."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:17
+#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:24
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:50
 msgid "Subject"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:20
+#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:27
 msgid "Message"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:28
+#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:42
 msgid "Send Message"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:32
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:48
+#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:6
+msgid "Select all"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:49
+msgid "From"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:84
 msgid "From:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:37
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:91
 msgid "To:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:43
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:98
 msgid "View Message"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51
-#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:43
-#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24
-msgid "Delete Message"
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:124
+msgid "Unread"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:69
+#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:165
 msgid "Sorry, no messages were found."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:36
+#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:57
 msgid "Sent:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:54
+#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:71
+msgid "Delete Message"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:89
 msgid "Sorry, no notices were found."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:14
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:21
 msgid "You are alone in this conversation."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:18
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:25
+msgid "Conversation between %s recipients."
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:29
 msgid "Conversation between %s and you."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:86
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:35
+msgid "Delete Conversation"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:139
 msgid "Send a Reply"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:102
+#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:172
 msgid "Send Reply"
 msgstr ""
 
@@ -5763,11 +6326,11 @@ msgstr ""
 msgid "This member has no notifications."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:5
+#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:7
 msgid "Notification"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:6
+#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:8
 msgid "Date Received"
 msgstr ""
 
@@ -5775,7 +6338,7 @@ msgstr ""
 msgid "Change Profile Photo"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:7
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:14
 msgid ""
 "Your profile photo will be used on your profile and throughout the site. If "
 "there is a <a href=\"http://gravatar.com\">Gravatar</a> associated with "
@@ -5783,40 +6346,25 @@ msgid ""
 "computer."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:14
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:21
 msgid ""
 "Click below to select a JPG, GIF or PNG format photo from your computer and "
 "then click 'Upload Image' to proceed."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:23
-msgid ""
-"If you'd like to delete your current profile photo but not upload a new "
-"one, please use the delete profile photo button."
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24
-#: bp-xprofile/bp-xprofile-admin.php:851
-msgid "Delete Profile Photo"
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24
-msgid "Delete My Profile Photo"
-msgstr ""
-
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:31
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:38
 msgid "Crop Your New Profile Photo"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:33
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:40
 msgid "Profile Photo to crop"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:36
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:43
 msgid "Profile Photo preview"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:55
+#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:70
 msgid ""
 "Your profile photo will be used on your profile and throughout the site. To "
 "change your profile photo, please create an account with <a "
@@ -5824,74 +6372,75 @@ msgid ""
 "you used to register with this site."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:10
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:20
 msgid "Editing '%s' Profile Group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:35
-#: bp-xprofile/bp-xprofile-admin.php:772
+#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:50
+#: bp-xprofile/bp-xprofile-admin.php:986
 msgid "Change"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
+#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:22
 msgid "%s's Profile"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:9
+#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:19
 msgid "This user is a spammer."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:7
+#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:10
 msgid ""
 "Deleting your account will delete all of the content you have created. It "
 "will be completely irrecoverable."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:11
+#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:14
 msgid ""
 "Deleting this account will delete all of the content it has created. It "
 "will be completely irrecoverable."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:23
+#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:33
 msgid "I understand the consequences."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:7
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:10
 msgid ""
 "Current Password <span>(required to update email or change current "
 "password)</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:8
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:11
 msgid "Password Lost and Found"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:8
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:11
 msgid "Lost your password?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:12
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:15
 msgid "Account Email"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:15
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:18
 msgid "Change Password <span>(leave blank for no change)</span>"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:16
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:19
 msgid "New Password"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:18
+#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:21
 msgid "Repeat New Password"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:4
+#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:7
 msgid "Send an email notice when:"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:15
+#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:22
+#: bp-xprofile/classes/class-bp-xprofile-field.php:885
 msgid "Visibility"
 msgstr ""
 
@@ -5899,124 +6448,116 @@ msgstr ""
 msgid "BuddyPress Legacy"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:238
+#: bp-templates/bp-legacy/buddypress-functions.php:299
 msgid "Accepted"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:240
+#: bp-templates/bp-legacy/buddypress-functions.php:301
 msgid "comments"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:241
+#: bp-templates/bp-legacy/buddypress-functions.php:302
 msgid "Are you sure you want to leave this group?"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:243
+#: bp-templates/bp-legacy/buddypress-functions.php:304
 msgid "My Favorites"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:244
+#: bp-templates/bp-legacy/buddypress-functions.php:305
 msgid "Rejected"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:246
+#: bp-templates/bp-legacy/buddypress-functions.php:307
 msgid "Show all"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:247
+#: bp-templates/bp-legacy/buddypress-functions.php:308
 msgid "Show all comments for this thread"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:248
+#: bp-templates/bp-legacy/buddypress-functions.php:309
 msgid "Show all %d comments"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:249
+#: bp-templates/bp-legacy/buddypress-functions.php:310
 msgid ""
 "Your profile has unsaved changes. If you leave the page, the changes will "
 "be lost."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:726
-msgid "There was a problem posting your update; please try again."
+#: bp-templates/bp-legacy/buddypress-functions.php:942
+msgid "There was a problem posting your update. Please try again."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:844
-#: bp-templates/bp-legacy/buddypress-functions.php:880
+#: bp-templates/bp-legacy/buddypress-functions.php:1074
+#: bp-templates/bp-legacy/buddypress-functions.php:1111
 msgid "There was a problem when deleting. Please try again."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1054
+#: bp-templates/bp-legacy/buddypress-functions.php:1298
 msgid ""
 "%s has previously requested to join this group. Sending an invitation will "
 "automatically add the member to the group."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1109
+#: bp-templates/bp-legacy/buddypress-functions.php:1353
 msgid " Friendship could not be requested."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1121
+#: bp-templates/bp-legacy/buddypress-functions.php:1365
 msgid "Friendship request could not be cancelled."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1126
+#: bp-templates/bp-legacy/buddypress-functions.php:1370
 msgid "Request Pending"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1146
+#: bp-templates/bp-legacy/buddypress-functions.php:1390
 msgid "There was a problem accepting that request. Please try again."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1165
+#: bp-templates/bp-legacy/buddypress-functions.php:1409
 msgid "There was a problem rejecting that request. Please try again."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1195
+#: bp-templates/bp-legacy/buddypress-functions.php:1439
 msgid "Error joining group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1208
-#: bp-templates/bp-legacy/buddypress-functions.php:1218
+#: bp-templates/bp-legacy/buddypress-functions.php:1452
+#: bp-templates/bp-legacy/buddypress-functions.php:1462
 msgid "Error requesting membership"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1220
+#: bp-templates/bp-legacy/buddypress-functions.php:1464
 msgid "Membership Requested"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1229
+#: bp-templates/bp-legacy/buddypress-functions.php:1473
 msgid "Error leaving group"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1252
+#: bp-templates/bp-legacy/buddypress-functions.php:1496
 msgid "There was a problem closing the notice."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1315
+#: bp-templates/bp-legacy/buddypress-functions.php:1599
 msgid "There was a problem sending that reply. Please try again."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1333
+#: bp-templates/bp-legacy/buddypress-functions.php:1617
 msgid "There was a problem marking messages as unread."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1358
+#: bp-templates/bp-legacy/buddypress-functions.php:1642
 msgid "There was a problem marking messages as read."
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress-functions.php:1383
+#: bp-templates/bp-legacy/buddypress-functions.php:1667
 msgid "There was a problem deleting messages."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-actions.php:39
-msgid "Your profile photo was deleted successfully!"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-actions.php:41
-msgid "There was a problem deleting your profile photo; please try again."
-msgstr ""
-
 #: bp-xprofile/bp-xprofile-activity.php:31
 msgid "Member changed profile picture"
 msgstr ""
@@ -6025,326 +6566,299 @@ msgstr ""
 msgid "Updated Profile Photos"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:42
-msgid "New member registered"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-activity.php:44
-msgid "New Members"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-activity.php:51
+#: bp-xprofile/bp-xprofile-activity.php:39
 msgid "Updated Profile"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:53
-#: bp-xprofile/bp-xprofile-activity.php:329
+#: bp-xprofile/bp-xprofile-activity.php:41
+#: bp-xprofile/bp-xprofile-activity.php:340
 msgid "Profile Updates"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:72
+#: bp-xprofile/bp-xprofile-activity.php:65
 msgid "%s changed their profile picture"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-activity.php:93
-msgid "%s became a registered member"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-activity.php:119
+#: bp-xprofile/bp-xprofile-activity.php:99
 msgid "%s&#8217;s profile was updated"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:72 bp-xprofile/bp-xprofile-classes.php:472
+#: bp-xprofile/bp-xprofile-admin.php:91
+#: bp-xprofile/classes/class-bp-xprofile-group.php:655
 msgid "Add New Field Group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:75
-msgid "Fields in the \"%s\" group will appear on the signup page."
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-admin.php:98 bp-xprofile/bp-xprofile-admin.php:382
+#: bp-xprofile/bp-xprofile-admin.php:120 bp-xprofile/bp-xprofile-admin.php:499
 msgid "(Primary)"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:113
+#: bp-xprofile/bp-xprofile-admin.php:139
+#: bp-xprofile/classes/class-bp-xprofile-field.php:671
 msgid "Add New Field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:152
+#: bp-xprofile/bp-xprofile-admin.php:172
+msgid "Fields for \"%s\" Group"
+msgstr ""
+
+#: bp-xprofile/bp-xprofile-admin.php:197
 msgid "There are no fields in this group."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:161
-msgid "You have no groups."
+#: bp-xprofile/bp-xprofile-admin.php:205
+msgid "* Fields in this group appear on the signup page."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:162
-msgid "Add New Group"
+#: bp-xprofile/bp-xprofile-admin.php:213
+msgid "You have no groups."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:189
-msgid "There was an error saving the group. Please try again"
+#: bp-xprofile/bp-xprofile-admin.php:214
+msgid "Add New Group"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:192
-msgid "The group was saved successfully."
+#: bp-xprofile/bp-xprofile-admin.php:252
+msgid "There was an error saving the group. Please try again."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:221
-msgid "There was an error deleting the group. Please try again"
+#: bp-xprofile/bp-xprofile-admin.php:257
+msgid "The group was saved successfully."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:224
+#: bp-xprofile/bp-xprofile-admin.php:298
 msgid "The group was deleted successfully."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:265
-msgid "There was an error saving the field. Please try again"
+#: bp-xprofile/bp-xprofile-admin.php:353
+msgid "There was an error saving the field. Please try again."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:272
+#: bp-xprofile/bp-xprofile-admin.php:356
 msgid "The field was saved successfully."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:316
+#: bp-xprofile/bp-xprofile-admin.php:420
 msgid "field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:316
+#: bp-xprofile/bp-xprofile-admin.php:420
 msgid "option"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:320
-msgid "There was an error deleting the %s. Please try again"
+#: bp-xprofile/bp-xprofile-admin.php:424
+msgid "There was an error deleting the %s. Please try again."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:323
+#: bp-xprofile/bp-xprofile-admin.php:427
 msgid "The %s was deleted successfully!"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:382
+#: bp-xprofile/bp-xprofile-admin.php:500
 msgid "(Required)"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:768
-msgid "This field can be seen by: <span class=\"%s\">%s</span>"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:380
-msgid "Please make sure you give the group a name."
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:474
-msgid "Create Field Group"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:476
-msgid "Edit Field Group"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:502
-msgid "Field Group Title"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:509
-msgid "Group Description"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:890
-msgid "Add Field"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:902
-msgid "Edit Field"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:926
-msgid "Field Description"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:947
-msgid "Submit"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:992
-msgid "Default Visibility"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:1010
-msgid "Per-Member Visibility"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:1015
-msgid "Let members change this field's visibility"
+#: bp-xprofile/bp-xprofile-admin.php:501
+msgid "(Sign-up)"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1019
-msgid "Enforce the default visibility for all members"
+#: bp-xprofile/bp-xprofile-admin.php:982
+msgid "This field can be seen by: <span class=\"%s\">%s</span>"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1034
-msgid "Field Requirement"
+#: bp-xprofile/bp-xprofile-screens.php:179
+msgid "Changes saved."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1037
-msgid "Not Required"
+#: bp-xprofile/bp-xprofile-settings.php:43
+msgid "Your profile settings have been saved."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1038
-msgid "Required"
+#: bp-xprofile/bp-xprofile-settings.php:47
+msgid "This member's profile settings have been saved."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1044
-msgid "Field Type"
+#: bp-xprofile/bp-xprofile-template.php:1089
+msgid "Profile not recently updated."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1082
-msgid "Please make sure you fill out all required fields."
+#: bp-xprofile/bp-xprofile-template.php:1107
+msgid "Profile updated %s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1090
-msgid "This field type require at least one option. Please add options below."
+#: bp-xprofile/bp-xprofile-template.php:1285
+msgid "This field's visibility cannot be changed."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1704
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:193
 msgid "January"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1705
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:194
 msgid "February"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1706
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:195
 msgid "March"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1707
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:196
 msgid "April"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1708
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:197
 msgid "May"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1709
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:198
 msgid "June"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1710
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:199
 msgid "July"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1711
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:200
 msgid "August"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1712
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:201
 msgid "September"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1713
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:202
 msgid "October"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1714
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:203
 msgid "November"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1715
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:204
 msgid "December"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:2020
-#: bp-xprofile/bp-xprofile-classes.php:2098
-#: bp-xprofile/bp-xprofile-classes.php:2182
+#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:88
+#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:83
+#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:173
 msgid "Clear"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3090
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:263
 msgid "Please enter options for this Field:"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3093
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:266
 msgid "Sort Order:"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3095
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:268
 msgid "Custom"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3096
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:269
 msgid "Ascending"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3097
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:270
 msgid "Descending"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3162
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:335
 msgid "Default Value"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:3179
+#: bp-xprofile/classes/class-bp-xprofile-field-type.php:352
 msgid "Add Another Option"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:142
-msgid ""
-"There was a problem updating some of your profile information; please try "
-"again."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:593
+msgid "Profile fields must have a name."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:144
-msgid "Changes saved."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:599
+msgid "Profile field requirement is missing."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:212
-msgid "There was a problem cropping your profile photo."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:605
+msgid "Profile field type is missing."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-screens.php:215
-msgid "Your new profile photo was uploaded successfully."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:611
+msgid "The profile field type %s is not registered."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-settings.php:43
-msgid "Your profile settings have been saved."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:626
+msgid "These field options are invalid."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-settings.php:47
-msgid "This member's profile settings have been saved."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:637
+#: bp-xprofile/classes/class-bp-xprofile-field.php:643
+msgid "%s require at least one option."
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:712
-msgid "Profile not recently updated"
+#: bp-xprofile/classes/class-bp-xprofile-field.php:684
+msgid "Edit Field"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:722
-msgid "Profile updated %s"
+#: bp-xprofile/classes/class-bp-xprofile-field.php:795
+#: bp-xprofile/classes/class-bp-xprofile-group.php:712
+msgid "Submit"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-template.php:872
-msgid "This field's visibility cannot be changed."
+#: bp-xprofile/classes/class-bp-xprofile-field.php:905
+msgid "Allow members to override"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field.php:909
+msgid "Enforce field visibility"
 msgstr ""
 
-#. Plugin URI of the plugin/theme
-msgid "http://buddypress.org"
+#: bp-xprofile/classes/class-bp-xprofile-field.php:934
+msgid "Requirement"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field.php:937
+msgid "Not Required"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field.php:938
+msgid "Required"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field.php:961
+msgid "Type"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-group.php:524
+msgid "Please make sure you give the group a name."
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-group.php:661
+msgid "Edit Field Group"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-group.php:686
+msgid "Field Group Name"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-group.php:691
+msgid "Field Group Description"
+msgstr ""
+
+#. Author URI of the plugin/theme
+msgid "https://buddypress.org/"
 msgstr ""
 
 #. Description of the plugin/theme
 msgid ""
-"Social networking in a box. Build a social network for your company, "
-"school, sports team or niche community all based on the power and "
-"flexibility of WordPress."
+"BuddyPress helps you run any kind of social network on your WordPress, with "
+"member profiles, activity streams, user groups, messaging, and more."
 msgstr ""
 
 #. Author of the plugin/theme
 msgid "The BuddyPress Community"
 msgstr ""
 
-#. Author URI of the plugin/theme
-msgid "http://buddypress.org/community/members/"
-msgstr ""
-
 #: bp-activity/bp-activity-admin.php:32
 msgctxt "Admin Dashbord SWA page title"
 msgid "Activity"
@@ -6355,72 +6869,92 @@ msgctxt "Admin Dashbord SWA menu"
 msgid "Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:236
+#: bp-activity/bp-activity-admin.php:253
 msgctxt "activity admin edit screen"
 msgid "Status"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:237
+#: bp-activity/bp-activity-admin.php:254
 msgctxt "activity admin edit screen"
 msgid "Primary Item/Secondary Item"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:238
+#: bp-activity/bp-activity-admin.php:255
 msgctxt "activity admin edit screen"
 msgid "Link"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:239
+#: bp-activity/bp-activity-admin.php:256
 msgctxt "activity admin edit screen"
 msgid "Type"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:240
+#: bp-activity/bp-activity-admin.php:257
 msgctxt "activity admin edit screen"
 msgid "Author ID"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:253
+#: bp-activity/bp-activity-admin.php:270
 msgctxt "Activity items per page (screen options)"
 msgid "Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:912
+#: bp-activity/bp-activity-admin.php:972
 msgctxt "Admin SWA page"
 msgid "Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1247
+#: bp-activity/bp-activity-admin.php:1335
 msgctxt "Admin SWA column header"
 msgid "Author"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1248
+#: bp-activity/bp-activity-admin.php:1336
 msgctxt "Admin SWA column header"
 msgid "Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1249
+#: bp-activity/bp-activity-admin.php:1337
 msgctxt "Admin SWA column header"
 msgid "Action"
 msgstr ""
 
-#: bp-activity/bp-activity-admin.php:1250
+#: bp-activity/bp-activity-admin.php:1338
 msgctxt "Admin SWA column header"
 msgid "In Response To"
 msgstr ""
 
-#: bp-activity/bp-activity-akismet.php:558
+#: bp-activity/bp-activity-akismet.php:612
 msgctxt "x hours ago - akismet cleared this item"
 msgid "<span>%1$s</span> &mdash; %2$s"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:110
+#: bp-activity/bp-activity-functions.php:481
+msgctxt "Post Type generic activity post admin filter"
+msgid "New item published"
+msgstr ""
+
+#: bp-activity/bp-activity-functions.php:1400
+msgctxt "Activity Custom Post Type post action"
+msgid "%1$s wrote a new <a href=\"%2$s\">item</a>, on the site %3$s"
+msgstr ""
+
+#: bp-activity/bp-activity-functions.php:1406
+msgctxt "Activity Custom Post Type post action"
+msgid "%1$s wrote a new <a href=\"%2$s\">item</a>"
+msgstr ""
+
+#: bp-activity/bp-activity-loader.php:112
 msgctxt "component directory title"
 msgid "Site-Wide Activity"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:480
+#: bp-blogs/bp-blogs-loader.php:69
+msgctxt "component directory title"
+msgid "Sites"
+msgstr ""
+
+#: bp-core/bp-core-filters.php:741
 msgctxt "component directory title"
 msgid "Directory"
 msgstr ""
@@ -6430,7 +6964,7 @@ msgctxt "component directory title"
 msgid "Groups"
 msgstr ""
 
-#: bp-members/bp-members-loader.php:86
+#: bp-members/bp-members-loader.php:103
 msgctxt "component directory title"
 msgid "Members"
 msgstr ""
@@ -6450,244 +6984,304 @@ msgctxt "Profile activity screen sub nav"
 msgid "Mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:189
+#: bp-activity/bp-activity-loader.php:190
 msgctxt "Profile activity screen sub nav"
 msgid "Favorites"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:201
+#: bp-activity/bp-activity-loader.php:203
 msgctxt "Profile activity screen sub nav"
 msgid "Friends"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:214
+#: bp-activity/bp-activity-loader.php:216
 msgctxt "Profile activity screen sub nav"
 msgid "Groups"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:259
+#: bp-activity/bp-activity-loader.php:261
 msgctxt "Toolbar Mention logged in user"
 msgid "Mentions <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:261
+#: bp-activity/bp-activity-loader.php:263
 msgctxt "Toolbar Mention logged in user"
 msgid "Mentions"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:269
+#: bp-activity/bp-activity-loader.php:271
 msgctxt "My Account Activity sub nav"
 msgid "Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:277
+#: bp-activity/bp-activity-loader.php:279
 msgctxt "My Account Activity sub nav"
 msgid "Personal"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:295
+#: bp-activity/bp-activity-loader.php:299
 msgctxt "My Account Activity sub nav"
 msgid "Favorites"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:304
+#: bp-activity/bp-activity-loader.php:309
 msgctxt "My Account Activity sub nav"
 msgid "Friends"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:314
+#: bp-activity/bp-activity-loader.php:319
 msgctxt "My Account Activity sub nav"
 msgid "Groups"
 msgstr ""
 
-#: bp-activity/bp-activity-loader.php:338
+#: bp-activity/bp-activity-loader.php:343
 msgctxt "Page and <title>"
 msgid "My Activity"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:284
+#: bp-activity/bp-activity-template.php:394
 msgctxt "Activity pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-activity/bp-activity-template.php:285
+#: bp-activity/bp-activity-template.php:395
 msgctxt "Activity pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:225
+#: bp-blogs/bp-blogs-template.php:250
 msgctxt "Blog pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-blogs/bp-blogs-template.php:226
+#: bp-blogs/bp-blogs-template.php:251
 msgctxt "Blog pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:37
+#: bp-blogs/bp-blogs-widgets.php:38
 msgctxt "widget name"
 msgid "(BuddyPress) Recent Networkwide Posts"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:154
+#: bp-friends/bp-friends-widgets.php:51
 msgctxt "widget name"
-msgid "(BuddyPress) Members"
+msgid "(BuddyPress) Friends"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:320
+#: bp-groups/bp-groups-widgets.php:27
 msgctxt "widget name"
-msgid "(BuddyPress) Who's Online"
+msgid "(BuddyPress) Groups"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:423
+#: bp-members/bp-members-widgets.php:38
 msgctxt "widget name"
-msgid "(BuddyPress) Recently Active Members"
+msgid "(BuddyPress) Members"
 msgstr ""
 
-#: bp-friends/bp-friends-widgets.php:51
+#: bp-members/bp-members-widgets.php:253
 msgctxt "widget name"
-msgid "(BuddyPress) Friends"
+msgid "(BuddyPress) Who's Online"
 msgstr ""
 
-#: bp-groups/bp-groups-widgets.php:27
+#: bp-members/bp-members-widgets.php:403
 msgctxt "widget name"
-msgid "(BuddyPress) Groups"
+msgid "(BuddyPress) Recently Active Members"
 msgstr ""
 
-#: bp-blogs/bp-blogs-widgets.php:133
+#: bp-blogs/bp-blogs-widgets.php:158
 msgctxt "Label for the Title field of the Recent Networkwide Posts widget"
 msgid "Title:"
 msgstr ""
 
-#: bp-core/admin/bp-core-components.php:144
+#: bp-core/admin/bp-core-admin-components.php:152
 msgctxt "plugins"
 msgid "All <span class=\"count\">(%s)</span>"
 msgid_plural "All <span class=\"count\">(%s)</span>"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-core/admin/bp-core-schema.php:328
+#: bp-core/admin/bp-core-admin-schema.php:350
 msgctxt "First field-group name"
 msgid "General"
 msgstr ""
 
-#: bp-core/admin/bp-core-schema.php:332
+#: bp-core/admin/bp-core-admin-schema.php:354
 msgctxt "Display name field"
 msgid "Display Name"
 msgstr ""
 
-#: bp-core/admin/bp-core-tools.php:386
+#: bp-core/admin/bp-core-admin-tools.php:404
 msgctxt "buddypress tools intro"
 msgid "Use the %s to repair these relationships."
 msgstr ""
 
-#: bp-core/bp-core-admin.php:337
+#: bp-core/bp-core-admin.php:339
 msgctxt "BuddyPress setting tab"
 msgid "Profile Settings"
 msgstr ""
 
-#: bp-core/bp-core-filters.php:460
-msgctxt "Construct the page title. 1 = user name, 2 = component name, 3 = seperator"
-msgid "%1$s %3$s %2$s"
+#: bp-core/bp-core-admin.php:617
+msgctxt "About screen, website links"
+msgid "Learn more:"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:617
+msgctxt "About screen, link to project blog"
+msgid "News"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:617
+msgctxt "About screen, link to support site"
+msgid "Support"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:617
+msgctxt "About screen, link to documentation"
+msgid "Documentation"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:617
+msgctxt "About screen, link to development blog"
+msgid "Development Blog"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:618
+msgctxt "official Twitter accounts:"
+msgid "Twitter:"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:618
+msgctxt "@buddypress twitter account name"
+msgid "BuddyPress"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:618
+msgctxt "@bptrac twitter account name"
+msgid "Trac"
+msgstr ""
+
+#: bp-core/bp-core-admin.php:618
+msgctxt "@buddypressdev twitter account name"
+msgid "Development"
+msgstr ""
+
+#: bp-core/bp-core-catchuri.php:277
+msgctxt "member type URL base"
+msgid "type"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:507
+#: bp-core/bp-core-functions.php:640
 msgctxt "Page title for the Activity directory."
 msgid "Activity"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:508
+#: bp-core/bp-core-functions.php:641
 msgctxt "Page title for the Groups directory."
 msgid "Groups"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:509
+#: bp-core/bp-core-functions.php:642
 msgctxt "Page title for the Sites directory."
 msgid "Sites"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:510
+#: bp-core/bp-core-functions.php:643
 msgctxt "Page title for the Members directory."
 msgid "Members"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:511
+#: bp-core/bp-core-functions.php:644
 msgctxt "Page title for the user activation screen."
 msgid "Activate"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:512
+#: bp-core/bp-core-functions.php:645
 msgctxt "Page title for the user registration screen."
 msgid "Register"
 msgstr ""
 
-#: bp-core/bp-core-functions.php:945
+#: bp-core/bp-core-functions.php:1186
 msgctxt "Separator in time since"
 msgid ","
 msgstr ""
 
-#: bp-core/bp-core-loader.php:233
+#: bp-core/bp-core-loader.php:289
 msgctxt "Main navigation"
 msgid "Profile"
 msgstr ""
 
-#: bp-core/bp-core-loader.php:244
+#: bp-core/bp-core-loader.php:300
 msgctxt "Profile sub nav"
 msgid "View"
 msgstr ""
 
-#: bp-core/bp-core-template.php:385
+#: bp-core/bp-core-template.php:501
 msgctxt "search form"
 msgid "Members"
 msgstr ""
 
-#: bp-core/bp-core-template.php:389
+#: bp-core/bp-core-template.php:505
 msgctxt "search form"
 msgid "Groups"
 msgstr ""
 
-#: bp-core/bp-core-template.php:393
+#: bp-core/bp-core-template.php:509
 msgctxt "search form"
 msgid "Blogs"
 msgstr ""
 
-#: bp-core/bp-core-template.php:397
+#: bp-core/bp-core-template.php:513
 msgctxt "search form"
 msgid "Forums"
 msgstr ""
 
-#: bp-core/bp-core-template.php:400
+#: bp-core/bp-core-template.php:516
 msgctxt "search form"
 msgid "Posts"
 msgstr ""
 
-#: bp-core/bp-core-template.php:403
+#: bp-core/bp-core-template.php:519
 msgctxt "search form"
 msgid "Search these:"
 msgstr ""
 
-#: bp-core/bp-core-widgets.php:36
+#: bp-core/bp-core-widgets.php:35
 msgctxt "Title of the login widget"
 msgid "(BuddyPress) Log In"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:296 bp-forums/bp-forums-template.php:568
+#: bp-core/classes/class-bp-attachment-avatar.php:55
+msgctxt "avatar types separator"
+msgid ","
+msgstr ""
+
+#: bp-core/classes/class-bp-attachment.php:456
+msgctxt "Attachment source file"
+msgid "source file"
+msgstr ""
+
+#: bp-core/classes/class-bp-attachment.php:458
+msgctxt "Attachment destination file"
+msgid "destination file"
+msgstr ""
+
+#: bp-forums/bp-forums-template.php:359 bp-forums/bp-forums-template.php:647
 msgctxt "Forum topic pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:297 bp-forums/bp-forums-template.php:569
+#: bp-forums/bp-forums-template.php:360 bp-forums/bp-forums-template.php:648
 msgctxt "Forum topic pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1736
+#: bp-forums/bp-forums-template.php:2105
 msgctxt "Forum thread pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-forums/bp-forums-template.php:1737
+#: bp-forums/bp-forums-template.php:2106
 msgctxt "Forum thread pagination next text"
 msgid "&rarr;"
 msgstr ""
@@ -6732,17 +7326,17 @@ msgctxt "My Account Friends menu sub nav"
 msgid "Friendships"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:85
+#: bp-friends/bp-friends-screens.php:109
 msgctxt "Friend settings on notification settings page"
 msgid "Friends"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:94
+#: bp-friends/bp-friends-screens.php:118
 msgctxt "Friend settings on notification settings page"
 msgid "A member sends you a friendship request"
 msgstr ""
 
-#: bp-friends/bp-friends-screens.php:100
+#: bp-friends/bp-friends-screens.php:124
 msgctxt "Friend settings on notification settings page"
 msgid "A member accepts your friendship request"
 msgstr ""
@@ -6757,71 +7351,81 @@ msgctxt "Admin Groups menu"
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:124
+#: bp-groups/bp-groups-admin.php:131
 msgctxt "group admin edit screen"
 msgid "Save"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:125
+#: bp-groups/bp-groups-admin.php:132
 msgctxt "group admin edit screen"
 msgid "Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:126
+#: bp-groups/bp-groups-admin.php:133
 msgctxt "group admin edit screen"
 msgid "Add New Members"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:127
+#: bp-groups/bp-groups-admin.php:134
 msgctxt "group admin edit screen"
 msgid "Manage Members"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:141
+#: bp-groups/bp-groups-admin.php:153
 msgctxt "Groups per page (screen options)"
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:797
+#: bp-groups/bp-groups-admin.php:877
 msgctxt "Group member user_id in group admin"
 msgid "ID"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:798
+#: bp-groups/bp-groups-admin.php:878
 msgctxt "Group member name in group admin"
 msgid "Name"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:799
+#: bp-groups/bp-groups-admin.php:879
 msgctxt "Group member role in group admin"
 msgid "Group Role"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1306
+#: bp-groups/bp-groups-admin.php:1446
 msgctxt "Groups admin Group Name column header"
 msgid "Name"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1307
+#: bp-groups/bp-groups-admin.php:1447
 msgctxt "Groups admin Group Description column header"
 msgid "Description"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1308
+#: bp-groups/bp-groups-admin.php:1448
 msgctxt "Groups admin Privacy Status column header"
 msgid "Status"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1309
+#: bp-groups/bp-groups-admin.php:1449
 msgctxt "Groups admin Members column header"
 msgid "# Members"
 msgstr ""
 
-#: bp-groups/bp-groups-admin.php:1310
+#: bp-groups/bp-groups-admin.php:1450
 msgctxt "Groups admin Last Active column header"
 msgid "Last Active"
 msgstr ""
 
+#: bp-groups/bp-groups-adminbar.php:67
+msgctxt "Group WP Admin Bar manage links"
+msgid "Edit Group %s"
+msgstr ""
+
+#: bp-groups/bp-groups-adminbar.php:71
+msgctxt "Group WP Admin Bar delete link"
+msgid "%s Group"
+msgstr ""
+
 #: bp-groups/bp-groups-loader.php:90
 msgctxt "Group screen page <title>"
 msgid "User Groups"
@@ -6832,288 +7436,303 @@ msgctxt "Component directory search"
 msgid "Search Groups..."
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:263
+#: bp-groups/bp-groups-loader.php:291
 msgctxt "Group screen nav"
 msgid "Details"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:267
+#: bp-groups/bp-groups-loader.php:295
 msgctxt "Group screen nav"
 msgid "Settings"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:275
+#: bp-groups/bp-groups-loader.php:304
 msgctxt "Group screen nav"
 msgid "Photo"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:283
+#: bp-groups/bp-groups-loader.php:312
 msgctxt "Group screen nav"
 msgid "Invites"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:448
+#: bp-groups/bp-groups-loader.php:489
 msgctxt "Group screen nav"
 msgid "Request Membership"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:357
+#: bp-groups/bp-groups-loader.php:398
 msgctxt "Group screen nav with counter"
 msgid "Groups <span class=\"%s\">%s</span>"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:359
+#: bp-groups/bp-groups-loader.php:400
 msgctxt "Group screen nav without counter"
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:428
+#: bp-groups/bp-groups-loader.php:469
 msgctxt "Group screen navigation title"
 msgid "Home"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:460
+#: bp-groups/bp-groups-loader.php:501
 msgctxt "My Group screen nav"
 msgid "Forum"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:472
+#: bp-groups/bp-groups-loader.php:513
 msgctxt "My Group screen nav"
 msgid "Members <span>%s</span>"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:485
+#: bp-groups/bp-groups-loader.php:526
 msgctxt "My Group screen nav"
 msgid "Send Invites"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:500
+#: bp-groups/bp-groups-loader.php:541
 msgctxt "My Group screen nav"
 msgid "Manage"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:543
+#: bp-groups/bp-groups-loader.php:644
 msgctxt "My Account Groups"
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:544
+#: bp-groups/bp-groups-loader.php:645
 msgctxt "My Account Groups sub nav"
 msgid "No Pending Invites"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:548
+#: bp-groups/bp-groups-loader.php:649
 msgctxt "My Account Groups sub nav"
 msgid "Pending Invites <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:563
+#: bp-groups/bp-groups-loader.php:664
 msgctxt "My Account Groups sub nav"
 msgid "Memberships"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:580
+#: bp-groups/bp-groups-loader.php:681
 msgctxt "My Account Groups sub nav"
 msgid "Create a Group"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:547
+#: bp-groups/bp-groups-loader.php:648
 msgctxt "My Account Groups nav"
 msgid "Groups <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-groups/bp-groups-loader.php:598
+#: bp-groups/bp-groups-loader.php:699
 msgctxt "My Groups page <title>"
 msgid "Memberships"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:972
+#: bp-groups/bp-groups-notifications.php:35
+msgctxt "Group update email text"
+msgid "* Name changed from \"%s\" to \"%s\""
+msgstr ""
+
+#: bp-groups/bp-groups-notifications.php:43
+msgctxt "Group update email text"
+msgid "* Description changed from \"%s\" to \"%s\""
+msgstr ""
+
+#: bp-groups/bp-groups-screens.php:1331
 msgctxt "Group settings on notification settings page"
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:981
+#: bp-groups/bp-groups-screens.php:1340
 msgctxt "group settings on notification settings page"
 msgid "A member invites you to join a group"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:987
+#: bp-groups/bp-groups-screens.php:1346
 msgctxt "group settings on notification settings page"
 msgid "Group information is updated"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:993
+#: bp-groups/bp-groups-screens.php:1352
 msgctxt "group settings on notification settings page"
 msgid "You are promoted to a group administrator or moderator"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:999
+#: bp-groups/bp-groups-screens.php:1358
 msgctxt "group settings on notification settings page"
 msgid "A member requests to join a private group for which you are an admin"
 msgstr ""
 
-#: bp-groups/bp-groups-screens.php:1160
+#: bp-groups/bp-groups-screens.php:1543
 msgctxt "Group creation page"
 msgid "Groups"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:334
+#: bp-groups/bp-groups-template.php:364
 msgctxt "Group pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-groups/bp-groups-template.php:335
+#: bp-groups/bp-groups-template.php:365
 msgctxt "Group pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:100
-#: bp-members/admin/bp-members-classes.php:440
-#: bp-members/bp-members-admin.php:1188
+#: bp-members/admin/bp-members-admin-classes.php:100
+#: bp-members/admin/bp-members-admin-classes.php:482
+#: bp-members/bp-members-admin.php:1351
 msgctxt "signup users"
 msgid "Pending %s"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:141
-#: bp-members/admin/bp-members-classes.php:469
+#: bp-members/admin/bp-members-admin-classes.php:151
+#: bp-members/admin/bp-members-admin-classes.php:519
 msgctxt "Pending signup action"
 msgid "Activate"
 msgstr ""
 
-#: bp-members/admin/bp-members-classes.php:142
-#: bp-members/admin/bp-members-classes.php:470
+#: bp-members/admin/bp-members-admin-classes.php:152
+#: bp-members/admin/bp-members-admin-classes.php:520
 msgctxt "Pending signup action"
 msgid "Email"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:688
+#: bp-members/bp-members-admin.php:732
 msgctxt "members user-admin edit screen"
 msgid "Status"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:715
+#: bp-members/bp-members-admin.php:766
 msgctxt "members user-admin edit screen"
 msgid "%s's Stats"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:816 bp-members/bp-members-admin.php:1662
+#: bp-members/bp-members-admin.php:778
+msgctxt "members user-admin edit screen"
+msgid "Member Type"
+msgstr ""
+
+#: bp-members/bp-members-admin.php:896 bp-members/bp-members-admin.php:1848
 msgctxt "user"
 msgid "Add New"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:820 bp-members/bp-members-admin.php:1666
+#: bp-members/bp-members-admin.php:900 bp-members/bp-members-admin.php:1852
 msgctxt "user"
 msgid "Add Existing"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1251
+#: bp-members/bp-members-admin.php:1428
 msgctxt "Pending Accounts per page (screen options)"
 msgid "Pending Accounts"
 msgstr ""
 
-#: bp-members/bp-members-admin.php:1425
+#: bp-members/bp-members-admin.php:1611
 msgctxt "signup resent"
 msgid "%s activation email successfully sent! "
 msgid_plural "%s activation emails successfully sent! "
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-admin.php:1459
+#: bp-members/bp-members-admin.php:1645
 msgctxt "signup resent"
 msgid "%s account successfully activated! "
 msgid_plural "%s accounts successfully activated! "
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-admin.php:1436
+#: bp-members/bp-members-admin.php:1622
 msgctxt "signup notsent"
 msgid "%s activation email was not sent."
 msgid_plural "%s activation emails were not sent."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-admin.php:1470
+#: bp-members/bp-members-admin.php:1656
 msgctxt "signup notsent"
 msgid "%s account was not activated."
 msgid_plural "%s accounts were not activated."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-admin.php:1493
+#: bp-members/bp-members-admin.php:1679
 msgctxt "signup deleted"
 msgid "%s sign-up successfully deleted!"
 msgid_plural "%s sign-ups successfully deleted!"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-admin.php:1504
+#: bp-members/bp-members-admin.php:1690
 msgctxt "signup notdeleted"
 msgid "%s sign-up was not deleted."
 msgid_plural "%s sign-ups were not deleted."
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-members/bp-members-loader.php:220
+#: bp-members/bp-members-loader.php:237
 msgctxt "Member profile main navigation"
 msgid "Profile"
 msgstr ""
 
-#: bp-members/bp-members-loader.php:234
+#: bp-members/bp-members-loader.php:251
 msgctxt "Member profile view"
 msgid "View"
 msgstr ""
 
-#: bp-members/bp-members-template.php:286
+#: bp-members/bp-members-template.php:349
 msgctxt "Member pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-members/bp-members-template.php:287
+#: bp-members/bp-members-template.php:350
 msgctxt "Member pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-members/bp-members-template.php:887
+#: bp-members/bp-members-template.php:1136
 msgctxt "member latest update in member directory"
 msgid "- &quot;%s&quot;"
 msgstr ""
 
-#: bp-members/bp-members-template.php:989
-msgctxt "Records the timestamp that the user registered into the activy stream"
+#: bp-members/bp-members-template.php:1252
+msgctxt "Records the timestamp that the user registered into the activity stream"
 msgid "registered %s"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:195
+#: bp-messages/bp-messages-template.php:228
 msgctxt "Message pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:196
+#: bp-messages/bp-messages-template.php:229
 msgctxt "Message pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:863
+#: bp-messages/bp-messages-template.php:1265
 msgctxt "Message dropdown filter"
 msgid "Read"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:864
+#: bp-messages/bp-messages-template.php:1266
 msgctxt "Message dropdown filter"
 msgid "Unread"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:865
+#: bp-messages/bp-messages-template.php:1267
 msgctxt "Message dropdown filter"
 msgid "All"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:870
+#: bp-messages/bp-messages-template.php:1272
 msgctxt "Message management markup"
 msgid "Mark as Read"
 msgstr ""
 
-#: bp-messages/bp-messages-template.php:871
+#: bp-messages/bp-messages-template.php:1273
 msgctxt "Message management markup"
 msgid "Mark as Unread"
 msgstr ""
@@ -7123,263 +7742,273 @@ msgctxt "Page <title>"
 msgid "Notifications"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:107
+#: bp-notifications/bp-notifications-loader.php:110
 msgctxt "Profile screen nav"
 msgid "Notifications <span class=\"%s\">%s</span>"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:109
+#: bp-notifications/bp-notifications-loader.php:112
 msgctxt "Profile screen nav"
 msgid "Notifications"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:136
+#: bp-notifications/bp-notifications-loader.php:139
 msgctxt "Notification screen nav"
 msgid "Unread"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:147
+#: bp-notifications/bp-notifications-loader.php:150
 msgctxt "Notification screen nav"
 msgid "Read"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:181
+#: bp-notifications/bp-notifications-loader.php:184
 msgctxt "My Account Notification pending"
 msgid "Notifications <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:182
+#: bp-notifications/bp-notifications-loader.php:185
 msgctxt "My Account Notification pending"
 msgid "Unread <span class=\"count\">%s</span>"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:184
+#: bp-notifications/bp-notifications-loader.php:187
 msgctxt "My Account Notification"
 msgid "Notifications"
 msgstr ""
 
-#: bp-notifications/bp-notifications-loader.php:185
+#: bp-notifications/bp-notifications-loader.php:188
 msgctxt "My Account Notification sub nav"
 msgid "Unread"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:309
+#: bp-notifications/bp-notifications-loader.php:211
+msgctxt "My Account Notification sub nav"
+msgid "Read"
+msgstr ""
+
+#: bp-notifications/bp-notifications-template.php:369
 msgctxt "Notifications pagination previous text"
 msgid "&larr;"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:310
+#: bp-notifications/bp-notifications-template.php:370
 msgctxt "Notifications pagination next text"
 msgid "&rarr;"
 msgstr ""
 
-#: bp-notifications/bp-notifications-template.php:785
+#: bp-notifications/bp-notifications-template.php:939
 msgctxt "Notification screen action"
 msgid "Unread"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/activity/index.php:59
+#: bp-templates/bp-legacy/buddypress/activity/index.php:115
 msgctxt "Number of new activity mentions"
 msgid "%s new"
 msgid_plural "%s new"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-templates/bp-legacy/buddypress/members/register.php:80
+#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:23
+msgctxt "Uploader: Drop your file here - or - Select your File"
+msgid "or"
+msgstr ""
+
+#: bp-templates/bp-legacy/buddypress/members/register.php:168
 msgctxt "Change profile field visibility level"
 msgid "Change"
 msgstr ""
 
-#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:14
+#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:23
 msgctxt "Group member count"
-msgid "1 member"
+msgid "%d member"
 msgid_plural "%d members"
 msgstr[0] ""
 msgstr[1] ""
 
-#: bp-xprofile/bp-xprofile-admin.php:27
+#: bp-xprofile/bp-xprofile-admin.php:29
 msgctxt "xProfile admin page title"
 msgid "Profile Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:27
+#: bp-xprofile/bp-xprofile-admin.php:29
 msgctxt "Admin Users menu"
 msgid "Profile Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:71
+#: bp-xprofile/bp-xprofile-admin.php:90
 msgctxt "Settings page header"
 msgid "Profile Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:438
+#: bp-xprofile/bp-xprofile-admin.php:593
 msgctxt "xprofile field type category"
 msgid "Other"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1558
-#: bp-xprofile/bp-xprofile-classes.php:2445
-#: bp-xprofile/bp-xprofile-classes.php:2532
-#: bp-xprofile/bp-xprofile-classes.php:2619
-#: bp-xprofile/bp-xprofile-classes.php:2704
+#: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:27
 msgctxt "xprofile field type category"
-msgid "Single Fields"
+msgid "Multi Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:1822
-#: bp-xprofile/bp-xprofile-classes.php:1976
-#: bp-xprofile/bp-xprofile-classes.php:2133
-#: bp-xprofile/bp-xprofile-classes.php:2296
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:27
+#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:27
 msgctxt "xprofile field type category"
-msgid "Multi Fields"
+msgid "Single Fields"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:580
+#: bp-xprofile/bp-xprofile-admin.php:767
 msgctxt "xprofile user-admin edit screen"
 msgid "User marked as a spammer"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-admin.php:591
+#: bp-xprofile/bp-xprofile-admin.php:779
 msgctxt "xprofile user-admin edit screen"
 msgid "Profile Photo"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-classes.php:503
-msgctxt "XProfile admin edit group"
-msgid "Group Name"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:923
-msgctxt "XProfile admin edit field"
-msgid "Field Name"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:1559
-msgctxt "xprofile field type"
-msgid "Date Selector"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:1823
-msgctxt "xprofile field type"
-msgid "Checkboxes"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:1977
-msgctxt "xprofile field type"
-msgid "Radio Buttons"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:2134
-msgctxt "xprofile field type"
-msgid "Multi Select Box"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:2297
-msgctxt "xprofile field type"
-msgid "Drop Down Select Box"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:2446
-msgctxt "xprofile field type"
-msgid "Multi-line Text Area"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:2533
-msgctxt "xprofile field type"
-msgid "Text Box"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:2620
-msgctxt "xprofile field type"
-msgid "Number"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-classes.php:2705
-msgctxt "xprofile field type"
-msgid "URL"
-msgstr ""
-
-#: bp-xprofile/bp-xprofile-loader.php:41
+#: bp-xprofile/bp-xprofile-loader.php:43
 msgctxt "Component page <title>"
 msgid "Extended Profiles"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:113
+#: bp-xprofile/bp-xprofile-loader.php:123
 msgctxt "Visibility level setting"
 msgid "Everyone"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:117
+#: bp-xprofile/bp-xprofile-loader.php:127
 msgctxt "Visibility level setting"
 msgid "Only Me"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:121
+#: bp-xprofile/bp-xprofile-loader.php:131
 msgctxt "Visibility level setting"
 msgid "All Members"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:128
+#: bp-xprofile/bp-xprofile-loader.php:138
 msgctxt "Visibility level setting"
 msgid "My Friends"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:168
+#: bp-xprofile/bp-xprofile-loader.php:178
 msgctxt "Profile header menu"
 msgid "Profile"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:189
+#: bp-xprofile/bp-xprofile-loader.php:199
 msgctxt "Profile header sub menu"
 msgid "View"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:199
+#: bp-xprofile/bp-xprofile-loader.php:209
 msgctxt "Profile header sub menu"
 msgid "Edit"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:211
+#: bp-xprofile/bp-xprofile-loader.php:221
 msgctxt "Profile header sub menu"
 msgid "Change Profile Photo"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:254
-msgctxt "Profile settings  sub nav"
-msgid "Profile"
+#: bp-xprofile/bp-xprofile-loader.php:264
+msgctxt "Profile settings sub nav"
+msgid "Profile Visibility"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:283
+#: bp-xprofile/bp-xprofile-loader.php:293
 msgctxt "My Account Profile"
 msgid "Profile"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:291
+#: bp-xprofile/bp-xprofile-loader.php:301
 msgctxt "My Account Profile sub nav"
 msgid "View"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:299
+#: bp-xprofile/bp-xprofile-loader.php:309
 msgctxt "My Account Profile sub nav"
 msgid "Edit"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:308
+#: bp-xprofile/bp-xprofile-loader.php:318
 msgctxt "My Account Profile sub nav"
 msgid "Change Profile Photo"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:335
+#: bp-xprofile/bp-xprofile-loader.php:345
 msgctxt "Page title"
 msgid "My Profile"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:340
+#: bp-xprofile/bp-xprofile-loader.php:350
 msgctxt "Avatar alt"
 msgid "Profile picture of %s"
 msgstr ""
 
-#: bp-xprofile/bp-xprofile-loader.php:365
+#: bp-xprofile/bp-xprofile-loader.php:393
 msgctxt "My Account Settings sub nav"
 msgid "Profile"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php:28
+msgctxt "xprofile field type"
+msgid "Checkboxes"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:28
+msgctxt "xprofile field type"
+msgid "Date Selector"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:28
+msgctxt "xprofile field type"
+msgid "Multi Select Box"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:28
+msgctxt "xprofile field type"
+msgid "Number"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:28
+msgctxt "xprofile field type"
+msgid "Radio Buttons"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:28
+msgctxt "xprofile field type"
+msgid "Drop Down Select Box"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php:28
+msgctxt "xprofile field type"
+msgid "Multi-line Text Area"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:28
+msgctxt "xprofile field type"
+msgid "Text Box"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:28
+msgctxt "xprofile field type"
+msgid "URL"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field.php:855
+msgctxt "XProfile admin edit field"
+msgid "Name"
+msgstr ""
+
+#: bp-xprofile/classes/class-bp-xprofile-field.php:861
+msgctxt "XProfile admin edit field"
+msgid "Description"
 msgstr ""
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/composer.json b/wp-content/plugins/buddypress/composer.json
new file mode 100644
index 0000000000000000000000000000000000000000..5c6f39e33dd0e9cbdf34376222c5a3f6304188f9
--- /dev/null
+++ b/wp-content/plugins/buddypress/composer.json
@@ -0,0 +1,33 @@
+{
+	"name": "buddypress/buddypress",
+	"description": "BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more.",
+	"type": "wordpress-plugin",
+	"keywords": [
+		"activity",
+		"community",
+		"forum",
+		"friends",
+		"groups",
+		"messaging",
+		"notifications",
+		"profiles",
+		"social network"
+	],
+	"homepage": "https://buddypress.org",
+	"license": "GPL-2.0+",
+	"authors": [ {
+		"name": "BuddyPress Community",
+		"homepage": "https://buddypress.org/about/"
+	} ],
+	"support": {
+		"forum": "https://buddypress.org/support/",
+		"irc": "irc://irc.freenode.net/buddypress-dev",
+		"issues": "https://buddypress.trac.wordpress.org/",
+		"wiki": "https://codex.buddypress.org/",
+		"source": "https://buddypress.trac.wordpress.org/browser"
+	},
+	"require": {
+		"composer/installers": "~1.0",
+		"php": ">=5.2.4"
+	}
+}
\ No newline at end of file
diff --git a/wp-content/plugins/buddypress/humans.txt b/wp-content/plugins/buddypress/humans.txt
index f9906c8979b0492db0681c4ee489ceb76c8d5324..65c157b5c991b8c5d62633bcf63b7de9ce42acd5 100644
--- a/wp-content/plugins/buddypress/humans.txt
+++ b/wp-content/plugins/buddypress/humans.txt
@@ -61,9 +61,24 @@ Title: Navigator
 Twitter: mercime_one
 Favorite Food: Paella Valenciana
 
+Name: David Cavins
+Title: Core Developer
+Twitter: daveycavey
+Favorite Food: Quad-Cities pizza
+
+Name: Michael Beckwith
+Title: Core Developer
+Twitter: tw2113
+Favorite Food: Jelly Beans
+
+Name: Hugo Ashmore (hnla)
+Title: Core Developer
+Twitter: hnla
+Favourite Food: Sunday Roast or Curries
+
 /* THANKS */
-hnla, modemlooper, cnorris23, karmatosed, photomatt
+modemlooper, cnorris23, karmatosed, photomatt
 
 /* META */
-Updated: 2014/04/14
+Updated: 2015/05/09
 See: http://humanstxt.org/
diff --git a/wp-content/plugins/buddypress/readme.txt b/wp-content/plugins/buddypress/readme.txt
index 327c60e3bb7024a6dde1027d06faedf65b2eeb23..03fe3c0328b8ff94fbb5be5d9d088b27484608a9 100644
--- a/wp-content/plugins/buddypress/readme.txt
+++ b/wp-content/plugins/buddypress/readme.txt
@@ -1,61 +1,103 @@
 === BuddyPress ===
-Contributors: johnjamesjacoby, DJPaul, boonebgorges, r-a-y, imath, mercime
+Contributors: johnjamesjacoby, DJPaul, boonebgorges, r-a-y, imath, mercime, tw2113, dcavins, hnla
 Tags: social networking, activity, profiles, messaging, friends, groups, forums, notifications, settings, social, community, networks, networking
 Requires at least: 3.6
-Tested up to: 4.0
-Stable tag: 2.1.1
+Tested up to: 4.2
+Stable tag: 2.3.2.1
 License: GPLv2 or later
-License URI: http://www.gnu.org/licenses/gpl-2.0.html
+License URI: https://www.gnu.org/licenses/gpl-2.0.html
 
-Social networking in a box. Build a social network for your company, school, sports team, or niche community.
+BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more.
 
 == Description ==
 
-BuddyPress lets users sign-up and start creating profiles, posting messages, making connections, creating and interacting in groups, and much more. A social network in a box, BuddyPress lets you easily build a community for your company, school, sports team, or other niche community.
+Are you looking for modern, robust, and sophisticated social network software? BuddyPress is a suite of components that are common to a typical social network, and allows for great add-on features through WordPress's extensive plugin system.
 
-<h4>Plugins: Adding So Much More</h4>
+BuddyPress is focused on ease of integration, ease of use, and extensibility. It is deliberately powerful yet unbelievably simple social network software, built by contributors to WordPress.
 
-BuddyPress boasts an ever growing array of new features developed by an awesome plugin development community. There are more than 330 BuddyPress plugins available, and the list is growing every day. Check out our list of <a href="http://buddypress.org/extend/recommended-plugins/">popular and recommended plugins</a>, or <a href="http://wordpress.org/plugins/search.php?q=buddypress">search for BuddyPress plugins on WordPress.org</a>. You can install any of these plugins automatically, using the plugin installer on your WordPress Dashboard.
+Enable registered members to create profiles, have private conversations, make connections, create & interact in groups, and much more. Truly a social network in a box, BuddyPress helps you more easily build a home for your company, school, sports team, or other niche community.
 
-<h4>More Information</h4>
+= Extensions =
 
-Visit the <a href="http://buddypress.org/">BuddyPress website</a> for more information about BuddyPress.
+BuddyPress has an ever-increasing array of extended features developed by an active and thriving plugin development community, with hundreds of free-and-open BuddyPress-compatible plugins available. We list them on both <a href="https://buddypress.org/extend/recommended-plugins/">our plugin directory</a> and <a href="https://wordpress.org/plugins/search.php?q=buddypress">WordPress.org</a>. Any plugin can be conveniently installed using the plugin installer in your WordPress Dashboard.
+
+= More Information =
+
+Visit the <a href="https://buddypress.org/">BuddyPress website</a> for documentation, support, and information on getting involved in the project and community.
 
 == Installation ==
 
-You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to "/wp-content/plugins/buddypress/".
+= From your WordPress dashboard =
+
+1. Visit 'Plugins > Add New'
+2. Search for 'BuddyPress'
+3. Activate BuddyPress from your Plugins page. (You will be greeted with a Welcome page.)
+
+= From WordPress.org =
+
+1. Download BuddyPress.
+2. Upload the 'buddypress' directory to your '/wp-content/plugins/' directory, using your favorite method (ftp, sftp, scp, etc...)
+3. Activate BuddyPress from your Plugins page. (You will be greeted with a Welcome page.)
+
+= Once Activated =
+
+1. If you do not have pretty permalinks enabled, you will see a notice to enable them. (BuddyPress will not currently work without them.)
+2. Visit 'Settings > BuddyPress > Components' and adjust the active components to match your community. (You can always toggle these later.)
+3. Visit 'Settings > BuddyPress > Pages' and setup your directories and special pages. We create a few automatically, but suggest you customize these to fit the flow and verbiage of your site.
+4. Visit 'Settings > BuddyPress > Settings' and take a moment to match BuddyPress's settings to your expectations. We pick the most common configuration by default, but every community is different.
 
-Activate BuddyPress in the "Plugins" admin panel using the "Activate" link. If you're using WordPress Multisite, you can choose to activate BuddyPress network wide for full integration with all of your site.
+= Once Configured =
+
+* BuddyPress comes with a robust theme-compatibility API that does its best to make every BuddyPress page look and feel right with just-about any WordPress theme. You may need to adjust some styling on your own to make everything look pristine.
+* A few BuddyPress specific themes are readily available for download from WordPress.org, and hundreds more are available from third-party theme authors. BuddyPress themes are just WordPress themes with additional templates for each component, and with a little work you could easily create your own too!
+* BuddyPress also comes with built-in support for Akismet and bbPress, two very popular and very powerful WordPress plugins. If you're using either, visit their settings pages and ensure everything is configured to your liking.
+
+= Multisite & Multiple Networks =
+
+BuddyPress can be activated and operate in just about any scope you need for it to.
+
+* Activate at the site level to only load BuddyPress on that site.
+* Activate at the network level for full integration with all sites in your network. (This is the most common multisite installation type.)
+* Enable <a href="https://codex.buddypress.org/getting-started/customizing/bp_enable_multiblog/">multiblog</a> mode to allow your BuddyPress content to be displayed on any site in your WordPress Multisite network, using the same central data.
+* Extend BuddyPress with a third-party multi-network plugin to allow each site or network to have an isolated and dedicated community, all from the same WordPress installation.
+
+Read more about custom BuddyPress activations <a href="https://codex.buddypress.org/getting-started/installation-in-wordpress-multisite/">on our codex page.</a>
 
 = Discussion Forums =
 
-Try <a href="http://wordpress.org/plugins/bbpress/">bbPress</a>. It's designed to work cohesively with BuddyPress Groups, Profiles, and Notifications. Each group on your site can choose to have its own forum, and each user's topics, replies, favorites, and subscriptions appear in their profiles.
+Try <a href="https://wordpress.org/plugins/bbpress/">bbPress</a>. It integrates with BuddyPress Groups, Profiles, and Notifications. Each group on your site can choose to have its own forum, and each user's topics, replies, favorites, and subscriptions appear in their profiles.
 
 == Frequently Asked Questions ==
 
 = Can I use my existing WordPress theme? =
 
-Of course! BuddyPress works out-of-the-box with nearly every WordPress theme.
+Yes! BuddyPress works out-of-the-box with nearly every WordPress theme.
 
 = Will this work on WordPress multisite? =
 
-Yes! If your WordPress installation has multisite enabled, BuddyPress will support the global tracking of blogs, posts and comments.
+Yes! If your WordPress installation has multisite enabled, BuddyPress will support the global tracking of blogs, posts, comments, and even custom post types with a little bit of custom code.
 
 = Where can I get support? =
 
-The support forums can be found at <a href="http://buddypress.org/support/">http://buddypress.org/support/</a>.
+Our community provides free support at <a href="https://buddypress.org/support/">https://buddypress.org/support/</a>.
+
+For dedicated consultations, see our <a href="https://buddypress.org/consulting/">unofficial list</a> of freelancers, contractors, and agencies offering BuddyPress services.
 
 = Where can I find documentation? =
 
-The documentation codex can be found at <a href="http://codex.buddypress.org/">http://codex.buddypress.org/</a>.
+Our codex can be found at <a href="https://codex.buddypress.org/">https://codex.buddypress.org/</a>.
 
 = Where can I report a bug? =
 
-Report bugs and participate in development at <a href="http://buddypress.trac.wordpress.org/">http://buddypress.trac.wordpress.org</a>.
+Report bugs, suggest ideas, and participate in development at <a href="https://buddypress.trac.wordpress.org/">https://buddypress.trac.wordpress.org</a>.
 
 = Where can I get the bleeding edge version of BuddyPress? =
 
-Check out the development trunk of BuddyPress via Subversion, from <a href="http://buddypress.svn.wordpress.org/trunk/">http://buddypress.svn.wordpress.org/trunk/</a>
+Check out the development trunk of BuddyPress from Subversion at <a href="https://buddypress.svn.wordpress.org/trunk/">https://buddypress.svn.wordpress.org/trunk/</a>, or clone from Git at git://buddypress.git.wordpress.org/.
+
+= Who builds BuddyPress? =
+
+BuddyPress is free software, built by an international community of volunteers. Some contributors to BuddyPress are employed by companies that use BuddyPress, while others are consultants who offer BuddyPress-related services for hire. No one is paid by the BuddyPress project for his or her contributions. If you would like to provide monetary support to BuddyPress, please consider a donation to the <a href="http://wordpressfoundation.org">WordPress Foundation</a>, or ask your favorite contributor how they prefer to have their efforts rewarded.
 
 == Screenshots ==
 
@@ -70,63 +112,86 @@ Check out the development trunk of BuddyPress via Subversion, from <a href="http
 
 == Languages ==
 
-BuddyPress is available in many languages. For more information, check out the <a href="http://codex.buddypress.org/translations/">translation page</a> on the BuddyPress Codex.
+BuddyPress is available in many languages thanks to the volunteer efforts of individuals all around the world. Check out our <a href="https://codex.buddypress.org/translations/">translations page</a> on the BuddyPress Codex for more details.
+
+Please consider helping translate BuddyPress at our <a href="https://translate.wordpress.org/projects/buddypress">GlotPress project</a>. Growing the BuddyPress community means better software for everyone!
 
 == Upgrade Notice ==
 
-= 2.1.1 =
-See: http://codex.buddypress.org/releases/version-2-1-1/
+= 2.3.1 =
+See: https://codex.buddypress.org/releases/version-2-3-1/
+
+= 2.3.0 =
+See: https://codex.buddypress.org/releases/version-2-3-0/
+
+= 2.2.3.1 =
+See: https://codex.buddypress.org/releases/version-2-2-3-1/
+
+= 2.2.3 =
+See: https://codex.buddypress.org/releases/version-2-2-3/
+
+= 2.2.2.1 =
+See: https://codex.buddypress.org/releases/version-2-2-2-1/
+
+= 2.2.2 =
+See: https://codex.buddypress.org/releases/version-2-2-2/
+
+= 2.2.1 =
+See: https://codex.buddypress.org/releases/version-2-2-1/
+
+= 2.2 =
+See: https://codex.buddypress.org/releases/version-2-2/
 
 = 2.1 =
-See: http://codex.buddypress.org/releases/version-2-1/
+See: https://codex.buddypress.org/releases/version-2-1/
 
 = 2.0.3 =
-See: http://codex.buddypress.org/releases/version-2-0-3/
+See: https://codex.buddypress.org/releases/version-2-0-3/
 
 = 2.0.2 =
-See: http://codex.buddypress.org/releases/version-2-0-2/
+See: https://codex.buddypress.org/releases/version-2-0-2/
 
 = 2.0.1 =
-See: http://codex.buddypress.org/releases/version-2-0-1/
+See: https://codex.buddypress.org/releases/version-2-0-1/
 
 = 2.0 =
-See: http://codex.buddypress.org/releases/version-2-0/
+See: https://codex.buddypress.org/releases/version-2-0/
 
 = 1.9.2 =
-See: http://codex.buddypress.org/releases/version-1-9-2/
+See: https://codex.buddypress.org/releases/version-1-9-2/
 
 = 1.9.1 =
-See: http://codex.buddypress.org/releases/version-1-9-1/
+See: https://codex.buddypress.org/releases/version-1-9-1/
 
 = 1.9 =
-See: http://codex.buddypress.org/releases/version-1-9/
+See: https://codex.buddypress.org/releases/version-1-9/
 
 = 1.8.1 =
-See: http://codex.buddypress.org/releases/version-1-8-1/
+See: https://codex.buddypress.org/releases/version-1-8-1/
 
 = 1.8 =
-See: http://codex.buddypress.org/releases/version-1-8/
+See: https://codex.buddypress.org/releases/version-1-8/
 
 = 1.7.3 =
-See: http://codex.buddypress.org/releases/version-1-7-3/
+See: https://codex.buddypress.org/releases/version-1-7-3/
 
 = 1.7.2 =
-See: http://codex.buddypress.org/releases/version-1-7-2/
+See: https://codex.buddypress.org/releases/version-1-7-2/
 
 = 1.7.1 =
-See: http://codex.buddypress.org/releases/version-1-7-1/
+See: https://codex.buddypress.org/releases/version-1-7-1/
 
 = 1.7 =
-See: http://codex.buddypress.org/releases/version-1-7/
+See: https://codex.buddypress.org/releases/version-1-7/
 
 = 1.6.5 =
-See: http://codex.buddypress.org/releases/version-1-6-5/
+See: https://codex.buddypress.org/releases/version-1-6-5/
 
 = 1.6.4 =
-See: http://codex.buddypress.org/releases/version-1-6-4/
+See: https://codex.buddypress.org/releases/version-1-6-4/
 
 = 1.6.3 =
-See: http://codex.buddypress.org/releases/version-1-6-3/
+See: https://codex.buddypress.org/releases/version-1-6-3/
 
 = 1.6.2 =
 Compatibility with WordPress 3.5
@@ -135,10 +200,10 @@ Compatibility with WordPress 3.5
 Fixes 4 bugs
 
 = 1.6 =
-See: http://codex.buddypress.org/releases/version-1-6/
+See: https://codex.buddypress.org/releases/version-1-6/
 
 = 1.5 =
-See: http://codex.buddypress.org/releases/version-1-5/
+See: https://codex.buddypress.org/releases/version-1-5/
 
 = 1.2.9 =
 Compatibility with WordPress 3.2
@@ -151,41 +216,47 @@ Fixes over 10 bugs.
 
 == Changelog ==
 
-= 2.1.1 =
-See: http://codex.buddypress.org/releases/version-2-1-1/
+= 2.3.1 =
+See: https://codex.buddypress.org/releases/version-2-3-1/
+
+= 2.3.0 =
+See: https://codex.buddypress.org/releases/version-2-3-0/
+
+= 2.2 =
+See: https://codex.buddypress.org/releases/version-2-2/
 
 = 2.1 =
-See: http://codex.buddypress.org/releases/version-2-1/
+See: https://codex.buddypress.org/releases/version-2-1/
 
 = 2.0.3 =
-See: http://codex.buddypress.org/releases/version-2-0-3/
+See: https://codex.buddypress.org/releases/version-2-0-3/
 
 = 2.0.2 =
-See: http://codex.buddypress.org/releases/version-2-0-2/
+See: https://codex.buddypress.org/releases/version-2-0-2/
 
 = 2.0.1 =
-See: http://codex.buddypress.org/releases/version-2-0-1/
+See: https://codex.buddypress.org/releases/version-2-0-1/
 
 = 2.0 =
-See: http://codex.buddypress.org/releases/version-2-0/
+See: https://codex.buddypress.org/releases/version-2-0/
 
 = 1.9 =
-See: http://codex.buddypress.org/releases/version-1-9/
+See: https://codex.buddypress.org/releases/version-1-9/
 
 = 1.8.1 =
-See: http://codex.buddypress.org/releases/version-1-8-1/
+See: https://codex.buddypress.org/releases/version-1-8-1/
 
 = 1.8 =
-See: http://codex.buddypress.org/releases/version-1-8/
+See: https://codex.buddypress.org/releases/version-1-8/
 
 = 1.7 =
-See: http://codex.buddypress.org/releases/version-1-7/
+See: https://codex.buddypress.org/releases/version-1-7/
 
 = 1.6 =
-See: http://codex.buddypress.org/releases/version-1-6/
+See: https://codex.buddypress.org/releases/version-1-6/
 
 = 1.5 =
-See: http://codex.buddypress.org/releases/version-1-5/
+See: https://codex.buddypress.org/releases/version-1-5/
 
 = Older =
-See: http://codex.buddypress.org/releases/
+See: https://codex.buddypress.org/releases/